9781449339739
index.html

Interactive Data Visualization for the Web

Scott Murray

FIX ME!

David Futato

Robert Romano

Karen Montgomery

Printed in the United States of America.

[?]

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or .

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. !!FILL THIS IN!! and related trade dress are trademarks of O’Reilly Media, Inc.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

Revision History
2012-11-20
Early Release Version 1
2012-12-12
Early Release Version 2

Preface
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Introduction
Why Data Visualization?
Why Write Code?
Why Interactive?
Why on the Web?
What This Book Is
Who You Are
What This Book Is Not
Using Sample Code
Thank You
2. Introducing D3
What it Does
What it Doesn’t Do
Origins and Context
Alternatives
Easy Charts
Graph Visualizations
Geomapping
Almost From Scratch
Three-Dimensional
Tools Built With D3
3. Technology Fundamentals
The Web
HTML
Content + Structure
Adding Structure with Elements
Common Elements
Attributes
Classes and IDs
Comments
DOM
Developer Tools
Rendering and the Box Model
CSS
Selectors
Properties and Values
Comments
Referencing Styles
Inheritance, Cascading, and Specificity
JavaScript
Hello, Console
Variables
Mathematical Operators
Comparison Operators
Control Structures
Functions
Comments
Referencing Scripts
JavaScript Gotchas
SVG
The SVG Element
Simple Shapes
Styling SVG Elements
Layering and Drawing Order
Transparency
A Note on Compatibility
4. Setup
Downloading D3
Referencing D3
Setting up a Web Server
1. Terminal + Python
2. MAMP, WAMP, & LAMP
Diving In
5. Data
Generating Page Elements
Chaining Methods
One Link at a Time
The Hand-off
Going Chainless
Binding data
In a Bind
Data
Please Make Your Selection
Bound and Determined
Using your data
High-functioning
Data Wants to be Held
Beyond Text
6. Drawing with Data
Drawing divs
Setting Attributes
A Note on Classes
Back to the Bars
Setting Styles
The Power of data()
Random Data
Drawing SVGs
Create the SVG
Data-driven Shapes
Pretty Colors, Oooh!
Making a Bar Chart
The Old Chart
The New Chart
Color
Labels
Making a Scatterplot
The Data
The Scatterplot
Size
Labels
Next Steps
7. Scales
Apples and Pixels
Domains and Ranges
Normalization
Creating a Scale
Scaling the Scatterplot
d3.min() and d3.max()
Seting up Dynamic Scales
Incorporating Scaled Values
Refining the Plot
Other Methods
Other Scales
8. Axes
Introducing Axes
Setting up an Axis
Cleaning it Up
Check for Ticks
Y Not?
Final Touches
Formatting Tick Labels
9. Updates, Transitions, and Motion
Modernizing the Bar Chart
Ordinal Scales, Explained
Round Bands Are All the Range These Days
Referencing the Ordinal Scale
Other Updates
Updating Data
Interaction via Event Listeners
Changing the Data
Updating the Visuals
Transitions
duration(), or How Long is This Going to Take?
ease()-y Does It
Please Do Not delay()
Randomizing the Data
Updating Scales
Updating Axes
each() Transition Starts and Ends
Other Kinds of Data Updates
Adding Values (and Elements)
Removing Values (and Elements)
Data Joins With Keys
Add and Remove: Combo Platter
Recap
10. Interactivity
Binding Event Listeners
Introducing Behaviors
Hover to Highlight
Click to Sort
Tooltips
Default Browser Tooltips
SVG Element Tooltips
HTML div Tooltips
Consideration for Touch Devices
Moving Forward
11. Layouts
Pie Layout
Stack Layout
Force Layout
12. Geomapping
JSON, Meet GeoJSON
Paths
Projections
Choropleth
Adding Points
Acquiring and Parsing Geodata
Find Shapefiles
Choose a Resolution
Simplify the Shapes
Convert to GeoJSON
13. Exporting
Bitmaps
PDF
SVG
14. Appendix: Further Study
Books
Websites
Twitterers
Site last updated on: February 8, 2013 at 03:39:57 PM PST
Cover for Interactive Data Visualization for the Web