Skip to main content
100%

D3 line module test w/Canvas

✓ Published0🌍 Public
Aandrew-reid
Last edited Jan 1, 2020
Created on Jan 1, 2020

Two horizontal lines are drawn on a canvas, each connecting a fixed left point to a moving right point. The right point animates back and forth between two positions, causing the line to redraw smoothly with a zigzag or "funky" pattern along its length. The example uses a custom D3 curve, `d3.funkyline()`, applied via `d3.line()` with a Canvas 2D context, and animates using `transition.attrTween` and a recursive `transition` loop. The line’s wavy offset is controlled by interval and margin parameters, while a small circle marker updates its position in sync with the animated endpoint.

AI-generated description

Similar vizzes