vasturiano/force-graph

question simple function !

Opened this issue · 2 comments

Hi, @vasturiano

I am using 'force-graph' very well. thank you.

I have a question.

After nodes and edges are drawing, the node was dragged or the position was moved.
then, I want initialize the coordinates nodes position.

same node information and the same edge information,
I want to initialize only the coordinate calculation.
Is there a function provided to initialize the coordinates?

or
do I put data again like when i first made it??

thank you.🤷‍♂️

@NoviceInWeb thanks for reaching out.

You can simply add x and y attributes to each of your nodes. This will tell the force simulation to use those coordinates as starting points for the nodes.

See more at: https://github.com/d3/d3-force#simulation_nodes

@NoviceInWeb thanks for reaching out.

thank you . have a nice day !