CSV to JSON
✓ Published0🌍 Public
SSpaceActuary
Last edited Jun 17, 2016
Created on Jun 17, 2016
This example demonstrates how to convert flat CSV data into a nested JSON structure using D3’s nesting and mapping functions. It shows the raw CSV text alongside the resulting JSON, grouping records by name and transforming year–amount pairs into arrays for two time-series variables. The code loads `data.csv` via `d3.csv`, coerces numeric columns, then applies `d3.nest()` and `.map()` to reshape the data. Output is displayed in HTML paragraphs using D3 selections.
AI-generated descriptionBuilt with blockbuilder.org