Skip to content

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

Open

Description

@cpsievert

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

Activity

  1. KasperSkytte commented on Jun 26, 2018

    @KasperSkytte

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

  2. marnixkoops commented on Jul 20, 2018

    @marnixkoops

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

  3. KasperSkytte commented on Jul 20, 2018

    @KasperSkytte

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

  4. kenahoo commented on Aug 19, 2019

    @kenahoo

    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

  5. micdonato commented on Sep 9, 2019

    @micdonato
  6. locked and limited conversation to collaborators on May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions