{"id":16170443,"url":"https://github.com/corentinth/day-heatmap","last_synced_at":"2025-06-22T01:34:03.141Z","repository":{"id":95926590,"uuid":"111746861","full_name":"CorentinTh/day-heatmap","owner":"CorentinTh","description":"A simple library to create responsive github like heatmap to display data on a scale of a day.","archived":false,"fork":false,"pushed_at":"2017-11-23T02:15:54.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T07:34:39.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CorentinTh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-23T00:52:33.000Z","updated_at":"2024-01-01T01:03:42.000Z","dependencies_parsed_at":"2023-04-21T19:08:05.755Z","dependency_job_id":null,"html_url":"https://github.com/CorentinTh/day-heatmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CorentinTh/day-heatmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fday-heatmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fday-heatmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fday-heatmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fday-heatmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorentinTh","download_url":"https://codeload.github.com/CorentinTh/day-heatmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fday-heatmap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261220276,"owners_count":23126724,"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":[],"created_at":"2024-10-10T03:18:48.910Z","updated_at":"2025-06-22T01:33:58.114Z","avatar_url":"https://github.com/CorentinTh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# day-heatmap.js\n\n![Day-heatmap exemple](http://divers.corentin-thomasset.fr/public/images/day-heatmap-1.PNG)\n\n`day-heatmap.js` is a simple library to create responsive github like heatmap to display data on a scale of a day.\n\nTry it: [live demo](http://divers.corentin-thomasset.fr/day-heatmap/).\n\n## Setup\nIt's composed of a javascript and a css file.\n\n**Note:** This library requires jQuery to work.\n\n### Method 1: Direct files\n\nYou can download the source files (under `src/`), and add them to your project (the javascript must be loaded after jQuery).\n\n```html\n    \u003clink rel=\"stylesheet\" href=\"css/day-heatmap.min.css\"\u003e\n    \u003cscript src=\"js/day-heatmap.min.js\"\u003e\u003c/script\u003e\n```\n\n### Method 2: CDN\n\nThe most easier thing is to use github as a CDN, so you don't have to donwload the files. Just add that to your project:\n\n```html\n    \u003clink rel=\"stylesheet\" href=\"https://cdn.rawgit.com/CorentinTh/day-heatmap/master/src/day-heatmap.min.js\"\u003e\n    \u003cscript src=\"https://cdn.rawgit.com/CorentinTh/day-heatmap/master/src/day-heatmap.min.js\"\u003e\u003c/script\u003e\n```\n\n## Make it works\n\nTo make it works you just need one line of javascript:\n\n```html\n\u003cscript\u003e\n    DayHeatmap(element, options).data(dataset).draw();    \n\u003c/script\u003e\n```\nWhere :\n* `element` is a string representing the id of the div where you want it to be displayed.\n* `options` (optional) is an object to customize a the heatmap.\n    * `halfDays` a boolean, to display only a day in two\n    * `halfHours` a boolean, to display only a hour in two\n    * `colors` a 5 row array contening your custom gradient (index 0: the lighter, and index 4 the darker).\n* `data` is an object array with the following format :\n```javascript\nvar data = [\n    {timestamp:1511401167678, value:5},\n    {timestamp:1511401177542, value:2},\n    // ...\n]\n```\n\n### Exemple\n\nHere is a working exemple with all the functionnalities:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eHeatmap\u003c/title\u003e\n    \n    \u003clink rel=\"stylesheet\" href=\"https://cdn.rawgit.com/CorentinTh/day-heatmap/master/src/day-heatmap.min.js\"\u003e\n\n    \u003c!-- Just for styling purpose --\u003e\n    \u003cstyle\u003e\n        .container{\n            width: 50%;\n            margin:200px 25%;\n        }\n    \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\n\u003cdiv class=\"container\"\u003e\n   \u003cdiv id=\"day-heatmap\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\u003c!-- First jQuery --\u003e\n\u003cscript src=\"https://code.jquery.com/jquery-3.2.1.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.rawgit.com/CorentinTh/day-heatmap/master/src/day-heatmap.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    var dummyData = [{timestamp: 738221588, value: 34}, {timestamp: 455091188, value: 85}, {timestamp: 1006992511, value: 61}, {timestamp: 374216407, value: 96}, {timestamp: 557060294, value: 39}, {timestamp: 1088268560, value: 45}, {timestamp: 790274681, value: 95}, {timestamp: 924184922, value: 46}, {timestamp: 16227933, value: 47}];\n\n    DayHeatmap(\"day-heatmap\",\n        {\n            halfDays: true,\n            halfHours: true,\n            colors: [\n                \"#7ae0cc\",\n                \"#3fc5ab\",\n                \"#379e8a\",\n                \"#28675b\",\n                \"#294C58\"\n            ]\n        }).data(dummyData).draw();\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Todo\n* Allow other type of data input.\n* Display tooltip with the value on hover of a square.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fday-heatmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorentinth%2Fday-heatmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fday-heatmap/lists"}