Skip to content

nestedProperty results in modal Plotly.restyle #1580

Closed
@rreusser

Description

@rreusser

See: http://codepen.io/rsreusser/pen/NjKXqJ?editors=0010

It seems to me that Plotly.restyle is modal in an undesirable way. That is, the same command succeeds or fails depending on the value of current data. Right now value of the filter transform is the only property which I'm aware exhibits this since either a number or an array is valid, but there may be others.

Consider:

  1. value is a number
  2. restyle 'value[0]' ⟶ fails because you can't set property [0] of a number
  3. restyle 'value': [0, 0] ⟶ succeeds
  4. restyle 'value[0]' ⟶ succeeds

So the same command both fails and succeeds. You're welcome to close this, but it seems undesirable and uncommon, so I'd love to answer it definitively before it becomes a common usage that can't be undone. (Which is to say, carpet adds another usage of this and I'm currently struggling with the fallout.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions