Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rectangles coordinates when translated

Public visualization

Viewing a saved revision (read-only)

3c59e642533448b5a6c79a1bdbb91e71

Rectangles coordinates when translated

1 star0🌍 Public
NNita
Last edited Feb 20, 2020
Created on Feb 18, 2020
Forked from RGB color theory

Five semi-transparent squares arranged around a common center demonstrate how SVG translation affects a rectangle’s coordinate system. A red, green, blue, and yellow square sit at the cardinal offsets from the origin, while a magenta square is centered at half the rectangle’s width and height. Using React with D3 v5, the `<g>` element’s `transform` attribute shifts all children via `translate(480,250)`. The code defines reusable `MyRect` components, passing explicit `xPos` and `yPos` props, and renders them into an SVG with a light gray background.

AI-generated description

Smiley Face Part I (with React)