d3.js - D3 force directed graph with drag and drop support to make selected node position fixed when dropped -
example on force direct graph can found here: http://bl.ocks.org/950642
how can add support drag , drop? should set node fixed current location of dropped it. important rest of nodes still uses 'force directed mode' position rest of nodes in graph automatically
https://github.com/mbostock/d3/wiki/force-layout
i've played around bit without success, , wondering if able give me quick example on how add such support explained above.
finally got working after figuring out not ideal fight 2 "drag" listeners (your own, , force.drag) attached nodes!
much better have own "drag"-listener , call tick() manually key feature of getting force graph position nodes on every new node position on node dragging.
working example: http://bl.ocks.org/2883411
Comments
Post a Comment