Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to constrain brush interactions #1850

Open
neefrehman opened this issue Jun 6, 2024 · 0 comments
Open

Ability to constrain brush interactions #1850

neefrehman opened this issue Jun 6, 2024 · 0 comments

Comments

@neefrehman
Copy link

While working on the brushing implementation for some graphs, one thing that I've found missing is the ability to constrain the zoom level that a brush interaction could result in. For some of our time-series data, we want to always be able to show multiple datapoints in the graph, and brushing can sometimes make this hard to achieve if a user incrementally zooms in.

We can currently prevent the graph's data from being updated in our handleBrush function like so:

onBrushEnd={(newBounds) => {
  handleBrush(newBounds);
  if (lessThanThreeDataPointsInBounds(newBounds)) {
    return
  }
  updateShownDatapoints(newBounds)
}}

Though in this scenario the rendered selectedBox will still update with the new bounds. It would be nice to introduce an API that can solve this case, as well as introduce some other related DX and UX improvements, such as automatically "expanding" the selection to the smallest allowed domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant