Visual Storytelling with D3



Similar documents
Winning the Hardware-Software Game

Delivery. Enterprise Software. Bringing Agility and Efficiency. Global Software Supply Chain. AAddison-Wesley. Alan W. Brown.

BIRT: A Field Guide to Reporting

Software Security. Building Security In. Gary McGraw. A Addison-Wesley

The Data Access Handbook

Agile Methods. Introduction to. AAddison-Wesley. Sondra Ashmore, Ph.D. Kristin Runyan. Capetown Sydney Tokyo Singapore Mexico City

Web Development with TIBCO General Interface

AGILE GAME DEVELOPMENT WITH SCRUM

CHAINED EXPLOITS Advanced Hacking Attacks from Start to Finish

Building. Applications. in the Cloud. Concepts, Patterns, and Projects. AAddison-Wesley. Christopher M. Mo^ar. Cape Town Sydney.

RFID Field Guide. Deploying Radio Frequency Identification Systems. Manish Bhuptani Shahram Moradpour. Sun Microsystems Press A Prentice Hall Title

MIKE COHN. Software Development Using Scrum. VAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis San Francisco

Public Relations in Schools

Managing the Unmanageable

QUANTITATIVE METHODS. for Decision Makers. Mik Wisniewski. Fifth Edition. FT Prentice Hall

SOA with Java. Realizing Service-Orientation with Java Technologies UPPER SADDLE RIVER, NJ BOSTON INDIANAPOLIS SAN FRANCISCO

THE PSYCHOLOGY OF INVESTING

Enterprise Integration Patterns

Financial Statement Analysis

ENTERPRISE SYSTEMS FOR MANAGEMENT

BUSINESS AND PROFESSIONAL COMMUNICATION

BUSINESS INTELLIGENCE

Designing Interactive Systems

Delivery. Continuous. Jez Humble and David Farley. AAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis San Francisco

How To Write A Web Framework In Java

JAVA r VOLUME II-ADVANCED FEATURES. e^i v it;

Maximum vsphere. Tips, How-Tos,and Best Practices for. Working with VMware vsphere 4. Eric Siebert. Simon Seagrave. Tokyo.

SOA Governance. Stephen G. Bennett, Clive Gee, Robert Laird, Co-authored and edited by Thomas Erl. Governing

Practical Intrusion Analysis

Social Media Marketing

Software Configuration Management Patterns

Performance Management

Advertising Research

CONTEMPORARY DIRECT & INTERACTIVE MARKETING

The Crossroads of Accounting & IT

Metrics and Methods for Security Risk Management

SERVICES MARKETING PEOPLE, TECHNOLOGY, STRATEGY. Global Edition. Christopher Lovelock. Yale University Jochen Wirtz National University of Singapore

The x86 PC: Assembly Language, Design, and Interfacing 5 th Edition

Univariate and Multivariate Methods PEARSON. Addison Wesley

VISUALIZING DATA POWER VIEW. with MICROSOFT. Brian Larson. Mark Davis Dan English Paui Purington. Mc Grauu. Sydney Toronto

Patterns of Enterprise Application Architecture

Learning HTML5 Game Programming

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

DEC Networks and Architectures

Essential Scrum. A Practical Guide to the Most Popular Agile Process. AAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis

Audio and Video for the Internet

EXCEL SPREADSHEET MANUAL

Social Work, Social Welfare, and American Society

CAREER DEVELOPMENT INTERVENTIONS IN THE 21 ST CENTURY

Enterprise. ESXi in the. VMware ESX and. Planning Deployment of. Virtualization Servers. Edward L. Haletky

Computer Organization

Relationship marketing

VALUATION The Art and Science of Corporate Investment Decisions

Business Finance. Theory and Practica. Eddie McLaney PEARSON

Network Security Essentials:

An Introduction. Global Edition. "University of North Carolina. Northwestern University

Security Metrics. A Beginner's Guide. Caroline Wong. Mc Graw Hill. Singapore Sydney Toronto. Lisbon London Madrid Mexico City Milan New Delhi San Juan

Development Effort & Duration

ux BEST PRACTICES How To Achieve More Impact With User Experience Helmut Degen and XiaoweiYuan With support of Nan Guo Graw

MCSE Windows 98 Study Guide

Oracle Backup & Recovery

Sixth Edition. Global Edition STRATEGY, FLANNING, AND OPERATION. Sunil Chopra. Kellogg School of Management. Peter Meindl.

Managing Data in Motion

LuxeMbOurG Trading CenTre LisT Annex 1 to the s pecial terms and conditions for securities transactions Valid as from 1 January 2011

Customer Relationship. Management. Ed Peelen and Rob Beltman

Compensating the Sales Force

How to Implement Lean Manufacturing

Manager's Guide to Performance Management

User Stories Applied

Measuring Data Quality for Ongoing Improvement

Job Hazard Analysis. A Guide for Voluntary Compliance and Beyond. From Hazard to Risk: Transforming the JHA from a Tool to a Process

Programming Flaws and How to Fix Them

Customer Relationship Management

Configuration. Management for. Senior Managers. Essential Product Configuration. and Lifecycle Management

MINT TWELFTH EDITION PEARSON

Implementation & Administration

Networking. Sixth Edition. A Beginner's Guide BRUCE HALLBERG

LuxeMbOurG Trading CenT re LisT Annex 1 to the special terms and conditions for securities transactions Valid as from 1 september 2011

The Guru's Guide to Transact-SQL

Strategic Management and Competitive Advantage

Software Project Management (Second Edition)

Network Security. Windows 2012 Server. Securing Your Windows. Infrastructure. Network Systems and. Derrick Rountree. Richard Hicks, Technical Editor

Counseling the Alcohol and Drug Dependent Client

for Hundreds of Ready-to-Use Phrases to Set the Stage for Productive Conversations, Meetings, and Events Meryl Runion with Diane Windingland

IMPROVEMENT THE PRACTITIONER'S GUIDE TO DATA QUALITY DAVID LOSHIN

Transcription:

Visual Storytelling with D3 An Introduction to Data Visualization in JavaScript Ritchie S. King TT ArAddison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Paris Madrid Capetown Sydney Tokyo Singapore Mexico City

Contents Foreword Preface I Mi xl xiil Acknowledgments xvii About the Author xix Visual Storytelling and D3 Visualization, Visualized I 1 Charts Give Data a Form That Form Tells a Story Quality: It Is All about Content Design: It Is All about Form Visual Storytelling Enter D3 Things You Designers Will Love about D3 Things You Coders Will Love about D3 Things for Which You Should Not Use D3 Notes on Using D3 2 9 9 Tools You Will Need 2 5 10 10 Finding a Data-Driven Story and Telling It Visually 11 Getting Started 11 Is the World Getting Older? 12 Finding and Inspecting Data 13 Honing the Concept Choosing a Form 15 1 Showing the Data as a Column Chart 1 Showing the Data as a Stacked Column Chart Showing the Data as a Line Chart 20 Showing the Data as a Pie Chart 22 Showing the Data as a Bar Chart 23 Showing the Data as a Small Multiple Bar Chart 25 Chart Suggestions A Thought Starter The Example We Will Build in This Book 29 25 2 1

1 U Ü jeiftasoi iiv M SuiMnj S1U9LU9I3 Maw Buipudddv luawubissv 3 qeuba pue SUJBMO SI uieuo e jo pp!w am ui suofloaias MSN Suiieajo M, ' : W spoiija^ Sujuieiio oaiieieioaa sq o; SÖAUIS 0 i sainy ajäjs pue sasseo A ddy o; () J t n e ujsn ZL OJL Oi S> JOM ( ) J ^ e «O H sajnquwv s,uoj;oa as e f u 3ueqo saiqeuba oi suoipaias SUJUSJSSV suo;;oa as jamo W04 suofloajas f UUBSJO suoii03 as aieajq oj sjoioaias SSO 3uisn 99 9 suojpaias SM^eiAj CO Ht!«d f i i a s 3u!»»9 suo^oeias Q «WIM ssgbd qam Sujdeiis frg TS it SUOflBUIJOjSUB.ll sdnojo pus japjo 3ujMejQ Sf trfr saj^iadojd a^oj^s Xouajedsueji pub JO OQ *fr saiviadojd aiäis 9AS Tfr 0* Ofr I p /Oeuiiuns 3AS "! ^BMO Jeg e BuiPlfng fr SE fr Wi OAS SMJBJ saun suo3a 0d E sesdiih saiaiio saisubpay papunoy IS S9 3upay It sadbljs JatiiO SSO mi** SJU9UJ9I3 9AS Suil^JS iopadsui qa/v\ am Uj QAS fujjoadsut 2 9AS w. sa DJjo IIJIM SwAey T T T i^tpexb 'QAS S }BU.M POOH 3MI J3pun f u^aay somdejq io)09a aiqeieo$ S}ua;uoo ill A

Contents Selecting Multiple Elements with d3.selectall() 0 Building a Bar Chart with Selections Use Variables Do Math 1 93 95 Use Better Variables 95 Use a Variable for your Data 9 Make Your Constraints Explicit Use Loops 5 9 9 103 Data-Joins: Enter 105 What Are Data-Joins? 105 A Conceptual Overview of Data-Joins: Enter Enter and Binding Data 10 10 Using a Data-Join to Make a Bar Chart 111 Using Anonymous Functions to Access Bound Data 115 Finishing the Rest of the Chart Storing Data in Objects 119 120 125 Sizing Charts and Adding Axes Linear Scales 12 12 Using Smart Margin Conventions Adding Axes 135 Ordinal Scales and Axes 132 144 15 Loading and Filtering External Data 15 Building a Graphic that Uses All of the Population Distribution Data 15 Data Formats You Can Use with D3 15 Creating a Server to Upload Your Data Initiating a Server on the Command Line Creating an Index File D3's Functions for Loading Data Callback Functions 10 11 How D3 Interprets CSV Tables Dealing with Asynchronous Requests 11 15 Creating a Bar Chart with External Data 1 ix

SS2 H S 3 X9pu BJBO uoi)nqjj}sia uos»b ndod ai ) 3u ueaio g III f l 2 2 a 22 tozz 22 3u 33nqaa sdoon.iog pue siuawajeis 31 LZZ suojjounj pue spoqiaiaj spafqo pue säejjv S9!J sf- pue cln^ieiai ui ;duoseaer 3UJJUM 022 sadaj. e\ea pue 'saiqeuea 'ifteiaj Ojseg T2 3 osuoo iduoseaep s.-iasmojg jnoa TZ TZ JSM9 "! JduoseAer SJauinSag JOj ^duosbabf TZ 2.T2 v Ajeujujns Buipoo ag SÄBMIV STZ vprnsun lag oj MOH 0 Buiujean JOJ uo^epunoj e s >ioog still ST2 9T2 UMO JnoA uo»no S u i w i s T2 OT Ajeujiuns IOZ aouanbas Aeid am jdnjjaiui 0} jasri su.1 3utMO iv froz 02 09 uojjng Aey ai l Su^eiM 9 ed am en uoung Aey B 3u;ppv uojpury e u aseu.d aiepdn am BinddeJM uo»ng Xeid e 3u ppv T 9T TT sueno Buiiepdn ujop B}9a B 3u sn suonng 3UI>IB AJ LLT suonng aajiobjajui x l! 3 Pue aiepdfl :suiof-eiea paieiumv pue &M\oeia\u\ s^ieio 3ui> e Ai g^t LX TAT sxa» Buisn qe>13!io suonng ai j BU^BIAJ XT LLT Ajeoioins suouisueji Suippv 0T 1ST AjBiuiuns jama3oi nv J 3u nnd 19S eiea (J)33JBI e Suuaiiy pue Sinpecn sjuajuoo