plotly / plotly/plotly.js

Double click to zoom out alternates between ranges

Open
#6,336 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Double click to reset zoom when an axis range is specified causes the double click zoom out behavior to alternate between the specified range and fully zoomed out on subsequent double clicks.

Reproduction
  1. Create new plot with a trace using Plotly.newPlot
  2. Specify a layout where at least one axis has a range specified
  3. Double click to fully zoom out
  4. Double click again to zoom back in to the specified range

See: https://codepen.io/Kurappu/pen/jOxpMvj

Expected

Double clicking to zoom out multiple times should not alternate between zoom states (step 4 above should result in nothing happening)

Possibly related issues

#2957, which got merged with #2718
While they touch on few related points, they don't seem to mention anything about the alternating issue I'm experiencing.

Contributor guide

Open the contributing guide

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 CodePen reproduction and the double-click zoom handling reached from Plotly.newPlot when a layout axis has an explicit range. Verify the repeated double-click sequence against the expected behavior: after fully zooming out, another double click should do nothing rather than restore the specified range.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.