Skip to content

Should Plotly.restyle throw error(s) when the update object isn't valid? #167

Closed
@harshjv

Description

@harshjv

Consider this setup,

var data = [
  {
    y: ['22.3', '23'],
    x: ['2001-06-11 11:00', '2001-06-11 11:10'],
    line: {
      'width': 2
    },
    uid: '40abaa'
  }
]

var layout = {
  yaxis: {
    title: 'Rate'
  },
  margin: {
    l: 40, b: 40, r: 40, t: 40
  }
}

Plotly.plot('mydiv', data, layout)

This dosen't work, and clears the plot

var update = {
  x: ['2001-06-15 11:10', '2001-06-15 11:20'],
  y: ['23', '100.3']
}

Plotly.restyle('mydiv', update)

But this is working

var update = {
  y: ['23', '100.3']
}

Plotly.restyle('mydiv', update)

Plotly.restyle is handling two axis data update incorrectly and clears the existing data on the plot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions