Plot does not show hoverinfo for first data point when default hovermode or set to 'closest'
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
As written in the title, the hoverinfo for the first (bottom left) data point when layout.hovermode= 'closest' or kept as default does not appear.
# call library
library(plotly)
# reset fig
fig <- NULL
# add an extra line to check behavior on right hand side of graph
cars_one_extra_line <- rbind(cars,c(25,90))
# plot
fig <- plot_ly(cars_one_extra_line)
fig <- fig %>% add_trace(x = ~speed,
y = ~dist,
color = ~dist,
colors = 'RdBu',
type = 'scatter',
mode = 'markers')
fig <- fig %>% layout(hovermode = "closest")
fig
This is shown in the screenshot below. If the cursor is moved to the point above, the hoverinfo appears.

In an effort to understand the behavior, I also tried other tags. Strangely, the hovermode = 'y' also seems to have a weird behavior. Things to note are the following:
- text is tilted,
- text is sometimes obscured beyond the viewing frame (not shown in this example but does occur in certain cases),
- text is sometimes shown twice but in two places,
- y axis position is not always shown (for points at the top and bottom of the chart)


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
Führen Sie die bereitgestellte R-Reproduktion mit plot_ly, Streuungsmarkierungen und hovermode auf "closest" oder "y" gesetzt aus, um das fehlende und fehlerhafte Hover-Verhalten zu bestätigen. Verfolgen Sie den vom R-Paket und seiner interaktiven Diagrammausgabe verwendeten Hover-Rendering-Pfad; abgeschlossen ist die Aufgabe, wenn der erste Punkt hoverinfo anzeigt und die gemeldeten hovermode-Fälle konsistent ohne Abschneiden, Duplizierung oder fehlende Achsenpositionen gerendert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- r
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100