You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
encode_plotly does not handle plot_ly objects made with plotly::subplot #83
Creating a plotly object with subplot gives a data element, and no visdat element, so encode_plotly fails to mutate it to contain just data and layout elements. These objects then fail to render on dashr apps.
library(plotly)
linePlot <- plot_ly(x = c(1,2,3), y = rnorm(3), type = "scatter", mode='line')
subPlot <- subplot(list(linePlot, linePlot), nrows=2)
str(subPlot)
#List of 8
#$ x :List of 7
#..$ data :List of 2 # <- data element instead of visdat, cannot be mutated by encode_plotly
#.. ..$ :List of 10
#.. .. ..$ x : num [1:3] 1 2 3
#.. .. .. ..- attr(*, "apiSrc")= logi TRUE
# ....
str(linePlot)
#List of 8
#$ x :List of 6
#..$ visdat :List of 1 # <- visdat element can correctly be mutated by encode_plotly
#.. ..$ 45f77f423b03:function ()
#..$ cur_data: chr "45f77f423b03"
#..$ attrs :List of 1
Activity
rpkyle commentedon Apr 17, 2019
@sacul-git Thanks for this 🌟 issue! I'm going to open a PR to address this one, it's an easy fix.