Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

viz-happiness-2024

Public visualization

Viewing a saved revision (read-only)

b9fc7b0022ad48adbafae85e4c8ef831

viz-happiness-2024

0 stars1🌍 Public
XXiaojun
Last edited Sep 3, 2025
Created on Sep 2, 2025
Forked from Loading Data

This example displays the raw data from the World Happiness Report 2024 as a formatted JSON preview, showing country names and their associated happiness indicators including Ladder score, social support, and GDP per capita. The visualization loads data from a CSV file using the `fetch` API and parses it with `d3.csvParse`, converting numeric fields from strings to numbers. The code renders the parsed data structure in a `<pre>` element, providing a simple text-based investigation of the dataset before any graphical mapping is applied. The implementation follows a state management pattern where data loading triggers a re-render of the view.

AI-generated description