Transforming Data
✓ Published0🌍 Public
This example demonstrates unidirectional data flow in D3 v7 by loading the Iris flower dataset and transforming it through a series of data-processing APIs. The visualization initially renders the raw CSV data as JSON text, then uses `csvParse` to convert the spreadsheet into typed objects, converting numeric columns with unary plus operators. It showcases `group`, `flatGroup`, `rollup`, `flatRollup` for aggregations by species, `sum` for computing average sepal lengths, and `bin` for histogram-like frequency distributions of sepal lengths. The state management pattern uses explicit `setState` calls to trigger re-renders, contrasting with typical D3 data joins.
AI-generated descriptionA circle that follows the mouse using unidirectional data flow.
MIT Licensed