plotly / plotly/plotly.js

hover is not displayed in the case of overflow

Open
#5,459 1 comment 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

See for example https://codepen.io/emmanuelle-plotly/pen/GRNJevo : the hover information (created here with a hovertemplate, not sure if it matters) is very long and the resulting hover box would be larger than the figure height. However, nothing is displayed at all for hover, which is not the expected behaviour I think (probably one cannot scroll, so should it be clipped?). The problem disappears when the text to be displayed is shorter.

For Python users, here is a code snippet to experiment with to reproduce the problem:

import plotly.express as px
n_lines = 30
long_hover_text = 'bla bla bla bla bla <br>'* n_lines
df_dict = {'x':[1, 2, 3], 'y':[1, 2, 3], 'text':[long_hover_text,]*3}
fig = px.scatter(df_dict, x='x', y='y', hover_data=['text']
                )
fig.show()

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

Reproduce the issue with the linked CodePen or the provided Python snippet, focusing on the long hovertemplate text and the figure-height overflow. Trace the hover behavior from that reproduction and define done as showing the hover information in a usable clipped or otherwise visible form instead of displaying nothing.

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.