Fork of Loading Data
This example demonstrates the asynchronous loading of airline flight data from a CSV file, displaying the parsed contents as a JSON string in a preformatted text element. The visualization uses D3 v7’s `csvParse` method to convert the raw text into an array of objects, with numeric fields explicitly coerced to numbers. The code manages a state machine—starting as undefined, transitioning to `'LOADING'`, then resolving to the final dataset—by fetching `data.csv` via the Fetch API and updating the DOM through `select` and `.join` methods. The data source is a Kaggle dataset of airline flights, though the included file uses iris sample data for demonstration.
AI-generated descriptionThis data set contains information about airlines and their flights. It includes details about flight origin and destination, flight duration, number of stops, etc.
Here is the link to the dataset: https://www.kaggle.com/datasets/rohitgrewal/airlines-flights-data?resource=download