I’m trying to animate a filled area plot using plotly/R. While my code produces the desired result, plotly prints an error message about ‘scatter’ objects not having the attribute ‘frameOrder’. I’m uncertain if the issue is with the code or a bug in plotly, so I was hoping someone more knowledgeable than me may be able to help.
I have a data frame with a column for time, a column for x coordinates, and two columns for y coordinates named “a” and “b”. I want to plot objects “a” and “b” in a two-dimensional plane and animate them so that they change over time. Here is what I do:
library("plotly")
df <- expand.grid(seq(1:3), seq(1:3), NA, NA)
df <- setNames(df, c("x", "time", "a", "b"))
df$a <- c(1, 0.5, 0.25, 0.5, 1, 0.25, 0.25, 0.5, 1)
df$b <- c(0.25, 0.5, 1, 0.25, 1, 0.5, 1, 0.5, 0.25)
pp <- plot_ly(df, x = ~x)
pp <- add_trace(pp, y = ~df$a, name = "a", frame = ~df$time, type = "scatter", mode = "none", fill = "tozeroy")
pp <- add_trace(pp, y = ~df$b, name = "b", frame = ~df$time, type = "scatter", mode = "none", fill = "tozeroy")
pp
After this runs through, RStudio brings up an interactive plotly plot in the Viewer which looks and works exactly as intended. However, these error messages are printed in the console after I execute ‘pp’:
Warning messages:
1: 'scatter' objects don't have these attributes: 'frameOrder'
Valid attributes include:
'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'stackgroup', 'orientation', 'groupnorm', 'stackgaps', 'text', 'hovertext', 'mode', 'hoveron', 'line', 'connectgaps', 'cliponaxis', 'fill', 'fillcolor', 'marker', 'selected', 'unselected', 'textposition', 'textfont', 'r', 't', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'rsrc', 'tsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'
2: 'scatter' objects don't have these attributes: 'frameOrder'
Valid attributes include:
'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'stackgroup', 'orientation', 'groupnorm', 'stackgaps', 'text', 'hovertext', 'mode', 'hoveron', 'line', 'connectgaps', 'cliponaxis', 'fill', 'fillcolor', 'marker', 'selected', 'unselected', 'textposition', 'textfont', 'r', 't', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'rsrc', 'tsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'