Skip to content

Account for trace specific layoutAttributes when warning about attribute names #994

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
cpsievert opened this issue May 9, 2017 · 5 comments

Comments

@cpsievert
Copy link
Collaborator

This shouldn't throw a warning

> plot_ly(ggplot2::diamonds, x = ~cut, y = ~price, color = ~clarity, type = "box") %>% layout(boxmode = "group")

Warning message:
'layout' objects don't have these attributes: 'boxmode'
Valid attributes include:
'font', 'title', 'titlefont', 'autosize', 'width', 'height', 'margin', 'paper_bgcolor', 'plot_bgcolor', 'separators', 'hidesources', 'smith', 'showlegend', 'dragmode', 'hovermode', 'xaxis', 'yaxis', 'ternary', 'scene', 'geo', 'mapbox', 'radialaxis', 'angularaxis', 'direction', 'orientation', 'legend', 'annotations', 'shapes', 'images', 'updatemenus', 'sliders', 'calendar', 'barmode', 'bargap', 'mapType'
> Schema$traces$box$layoutAttributes$boxmode
$valType
[1] "enumerated"

$values
[1] "group"   "overlay"

$dflt
[1] "overlay"

Originally posted in https://community.plot.ly/t/not-a-real-error-for-boxmode/2596

@KasperSkytte
Copy link

KasperSkytte commented Jun 26, 2018

Agree! And wrapping in suppressWarnings() has no effect, only if the print method is called, which is not possible when returning the object invisibly.

@marnixkoops
Copy link

I'm running into the same problem, did you find any proper solution in the meanwhile? @cpsievert @KasperSkytte

@KasperSkytte
Copy link

No, I just live with it, it's just warnings after all. Works fine

@kenahoo
Copy link

kenahoo commented Aug 19, 2019

This is still a problem in plotly version 4.9.0.

In some contexts it's easy to ignore the warning, but if I'm making a Jupyter notebook for people to look at, it's pretty bad:

Screen Shot 2019-08-19 at 5 01 44 PM

@micdonato

This comment has been minimized.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants