🌍 Public
Viewing a saved revision (read-only)
42c77c565bf44c00bc6eae86559bf8ca
D3-coding-challenge#1: Read and Display JSON Data
MMartin MIAO
Last edited Mar 21, 2022
Created on Mar 21, 2022
This example demonstrates how to read and display JSON data using D3.js v7. It loads an array of car objects containing year, make, model, and price fields, then renders two lists: one showing only the car make and another displaying full descriptive sentences for each car generated by the `print_info` helper function. The code imports the data from a separate JavaScript module, formats it using `JSON.stringify`, and binds it to DOM list items through D3’s `selectAll().data().enter().append()` pattern, with styles defined in an external CSS file.
AI-generated description