leeoniya / leeoniya/uPlot

Is there a way to reset scales programmatically?

Open
#924 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
10.5k
Forks
463
PR merge metrics
No merged PRs in 30d

Description

I'm trying to add a button to reset all scales similar to the way that double click works. Is there way to invoke the built in implementation of double click? or any clean way of doing this?

My current solution is saving the initial min and max in _range then setting the scale to be that value.

Another solution is emitting a double click event on u-over which seems a bit hacky.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the built-in double-click implementation in src/uPlot.js at lines 3252-3264 and compare it with the reported _range workaround and synthetic u-over event. Define the public behavior for programmatically resetting all scales, then verify that the chosen API provides the same result without relying on private state or simulated events.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.