Add support for ggrepel::geom_text_repel labels
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 would like to produce a scatter plot in HTML format where labels are associated with each point.
This works well when I export the plot in PDF or PNG format:
But my HTML does not have the labels associated with each point. The warning message suggests that plotly does not support the label geometry from the ggrepel package:
Would someone be so kind so add support for this function, please?
data(iris)
library(ggplot2)
library(htmlwidgets)
library(plotly)
p <- ggplot2::ggplot(iris, ggplot2::aes(x = Sepal.Length, y = Petal.Length)) +
ggplot2::geom_point() +
ggrepel::geom_text_repel(ggplot2::aes(label = Species)) +
ggplot2::theme_classic()
ggplot2::ggsave('output/plot/point/example_repel_labels.pdf', p, height = 15, width = 15)
ggplot2::ggsave('output/plot/point/example_repel_labels.png', p, height = 15, width = 15)
pPlotly <- plotly::ggplotly(p)
htmlwidgets::saveWidget(pPlotly, 'output/plot/point/example_repel_labels.html')
Output:
Warning message:
In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomTextRepel() has yet to be implemented in plotly.
If you'd like to see this geom implemented,
Please open an issue with your example code at
https://github.com/ropensci/plotly/issues
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 le point d’entrée geom2trace.default indiqué dans l’avertissement et reproduisez l’exemple R fourni avec geom_text_repel. C’est terminé lorsque plotly::ggplotly restitue les étiquettes dans le fichier HTML enregistré sans signaler que GeomTextRepel n’est pas pris en charge.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data-visualization
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100