All Projects → tbaeg → calendar-heatmap-mini

tbaeg / calendar-heatmap-mini

Licence: MIT license
A d3.js heatmap representing time series data

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to calendar-heatmap-mini

leaflet heatmap
简单的可视化湖州通话数据 假设数据量很大,没法用浏览器直接绘制热力图,把绘制热力图这一步骤放到线下计算分析。使用Apache Spark并行计算数据之后,再使用Apache Spark绘制热力图,然后用leafletjs加载OpenStreetMap图层和热力图图层,以达到良好的交互效果。现在使用Apache Spark实现绘制,可能是Apache Spark不擅长这方面的计算或者是我没有设计好算法,并行计算的速度比不上单机计算。Apache Spark绘制热力图和计算代码在这 https://github.com/yuanzhaokang/ParallelizeHeatmap.git .
Stars: ✭ 13 (-40.91%)
Mutual labels:  d3, heatmap
reactjs-calendar-heatmap
React component for d3.js calendar heatmap graph
Stars: ✭ 128 (+481.82%)
Mutual labels:  d3, heatmap
Clustergrammer
An interactive heatmap visualization built using D3.js
Stars: ✭ 188 (+754.55%)
Mutual labels:  d3, heatmap
simple-d3-heatmap
A javascript module to create heatmap calendars
Stars: ✭ 24 (+9.09%)
Mutual labels:  d3, heatmap
Calendar Heatmap
A d3 heatmap for representing time series data similar to github's contribution chart
Stars: ✭ 1,985 (+8922.73%)
Mutual labels:  d3, heatmap
Calendar Heatmap
📊 Calendar heatmap graph
Stars: ✭ 170 (+672.73%)
Mutual labels:  d3, heatmap
Reaviz
📊 Data visualization library for React based on D3
Stars: ✭ 215 (+877.27%)
Mutual labels:  d3, heatmap
d3-in-angular
How to build reactive charts in Angular 8 using D3
Stars: ✭ 47 (+113.64%)
Mutual labels:  d3
visualizing-hierarchies
Workshop for making hierarchies in Vue and D3
Stars: ✭ 39 (+77.27%)
Mutual labels:  d3
course-18-19
🎓 tech track · 2018-2019 · curriculum and syllabus 📊
Stars: ✭ 23 (+4.55%)
Mutual labels:  d3
d3-metro
d3 based metro engine
Stars: ✭ 16 (-27.27%)
Mutual labels:  d3
Vuesalize
Component library dedicated to simplifying interactive visualization building in Vue.js.
Stars: ✭ 24 (+9.09%)
Mutual labels:  d3
vue-topo
使用d3+vue开发的Topo图
Stars: ✭ 49 (+122.73%)
Mutual labels:  d3
MobilePose
Light-weight Single Person Pose Estimator
Stars: ✭ 588 (+2572.73%)
Mutual labels:  heatmap
vk-slaves-bot
Бот для мини-игры "Рабы" ("Рабство") ВКонтакте.
Stars: ✭ 79 (+259.09%)
Mutual labels:  mini
datart
Datart is a next generation Data Visualization Open Platform
Stars: ✭ 1,042 (+4636.36%)
Mutual labels:  d3
data-driven-range-slider
D3.js based data-driven range slider, date time support
Stars: ✭ 21 (-4.55%)
Mutual labels:  d3
org-roam-ui
A graphical frontend for exploring your org-roam Zettelkasten
Stars: ✭ 1,393 (+6231.82%)
Mutual labels:  d3
streamlit-d3-demo
D3 in React in Streamlit tech demo
Stars: ✭ 50 (+127.27%)
Mutual labels:  d3
D3Fire
Power your D3 visualizations with data from Firebase
Stars: ✭ 31 (+40.91%)
Mutual labels:  d3

D3 Calendar Heatmap Mini

This code was originally forked from https://github.com/DKirwan/calendar-heatmap and modified. This serves to publish the package to npm as calendar-heatmap-mini along with a few key differences.

Key Differences

  • Option for singleSelection thanks to @remyvhw.
  • npm installable as well as importable as a module.
  • Update to the latest [email protected]
    • Trim down to specific d3 packages.
  • Data is auto initialized if none is presented.
  • When updating the same instance of a heatmap, previous max size is not used.
  • Use SVG text for tooltips.
  • Move into a non-forked version of the repository.
    • Rework project structure into the appropriate name (calendar-heatmap-mini).

A d3.js heatmap representing time series data. Inspired by Github's contribution chart.

Reusable D3.js Calendar Heatmap chart

Configuration

Property Usage Default Required
data Chart data none no
selector DOM selector to attach the chart to body no
max Maximum count max found in data no
startDate Date to start heatmap at 1 year ago no
colorRange Minimum and maximum chart gradient colors ['#D8E6E7', '#218380'] no
tooltipEnabled Option to render a tooltip true no
tooltipUnit Unit to render on the tooltip, can be object for pluralization control 'contributions' no
legendEnabled Option to render a legend true no
onClick callback function on day click events (see example below) null no
singleSelection Option to only be able to select a single date false no
locale Object to translate every word used, except for tooltipUnit see below no

Default locale object

{
    months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
    No: 'No',
    on: 'on',
    Less: 'Less',
    More: 'More'
}

Dependencies

Usage

Without npm

1: Add d3.js and moment.js

2: Include calendar-heatmap-mini.js and calendar-heatmap-mini.css.

<link rel="stylesheet" type="text/css" href="path/tocalendar-heatmap-mini.css">
<script src="path/to/calendar-heatmap-mini.js"></script>

3: Format the data so each array item has a date and count property. As long as new Date() can parse the date string it's ok. Note - there all data should be rolled up into daily bucket granularity.

4: Configure the chart and render it

// chart data example
var chartData = [{
  date: new Date(),
  count: 100
}];

var chart1 = calendarHeatmap()
              .data(chartData)
              .selector('#chart-one')
              .colorRange(['#D8E6E7', '#218380'])
              .tooltipEnabled(true)
              .onClick(function (data) {
                console.log('onClick callback. Data:', data);
              });

// render the chart
chart1();

With npm

1: Add package dependency.

npm install calendar-heatmap-mini --save
  1. Import however desired.
import CalendarHeatMap from 'calendar-heatmap-mini'
  1. Configure and render the chart.
import CalendarHeatMap from 'calendar-heatmap-mini'

// chart data example
var chartData = [{
  date: new Date(),
  count: 100
}];

const chart1 = new CalendarHeatMap()
              .data(chartData)
              .selector('#chart-one')
              .colorRange(['#D8E6E7', '#218380'])
              .tooltipEnabled(true)
              .onClick(function (data) {
                console.log('onClick callback. Data:', data);
              });

// render the chart
chart1();

Control Unit Pluralization

var chart1 = calendarHeatmap()
              .data(chartData)
              .tooltipUnit(
                [
                  {min: 0, unit: 'contribution'},
                  {min: 1, max: 1, unit: 'contribution'},
                  {min: 2, max: 'Infinity', unit: 'contributions'}
                ]
              );
chart1();  // render the chart

Pull Requests and Issues

...are very welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].