MCPcopy Index your code
hub / github.com/DKirwan/calendar-heatmap

github.com/DKirwan/calendar-heatmap @0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.1 ↗ · + Follow
5 symbols 9 edges 1 files 0 documented · 0% updated 4mo ago1.0.0-beta.1 · 2026-01-26★ 2,037
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

D3 Calendar Heatmap

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

Reusable D3.js Calendar Heatmap chart

TODO

  • ~~Enable/disable tooltip~~
  • ~~Editing of tooltip text~~
  • ~~Editing of the cell gradient colours~~
  • ~~Add optional callback for click events on the day cells~~
  • ~~Add project to bower~~
  • Remove example and vendor folders to separate gh-pages branch [in progress]

Configuration

Property Usage Default Required
data Chart data none yes
selector DOM selector to attach the chart to body 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 'contributions' no
legendEnabled Option to render a legend true no
onClick callback function on day click events (see example below) null no

Dependencies

Usage

1: Add d3.js and moment.js

2: Include calendar-heatmap.js and calendar-heatmap.css <link rel="stylesheet" type="text/css" href="https://github.com/DKirwan/calendar-heatmap/raw/0.4.1/path/tocalendar-heatmap.css"> <script src="https://github.com/DKirwan/calendar-heatmap/raw/0.4.1/path/to/calendar-heatmap.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: valid Javascript date object,
  count: Number
}];
var chart1 = calendarHeatmap()
              .data(chartData)
              .selector('#chart-one')
              .colorRange(['#D8E6E7', '#218380'])
              .tooltipEnabled(true)
              .onClick(function (data) {
                console.log('onClick callback. Data:', data);
              });
chart1();  // render the chart

Pull Requests and issues

...are very welcome!

Core symbols most depended-on inside this repo

countForDate
called by 2
src/calendar-heatmap.js
drawChart
called by 1
src/calendar-heatmap.js
tooltipHTMLForDate
called by 1
src/calendar-heatmap.js
calendarHeatmap
called by 0
src/calendar-heatmap.js
chart
called by 0
src/calendar-heatmap.js

Shape

Function 5

Languages

TypeScript100%

Modules by API surface

src/calendar-heatmap.js5 symbols

For agents

$ claude mcp add calendar-heatmap \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page