everyone I was trying to make Force layout that selection node always at the center and the whole graph redraw. I current now set 1 node as a "root" and fix it to the center but i am stuck there. My current approach
Psuedo code:
root=nodes[0]
root.x and root.y=center and root.fix=true
onclick(){
root=not root anymore//Make current root is no longer root
d3.select(this)=root; // Selection become root
update() //What should be in this function?
}
Data format: miserables.json at http://bl.ocks.org/sjengle/5431779
The idea is this Flash example: http://www.liveplasma.com/#/artist/Arctic_Monkeys/ada7a83c-e3e1-40f1-93f9-3e73dbc9298a/DE