Skip to main content
100%

Fork of Loading Data - Crop Yield

✓ Published0🌍 Public
BBrian Hulbert
Last edited Sep 4, 2025
Created on Sep 4, 2025
Forked from Loading Data

This example demonstrates loading and displaying crop yield data from a CSV file, showing raw parsed values for crops like maize and potatoes across multiple years in Afghanistan. The visualization initially renders a JSON representation of the dataset, then transitions to a structured table after the asynchronous fetch completes. Using `d3.csvParse` and `d3.select`, the code reads the remote CSV, converts numeric fields such as `Year_Code` and `Value` to numbers, and updates the DOM with the processed data. The state management via `setState` triggers re-rendering as data moves from an initial `undefined` state through `'LOADING'` to the final parsed array.

AI-generated description

This dataset contains information about crop yield for a given location and year. I plan to reduce the number of attributes in the future. https://www.kaggle.com/datasets/patelris/crop-yield-prediction-dataset Data attributes: Quantitative: Value

Ordinal: Year_code year

Categorical: Domain_code Area_code Domain Unit Element

MIT Licensed

Similar vizzes