Fork of Loading Data - Cars Data
This example displays raw car data loaded from a CSV file by parsing it with D3’s `csvParse` and rendering it as a JSON string using `JSON.stringify`. The visualization shows the dataset’s structure, including categorical attributes like company and fuel type, alongside quantitative fields such as horsepower, price, and top speed. The code uses `fetch` to retrieve the CSV, then maps each row without cleaning the text-based numeric values, preserving them as strings. D3 selections manage the `<pre>` element that displays the parsed data.
AI-generated descriptionThis dataset is a set data that documents information about cars by company name (Company) and Model (Cars Name). The information about the cars includes: engine type (Engine), displacement or battery (CC/Battery Capacity), horsepower (HorsePower), top speed (Total Speed), 0-100 km/h time (Performance(0 - 100)KM/H), car price (Cars Prices), type of fuel used (Fuel Types), number of seats (Seats), and engine/motor torque (Torque).
Note that all the data cells have string data along with numerical data in the quantitative attributes. Without preprocessing of the csv data to rid each cell of the string component, I do not know how to handle the data other than to import it as a string. This is what I will do for now until further instruction is provided about this sort of data issues.
The dataset can be found here: https://www.kaggle.com/datasets/abdulmalik1518/cars-datasets-2025?resource=download
Attribute Description
Company: Categorical Cars Name: Categorical Engine: Categorical CC/Battery Capacity: Quantitative HorsePower: Quantitative Total Speed: Quantitative Performance: Quantitative Cars Prices: Quantitative Fuel Types: Categorical Seats: Quantitative Torque: Quantitative