Skip to main content
100%

Shape with SVG and CSS

✓ Published0🌍 Public
Rradiohead-lgl
Last edited Sep 8, 2021
Created on Aug 1, 2021
Forked from HTML Cars Reports

This example demonstrates primitive SVG shapes—circles, rectangles, lines, and paths—styled with CSS and grouped using SVG’s `<g>` element. It shows how fill, stroke, and stroke-width attributes are applied directly on elements or inherited collectively from a group, with transform operations like scale and translate adjusting their placement. The code loads no external data but renders entirely in SVG, using only D3 conventions for module imports without invoking D3 functions. The stylesheet controls body margins, hidden overflow, and class-based stroke styling for the line group.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes