roughViz icon indicating copy to clipboard operation
roughViz copied to clipboard

Ability to clear and re-draw

Open peterbe opened this issue 5 years ago • 3 comments

I'm currently using ref.current.querySelectorAll("*").forEach(n => n.remove()); where ref.current refers to the DOM <div> element. This kinda works but it appears the y-axis is changing which might be a bug but I'd rather figure out a way to re-draw or clear.

peterbe avatar Nov 27 '19 03:11 peterbe

I got it to work using the following hack:-

   chart.svg.selectAll("*").remove();
   chart.drawChart();

but agree a redraw call would be cleaner. Linking #9

MintyMods avatar Nov 28 '19 18:11 MintyMods

+1 Will add update function to do this that can take new data. Possible pain point: smooth transition of rough paths.

jwilber avatar Jun 25 '20 06:06 jwilber

I would like to integrate this nice charting library to our Python ecosystem but I cannot find any details on a JavaScript API to update chart, add points, or change the options. Is it in the roadmap ? If you are interested this is what I manage to get for the time being: https://epykure.github.io/demos/charts/roughViz.html.

Thanks

epykure avatar May 11 '21 20:05 epykure

.redraw() method added in v2

jwilber avatar Oct 01 '23 04:10 jwilber