3

As I'm a beginner, here's another question about D3.js.

I have constructed a force directed graph, just as a lot did.

All the nodes are stored in one array and all links in another.

Now I want the central node to be fixed in the middle of the svg and the others lingering around it.

Is there any possibility to cut only one node out of the force layout without it falling out of my net? Has anybody already made it?

1 Answer 1

2

You can set the fixed property of a node to true, then place it where you like - see this related question.

// explicity set node position var fixedNode = graph.nodes[0]; fixedNode.fixed = true; fixedNode.x = width/2; fixedNode.y = height/2; 

Working fiddle: http://jsfiddle.net/nrabinowitz/z2cye/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.