Activity6_4_Transforming the Data
✓ Published0🌍 Public
This example demonstrates data transformation by loading the classic Iris flower dataset from a CSV file and computing the average sepal length for each species using D3’s `flatRollup` and `sum` functions. The results are displayed as a formatted JSON summary in a `<pre>` element. The visualization fetches the local CSV with `fetch`, parses it via `csvParse`, and converts numeric fields to numbers. The code also shows state management patterns, including a loading state and conditional rendering, relying on D3 v7’s selection and join methods.
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