marmelab / marmelab/EventDrops

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

Open
#252 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
233
PR merge metrics
No merged PRs in 30d

Description

**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/

```javascript
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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the JSFiddle reproduction and trace the chart.draw(config, scale) call alongside the chart's zoom and pan behavior. Confirm how the explicit scale is handled, then verify that a subsequent zoom or pan begins from the scale supplied to draw() rather than the previous internal state.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.