Fork of Loading Data - Crop Yield
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 descriptionThis 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