This project demonstrates how to create colorful circles using D3.js with modern ES6 modules and HTML import maps. Creating circles with D3! To use code like this in various frameworks or vanilla HTML, see d3-rosetta.
Full Playlist: Constructing Visualizations
We will create an SVG element containing multiple colorful circles with varying sizes and positions. The visualization demonstrates key D3 concepts including data binding, the General Update Pattern, method chaining, and dynamic styling. Each circle is positioned using data-driven coordinates and styled with vibrant colors and transparency effects.
This project leverages modern HTML Import Maps to load D3.js directly from a CDN without requiring a complex build process or bundler. Import maps provide a clean way to specify module dependencies in the browser.
Import maps are a web standard that allows you to control how module specifiers are resolved when importing ES6 modules. Instead of writing: