Skip to main content
100%

D3v4 Force Layout with Covex Hull

✓ Published0🌍 Public
Aandrew-reid
Last edited Jul 14, 2017
Created on Jun 8, 2017

This example demonstrates a force-directed network graph using D3v4, with the nodes and links of the Les Misérables character co-occurrence dataset. A semi-transparent convex hull, computed via `d3.polygonHull`, dynamically wraps the entire set of nodes, updating its path on every simulation tick. Nodes are colored by group, links are weighted by line thickness, and the hull provides a visual boundary around the full network. The SVG rendering uses D3’s force simulation to position nodes and links, while the hull path is recomputed each tick to enclose all node positions.

AI-generated description

A quick attempt to achieve a minimum convex hull on a force in v4 (as opposed to v3 ).

In v4 there are no accessor methods, so the d3.polygonHull function takes only arrays of coordinates from the looks of it (June 2017).

Similar vizzes