PacktLib: Data Visualization with D3.js Cookbook

Data Visualization with D3.js Cookbook


About the Author

About the Reviewers


Getting Started with D3.js


Setting up a simple D3 development environment

Setting up an NPM-based development environment

Understanding D3-style JavaScript

Be Selective


Selecting a single element

Selecting multiple elements

Iterating through a selection

Performing subselection

Function chaining

Manipulating the raw selection

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

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

Playing with Axes


Working with basic axes

Customizing ticks

Drawing grid lines

Dynamic rescaling of axes

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

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

Chart Them Up


Creating a line chart

Creating an area chart

Creating a scatter plot chart

Creating a bubble chart

Creating a bar chart

Lay Them Out


Building a pie chart

Building a stacked area chart

Building a treemap

Building a tree

Building an enclosure diagram

Interacting with your Visualization


Interacting with mouse events

Interacting with a multi-touch device

Implementing zoom and pan behavior

Implementing drag behavior

Using Force


Using gravity and charge

Generating momentum

Setting the link constraint

Using force to assist visualization

Manipulating force

Building a force-directed graph

Know your Map


Projecting the US map

Projecting the world map

Building a choropleth map

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

Building Interactive Analytics in Minutes

Building Interactive Analytics in Minutes

Building Interactive Analytics in Minutes

Building Interactive Analytics in Minutes