Skip to content

BUG: Plotly.restyle gives error if array has empty values #4031

Closed
@mafar

Description

@mafar

when Plotly.restyle is called with array with empty values , gives error
y: [["Morning", "Afternoon", "Evening", "", ""]]

CODE: https://codepen.io/mafar/pen/agMvEO

var data = [
  {
    z: [[1, 20, 30, 50, 1], [20, 1, 60, 80, 30], [30, 60, 1, -10, 20]],
    x: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "", ""],
    y: ["Morning", "Afternoon", "Evening"],
    type: "heatmap"
  }
];

Plotly.newPlot("myDiv", data, {}, { showSendToCloud: true });
// Plotly.restyle with empty array values
var update = {
  y: [["Morning", "Afternoon", "Evening", "", ""]]
};
Plotly.restyle("myDiv", update, 0);

See attached image:
ion

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions