Radial Force
This example demonstrates a custom radial force in D3.js that positions nodes into two distinct concentric circles. Red nodes cluster at a radius of 100 pixels, while blue nodes form a larger circle at 200 pixels. The simulation uses `d3.forceSimulation` combined with a custom `forceRadial` function and `d3.forceCollide` to prevent overlap. Node positions are rendered as SVG circles, with the force updating their `cx` and `cy` attributes on each tick.
AI-generated descriptionThis example shows how to create a custom “radial” force that places nodes in a circle with a configurable radius and center. The red nodes form a circle of approximate radius 100px, and the blue nodes approximately 200px.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/cd98bf52e9067e26945edd95e8cf6ef9'>Radial Force</a>
forked from <a href='http://bl.ocks.org/wcjohnson11/'>wcjohnson11</a>'s block: <a href='http://bl.ocks.org/wcjohnson11/0e59422dda4f7f507f2403378528d721'>Radial Force</a>