Skip to Content
Learn D3.js - Second Edition
book

Learn D3.js - Second Edition

by Helder da Rocha
June 2026
Intermediate to advanced
582 pages
16h 16m
English
Packt Publishing

Overview

Master data visualization with D3.js v7 using modern web standards and real-world projects to build interactive charts, maps, and visual narratives

Key Features

  • Build dynamic, data-driven visualizations using D3.js v7 and ES2019+
  • Create D3 data visualizations, including charts, maps, and networks
  • Master data visualization with JavaScript through hands-on examples

Book Description

Learn D3.js, Second Edition, is a fully updated guide to building interactive, standards-compliant data visualizations for the web using D3.js v7 and modern JavaScript. Whether you're a developer, designer, data journalist, or analyst, this book will help you master the core techniques for transforming data into compelling, meaningful visuals.

Starting with fundamentals like selections, data binding, and SVG, the book progressively covers scales, axes, animations, hierarchical data, and geographical maps. Each chapter includes short examples and a hands-on project with downloadable code you can run, modify, and use in your own work.

This new edition introduces improved chapter structure, updated code samples using ES2019 standards, and better formatting for readability. Chapters were completely rewritten to focus on the most important topics first, with suggested exercises after each section, complete with commented solutions and online step-by-step tutorials. All code snippets are drawn from real-world D3 data visualization projects available in a GitHub repository, which also includes bonus content on integrating D3 into applications and migrating legacy code.

With its practical approach, this book remains one of the most respected resources for learning D3.js and creating interactive data visualizations with JavaScript.

What you will learn

  • Bind data to DOM elements and apply transitions and styles
  • Build interactive bar, line, pie, scatter, tree, and animated network charts
  • Implement interactive behaviors with zoom, drag, and tooltips
  • Visualize hierarchical data, flows, and maps using D3 layouts and projections
  • Use D3 with HTML5 Canvas for high-performance rendering
  • Create thematic geographic maps using standard GeoJSON and TopoJSON shapefiles
  • Complete 100+ exercises with commented templates and solutions
  • Build full visualizations through 10 guided online exercises

Who this book is for

This book is for web developers, data journalists, designers, analysts, and anyone who wants to create interactive, web-based data visualizations. A basic understanding of HTML, CSS, and JavaScript is recommended. No prior knowledge of SVG or D3 is required.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

D3 for the Impatient

D3 for the Impatient

Philipp K. Janert
D3.js in Action, Third Edition

D3.js in Action, Third Edition

Elijah Meeks, Anne-Marie Dufour
The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar

Publisher Resources

ISBN: 9781837636860