plotly / plotly/plotly.js

Dragging shape with xref "x2" results in wrong final position

Open
#7,472 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In below codepen that uses plotly.js v2.23.1 is an editable shape attached to x2. When dragging and releasing the shape, it will jump to a new location, it will not stay where it was released.

You can check with newer plotly versions that the bug still exists. I chose the old version just to show that it is an old bug.

I had a brief look at the code and saw that for some reason the shape's xref is changed to 'paper'. This explains the jump, because the coordinates mean something different with xref 'paper'.

https://codepen.io/toffi-fee/pen/Byoormr

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 linked CodePen reproduction using plotly.js v2.23.1 and inspect the shape-drag handling described in the issue. Trace why the shape's xref changes to "paper" during release; done means an editable shape attached to x2 remains at the position where it was released.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.