force-graph icon indicating copy to clipboard operation
force-graph copied to clipboard

question simple function !

Open NoviceInWeb opened this issue 2 years ago • 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 avatar Jun 09 '22 01:06 NoviceInWeb

@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

vasturiano avatar Jun 10 '22 17:06 vasturiano

@NoviceInWeb thanks for reaching out.

thank you . have a nice day !

NoviceInWeb avatar Jun 22 '22 08:06 NoviceInWeb