geom_xspline not implemented in plotly - getting error message when using ggplotly() function
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
I get an error message when trying to implement geom_xspline with
plotly.
I get the desired graph in ggplot2 but the plot cannot be converted to a
plotly object when using the ggplotly function.
You can find the code showcasing this below.
library(pacman)
pacman::p_load(tidyverse, datasets, plotly, ggplotly, ggalt)
# airmiles built-in dataset:
airmiles <- datasets::airmiles
year <- 1937:1960
airmiles <- data.frame(year = year, airmiles = airmiles)
# "line" plot using geom_xspline from ggalt package:
plot_airmiles <- ggplot(data = airmiles,
aes(x = year, y = airmiles)) +
geom_point(alpha = 0.75) +
geom_xspline(spline_shape = -0.7) +
scale_y_continuous(n.breaks = 10)
plot_airmiles
# interactive plot: using ggplotly doesn't work
ggplotly(plot_airmiles)
Could this be implemented in plotly? Is there any way I can still
produce the interactive graph in plotly without waiting for this to be
implemented?
The plotly documentation (https://linking.plotly-r.com/custom-geoms)
mentions the possibility of creating custom geoms and using the
to_basic() function from the plotly package to “convert” the custom geom
into a geom plotly understands.
In the link above, the authors provide an example for geom_xspline
specifically but their method and code don’t work unfortunately.
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
Reproduisez l’échec avec l’exemple airmiles fourni, geom_xspline et ggplotly(). Consultez la documentation de custom-geoms liée dans l’issue, puis examinez l’approche to_basic() qui y est décrite. La tâche est terminée lorsque geom_xspline peut être converti en objet plotly, ou lorsque la limitation prise en charge et le workaround sont documentés.
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é
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100