plotly / plotly/plotly.R

GeomTextRepel() kicking error in plot_ly

Offen
#1,809 3 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung


Trying to add labels to a plot_ly chart with GeomTextRepel() from ggrepel packge but am getting this error:

"Warning 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"

.... so here I am lol Another issue is that the labels aren't actually showing up... but I'm assuming that's due to the apparent lack of coordination between geomtextrepel and plot_ly

 
AHR_data <-  read_csv(file = "Final_AHR_Report.csv", col_names = TRUE)

fluidRow(
                                  box(
                                    width = 12,
                                    status = "warning",
                                    plotlyOutput("National_Line")
                                  ),
                                )
                                ),


output$National_Line <- renderPlotly({ 
    
    AHR_data_filtered <- reactive({
      AHR_data %>% 
        select(States, Year, input$Variables) %>% 
        group_by(Year) %>% 
        summarise(mean = mean(get(input$Variables)))
    })
    
      p <- AHR_data_filtered() %>%
      ggplot(aes(x = Year, y = mean, label=mean, group=1)) +
      geom_line() +
      geom_point(color = "Orange", size = 3) +
      geom_text_repel() +
      ylab(paste(as.character(input$Variables), "National Average")) +
      xlab("Year")
      ggplotly(p)
      
  })

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie bei geom2trace.default mit dem bereitgestellten ggplotly-Beispiel und untersuchen Sie, wie die nicht unterstützte GeomTextRepel-Ebene behandelt wird. Vergleichen Sie vorhandene Geom-Konvertierungen und überprüfen Sie anschließend, dass das Beispiel sichtbare Beschriftungen erzeugt, ohne die Warnung zu nicht unterstützten Geoms auszugeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
data-visualization
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.