Skip to content

a version of .newPlot that does the .update logic behind the scenes #1850

Closed
@chriddyp

Description

@chriddyp

In Dash, I'd like the Graph component to do smart restyle and relayout updates when I call newPlot or plot (or some new method). Dash users deal with figures and not diffs.

Programming this logic myself is a lot of work that other groups could benefit from if it was done centrally in plotly.js. I wrote a lot of the logic in the workspace and it took a while to work through all the kinks. Some of the edge cases included:

  • calling newPlot instead of update at the start
  • calling addTraces manually instead of update
  • calling newPlot instead of update when switching between 2D, 3D, or ternary
  • calling newPlot when switching to a financial chart type
  • deleting cartesian axes when swithing to ternary or mapbox

Here is that code

This would form the basis of a plotly.js React component.

Dash users will benefit from this immediately with:

  • Faster updates enabling their apps to refresh every 50ms and mimic live-streaming
  • Mapbox updates with full map redraws

Ideally, this logic would work its way into a robust .animate method as well (.animate method that can handle any type of figure diff #1849)


cc @rreusser @alexcjohnson @etpinard @cpsievert @monfera @jackparmer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions