Skip to content

Commit 820f3b9

Browse files
committed
Update
1 parent 88cdbe4 commit 820f3b9

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

README.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ Inspired by Github's contribution chart.
88
Based on [D3.js Calendar Heatmap](https://github.com/DKirwan/calendar-heatmap) by [Darragh Kirwan](https://github.com/DKirwan)
99
Aaand [Calendar View](https://bl.ocks.org/mbostock/4063318) by [Mike Bostock](https://github.com/mbostock)
1010

11-
[![Angular directive for d3.js calendar heatmap chart](https://raw.githubusercontent.com/g1eb/angular-calendar-heatmap/master/screenshot.png)](https://rawgit.com/g1eb/angular-calendar-heatmap/master/example.html)
12-
1311
## Demo
14-
1512
Click <a href="https://rawgit.com/g1eb/angular-calendar-heatmap/master/example.html" target="_blank">here</a> for a live demo.
1613

14+
### Year overview
15+
[![Angular directive for d3.js calendar heatmap chart - year overview](https://raw.githubusercontent.com/g1eb/angular-calendar-heatmap/master/screenshot_year_overview.png)](https://rawgit.com/g1eb/angular-calendar-heatmap/master/example.html)
16+
17+
### Daily overview
18+
[![Angular directive for d3.js calendar heatmap chart - daily overview](https://raw.githubusercontent.com/g1eb/angular-calendar-heatmap/master/screenshot_daily_overview.png)](https://rawgit.com/g1eb/angular-calendar-heatmap/master/example.html)
19+
1720
## Installation
1821

1922
1) Install 'angular-calendar-heatmap' with bower
@@ -44,19 +47,48 @@ angular.module('myApp', [
4447
|:------------- |:-------------|:-----:|:-----:|
4548
| data | Time series data | none | yes |
4649
| color | Theme hex color | #45ff00 | no |
47-
| handler | Handler function is fired on click | none | no |
50+
| handler | Handler function is fired on click of a time entry in daily overview | none | no |
4851

4952
### Example data
5053

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

5558
```
5659
var data = [{
5760
"date": "2016-01-01",
5861
"total": 17164,
5962
"details": [{
63+
"name": "Project 1",
64+
"date": "2016-01-01 12:30:45",
65+
"value": 9192
66+
}, {
67+
"name": "Project 2",
68+
"date": "2016-01-01 13:37:00",
69+
"value": 6753
70+
},
71+
.....
72+
{
73+
"name": "Project N",
74+
"date": "2016-01-01 17:52:41",
75+
"value": 1219
76+
}]
77+
}]
78+
```
79+
80+
### Optimization
81+
82+
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.
83+
In terms of optimization summary data can be computed server-side and passed in using the ``summary'' attribute.
84+
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.:
85+
86+
```
87+
var data = [{
88+
"date": "2016-01-01",
89+
"total": 17164,
90+
"details": [.....],
91+
"summary": [{
6092
"name": "Project 1",
6193
"value": 9192
6294
}, {

0 commit comments

Comments
 (0)