Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make some random bricks and practice basic looping

Public visualization

Let's make some random bricks and practice basic looping

0 stars0🌍 Public
MModalMBS
Last edited Sep 24, 2020
Created on Sep 24, 2020

A random field of 1,000 overlapping rectangles forms a dense, colorful brick-like pattern. The example demonstrates basic looping and random attribute assignment using D3 v6 within a React framework. Each iteration appends an SVG `rect` element, varying its width, height, and fill color through `Math.random()` and a conditional color chooser that selects red, green, or blue. The `select` API targets the SVG container, while `attr` with a dynamic `transform` rule staggers rectangles horizontally, creating a layered, chaotic composition.

AI-generated description

A bare minimum HTML page.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed