plotly / plotly/plotly.R

Integration with geom_phylopic()

Aperta
#2,313 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
R
Stelle
2.7k
Fork
641
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia eseguendo il reprex R fornito con geom_phylopic() e ggplotly() per riprodurre l’errore relativo al geom non supportato. Leggi la gestione esistente di ggplotly() per i geom non supportati e determina come viene testata questa integrazione. Il lavoro è completato quando l’esempio viene renderizzato tramite ggplotly() senza l’errore di implementazione, mantenendo l’immagine phylopic tracciata e il comportamento del tooltip.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
plotly, r
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.