I am experimenting with force directed layout using D3.js. What I need is center the layout by root (or other selected node) and return this node to the svg (e.g. canvas) center after the tick function is done (the graph alpha is low). Is it possible? I found an example at
but I am unable to make the root (when using aplha or other custom tick function calculation) return back to the center (center the layout by this particular node).
Any help would be appreciated.
Actually I solved this like this(similar to previous but more sophisticated):