Free Sample
+ Collection

Data Visualization with D3.js Cookbook

Nick Qi Zhu

Turn your digital data into dynamic graphics with this exciting, leading-edge cookbook. Packed with recipes and practical guidance it will quickly make you a proficient user of the D3 JavaScript library.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782162162
Paperback338 pages

About This Book

  • Create stunning data visualization with the power of D3
  • Bootstrap D3 quickly with the help of ready-to-go code samples
  • Solve real-world visualization problems with the help of practical recipes

Who This Book Is For

If you are a developer familiar with HTML, CSS, and JavaScript, and you wish to get the most out of D3, then this book is for you. This book can also serve as a desktop quick-reference guide for experienced data visualization developers.

Table of Contents

Chapter 1: Getting Started with D3.js
Setting up a simple D3 development environment
Setting up an NPM-based development environment
Understanding D3-style JavaScript
Chapter 2: Be Selective
Selecting a single element
Selecting multiple elements
Iterating through a selection
Performing subselection
Function chaining
Manipulating the raw selection
Chapter 3: Dealing with Data
Binding an array as data
Binding object literals as data
Binding functions as data
Working with arrays
Filtering with data
Sorting with data
Loading data from a server
Chapter 4: Tipping the Scales
Using quantitative scales
Using the time scale
Using the ordinal scale
Interpolating a string
Interpolating colors
Interpolating compound objects
Implementing a custom interpolator
Chapter 5: Playing with Axes
Working with basic axes
Customizing ticks
Drawing grid lines
Dynamic rescaling of axes
Chapter 6: Transition with Style
Animating a single element
Animating multiple elements
Using ease
Using tweening
Using transition chaining
Using transition filter
Listening to transitional events
Implementing a custom interpolator
Working with timer
Chapter 7: Getting into Shape
Creating simple shapes
Using a line generator
Using line interpolation
Changing line tension
Using an area generator
Using area interpolation
Using an arc generator
Implementing arc transition
Chapter 8: Chart Them Up
Creating a line chart
Creating an area chart
Creating a scatter plot chart
Creating a bubble chart
Creating a bar chart
Chapter 9: Lay Them Out
Building a pie chart
Building a stacked area chart
Building a treemap
Building a tree
Building an enclosure diagram
Chapter 10: Interacting with your Visualization
Interacting with mouse events
Interacting with a multi-touch device
Implementing zoom and pan behavior
Implementing drag behavior
Chapter 11: Using Force
Using gravity and charge
Generating momentum
Setting the link constraint
Using force to assist visualization
Manipulating force
Building a force-directed graph
Chapter 12: Know your Map
Projecting the US map
Projecting the world map
Building a choropleth map
Chapter 13: Test Drive your Visualization
Getting Jasmine and setting up the test environment
Test driving your visualization – chart creation
Test driving your visualization – SVG rendering
Test driving your visualization – pixel-perfect bar rendering

What You Will Learn

  • Learn how to use functional JavaScript so you can write it the D3 way
  • Select and manipulate HTML and SVG elements efficiently in D3
  • Drive your visualization using data
  • Master D3 scales and interpolators
  • Animate your visualization with style
  • Use SVG and various D3 path generators
  • Explore D3 layouts and understand and leverage D3 force
  • Build mobile-first interactive visualization with touch support
  • Test-drive your visualization implementation
  • Build multi-dimensional data visualization with crossfilter and dc.js in minutes

In Detail

D3.js is a JavaScript library designed to display digital data in dynamic graphical form. It helps you bring data to life using HTML, SVG, and CSS. D3 allows great control over the final visual result, and it is the hottest and most powerful web-based data visualization technology on the market today.

"Data Visualization with D3.js Cookbook" is packed with practical recipes to help you learn every aspect of data visualization with D3.

"Data Visualization with D3.js Cookbook" is designed to provide you with all the guidance you need to get to grips with data visualization with D3. With this book, you will create breathtaking data visualization with professional efficiency and precision with the help of practical recipes, illustrations, and code samples.

"Data Visualization with D3.js Cookbook" starts off by touching upon data visualization and D3 basics before gradually taking you through a number of practical recipes covering a wide range of topics you need to know about D3.

You will learn the fundamental concepts of data visualization, functional JavaScript, and D3 fundamentals including element selection, data binding, animation, and SVG generation. You will also learn how to leverage more advanced techniques such as custom interpolators, custom tweening, timers, the layout manager, force manipulation, and so on. This book also provides a number of pre-built chart recipes with ready-to-go sample code to help you bootstrap quickly.


Read More