plotly / plotly/plotly.R

hovertemplate doesn't work for points in boxplots

Offen
#1,636 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug plotly.js
Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Using hovertemplate on a boxplot breaks the tooltips for data points, it simply doesn't appear at all:

image

# Using hoverinfo (works)
plot_ly() %>% add_trace(y = 1:10, type = "box", hoverinfo = "y", boxpoints = "all", pointpos = 0)

# Using hovertemplate (doesn't work)
plot_ly() %>% add_trace(y = 1:10, type = "box", hovertemplate = "%{y}", boxpoints = "all", pointpos = 0)

When inspecting the hovertemplate graph using my browser's dev tools I found that this appears in the console when I move the mouse over a data point:

test2.html:1820 Uncaught TypeError: t.replace is not a function
    at Object.l.hovertemplateString (test2.html:1820)
    at SVGGElement.<anonymous> (test2.html:1820)
    at test2.html:1820
    at ut (test2.html:1820)
    at Array.W.each (test2.html:1820)
    at A (test2.html:1820)
    at test2.html:1820
    at test2.html:1820
    at l (test2.html:1820)
    at Object.r.throttle (test2.html:1820)

hovertemplate works as expected for other graph types, like e.g.:

plot_ly() %>% add_trace(y = 1:10, type = "bar", hovertemplate = "%{y}")

plotly 4.9.0
R 3.4.4

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere die beiden R-Beispiele mit einem Boxplot unter Verwendung von boxpoints und hovertemplate und vergleiche sie anschließend mit dem funktionierenden Balkendiagramm-Beispiel. Beginne beim im Browserfehler angezeigten hovertemplateString-Aufruf und verfolge den Hover-Pfad für Boxplot-Punkte; abgeschlossen ist die Aufgabe, wenn hovertemplate für Boxplot-Datenpunkte ohne den t.replace-Fehler gerendert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.