Giter Site home page Giter Site logo

radovankavicky / calendar-heatmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from g1eb/calendar-heatmap

0.0 1.0 0.0 454 KB

๐Ÿ“… Calendar heatmap graph

Home Page: https://rawgit.com/g1eb/calendar-heatmap/master/

JavaScript 93.86% HTML 3.76% CSS 2.38%

calendar-heatmap's Introduction

Calendar heatmap graph

This d3.js heatmap representing time series data is used to visualize tracked time over the past year, showing details for each of the days on demand.

Includes visualization of year, month, week and day overview.

Inspired by Github's contribution graph

Based on Calendar View by Mike Bostock

Aaand D3.js Calendar Heatmap by Darragh Kirwan

Demo

Click here for a live demo.

Year overview

calendar heatmap - year overview

Month overview

calendar heatmap - month overview

Week overview

calendar heatmap - week overview

Day overview

calendar heatmap - day overview

Install

  • Install 'calendar-heatmap-graph' with bower
bower install calendar-heatmap-graph
  • Install 'calendar-heatmap-graph' with npm
npm install calendar-heatmap-graph
  • Or include files directly in your html:
<link rel="stylesheet" type="text/css" href="dist/calendar-heatmap.min.css">
<script type="text/javascript" src="dist/calendar-heatmap.min.js"></script>

Properties

Property Usage Default Required
data Time series data from max a year back none yes
color Theme hex color #45ff00 no
overview Initial overview type (choices are: year, month, day) year no
handler Handler function is fired on click of a time entry in daily overview none no

Example data

Time series data for each day going 1 year back. Each day has a total time tracked (in seconds). Details, if provided, are shown in a tooltip as well as in daily overview.

var data = [{
  "date": "2016-01-01",
  "total": 17164,
  "details": [{
    "name": "Project 1",
    "date": "2016-01-01 12:30:45",
    "value": 9192
  }, {
    "name": "Project 2",
    "date": "2016-01-01 13:37:00",
    "value": 6753
  },
  .....
  {
    "name": "Project N",
    "date": "2016-01-01 17:52:41",
    "value": 1219
  }]
}]

Optimization

In some cases details array could be large and in order to fit the data into the tooltip a short summary is generated with distinct projects and their total tracked time for that date. In terms of optimization summary data can be computed server-side and passed in using the ``summary'' attribute. And in addition to the data structure described above this would result in a summary dictionary with distinct project names and total values of tracked time in seconds, e.g.:

var data = [{
  "date": "2016-01-01",
  "total": 17164,
  "details": [.....],
  "summary": [{
    "name": "Project 1",
    "value": 9192
  }, {
    "name": "Project 2",
    "value": 6753
  },
  .....
  {
    "name": "Project N",
    "value": 1219
  }]
}]

See index.html for an example implementation with random data or click here for a live demo.

AngularJS Directive

Calendar heatmap graph angular directive

Dependencies

calendar-heatmap's People

Contributors

g1eb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.