{"id":15109548,"url":"https://github.com/dkirwan/calendar-heatmap","last_synced_at":"2025-09-27T10:31:32.964Z","repository":{"id":50383149,"uuid":"51869520","full_name":"DKirwan/calendar-heatmap","owner":"DKirwan","description":"A d3 heatmap for representing time series data similar to github's contribution chart","archived":true,"fork":false,"pushed_at":"2020-08-09T18:04:29.000Z","size":238,"stargazers_count":2014,"open_issues_count":16,"forks_count":145,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-09-25T23:03:40.083Z","etag":null,"topics":["d3","data-visualization","heatmap","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DKirwan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-16T20:54:30.000Z","updated_at":"2024-08-11T18:07:25.000Z","dependencies_parsed_at":"2022-09-06T23:31:27.927Z","dependency_job_id":null,"html_url":"https://github.com/DKirwan/calendar-heatmap","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DKirwan%2Fcalendar-heatmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DKirwan%2Fcalendar-heatmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DKirwan%2Fcalendar-heatmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DKirwan%2Fcalendar-heatmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DKirwan","download_url":"https://codeload.github.com/DKirwan/calendar-heatmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871972,"owners_count":16554475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d3","data-visualization","heatmap","javascript"],"created_at":"2024-09-25T23:03:53.154Z","updated_at":"2025-09-27T10:31:27.701Z","avatar_url":"https://github.com/DKirwan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## This project is not actively maintained\n\n# D3 Calendar Heatmap\nA [d3.js](https://d3js.org/) heatmap representing time series data. Inspired by Github's contribution chart\n\n![Reusable D3.js Calendar Heatmap chart](https://raw.githubusercontent.com/DKirwan/calendar-heatmap/develop/example/thumbnail.png)\n\n## Configuration\n\n|Property        | Usage           | Default  | Required |\n|:------------- |:-------------|:-----:|:-----:|\n| data | Chart data | none | yes |\n| selector | DOM selector to attach the chart to | body | no |\n| max | Maximum count | max found in data | no |\n| startDate | Date to start heatmap at | 1 year ago | no |\n| colorRange | Minimum and maximum chart gradient colors | ['#D8E6E7', '#218380'] | no |\n| tooltipEnabled | Option to render a tooltip | true | no |\n| tooltipUnit | Unit to render on the tooltip, can be object for pluralization control | 'contributions' | no |\n| legendEnabled | Option to render a legend | true | no |\n| onClick | callback function on day click events (see example below) | null | no |\n| locale | Object to translate every word used, except for tooltipUnit | see below | no |\n\n### Default locale object\n\n```javascript\n{\n    months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n    days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n    No: 'No',\n    on: 'on',\n    Less: 'Less',\n    More: 'More'\n}\n```\n\n## Dependencies\n\n* [d3.js](https://d3js.org/)\n* [moment.js](http://momentjs.com/)\n\n## Usage\n\n1: Add d3.js and moment.js\n\n2: Include calendar-heatmap.js and calendar-heatmap.css\n`\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"path/tocalendar-heatmap.css\"\u003e`\n`\u003cscript src=\"path/to/calendar-heatmap.js\"\u003e\u003c/script\u003e`\n\n3: Format the data so each array item has a `date` and `count` property.\nAs long as `new Date()` can parse the date string it's ok. Note - there all data should be rolled up into daily bucket granularity.\n\n4: Configure the chart and render it\n```javascript\n// chart data example\nvar chartData = [{\n  date: valid Javascript date object,\n  count: Number\n}];\nvar chart1 = calendarHeatmap()\n              .data(chartData)\n              .selector('#chart-one')\n              .colorRange(['#D8E6E7', '#218380'])\n              .tooltipEnabled(true)\n              .onClick(function (data) {\n                console.log('onClick callback. Data:', data);\n              });\nchart1();  // render the chart\n```\n\n### control unit pluralization\n\n```javascript\nvar chart1 = calendarHeatmap()\n              .data(chartData)\n              .tooltipUnit(\n                [\n                  {min: 0, unit: 'contribution'},\n                  {min: 1, max: 1, unit: 'contribution'},\n                  {min: 2, max: 'Infinity', unit: 'contributions'}\n                ]\n              );\nchart1();  // render the chart\n```\n\n## Pull Requests and issues\n\n...are very welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkirwan%2Fcalendar-heatmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkirwan%2Fcalendar-heatmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkirwan%2Fcalendar-heatmap/lists"}