Skip to main content
100%

Rectangles coordinates when translated

✓ Published0🌍 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)

MIT Licensed

Similar vizzes