🌍 Public
Viewing a saved revision (read-only)
1053827d4ce346e7a88e11590ae8675e
Loading & parsing CSV data
This example demonstrates how D3 loads and parses external CSV data by fetching a remote file and displaying a summary of its contents. The code uses `d3.csv()` to retrieve the dataset from a GitHub gist URL, then calculates and presents the file size in kilobytes, the number of rows, and the number of columns directly on the page. The resulting message is rendered inside an HTML `<pre>` element via the `textContent` property, with `d3.csvFormat()` used to measure the data’s string length for the size calculation. The example also defines an unused `fetchText` helper with the Fetch API.
AI-generated descriptionProgram loading and parsing CSV data