Skip to main content
100%

Circular bounds

✓ Published0🌍 Public
FFrissAnalytics
Last edited Sep 3, 2018
Created on May 21, 2017

A force-directed network of 80 circular nodes is confined within a circular boundary. Each node has a random radius and is subject to repulsive charge and gravity forces. The visualization calculates the maximum and minimum x-coordinate for a given y-coordinate within the circle, and vice versa, to keep nodes inside the circular pool. This example uses `d3.layout.force()` and follows a variation of Mike Bostock's bounded force layout, adapting its rectangular bounds to circular ones. The SVG rendering includes a styled pool circle and nodes with a light fill.

AI-generated description

Circle-bound nodes in d3.layout.force(), using a variation of Mike Bostock's rectangular Bounded Force Layout. Here we calculate the maximum and minimum x for a given y in the circle, and vice versa.

forked from <a href='http://bl.ocks.org/nsonnad/'>nsonnad</a>'s block: <a href='http://bl.ocks.org/nsonnad/5993342'>Circle-bound D3 force layout</a>

mit Licensed

Similar vizzes