Appendix B. What’s New in 4.0

A lot changed in version 4.0 of D3! In case you were just getting comfortable with version 3.x, you may feel as though 4.0 pulled the rug out from under you. Here I’ve summarized the changes most likely to affect beginner users of D3; this appendix addresses only the changes that impact what you would have learned from the first edition of this book.

For the rest, see Mike Bostock’s exhaustive list of “Changes in D3 4.0”. Also see Mike Bostock’s essay “What Makes Software Good?” for context and the rationale behind these changes.

The good news is that the fundamental principles baked into D3 (such as that of the data join) are unchanged. But 4.0 was rewritten from the ground up, and there are several significant structural and syntactical changes. 4.0 is decidedly not backward compatible.

Modularity

No longer one giant, hulking library, D3 is now modular, meaning it’s made up of many tiny libraries, each focused on a specific domain. Unless your project is super fancy, you can probably just use the default bundle, which includes the following D3 microlibraries or modules (each repository for which also contains its own documentation):

Get Interactive Data Visualization for the Web, 2nd Edition 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.