Shape with SVG and CSS
✓ Published0🌍 Public
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed