Skip to main content
100%

Drawing circles with d3

✓ Published1🌍 Public
AAlina Sul
Last edited Mar 21, 2020
Created on Mar 21, 2020
Forked from HTML Starter

This example demonstrates two approaches to drawing a circle with D3, resulting in side-by-side red and blue circles. One circle is created directly in static SVG markup within the HTML, while the other is generated dynamically using D3’s selection and append methods, chaining `attr` calls to set the `cx`, `cy`, and `r` properties and `style` to fill the shape. The code uses `d3.select` and `d3.append` from the D3 v5 library to construct the SVG element and its circle child, showcasing basic programmatic SVG creation.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes