D3.js in Action: Data visualization with JavaScript

D3.js in Action: Data visualization with JavaScript

by Elijah Meeks
D3.js in Action: Data visualization with JavaScript

D3.js in Action: Data visualization with JavaScript

by Elijah Meeks

Paperback(2nd Edition)

$44.99 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Summary

D3.js in Action, Second Edition is completely revised and updated for D3 v4 and ES6. It's a practical tutorial for creating interactive graphics and data-driven applications using D3.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

Visualizing complex data is hard. Visualizing complex data on the web is darn near impossible without D3.js. D3 is a JavaScript library that provides a simple but powerful data visualization API over HTML, CSS, and SVG. Start with a structure, dataset, or algorithm; mix in D3; and you can programmatically generate static, animated, or interactive images that scale to any screen or browser. It's easy, and after a little practice, you'll be blown away by how beautiful your results can be!

About the Book

D3.js in Action, Second Edition is a completely updated revision of Manning's bestselling guide to data visualization with D3. You'll explore dozens of real-world examples, including force and network diagrams, workflow illustrations, geospatial constructions, and more. Along the way, you'll pick up best practices for building interactive graphics, animations, and live data representations. You'll also step through a fully interactive application created with D3 and React.

What's Inside

  • Updated for D3 v4 and ES6
  • Reusable layouts and components
  • Geospatial data visualizations
  • Mixed-mode rendering

About the Reader

Suitable for web developers with HTML, CSS, and JavaScript skills. No specialized data science skills required.

About the Author

Elijah Meeks is a senior data visualization engineer at Netflix.

Table of Contents

  1. An introduction to D3.js
  2. Information visualization data flow
  3. Data-driven design and interaction
  4. Chart components
  5. Layouts
  6. Hierarchical visualization
  7. Network visualization
  8. Geospatial information visualization
  9. Interactive applications with React and D3
  10. Writing layouts and components
  11. Mixed mode rendering

Product Details

ISBN-13: 9781617294488
Publisher: Manning
Publication date: 12/07/2017
Edition description: 2nd Edition
Pages: 375
Product dimensions: 7.30(w) x 9.10(h) x 1.00(d)

About the Author

Elijah Meeks is a co-founder and Chief Innovation Officer of Noteable, a startup focused on evolving how we analyze and communicate data. He is known for his pioneering work while at Stanford, where he was the technical lead for acclaimed works like ORBIS and Kindred Britain, as well as being Netflix's first Senior Data Visualization Engineer.

Table of Contents

Preface xi

Acknowledgments xiii

About this book xiv

About the cover illustration xvii

Part 1 D3.JS Fundamentals 1

1 An introduction to D3.js 3

1.1 What is D3.js? 4

1.2 How D3 works 4

Data visualization is more than charts 4

D3 is about selecting and binding 9

D3 is about deriving the appearance of web page elements from bound data 10

Web page elements can now be divs, countries, and flowcharts 11

1.3 The power of HTML5 11

The DOM 12

Coding in the console 16

SVG 17

CSS 24

JavaScript 28

ES2015 and Node 33

1.4 Data standards 34

Tabular data 34

Nested data 35

Network data 35

Geographic data 36

Raw data 37

Objects 37

1.5 Infoviz standards expressed in D3 38

1.6 Your first D3 app 39

Hello world with divs 40

Hello World with circles 41

A conversation with D3 42

1.7 Summary 44

Why learn D3? 45

2 Information visualization data flow 47

2.1 Working with data 48

Loading data 49

Formatting data 52

Further modifying data 54

Measuring data 59

2.2 Data-binding 60

Selections and binding 60

Accessing data with inline functions 63

Integrating scales 65

2.3 Data presentation style, attributes, and content 68

Visualization from loaded data 68

Setting channels 70

Enter, update, merge, and exit 72

2.4 Summary 77

3 Data-driven design and interaction 78

3.1 Project architecture 79

Data 79

Resources 80

Images 80

Style sheets 80

External libraries 81

3.2 Interactive style and DOM 83

Events 85

Graphical transitions 85

DOM manipulation 87

Using color wisely 90

3.3 Pregenerated content 97

Images 97

HTML fragments 98

Pregenerated SVG 100

3.4 Summary 106

3.5 D3.js in the real world 107

Bocoup for Measurement Lab 107

4 Chart components 109

4.1 General charting principles 110

Generators 111

Components 111

Layouts 112

4.2 Creating an axis 112

Plotting data 112

Styling axes 115

4.3 Complex graphical objects 117

4.4 Line charts and interpolations 126

Drawing a line from points 127

Drawing many lines with multiple generators 130

Exploring line interpolation 131

4.5 Complex accessor functions 132

4.6 Using third-party D3 modules to create legends 139

4.7 Summary 141

5 Layouts 143

5.1 Histograms 144

Drawing a histogram 144

Interactivity 146

Drawing violin plots 147

5.2 Pie charts 149

Drawing the pie layout 150

Creating a ring chart 151

Transitioning 152

5.3 Stack layout 154

5.4 Plugins to add new layouts 158

Sankey diagram 158

Word clouds 165

5.5 Summary 170

5.6 D3.js in the real world 171

Adam Pearce

Graphics Editor, New York Times 171

Part 2 Complex Data Visualization 173

6.1 Hierarchical patterns 176

6.2 Working with hierarchical data 178

Hierarchical JSON and hierarchical objects 179

D3.nest 179

D3.stratify 180

6.3 Pack layouts 180

Drawing the circle pack 181

When to use circle packing 184

6.4 Trees 184

Drawing a dendrogram 184

Radial tree diagrams 190

d3.cluster vs d3.tree 192

When to use dendrograms 192

6.5 Partition 192

Drawing an icicle chart 192

Sunburst: radial icicle chart 194

Flame graph 196

When to use the partition layout 196

6.6 Treemaps 197

Building 197

Filtering 198

Radial treemap 200

When to use treemaps 200

6.7 Summary 201

6.8 D3.js in the real world 202

Nadieh Bremer

Data Visualization Consultant 202

7 Network visualization 204

7.1 Static network diagrams 205

Network data 206

Adjacency matrix 209

Arc diagram 214

7.2 Force-directed layout 218

Playing with forces 219

Creating a force-directed network diagram 221

SVG markers 223

Network measures 225

Force layout settings 227

Updating the network 228

Removing and adding nodes and links 231

Manually positioning nodes 235

Optimization 236

7.3 Summary 237

7.4 D3.js in the real world 238

Shirley Wu

Data Visualization Consultant 238

8 Geospatial information visualization 240

8.1 Basic mapmaking 242

Finding data 243

Drawing points on a map 248

Projections and areas 249

Interactivity 251

8.2 Better mapping 253

Graticule 253

Zoom 253

8.3 Advanced mapping 257

Creating and rotating globes 258

Satellite projection 261

8.4 TopoJSON data and functionality 262

TopofSON the file format 262

Rendering TopoJSON 262

Merging 264

Neighbors 266

8.5 Further reading for web mapping 267

Tile mapping 267

Transform zoom 267

Canvas drawing 268

Raster reprojection 268

Hexbins 268

Voronoi diagrams 268

Cartograms 268

8.6 Summary 269

8.7 D3 in the real world 270

Philippe Rivière

Journalist/programmer 270

Part 3 Advanced Techniques 273

9 Interactive applications with React and D3 275

9.1 One data source, many perspectives 276

9.2 Getting started with React 279

Why React, why not X? 279

React-create-app: setting up your application 280

JSX 281

9.3 Traditional D3 rendering with React 282

9.4 React for element creation, D3 as the visualization kernel 284

9.5 Data dashboard basics 286

9.6 Dashboard upgrades 292

Responsiveness 293

Legends 294

Cross-highlighting 295

9.7 Brushing 298

Creating the brush 298

Understanding brush events 304

9.8 Show me the numbers 304

9.9 Summary 306

9.10 D3 in the real world 307

Elijah Meeks

Senior Data Visualization Engineer 307

10 Writing layouts and components 309

10.1 Creating a layout 310

Designing your layout 310

Implementing your layout 311

Testing your layout 312

Extending your layout 313

10.2 Writing your own components 318

10.3 Loading sample data 318

10.4 Linking components to scales 321

10.5 Adding component labels 326

10.6 Summary 328

10.7 D3.js in the real world 329

Susie Lu

Senior Data Visualization Engineer 329

11 Mixed mode rendering 330

11.1 Built-in canvas rendering with d3-shape generators 332

11.2 Big geodata 335

Creating random geodata 335

Drawing geodata with canvas 339

Mixed mode rendering techniques 340

11.3 Big network data 345

11.4 Optimizing xy data selection with quadtrees 350

Generating random xy data 350

Xy brushing 351

11.5 More optimization techniques 355

Avoid general opacity 355

Avoid general selections 355

Precalculate positions 356

11.6 Summary 356

11.7 D3 in the real world 358

Christophe Viau 358

Index 360

From the B&N Reads Blog

Customer Reviews