knots from gauss codes - stable branch
This interactive knot visualization generates random Gauss codes from four crossings and renders them as dynamic force-directed diagrams using D3 v4. Users can click translucent overlay circles to cycle each crossing through over, under, vertical, and horizontal smoothing states, which updates the link topology in real time. The SVG output combines thick colored paths representing knot strands with dashed helper lines, while `d3.forceSimulation` with x, y, and charge forces arranges the port nodes. Circle fill colors distinguish crossing types, and drag interactions let viewers manually reposition all elements.