Loading and Parsing CSV data
✓ Published0🌍 Public
This example demonstrates the loading and parsing of CSV data by fetching a file from a GitHub gist and displaying summary statistics—file size in kilobytes, row count, and column count—in large text within an HTML `<pre>` element. It uses the Fetch API with async/await to retrieve the raw text, then parses it with `d3.csvParse` from D3 v7. The resulting data structure’s length and `columns` array are accessed to report the metrics, showcasing a minimal workflow for handling tabular data in a browser.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
const promise = fetch(url);
promise.then(response => {
response.text().then(text => {
console.log(text);
});
});
MIT Licensed