Skip to main content
100%

Loading US GDP Data

✓ Published2🌍 Public
SSeekerzero
Last edited Jan 23, 2023
Created on Jan 22, 2023
Forked from Loading Data

This example demonstrates the asynchronous loading and parsing of a CSV file containing US GDP data, displaying the resulting data structure as JSON in a `<pre>` element. Initially showing "LOADING" and then the parsed array of objects, it fetches the dataset from a Gist URL, uses `d3.csvParse` to parse the CSV, and converts numeric fields like `date`, `level_current`, and `change_chained` to numbers. The visualization relies on the `d3` library for DOM selection and CSV parsing, with the data structured according to the BEA-sourced fields from datahub.io.

AI-generated description

https://datahub.io/core/gdp-us

Gross Domestic Product of the United States (US GDP)

Gross Domestic Product (GDP) of the United States (US) both nominal and real on an annual and quarterly basis. Annual data is provided since 1930 and quarterly data since 1947. Both total GDP (levels) and annualized percentage change in GDP are provided. Both levels and changes are available both in current dollars (nominal GDP) and in chained 2009 dollars (real GDP). Data is sourced from US Government’s Bureau of Economic Analysis (BEA) and provided in standardized CSV.

Field Name Order Type (Format) Description
date 1 year The year
level-current 2 number GDP in billions of current dollars
level-chained 3 number GDP in billions of chained 2009 dollars
change-current 4 number GDP percent change based on current dollars
change-chained 5 number GDP percent change based on chained 2009 dollars

MIT Licensed

Similar vizzes