O'Reilly logo

Learning d3.js Data Visualization - Second Edition by Swizec Teller, Ændrew Rininsland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Layouts – D3's Black Magic

Most of us look at the Internet for inspiration and code samples. You find something that looks great, you look at the code, and your eyes glaze over. It doesn't make any sense.

The usual culprit is D3's reliance on layouts for anything remotely complicated. The black magic of taking some data, calling a function, and—voilà—visualization! This elegance makes layouts look deceptively difficult, but they make things a lot easier when you get the hang of them.

In this chapter, we'll go in, guns blazing, with everything you've learned so far to create 11—count 'em! 11!—visualizations of the same dataset.

What are layouts and why should you care?

D3 layouts are modules that transform data into drawing rules. The simplest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required