New data at .data() makes svg to redraw instead of updating nodes position

27 views
Skip to first unread message

Mário Lopes

unread,
Jan 8, 2021, 4:12:12 AM1/8/21
to d3-js
Considering this working example https://bl.ocks.org/colbenkharrl/21b3808492b93a21de841bc5ceac4e47, the data update makes the svg update without being re-drawn.

However, if the node and links data reference is new, even if the contents are the same, the svg is re-drawn on every update.

Here https://jsfiddle.net/nx9wctdk/ , inside the function update(), the call update_local() will make the graph working as expected. The call update_http() will make the graph to be re-drawn.

Tested with D3 v4.13.0 and D3 v6.3.1 in Firefox 78.6.0esr and Chrome 86.0.4240.111. No errors are thrown on dev tools.

Thanks.
Reply all
Reply to author
Forward
0 new messages