Transforming Data
✓ Published0🌍 Public
This example demonstrates how to load, transform, and summarize the classic Iris dataset. It fetches a CSV file, parses it with `d3.csvParse`, converts numeric fields, and then uses `d3.flatRollup` and `d3.sum` to compute the average sepal length for each species. The resulting summary is displayed as a JSON string in a `<pre>` element. The code relies on D3 v7 for data parsing and aggregation, and uses a simple state-management pattern with `setState` to handle asynchronous loading.
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