G
G
gsdev992019-12-02 14:34:43
React
gsdev99, 2019-12-02 14:34:43

How to do a rerender in react (hooks and d3.js)?

Hello. Please tell me exactly where I went wrong. In the next implementation, the task is to change the state and redraw the graph with new data. Instead, I recreate it.
https://codepen.io/gsdev99/pen/eYmYzKE
You can do the following in the draw() function:
d3.select(chart.current).html('')
But, I'm not sure if this is the right solution. In addition, it is assumed that the path should be redrawn animatedly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-12-02
@gsdev99

https://jsfiddle.net/gqa2wrkp/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question