When calling on geom_area tooltip activates when hovering over line, not area
Personne n'a encore pris cette issue.
- Langage dominant
- R
- Étoiles
- 2.7k
- Forks
- 641
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par exécuter le reprex fourni avec R, ggplot2 et plotly, puis examinez la conversion ggplotly pour le comportement au survol de geom_area. Le travail est considéré comme terminé lorsque l’infobulle s’active au survol de la zone remplie, plutôt que seulement le long des lignes séparant les zones.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data-visualization
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100