javascript - Find/recenter arbitrary node in d3 force-directed layout -
i have force-directed graph large number of nodes (thousands) - volume of data makes specific node difficult locate in graph. love have way search specific node, , recenter graph on it.
is parsing force.nodes() specific data value , somehow recentering graph on node? or more complicated that?
not troublesome. once you've identified special node, re-run layout own tick handler. in tick handler, set special node's x
, y
properties keep centered. layout algorithm adjust other nodes accordingly.
for smoother user experience, incrementally move node it's starting position center within tick handler.
Comments
Post a Comment