4. Shaping Web Pages with D3 Selections

In this chapter we are going to dive in to D3 (finally!). Specifically, we’re going to cover something called selections. On the most basic level, selections are D3’s way of letting you access a web page so you can make changes to it. Selections give you the keys to the web page document so you can drive it! Remember, although D3 is an amazing tool for creating data visualizations, it doesn’t have a basic function for generating charts. Instead, it provides a bunch of ways to manipulate the contents of a web page, based on data. But it’s up to you to create the shapes and lines you need to make an intelligible data visualization.

Getting Set Up with D3

D3 is a JavaScript library, a large-ish text file ...

Get Visual Storytelling with D3: An Introduction to Data Visualization in JavaScript™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.