Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

Closed
mafar opened this issue Jul 11, 2019 · 1 comment · Fixed by #4038
Closed

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

mafar opened this issue Jul 11, 2019 · 1 comment · Fixed by #4038
Assignees
Labels
bug something broken

Comments

@mafar
Copy link
Contributor

mafar commented Jul 11, 2019

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

@etpinard
Copy link
Contributor

Thanks for reporting!


This isn't a restyle bug it looks like:

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(gd, data, {}, { showSendToCloud: true });

also spits out the same exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants