roughViz
roughViz copied to clipboard
Ability to clear and re-draw
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.
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
+1 Will add update function to do this that can take new data. Possible pain point: smooth transition of rough paths.
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
.redraw()
method added in v2