plotly / plotly/react-plotly.js
Issue with axis autorange: state self-mutates 'reversed' -> true
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
As far as I understand, Plotly's axis reversal works by setting autorange to a string value of 'reversed' (with the other options being true for non-reversed autorange, and false for no autorange). After setting this, Plotly will autoscale the axis with range[0] and range[1] of the axis swapped.
The problem is, it seems like after setting autorange -> 'reversed', react-plotly mutates autorange back to true after doing the range reversal. So, there is no way to un-reverse the autorange without setting it first to false, then true.
What I think should happen:
Step 1: autorange true -> 'reversed'
Step 2: autorange 'reversed' -> true //can toggle axis reversal
What actually happens:
Step 1: autorange true -> 'reversed' -> true //last step being done automatically by react-plotly
Step 2: autorange true -> true //doesn't toggle axis reversal b/c no state change
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two autorange transitions described in the issue, focusing on the React component's handling of Plotly axis state. Done means changing true to 'reversed' preserves that value so a subsequent change back to true toggles reversal without an intermediate false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100