REVIEW - Visual Storytelling with D3 - An Introduction to Data Visualization in JavaScript


Title:

Visual Storytelling with D3

An Introduction to Data Visualization in JavaScript

Author:

Ritchie S. King

Publisher:

Addison-Wesley Professional (2014)

Pages:

288pp

Reviewer:

Frances Buontempo

Reviewed:

January 2015

Rating:

★★★☆☆


Reviewed: January 2015

D3 is a JavaScript visualisation library for HTML and SVG, which you can either download or link directly to in a script element on your html. There are several online tutorials, but reading a real dead-tree book from time to time is enjoyable.

This book developed a narrative, starting by drawing a barchart in html, then moving on to using JavaScript, and after introducing the use of svg on a web-page, showed how to use D3 selections and data joins to do the same thing. It ends with a dynamic example that ‘plays’ through bar charts for various years of data.

It is aimed at a beginner, explaining that you cannot use Word as an editor and how to inspect elements and use the console in Chrome. Some of the earlier chapters were devoted to the ‘storytelling’ part of the book, considering when bar chart and lines charts are better, and reminding us that pie charts with more than a few sections can be hard to garner information from. Simpler is usually better. I suspect there are books on these specifics with far more detail about possible graphics for various types of data and things to avoid. I personally didn’t gain much from this short section, but if you’ve never heard of a bar-chart before or can’t remember how they work, it could be useful. It also reminded me how to calculate percentages, so again this is aim at a newbie. Other parts were devoted to explaining what a variable is, a function is, not to be afraid of anonymous functions as well as explaining the difference between a domain and a range. If you have no background in such things, this might be helpful.

One thing that is not immediately obvious from the online docs (after reading them for a total of about 5 minutes) is how to use a data file – lots of the simple examples hard-code the data in an array. The books showed how to run a simple web service using python, which allows the script to read the file, when placed in the same directory as a script. That was useful, since you will want to move beyond hard coding small data sets if you wish to move beyond the basics.

By the end of the book I did actually have code showing a bar chart in a web browser, which I failed to get working first time when I just went to the D3 manual pages, so I gained something from reading this book. It didn’t move beyond bar charts, though it mentioned circles, eclipses and other shapes besides rectangles in the svg section. There are many other things you can do with D3, including trees, Bezier curves, zoomable graphs and so on. I would have preferred a few hints on some other things too and less background things I already know. However, the focus on one data set and how to draw a bar chart of it kept the book focussed and it was very quick to read. It was also well written, even if in a somewhat chatty style in places. I enjoyed reading it, and am glad I did. I feel more confident about exploring some of the other examples on the d3 gallery now. I am not sure how often I would need to refer back to this book though. Certainly a good starting point if you’ve never used D3 before.


Book cover image courtesy of Open Library.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.