plotly / plotly/plotly.js

'hovercompare' modebar button does not retain hovermode y

Open
#6,515 0 comments 0 reactions 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

MWE:

const data = [
  {
    x: [1, 2, 3, 4],
    y: [10, 15, 13, 17],
    type: 'scatter'
  },
  {
    x: [1, 2, 3, 4],
    y: [10, 13, 15, 17],
    type: 'scatter'
  }
];

const layout = {
  hovermode: 'y',
  modebar: { add: ['hoverclosest', 'hovercompare'] }
};

Plotly.newPlot('myDiv', data, layout);

One might expect that if the hoverclosest button is clicked and then hovercompare after, it should return to the hover comparison by y values, as initially set, but instead, it switches to the default comparison by x values. If there is a workaround, that would also be helpful.

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 by reproducing the supplied MWE with hovermode set to y and the hoverclosest and hovercompare modebar buttons enabled. Trace how those buttons change hovermode, then verify that switching back to hovercompare preserves comparison by y values rather than reverting to x values.

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
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.