Fork of Marks and Channels
This fork of Marks and Channels demonstrates fundamental D3 visualization concepts by plotting a small dataset of seven countries according to their personal freedom and capital scores. The visualization uses circles as point marks, with horizontal and vertical positions encoding the two metrics, while circle radius encodes the average of both scores and color distinguishes countries using `d3.scaleOrdinal` with `d3.schemeCategory10`. The implementation shows a bubble chart built with SVG circle elements, `d3.axisBottom` and `d3.axisLeft` for axes, and linear scales for positioning. Country labels are placed inside each circle using SVG text elements. The code illustrates scaling factors, SVG attributes `transform` and `fill`, and D3 color schemes.
AI-generated descriptionA demonstration of basic D3 usage to implement the concept of Marks and Channels. Includes usage of:
- Point Marks by X, Y, Size
- Line mark varying in length
- Scaling factors
- SVG Rectangles
selection.each()- SVG Path Elements
d3.symbol()- SVG attributes
transformandfill - D3 Color Schemes
- JavaScript Modules
Part of the Constructing Visualizations Playlist.
See also blocks.roadtolarissa.com: Marks and Channels (a vanilla JavaScript version of this).