Basic introductory demo of making a network graph with the d3 force directed simulation.
See my exmple of a swarm plot for a good introduction to generally using the force simulation.
The key ingredient is adding the link force, one of about 5 kinds of forces that D3 provides constructors for.
Physically, the link force behaves like a spring.
It has a length that it wants to have. Shorten it and it pushes outward, lengthen it and it pulls inward.
For each link force, its length and strength are both customisable.