Psuedo-viz
This demo showcases several basic D3.js concepts for encoding data with marks and channels. It uses point marks (circles) to map data to X position, Y position, and size, plus a line mark with varying length and colored rectangles for a bar-like display. The code relies on D3 modules such as `d3-scale` for linear and ordinal scaling, `d3-axis` for axes, and `d3-shape` with `symbol` for SVG path elements. It also applies `d3.schemeCategory10` for color encoding and uses `selection.each()` to orchestrate multiple sub-visualizations within a single SVG.
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).