jiahuang / d3-timeline

Simple JS timeline plugin for d3
1.04k stars 280 forks source link

relativeTime now valid for all rows #90

Open antonin-lebrard opened 7 years ago

antonin-lebrard commented 7 years ago

relativeTime now takes into accounts other rows than the first to calculate the origin point of graph.

Also removed global variable originTime declaration.

Example : data : [ { "label": "firstRow", "times": [ { "starting_time": 2000, "ending_time": 3000 } ] }, { "label": "secondRow", "times": [ { "starting_time": 1000, "ending_time": 2000 } ] } ]

should produce : data : [ { "label": "firstRow", "times": [ { "starting_time": 1000, "ending_time": 2000} ] }, { "label": "secondRow", "times": [ { "starting_time": 0, "ending_time": 1000 } ] } ]

instead of : data : [ { "label": "firstRow", "times": [ { "starting_time": 0, "ending_time": 1000} ] }, { "label": "secondRow", "times": [ { "starting_time": -1000, "ending_time": 0} ] } ]