Table of Contents
Preface v
1 Introduction 1
Whom This Book Is For 2
Why D3? 3
What Is in This Book 4
How to Read This Book 5
Conventions 6
2 Let's Make Some Graphs, Already! 11
A First Example: A Single Data Set 11
A Second Example: Two Data Sets 16
A Third Example: Animating List Items 27
3 The Heart of the Matter: Selecting and Binding 31
Selections 32
Binding Data 38
Manipulating Selections 46
Shared Parent Information Among Selections with Groups 53
4 Events, Interactivity, and Animation 55
Events 55
Exploring Graphs with the Mouse 58
Smooth Transitions 67
Animation with Timer Events 75
5 Generators, Components, Layouts: Drawing Curves and Shapes 81
Generators, Components, and Layouts 81
Symbols 83
Lines and Curves 92
Circles, Arcs, and Pie Charts: Working with Layouts 100
Other Shapes 105
Writing Your Own Components 106
6 Files, Fetches, Formats: Getting Data In and Out 113
Fetching a File 113
Parsing and Writing Tabular Data 119
Formatting Numbers 124
7 Values to Visuals: Interpolations, Scales, and Axes 129
Interpolation 130
Scales 132
Axes 140
Examples 146
8 Colors, Color Scales, and Heatmaps 153
Colors and Color Space Conversions 153
Color Schemes 156
Color Scales 160
False-Color Graphs and Related Techniques 164
9 Trees and Networks 173
Trees and Hierarchical Data Structures 173
Force-Based Particle Arrangements 181
10 Utilities: Arrays, Statistics, and Timestamps 191
Structural Array Manipulations 191
Descriptive Statistics for Numerical Arrays 192
Working with Dates and Timestamps 196
A Setup, Tools, Resources 203
B An SVG Survival Kit 207
C Hitchhiker's Guide to JavaScript and the DOM 219
Index 237