Loading Data Airline Loyalty
This example demonstrates asynchronous data loading with D3 v7 by fetching an airline loyalty program CSV from Kaggle and displaying the parsed data as JSON. The visualization initially shows a loading state before `fetch()` retrieves the file and `csvParse` converts it into an array of objects. Numeric fields like Salary, CLV, and enrollment dates are coerced using unary plus operators. The `viz` function manages the render cycle through a state object, updating the displayed data once the loading completes.
AI-generated descriptionAirline Loyalty Program History: contains information about customer activity and demographics related to an airline's loyalty program, including a promotional campaign aimed at enhancing program enrollment.
The airline implemented a promotional campaign (2018 Promotion) aimed at enhancing program enrollment. The dataset encompasses information regarding:
Customer flight activity and loyalty points
Program signups and enrollment details
Cancellations within the loyalty program
Comprehensive customer demographics
Contains geospatial, temporal, numeric and categorical information about each customer.
https://www.kaggle.com/datasets/siddharth0935/airline-loyalty-program/data
| Attribute | Type | Classification | Description |
|---|---|---|---|
| Loyalty Number | Quantitative | Not Data, randomly gen | Unique numeric ID per customer. |
| Country | Categorical | Nominal | Customer’s country of residence. |
| Province | Categorical | Nominal | Province/state of residence. |
| City | Categorical | Nominal | City of residence. |
| Postal Code | Categorical | Nominal | Postal or ZIP code. |
| Gender | Categorical | Nominal | Gender of the customer (e.g., Male, Female). |
| Education | Categorical | Ordinal | Highest education level (High School < College < Bachelor < Master < Doctor). |
| Salary | Quantitative (Continuous) | Ratio | Annual income of the customer. |
| Marital Status | Categorical | Nominal | Marital status (e.g., Single, Married, Divorced). |
| Loyalty Card | Categorical | Ordinal | Tier of loyalty card (Star > Nova > Aurora). |
| CLV | Quantitative (Continuous) | Ratio | Total revenue (invoice value) from all flights ever booked by the customer. |
| Enrollment Type | Categorical | Nominal | How the customer enrolled (Standard or 2018 Promotion). |
| Enrollment Year | Quantitative (Discrete) | Interval | Year the customer enrolled. |
| Enrollment Month | Quantitative (Discrete) | Interval | Month the customer enrolled. |
| Cancellation Year | Quantitative (Discrete) | Interval | Year the customer canceled membership (if applicable). |
| Cancellation Month | Quantitative (Discrete) | Interval | Month the customer canceled membership (if applicable). |