plotly / plotly/plotly.R

When calling on geom_area tooltip activates when hovering over line, not area

Aperta
#2,343 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
R
Stelle
2.7k
Fork
641
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Calling ggplotly on ggplot invoking geom_area results in a plot in which the tooltip activates when hovering over the "lines" separating the areas. I would have expected the tooltip to activate when hovered over the filled area.

Here is some reprex

library("ggplot2")
library("plotly")

#create the data
data <- data.frame('year' = rep(1981:2020, 2),
           "type" = rep(c("a", "b"), 40),
           "value" = runif(80))

#Generate the plot
ggplotly(
  ggplot(data, 
         aes(x = year, y = value, fill = type)) +
    geom_area(col = "grey", size = 0.5) #set the line col so that you can see the activation when close to the line
)
  

I don't see any open or closed issues on this. Online, I only see this solution: https://stackoverflow.com/questions/47331323/ggplotly-and-geom-area-display-informations-when-hovering-over-an-area-not-a, which seems convoluted.

Regardless of that solution, I would still assume the expected behavior for geom_area is for the tooltip to activate over the area, not the line.

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 eseguendo il reprex fornito con R, ggplot2 e plotly, quindi esamina la conversione ggplotly per il comportamento al passaggio del mouse di geom_area. Il lavoro è completato quando il tooltip si attiva passando il mouse sull'area riempita, anziché soltanto lungo le linee che separano le aree.

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

Valutazione

Stack tecnologico
r
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.