Transforming Data
✓ Published0🌍 Public
This example demonstrates how to transform the classic Iris dataset by computing the average sepal length for each species using `d3.flatRollup` and `d3.sum`, then displaying the aggregated results as a JSON summary in a `<pre>` element. The visualization loads CSV data asynchronously via `fetch`, parses it with `d3.csvParse`, and converts numeric fields before processing. Built with D3 v7 and ES6 modules, it showcases lazy state management where data is fetched and transformed only once on initial render.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed