Visual Storytelling with D3: An Introduction to Data Visualization in JavaScript

Ritchie S King

Published by

Addison-Wesley

ISBN

9780321933171

RRP

£24.99

Reviewed by

Patrick Hill CEng MBCS CITP

Score

8 out of 10

It has long been recognised that the ability to visualise data greatly helps users to explore and understand those data sets. Data visualisation is an emerging field, which draws together a variety of disciplines to produce possibly interactive, visual data representations that support users in identifying patterns, correlations, outliers and so forth.

Data-Driven Documents (D3) is a popular JavaScript library that enables users to create data visualisations in HTML documents by binding selected HTML elements and attributes to items of a data set. This book helps readers take their first steps using D3.

After an introduction to data visualisation and the notion of storytelling through visualisation, the book quickly gets into coding. While there are various illustrative asides, the book really focuses on just one example, which is to develop a visualisation of world population changes over time, in order to help answer the question ‘is the average of the world’s population getting older?’

In order to help motivate the use of D3, an early chapter develops aspects of the final solution without using a visualisation library, instead relying on JavaScript, HTML and Scalable Vector Graphics (SVG). As the book progresses, the solution is incrementally refined by introducing features of D3 that provide general solutions to common tasks relating to data visualisation in HTML.

There is good coverage of D3’s fundamental ‘data join’ mechanism, which is used to initially populate, update and remove data from the document.

Along the way, the book also provides practical advice on using D3 and covers a variety of tangential topics including D3’s data import facilities. By the end of the book, the visualisation, albeit a basic bar chart, enables the user to select and compare subsets of the data set, and to display all sets in sequence, using animated transitions.

The writing style is very informal and easy to read. Some basic experience with HTML, CSS and JavaScript is assumed, but the book explains topics as they are encountered and an appendix contains a useful introduction to JavaScript.

As this book is intended to be simply an introduction to D3, I suspect that more advanced readers may find it slow. While the book does cover the core topics of D3, only one kind of representation, a bar chart, is used.

That said, the book’s concluding chapters aim to support readers in exploring D3 further by providing links to relevant web content. In addition, the book has a supporting website, from which code and datasets may be downloaded.

Overall, I thought this was a good read and a useful introduction to D3. However, I think that once readers have mastered the fundamentals, this book would be of limited further use.

Further information: Addison-Wesley

January 2015