Strength chart d3: sticky knots

I would like to add behavior to a template with a directed graph in D3 so that once it fell, a drag-and-drop svg node will fall into its place, which no longer changes its position no matter what else happens on the graph. I read something about this API, but I can’t figure out how to do it.

The problem I'm trying to solve allows the user to "parse" a graph of complex strength.

+6
source share
1 answer

Set the fixed property of the node property to true in mousedown.

 node.on("mousedown", function(d) { d.fixed = true; }); 

For example: http://bl.ocks.org/3750558

+11
source

Source: https://habr.com/ru/post/925772/


All Articles