Drawing SVG Shapes with D3
✓ Published0🌍 Public
This example contrasts hand-written SVG markup with D3-generated SVG for drawing a simple bar shape. It shows a static green rectangle created directly in HTML using the `<rect>` element, and an identical rectangle produced dynamically via D3’s selection and append methods. The page uses `d3.select`, `append`, `attr`, and `style` to construct and style the SVG node in the DOM. The code relies on D3 v7 loaded from a CDN and does not use any data binding or scales.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed