plotly / plotly/plotly.R

Integration with geom_phylopic()

Offen
#2,313 0 Kommentare 0 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

Hello,

When developing a shiny app for a data visualisation dashboard, I encountered an issue that geom_phylopic() isn't integrated with plotly yet. I have pasted the error below. Is there any plans to have this integrated? I (think I) have created a reprex showing two plots that work and the one with plotly with the error.

Thanks,
Jo


geom_GeomPhylopic() 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

library(rphylopic)
library(ggplot2)
library(plotly)
# get image from phylopic and set up df
silhouette.img <- get_phylopic(uuid = get_uuid(name = "Sphyrnidae", n=1)) # hammerhead
silhouette.df <- data.frame(x=1,  y=9)

# make some fake data
df = data.frame(x=c(1:10), 
                y=c(1:10))

# this plot works
p = ggplot() + 
  geom_point(data = df, aes(x=x, y=y)) + 
  theme_bw() + 
  # geom_phylopic(data = silhouette.df, aes(x = x, y = y), 
  #               size = 1, col='purple',
  #               img = silhouette.img) + 
  xlim(0,10)

p %>% ggplotly(tooltip = c("x"))

# this plot works
p = ggplot() + 
  geom_point(data = df, aes(x=x, y=y)) + 
  theme_bw() + 
  geom_phylopic(data = silhouette.df, aes(x = x, y = y),
                size = 1, col='purple',
                img = silhouette.img) +
  xlim(0,10)

p 

# this plot does not work
p = ggplot() + 
  geom_point(data = df, aes(x=x, y=y)) + 
  theme_bw() + 
  geom_phylopic(data = silhouette.df, aes(x = x, y = y),
                size = 1, col='purple',
                img = silhouette.img) +
  xlim(0,10)

p %>% ggplotly(tooltip = c("x"))

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

Beginne damit, das bereitgestellte R-reprex mit geom_phylopic() und ggplotly() auszuführen, um den Fehler aufgrund des nicht unterstützten Geoms zu reproduzieren. Lies die bestehende ggplotly()-Behandlung für nicht unterstützte Geoms und ermittle, wie diese Integration getestet wird. Erledigt ist die Aufgabe, wenn das Beispiel über ggplotly() ohne den Implementierungsfehler gerendert wird und dabei das geplottete Phylopic-Bild sowie das Tooltip-Verhalten erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
plotly, 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
35/100

Neue Issues direkt in Ihr Postfach

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