javascript - d3.js v4 force diagram update -


trying update force diagram nodes , links exist in current diagram. example, have simple diagram 2 nodes , b , link between them "a" --> "b".

i wondering correct way of handling if node, same, added.

in fiddle i've put , in personal development end duplicates, thought handled in

.data(nodes, function(d) { return d.id; }) 

and links appropriate data function (for example .data(links, function(d) { return d.target; }))

ideally, i'm looking "nothing happen" when same node/ link added. hopefully, makes sense, please see fiddle example here


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -