plotly / plotly.R

An interactive graphing library for R
https://plotly-r.com
Other
2.56k stars 627 forks source link

Unclear Warning message: 'box' objects don't have these attributes: 'mode' #2242

Open struckma opened 1 year ago

struckma commented 1 year ago

Thank you for your great work, a big step forward in data visualization!

Unfortunately, similar to #1560, I get a confusing warning, if I render a plot.ly created by plotly::ggplotly(.):

Warning message:
'box' objects don't have these attributes: 'mode'
Valid attributes include:
'alignmentgroup', 'boxmean', 'boxpoints', 'customdata', 'customdatasrc', 'dx', 'dy', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'hovertemplate', 'hovertemplatesrc', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'jitter', 'legendgroup', 'legendgrouptitle', 'legendrank', 'line', 'lowerfence', 'lowerfencesrc', 'marker', 'mean', 'meansrc', 'median', 'mediansrc', 'meta', 'metasrc', 'name', 'notched', 'notchspan', 'notchspansrc', 'notchwidth', 'offsetgroup', 'opacity', 'orientation', 'pointpos', 'q1', 'q1src', 'q3', 'q3src', 'quartilemethod', 'sd', 'sdsrc', 'selected', 'selectedpoints', 'showlegend', 'stream', 'text', 'textsrc', 'transforms', 'type', 'uid', 'uirevision', 'unselected', 'upperfence', 'upperfencesrc', 'visible', 'whiskerwidth', 'width', 'x', 'x0', 'xaxis', 'xcalendar', 'xhoverformat', 'xperiod', 'xperiod0', 'xperiodalignment', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'yhoverforma [... truncated] 

To reproduce, please use the following minimum iris example:

library(ggplot2)
plotly::ggplotly(ggplot(iris, 
                        aes(x = Species,
                            y = Sepal.Length,
                            ymin = 1, 
                            ymax = 10)) +
                   geom_boxplot() +
                   geom_pointrange() 
                 )

The plain ggplot2 print works.

I have tested this on version 4.10.1 of plotly on an Intel Mac with R 4.1.0 and ggplot2 vesion 3.4.0.

Thank you for considering a fix, so that I can avoid to suppress warnings here (I'm using plotly from a CRAN package).

gtollefson commented 4 months ago

I'm experiencing the same error.