3 ms·
I find that D3 is great, but it needs an abstraction for the general update pattern (https://bl.ocks.org/mbostock/3808218 https://bl.ocks.org/mbostock/3808218).
by aurelianito 10y ago
I find that D3 is great, but it needs an abstraction for the general update pattern (https://bl.ocks.org/mbostock/3808218 https://bl.ocks.org/mbostock/3808218).
I did that! One function that receives actions for update, create, delete, etc. Now my code is easier to read. Check the function gupChildren (AKA: General update pattern for child nodes of a selection) in my code, and feel free to use it: https://bitbucket.org/aurelito/sandro-lib/src/83b81c4b55684866fbab50ff98088822b1d42410/src/sandro/nadaMas/d3.js?at=default&fileviewer=file-view-default https://bitbucket.org/aurelito/sandro-lib/src/83b81c4b556848...
At last, unless you understand what you are doing, use selectAll and no select.
Cheers!