🌍 Public
Viewing a saved revision (read-only)
868d806884ab40d7a752d5c83b8ae186
Transforming Data
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.