Getting Started with D3

In this short book, Mike Dewar introduces D3 and makes a persuasive case for building visualizations using JavaScript, SVG, HTML and CSS.

Attempting to cover the four underlying technologies, as well as D3, is clearly an impossible task in only 57 pages, so Dewar deserves credit for keeping things relatively simple; he develops a handful of graphs that exemplify some useful D3 methods and highlights a core D3 idiom (selectAll, data, enter) in the process. In each case, I liked the reminder that effective visualization is as much about good design as well written code; it was also nice that the examples were based on ‘real’ data.

One of the main drawbacks of Getting Started with D3 is that it’s too ambitious. Readers will need more than a sprinkling of JavaScript to make the most of this book and although SVG, HTML and CSS are reasonable prerequisites, there aren’t enough pointers to alternative resources (I’d recommend the Mozilla Developer Network, for example). Similarly, the chapter on force-directed, histogram and stacked layouts is hurried. More importantly, however, are the errors in the code examples (see below), which are likely to frustrate beginners.

In many respects, this book marks D3’s transition from academia to the mainstream; at the very least, it should give the reader some confidence that D3 isn’t going to go the way of Protovis, its predecessor. In summary, Getting Started with D3 is worth reading, but not in isolation. And do check the errata!

Errors: for example, p.21 time_axis should be x_axis; p.25 the width attribute is set twice; pp.35-36 the HTML code is malformed (the <style> tag isn’t closed and the second <script> tag is neither in the <head> nor the <body>).

Getting Started with D3” by Mike Dewar (O’Reilly Media).

(Full disclosure: I received a free copy of this book through O’Reilly’s Blogger Review Program.)