🌍 Public
Viewing a saved revision (read-only)
6395f9640ce9409ea6e4c2e3e49200ba
Cars Report
This example demonstrates a simple asynchronous data-loading pattern: it fetches an in-memory array of car objects through `getCars()`, which returns a Promise after a simulated 2-second delay. While waiting, the page displays “Loading...”, then renders a filtered text report listing only cars priced under $2,000, formatted as “year make model: price” via `generateReport()` and `formatCar()`. The code uses D3 v7’s `select` import and vanilla DOM methods to update a `<pre>` element, showcasing how to combine Promises with D3 for dynamic content updates.
AI-generated descriptionA demonstration of how to start using D3 version 6.