plotly / plotly/plotly.js

hoverdistance broken in 3D scatter plots (hover radius vs click radius)?

Open
#6,908 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

Hi,

I want to use plotly in interactive dashboards. With my 3D scatter plots, I noticed that it's quite confusing that the click radius is different from the hover radius: when you move the mouse inside a point's hover radius, you get the hover lines that point to the axes, but it doesn't react to clicks yet. For that, you have to go much closer.
Is there a way to change the click radius to match the hover radius?

So I tried to change the hoverdistance parameter in the layout object, but realized that it seems that hoverdistance is broken in 3D plots. Here's a working example. You will see, that changing the hoverdistance doesn't make any difference:
https://codepen.io/bolau/pen/LYvPmWw

Is this a bug, or am I doing something wrong?
Here's the link to the documentation on the hoverdistance parameter, which doesn't distinguish between 2D and 3D plots:
https://plotly.com/javascript/reference/layout/#layout-hoverdistance

Best, Boris

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 and the layout.hoverdistance documentation, then compare hover and click behavior in 3D scatter plots. Done means determining whether hoverdistance should control the reported 3D behavior, with the implementation or documentation reflecting the result and the click-radius question addressed.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.