marmelab/EventDrops

Explicit draw() call does not update internal state of the chart

val-janeiko opened this issue · 1 comments

What you were expecting:

After calling draw() with a scale parameter different than the current state of the chart, when a user tries to zoom/pan the chart it should zoom/scroll from the scale specified in the draw() call.

What happened instead:

After calling draw() with a scale parameter different than the current state of the chart, when a user tries to zoom/pan the chart it resets zoom and pan to the state it was before draw() was issued.

Related code:

https://jsfiddle.net/6rqxusw5/271/

var scale = d3.scaleTime().domain([new Date('01/01/2017 12:00:00 AM'), new Date('02/01/2017 12:00:00 AM')]).range(chart.scale().range());
chart.draw(config, scale)(d3.select('#events').data([repositoriesData]));

Environment

  • EventDrops version: 1.3.0
  • Browser: Chrome, Firefox, Edge

You can probably modify the source and make a programmatical zoom function or something. Then you can zoom to domain:
zoom to domain in D3

You probably only want to draw the chart once, and then use zoom programmatically to change the domain (ranges of dates you view).