marmelab / marmelab/EventDrops

Limit start & end date

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

Description

:wave:

First of all: Thanks for all the work on this library, worked really well for us so far :)

For our app, we need to be able to limit the start date and the end date and need to disallow zooming / panning beyond that. We're setting the date range initially like this:

```js
const config = {
// ... omitting other values for readability
range: {
start: new Date('2019/01/01'),
end: new Date('2019/05/27'),
},
}
```

So the initial state is correct, but it allows to scroll beyond that. `onZoomEnd` triggers after the chart already has been redrawn and even with the other event listeners, the redraw usually happens before we can limit the date again, leading to some flickering.

Any ideas / hints on how to achieve what we want to achieve? Thank you :)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the range.start and range.end configuration is applied during zooming and panning, then inspect the onZoomEnd path and other event listeners mentioned in the issue. Done means zooming and panning cannot move beyond the configured 2019-01-01 to 2019-05-27 range, without redraw flicker.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.