Skip to content

[FEATURE]: Improve hoveranywhere and clickanywhere for use in a Dash app #7886

Description

@AnnMarieW

I love the new hoveranywhere and clickanywhere functionality introduced in #7707!

To make this even better for use with Dash, I'd like to propose two updates:

  1. Include xPixel and yPixel in the hoveranywhere data. This would make it possible to create a bounding box for use with a custom tooltip using dcc.Tooltip.

  2. Emit an unhover event after the cursor leaves the plot area. This would prevent stale hover information from being returned in a Dash callback.

Here is a sample app from my Dash PR, "Enable callbacks in Plotly hoveranywhere and clickanywhere": plotly/dash#3852

The first image was captured while hovering over a point. Notice that xPixel and yPixel are included.

The second image was captured when not hovering over a point. xPixel and yPixel are not available because they are only included with point data. Also, this image was captured after the mouse left the plot area. The stale hoveranywhere data is still included in the callback.

Image

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions