Skip to main content
100%

Loading Data - Health Insurance

✓ Published0🌍 Public
MMatt Hagger
Last edited Sep 3, 2025
Created on Sep 3, 2025
Forked from Loading Data

This example demonstrates how to load and parse a CSV file containing health insurance data using D3 v7. The visualization displays the raw parsed data as a JSON object in a `<pre>` element, showing fields such as age, sex, BMI, children, smoker status, region, and charges. It uses `d3.csvParse` to convert the CSV text into an array of objects, then manually coerces numeric fields with the unary plus operator. The code implements a loading state that transitions from undefined to "LOADING" before populating with the fetched data via the Fetch API.

AI-generated description
MIT Licensed

Similar vizzes