plotly / plotly/plotly.py

Hover tooltip works incorrectly in scatter WebGL

Ouverte
#3,516 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug P3
Langage dominant
Python
Étoiles
18.8k
Forks
2.8k
Merge moyen
16 h 26 min
PR mergées (30 j)
21

Description

In the code example below (using the scattergl) when the cursor is rolled over the bubble, the hover tooltip does not appear until the cursor is close to the center of the bubble. The tooltip itself also points to the center of the bubble.

This is different from the expected behavior observed with the regular scatter where the tooltip appears in relation to the boundary of the bubble, rather than its center. And the tooltip points to the boundary as well.

For the Plotly Express px.scatter, one needs to set render_mode='svg' to switch out of WebGL for the correct behaviour.

This results in an incorrect tooltip in WebGL appearing when the cursor is over the larger bubble in an example such as this one:

bubble

import pandas as pd
import plotly.graph_objects as go

df = pd.DataFrame({'x': [1], 'y': [1],'z': [100]})

fig = go.Figure()

fig.add_scattergl(
    x=df['x'],
    y=df['y'],
    marker_size=df['z'],
    mode='markers',
    marker_sizeref=0.01,
    marker_sizemode='area',
    showlegend=True,
    hovertemplate=(
        'x: %{x:.2f}<br>'
        'y: %{y:.2f}<br>'
        '<extra></extra>'
    ),
)

fig.show()

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par exécuter l’exemple Python fourni avec go.Figure.add_scattergl et comparez son comportement de hover avec celui de scatter classique. Suivez la gestion du hover WebGL depuis le point d’entrée de scattergl, en prenant comme références le comportement attendu de l’infobulle basé sur les limites et la comparaison avec render_mode='svg'. C’est terminé lorsque les grandes bulles réagissent sur toute leur zone visible et que l’infobulle pointe vers la limite.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
data-visualization, frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.