Skip to main content
100%

Force based label placement

✓ Published0🌍 Public
MMoritzStefaner
Last edited Jan 20, 2020
Created on Nov 18, 2011

Two force-directed layouts run simultaneously: one positions graph nodes and edges from randomly generated links, while a second governs label anchors that orbit each node at a fixed distance and repel one another to prevent overlap. Labels on the right align left, labels on the left align right, with interpolation in between. The code uses d3.layout.force for both simulations, d3.select, SVG text bounding boxes via getBBox, and manual transform updates on each tick.

AI-generated description
apache-2.0 Licensed

Similar vizzes