Transforming Data
✓ Published0🌍 Public
This example demonstrates data transformation with the Iris flower dataset, computing the average sepal length for each species and displaying the result as formatted JSON text. The visualization begins by fetching data.csv and parsing it with `d3.csvParse`, converting numeric fields from strings to numbers. It then uses `d3.flatRollup` combined with `d3.sum` to group records by species and calculate mean sepal lengths, with the final output rendered as a `<pre>` element via D3's `select` 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