geom_text_repel() yet to be implemented in plotly
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
I would like plotly to support ggrepel::geom_text_repel.
I prepare the following shiny that works with plotOutput but not with plotlyOutput :
library(shiny)
library(plotly)
library(ggplot2)
library(ggrepel)
library(bslib)
ui <- page_sidebar(
title = "Hello Shiny!",
sidebar = sidebar(
selectizeInput(
inputId = "Test",
label = "Tests to show",
choices = paste("Test",1:272),
multiple = TRUE
)
),
plotlyOutput(outputId = "distPlot")
)
server <- function(input, output) {
output$distPlot <- renderPlotly({
x<-faithful
x$test<-paste("Test",1:272)
ggplot(x,aes(x=eruptions,y=waiting))+
geom_point()+
geom_text_repel(data = x[match(input$Test,x$test),],
aes(label = test),
color="blue")
})
}
shinyApp(ui = ui, server = server)
Marjorie Leduc
Add a comment
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Shiny example with renderPlotly, plotlyOutput, and geom_text_repel, then compare it with the working plotOutput version. Trace how plotly handles ggplot2 layers and identify the entry point where ggrepel support is missing. Done means the example renders the repelled labels through plotlyOutput without breaking existing plotly behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- plotly, r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100