enable multiple hover boxes for overlapping/multiple points
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 16 Std. 26 Min.
- Gemergte PRs (30 T.)
- 21
Beschreibung
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:

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

Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Verhalten bei überlappenden Punkten mit dem bereitgestellten iris-Datensatz und dem px.scatter-Beispiel zu reproduzieren, und vergleiche es anschließend mit dem Ergebnis von hvPlot. Verfolge, wie fig.show() Hover-Informationen für zusammenfallende oder überlappende Punkte rendert, und bestimme die relevante Grenze der Plotly-Komponente. Als erledigt gilt die Aufgabe, wenn alle Punkte unter dem Cursor unterscheidbare Hover-Informationen erhalten und eine Regressionstestabdeckung sowohl für exakte als auch für nahe Überlappungen vorhanden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 28/100