Skip to main content
100%

D3-coding-challenge#1: Read and Display JSON Data

✓ Published1🌍 Public
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

Fork this template code and add new codes as you want.

MIT Licensed

Similar vizzes