🌍 Public
Viewing a saved revision (read-only)
306597c6cdb341f693d2f324083a69ac
Learn d3.js
This example demonstrates the fundamental data-binding pattern in D3.js by binding an array of six numbers to paragraph elements and displaying each value as text. The code uses `d3.select` to target the body, then chains `selectAll('p')`, `.data()`, `.enter()`, and `.append('p')` to create one paragraph per data point. The `.text()` method with a function returns each datum, rendering the numbers 1 through 6 on the page. It relies on D3 v4’s core selection and data-join APIs within a minimal HTML setup that loads the library from a CDN.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.