Skip to main content
100%

Cars Report

✓ Published2🌍 Public
++/+
Last edited Dec 1, 2020
Created on Nov 17, 2020
Forked from D3 Starter

This example demonstrates a simple car report generator that filters a hardcoded JSON dataset of five vehicles by maximum price and displays the results as formatted text. The app begins with a loading message, then uses the `getCars()` function to simulate a two-second asynchronous fetch via a `Promise` and `setTimeout`. Once resolved, the `generateReport()` function chains `filter()` and `map()` to select cars under $2,000, formats each entry using `formatCar()` to produce strings like “2009 Ford F150: $1950”, and joins them with line breaks into the `message-element` of the page. The code uses standard JavaScript APIs (ES6 modules, `Promise`, `JSON.parse`) without additional visualization libraries.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes