BSd3v / dash-chart-editor

A dash wrapper of Plotly's react-chart-editor
HomePage
MIT License
53 stars 7 forks source link

No ability to reset chart editor from callback #25

Open ndrezn opened 1 year ago

ndrezn commented 1 year ago

It's quite difficult to reset the chart config. I'm working with this and trying to reset the chart by passing:

{
    "data": [],
    "layout": {
        "xaxis": {"range": [-1, 6], "autorange": True},
        "yaxis": {"range": [-1, 4], "autorange": True},
        "autosize": True,
    },
    "frames": [],
}

to the attribute loadFigure (you can't pass it to the attribute figure as this isn't directly associated.

This gives: t[0] is undefined from the JS console. Maybe I'm missing something... Is it possible to reset the chart editor to its default state from a callback?