plotly / plotly/plotly.py

enable multiple hover boxes for overlapping/multiple points

Aperta
#2,476 18 commenti 17 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P3
Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

This has been tested in version 4.7.1.

When hover information is shown for points e.g. in a scatter plot, the following situations can occur:

  • there are multiple points on exactly the same coordinates
  • there are multiple points close to the same coordinates and the markers used to visualize those points overlap in the graph

Hover information for all those multiple points should be shown, especially in cases where the hover information includes additional data not shown directly in the graph.

The hvPlot library does this correctly: it shows stacked hover boxes for all the data points under the cursor. Plotly only shows one hover box and it is not clear which one.

I think this is an actual bug since it makes it easy to miss data and the hover information does not represent the actual data in the graph.

Here is an example using the Iris data set and Plotly:

import plotly.express as px
from bokeh.sampledata import iris
df = iris.flowers.copy()
fig = px.scatter(df, x="sepal_length", y="sepal_width", color="species",
                 opacity=0.4, hover_data=["petal_length", "petal_width"]
                )
fig.show()

This shows:
plotly01

With hvPlot:

df.hvplot(kind="scatter", 
          x="sepal_length", y="sepal_width", by="species", 
          hover_cols=["petal_length", "petal_width"], 
          alpha=0.4)

Hvplot01

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il comportamento dei punti sovrapposti con il dataset iris fornito e l’esempio px.scatter, quindi confrontalo con il risultato di hvPlot. Traccia il modo in cui fig.show() esegue il rendering delle informazioni hover per i punti coincidenti o sovrapposti e determina il confine del componente Plotly rilevante. Il lavoro è completato quando tutti i punti sotto il cursore ricevono informazioni hover distinguibili, con copertura di regressione sia per le sovrapposizioni esatte sia per quelle ravvicinate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.