esnet / esnet/react-timeseries-charts

Pan and Zooming Behavior

Open
#303 4 comments 3 reactions 0 assignees View on GitHub
:question: question
Dominant language
JavaScript
Stars
876
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Based on the discussion [here](https://github.com/esnet/react-timeseries-charts/pull/252#discussion_r202898021), #297 and PR #299 and giving it some thought, here's what we're thinking of doing.

Currently, we have a prop `enableDragZoom` which enables the ability to `drag to zoom + zoom using scroll wheel`. Also, there is another prop `enablePanZoom` which enables the ability to `pan and zoom`. It is a bit confusing and doesn't give you an option to customize what you're trying to achieve.

The alternative to this is suggested below. It will be a breaking change

**Alternative Props**

```
mouseDrag = none | zoom | pan
mouseWheel = none | zoom
```

**Backward compatibility**

```
enablePanZoom = {
mouseDrag: pan,
mouseWheel: zoom
}
enableDragZoom = {
mouseDrag: zoom,
mouseWheel: zoom
}
```

cc: @iabw @sb8244 @abramjstamper

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.