Skip to main content
100%

Untitled

✓ Published1🌍 Public
MMadalena
Last edited Jan 25, 2022
Created on Dec 2, 2021
Forked from HTML Starter

Twenty colored rectangles of random sizes bounce off one another and the edges of an SVG canvas, continuously accelerated by a custom force simulation built with `d3.forceSimulation`. Each particle moves at a constant velocity, with a custom `rectCollide` force handling pairwise collisions via a quadtree, and a `boundedBox` force keeping them inside the frame. Rectangles are draggable with `d3.drag`, which temporarily alters their velocity. The visualization uses D3 v4 with ordinal color scaling and direct SVG manipulation.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes