Viewing a saved revision (read-only)
386dd34c85cb43df9eb0cf459bc78ead
Circles with D3
This example shows a set of seven colorful circles scattered across an SVG canvas, each with a distinct size, position, and fill color at 70% opacity. It demonstrates core D3.js v7 concepts including data binding, the General Update Pattern, and method chaining via `select`, `selectAll`, `data`, and `join` to render `circle` elements. The visualization uses static, data-driven coordinates and colors defined in a JavaScript array, rendered through an HTML import map loading D3 from a CDN. The code also showcases the `join` API for creating SVG circles within a container sized to the viewport.
AI-generated descriptionD3 Circles Visualization
This project demonstrates how to create a simple data visualization using D3.js with modern ES6 modules and HTML import maps. It renders colorful circles on an SVG canvas using D3's powerful data-binding capabilities.
Project Structure
Files Overview
index.html - The main HTML file that sets up the page structure and imports D3 index.js - The entry point that initializes the visualization viz.js - Contains the main visualization logic using D3
How It Works
1. D3 Import Setup (index.html)
The project uses modern ES6 import maps to load D3 from a CDN without requiring a build step: