Skip to main content
100%

Fork of Sine Wave Circles

✓ Published0🌍 Public
PPeiyang Li
Last edited Apr 13, 2023
Created on Apr 13, 2023
Forked from Sine Wave Circles

This example visualizes a sine wave as a row of 30 circles that oscillate vertically in sequence, creating an undulating wave pattern across a 960-by-500 SVG canvas. Each circle’s y-position is determined by a sine function whose phase shifts with time and varies with the circle’s index, producing a smooth, continuous wave animation. The code uses D3 v7’s `range` and `timer` APIs to drive the animation, updating circle positions via selection attributes. It is a direct port of a p5.js sine wave example, implemented with SVG elements and vanilla JavaScript.

AI-generated description

A D3 version of the Math Sine Wave P5.js example.

Ported to ES6 from an older version: bl.ocks.org: Sine Wave Circles with blockbuilder.org.

MIT Licensed

Similar vizzes