Skip to main content
100%

Shapes with SVG and CSS

✓ Published2🌍 Public
DDaniel Weston
Last edited Jul 11, 2019
Created on Jul 11, 2019
Forked from Hello VizHub

This example demonstrates how to draw basic shapes—circles, rectangles, lines, and paths—using SVG elements embedded directly in an HTML page, with styling controlled through CSS. The code uses D3.js v5 to select the SVG container and relies on standard SVG attributes like `cx`, `r`, `x`, `y`, and `d` to define geometry. A simple transform group shifts and scales the shapes, while stroke and fill properties, including a blue fill with black stroke on a subgroup, show how visual appearance is set.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes