SlideShare a Scribd company logo
Data VisualizationsData Visualizations
with D3.jswith D3.js
Doug DomenyDoug Domeny
June 2014June 2014
Data-Driven DocumentsData-Driven Documents
 JavaScript + HTML + SVG + CSSJavaScript + HTML + SVG + CSS
 Bind arbitrary data to a Document ObjectBind arbitrary data to a Document Object
Model (DOM)Model (DOM)
 Similar to jQuery & PrototypeSimilar to jQuery & Prototype
• SelectionsSelections
• Dynamic PropertiesDynamic Properties
• Function ChainingFunction Chaining
d3.selectAll("p")
.data([4, 8, 15, 16, 23, 42])
.style("font-size", function(d)
{ return d + "px"; });
D3D3
 TransitionsTransitions
d3.selectAll("circle")
.transition()
.duration(750)
.delay(function(d, i)
{ return i * 10; })
.attr("r", function(d)
{ return Math.sqrt(d * scale); });
 Transformation, not RepresentationTransformation, not Representation
• Scaling and ProjectionsScaling and Projections
• Web standards: HTML, SVG and CSSWeb standards: HTML, SVG and CSS
SVGSVG
 Circle, Line, Ellipse, Path, Polygon,Circle, Line, Ellipse, Path, Polygon,
Text, Polyline, RectangleText, Polyline, Rectangle
 Clipping, Patterns, GradientsClipping, Patterns, Gradients
DOM ManipulationDOM Manipulation
 enterenter: create new nodes for incoming data: create new nodes for incoming data
 exit:exit: remove outgoing nodes that are no longerremove outgoing nodes that are no longer
needed.needed.
 Common PatternCommon Pattern
// Update…
var p = d3.select("body").selectAll("p")
.data([4, 8, 15, 16, 23, 42])
.text(String);
// Enter…
p.enter().append("p").text(String);
// Exit…
p.exit().remove();
API ReferenceAPI Reference
 CoreCore - selections, transitions, data, localization,- selections, transitions, data, localization,
colors, etc.colors, etc.
 ScalesScales - convert between data and visual- convert between data and visual
encodingsencodings
 SVGSVG - utilities for Scalable Vector Graphics- utilities for Scalable Vector Graphics
 TimeTime - parse or format times, compute calendar- parse or format times, compute calendar
intervals, etc.intervals, etc.
 LayoutsLayouts - derive secondary data for positioning- derive secondary data for positioning
elementselements
 GeographyGeography - project spherical coordinates,- project spherical coordinates,
latitude & longitude mathlatitude & longitude math
 GeometryGeometry - utilities for 2D geometry, such as- utilities for 2D geometry, such as
Voronoi diagrams and quadtreesVoronoi diagrams and quadtrees
 BehaviorsBehaviors - reusable interaction behaviors- reusable interaction behaviors
Loading External ResourcesLoading External Resources
 d3.xhrd3.xhr - request using XMLHttpRequest (AJAX)- request using XMLHttpRequest (AJAX)
 d3.textd3.text - request a text file- request a text file
 d3.jsond3.json - request a JSON blob- request a JSON blob
 d3.htmld3.html - request an HTML document fragment- request an HTML document fragment
 d3.xmld3.xml - request an XML document fragment- request an XML document fragment
 d3.csvd3.csv - request a comma-separated values file- request a comma-separated values file
 d3.tsvd3.tsv - request a tab-separated values file- request a tab-separated values file
Browser SupportBrowser Support
 FirefoxFirefox
 Chrome (Google)Chrome (Google)
 Safari (WebKit)Safari (WebKit)
 OperaOpera
 IE9 and laterIE9 and later
Include D3 JSInclude D3 JS
 IncludeInclude
<script
src="http://d3js.org/d3.v3.min.js"
charset="utf-8"></script>
 Self-HostSelf-Host
 CDNs AvailableCDNs Available
D3 GalleryD3 Gallery
Basic ChartsBasic Charts
Advanced Charts & MapsAdvanced Charts & Maps
Interactive & AnimatedInteractive & Animated
Visualizing Web Site UsageVisualizing Web Site Usage
WebActivity.swf
d3.geod3.geo
var projection = d3.geo.robinson()
.scale(200) // 150 = normal, 200 = zoom
.translate([1256/2, 480/2 + 40]) // +40=bias north
.rotate([71.4553, 0])
.precision(0.5);
var path = d3.geo.path().projection(projection);
var arc = d3.geo.greatArc()
.source(function (d) { return d.client_loc; })
.target(function (d) { return d.server_loc; });
var svg = d3.select("#main").append("svg")
.attr("width", 1256)
.attr("height", 480);
var container = svg.append("g").attr("id", "container");
var arcs = container.append("g").attr("id", "arcs");
arcs.selectAll("path.arc")
.data(conns).enter()
.append("path")
.attr("class", "arc")
.attr("d", function (d) { return path(arc(d)); });
Voronoi-based point pickerVoronoi-based point picker
http://bl.ocks.org/njvack/1405439
Voronoi DiagramVoronoi Diagram
http://mbostock.github.io/d3/talk/20111116/airports-all.html
Force Directed NodesForce Directed Nodes
Voronoi Diagram with Force Directed Nodes
and Delaunay Links
http://christophermanning.org/projects/voronoi-diagram-with-force-directed-nodes-and-delaunay-links/
VoronoiForceDirected.swf
Parallel SetsParallel Sets
Multidimensional categorical data
http://www.jasondavies.com/parallel-sets/
TitanicSurvivors.swf
Motion ChartMotion Chart
The Wealth & Health of NationsThe Wealth & Health of Nations
http://bost.ocks.org/mike/nations/
WealthOfNations.swf
ResourcesResources
 d3js.orgd3js.org d3js.org
 D3 Cheat SheetD3 Cheat Sheet
www.jeromecukier.net/wp-content/uploads/2012/10/d3-cheat-sheet.pdf
chimera.labs.oreilly.com/books/1230000000345/
Free OnlineEdition

More Related Content

What's hot

R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
MongoDB
 
PCA11: Python for Product Managers
PCA11: Python for Product ManagersPCA11: Python for Product Managers
PCA11: Python for Product Managers
David Heller
 
Bubbles – Virtual Data Objects
Bubbles – Virtual Data ObjectsBubbles – Virtual Data Objects
Bubbles – Virtual Data Objects
Stefan Urbanek
 
Working with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDBWorking with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDB
ScaleGrid.io
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping Visualization
Sudhir Chowbina
 
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.jsVisual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
Florian Georg
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
GeeksLab Odessa
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Henrik Ingo
 
Your First ASP.Net Project Part-2
Your First ASP.Net Project Part-2Your First ASP.Net Project Part-2
Your First ASP.Net Project Part-2
Biswadip Goswami
 
Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)
Stefan Urbanek
 
Machine Learning with Microsoft Azure
Machine Learning with Microsoft AzureMachine Learning with Microsoft Azure
Machine Learning with Microsoft Azure
Dmitry Petukhov
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
Joe Drumgoole
 
Cloud jpl
Cloud jplCloud jpl
Cloud jpl
Marc de Palol
 
Mongo db workshop # 01
Mongo db workshop # 01Mongo db workshop # 01
Mongo db workshop # 01
FarhatParveen10
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and Hadoop
Steven Francia
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1
Anuj Jain
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
MongoDB
 
Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014
MongoDB
 
Latinoware
LatinowareLatinoware
Latinoware
kchodorow
 

What's hot (20)

R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
 
PCA11: Python for Product Managers
PCA11: Python for Product ManagersPCA11: Python for Product Managers
PCA11: Python for Product Managers
 
Bubbles – Virtual Data Objects
Bubbles – Virtual Data ObjectsBubbles – Virtual Data Objects
Bubbles – Virtual Data Objects
 
Working with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDBWorking with JSON Data in PostgreSQL vs. MongoDB
Working with JSON Data in PostgreSQL vs. MongoDB
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping Visualization
 
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.jsVisual Exploration of Large Data sets with D3, crossfilter and dc.js
Visual Exploration of Large Data sets with D3, crossfilter and dc.js
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
Your First ASP.Net Project Part-2
Your First ASP.Net Project Part-2Your First ASP.Net Project Part-2
Your First ASP.Net Project Part-2
 
Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)
 
Machine Learning with Microsoft Azure
Machine Learning with Microsoft AzureMachine Learning with Microsoft Azure
Machine Learning with Microsoft Azure
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
 
Cloud jpl
Cloud jplCloud jpl
Cloud jpl
 
Mongo db workshop # 01
Mongo db workshop # 01Mongo db workshop # 01
Mongo db workshop # 01
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and Hadoop
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014
 
Latinoware
LatinowareLatinoware
Latinoware
 

Viewers also liked

Informe Anual de la Profesión Periodística 2016
Informe Anual de la Profesión Periodística 2016Informe Anual de la Profesión Periodística 2016
Informe Anual de la Profesión Periodística 2016
Carlos Terrones Lizana
 
brochure
brochurebrochure
brochure
Elva wang
 
Cs book. sagar italiya
Cs book.      sagar italiya Cs book.      sagar italiya
Cs book. sagar italiya
sager italiya
 
UG thesis
UG thesisUG thesis
UG thesis
Robin Prakash
 
Final Project - Web Front - Innovation Academy
Final Project - Web Front - Innovation AcademyFinal Project - Web Front - Innovation Academy
Final Project - Web Front - Innovation Academy
Cezarijus Kivylius
 
Tallerpráctico10 esther 14
Tallerpráctico10 esther 14Tallerpráctico10 esther 14
Tallerpráctico10 esther 14
innovatic grupos
 
Estimating Needs of Seminole County, FL
Estimating Needs of Seminole County, FLEstimating Needs of Seminole County, FL
Estimating Needs of Seminole County, FL
Andrew Pagano
 
Balanço do Atlético -MG 2011
Balanço do Atlético -MG 2011Balanço do Atlético -MG 2011
Balanço do Atlético -MG 2011
Cleuber Carlos Nascimento
 
DQ Book Review
DQ Book ReviewDQ Book Review
DQ Book Review
Angela Boyd
 
Rectas y planos
Rectas y planosRectas y planos
Rectas y planos
az0dj96
 
Psicologia na Saúde
Psicologia na SaúdePsicologia na Saúde
Psicologia na Saúde
Mayara Mônica
 
Relatório do tcm desaprovando as contas de sávio pontes
Relatório do tcm desaprovando as contas de sávio pontesRelatório do tcm desaprovando as contas de sávio pontes
Relatório do tcm desaprovando as contas de sávio pontes
Ipu Notícias
 
SOLOMON MUTABAZI
SOLOMON MUTABAZISOLOMON MUTABAZI
SOLOMON MUTABAZI
makofi solomon
 
Funciones vectoriales
Funciones vectorialesFunciones vectoriales
Funciones vectoriales
az0dj96
 
Homenagem Mães
Homenagem MãesHomenagem Mães
Homenagem Mães
Leisa Marcieli de Castro
 
Cartilla copaso
Cartilla copasoCartilla copaso
Cartilla copaso
Jeimmy Andrea
 

Viewers also liked (16)

Informe Anual de la Profesión Periodística 2016
Informe Anual de la Profesión Periodística 2016Informe Anual de la Profesión Periodística 2016
Informe Anual de la Profesión Periodística 2016
 
brochure
brochurebrochure
brochure
 
Cs book. sagar italiya
Cs book.      sagar italiya Cs book.      sagar italiya
Cs book. sagar italiya
 
UG thesis
UG thesisUG thesis
UG thesis
 
Final Project - Web Front - Innovation Academy
Final Project - Web Front - Innovation AcademyFinal Project - Web Front - Innovation Academy
Final Project - Web Front - Innovation Academy
 
Tallerpráctico10 esther 14
Tallerpráctico10 esther 14Tallerpráctico10 esther 14
Tallerpráctico10 esther 14
 
Estimating Needs of Seminole County, FL
Estimating Needs of Seminole County, FLEstimating Needs of Seminole County, FL
Estimating Needs of Seminole County, FL
 
Balanço do Atlético -MG 2011
Balanço do Atlético -MG 2011Balanço do Atlético -MG 2011
Balanço do Atlético -MG 2011
 
DQ Book Review
DQ Book ReviewDQ Book Review
DQ Book Review
 
Rectas y planos
Rectas y planosRectas y planos
Rectas y planos
 
Psicologia na Saúde
Psicologia na SaúdePsicologia na Saúde
Psicologia na Saúde
 
Relatório do tcm desaprovando as contas de sávio pontes
Relatório do tcm desaprovando as contas de sávio pontesRelatório do tcm desaprovando as contas de sávio pontes
Relatório do tcm desaprovando as contas de sávio pontes
 
SOLOMON MUTABAZI
SOLOMON MUTABAZISOLOMON MUTABAZI
SOLOMON MUTABAZI
 
Funciones vectoriales
Funciones vectorialesFunciones vectoriales
Funciones vectoriales
 
Homenagem Mães
Homenagem MãesHomenagem Mães
Homenagem Mães
 
Cartilla copaso
Cartilla copasoCartilla copaso
Cartilla copaso
 

Similar to Data Visualizations with D3

Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
Oleksii Prohonnyi
 
D3 data visualization
D3 data visualizationD3 data visualization
D3 data visualization
Keenan Holloway
 
The D3 Toolbox
The D3 ToolboxThe D3 Toolbox
The D3 Toolbox
Mark Rickerby
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute intro
Felipe
 
D3 meetup (Backbone and D3)
D3 meetup (Backbone and D3)D3 meetup (Backbone and D3)
D3 meetup (Backbone and D3)
Alpine Data
 
Visualization of Big Data in Web Apps
Visualization of Big Data in Web AppsVisualization of Big Data in Web Apps
Visualization of Big Data in Web Apps
EPAM
 
Introduction to D3
Introduction to D3 Introduction to D3
Introduction to D3
Marcos Iglesias
 
SVGD3Angular2React
SVGD3Angular2ReactSVGD3Angular2React
SVGD3Angular2React
Oswald Campesato
 
Utahjs D3
Utahjs D3Utahjs D3
Utahjs D3
knomedia
 
D3
D3D3
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
LearningTech
 
Dreamforce 2014 - Introduction to d3.js
Dreamforce 2014 - Introduction to d3.jsDreamforce 2014 - Introduction to d3.js
Dreamforce 2014 - Introduction to d3.js
ramanathanp82
 
Learn D3.js in 90 minutes
Learn D3.js in 90 minutesLearn D3.js in 90 minutes
Learn D3.js in 90 minutes
Jos Dirksen
 
Edge of the Web
Edge of the WebEdge of the Web
Edge of the Web
Todd Anglin
 
Python for R Users
Python for R UsersPython for R Users
Python for R Users
Ajay Ohri
 
Introduction to CrossRef Technical Basics Webinar 031815
Introduction to CrossRef Technical Basics Webinar 031815Introduction to CrossRef Technical Basics Webinar 031815
Introduction to CrossRef Technical Basics Webinar 031815
Crossref
 
Web Components With Rails
Web Components With RailsWeb Components With Rails
Web Components With Rails
Boris Nadion
 
Dex Technical Seminar (April 2011)
Dex Technical Seminar (April 2011)Dex Technical Seminar (April 2011)
Dex Technical Seminar (April 2011)
Sergio Gomez Villamor
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
MoscowJS
 

Similar to Data Visualizations with D3 (20)

Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
 
D3 data visualization
D3 data visualizationD3 data visualization
D3 data visualization
 
The D3 Toolbox
The D3 ToolboxThe D3 Toolbox
The D3 Toolbox
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute intro
 
D3 meetup (Backbone and D3)
D3 meetup (Backbone and D3)D3 meetup (Backbone and D3)
D3 meetup (Backbone and D3)
 
Visualization of Big Data in Web Apps
Visualization of Big Data in Web AppsVisualization of Big Data in Web Apps
Visualization of Big Data in Web Apps
 
Introduction to D3
Introduction to D3 Introduction to D3
Introduction to D3
 
SVGD3Angular2React
SVGD3Angular2ReactSVGD3Angular2React
SVGD3Angular2React
 
Utahjs D3
Utahjs D3Utahjs D3
Utahjs D3
 
D3
D3D3
D3
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
Dreamforce 2014 - Introduction to d3.js
Dreamforce 2014 - Introduction to d3.jsDreamforce 2014 - Introduction to d3.js
Dreamforce 2014 - Introduction to d3.js
 
Learn D3.js in 90 minutes
Learn D3.js in 90 minutesLearn D3.js in 90 minutes
Learn D3.js in 90 minutes
 
Edge of the Web
Edge of the WebEdge of the Web
Edge of the Web
 
Python for R Users
Python for R UsersPython for R Users
Python for R Users
 
Introduction to CrossRef Technical Basics Webinar 031815
Introduction to CrossRef Technical Basics Webinar 031815Introduction to CrossRef Technical Basics Webinar 031815
Introduction to CrossRef Technical Basics Webinar 031815
 
Web Components With Rails
Web Components With RailsWeb Components With Rails
Web Components With Rails
 
Dex Technical Seminar (April 2011)
Dex Technical Seminar (April 2011)Dex Technical Seminar (April 2011)
Dex Technical Seminar (April 2011)
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
 

Data Visualizations with D3

  • 1. Data VisualizationsData Visualizations with D3.jswith D3.js Doug DomenyDoug Domeny June 2014June 2014
  • 2. Data-Driven DocumentsData-Driven Documents  JavaScript + HTML + SVG + CSSJavaScript + HTML + SVG + CSS  Bind arbitrary data to a Document ObjectBind arbitrary data to a Document Object Model (DOM)Model (DOM)  Similar to jQuery & PrototypeSimilar to jQuery & Prototype • SelectionsSelections • Dynamic PropertiesDynamic Properties • Function ChainingFunction Chaining d3.selectAll("p") .data([4, 8, 15, 16, 23, 42]) .style("font-size", function(d) { return d + "px"; });
  • 3. D3D3  TransitionsTransitions d3.selectAll("circle") .transition() .duration(750) .delay(function(d, i) { return i * 10; }) .attr("r", function(d) { return Math.sqrt(d * scale); });  Transformation, not RepresentationTransformation, not Representation • Scaling and ProjectionsScaling and Projections • Web standards: HTML, SVG and CSSWeb standards: HTML, SVG and CSS
  • 4. SVGSVG  Circle, Line, Ellipse, Path, Polygon,Circle, Line, Ellipse, Path, Polygon, Text, Polyline, RectangleText, Polyline, Rectangle  Clipping, Patterns, GradientsClipping, Patterns, Gradients
  • 5. DOM ManipulationDOM Manipulation  enterenter: create new nodes for incoming data: create new nodes for incoming data  exit:exit: remove outgoing nodes that are no longerremove outgoing nodes that are no longer needed.needed.  Common PatternCommon Pattern // Update… var p = d3.select("body").selectAll("p") .data([4, 8, 15, 16, 23, 42]) .text(String); // Enter… p.enter().append("p").text(String); // Exit… p.exit().remove();
  • 6. API ReferenceAPI Reference  CoreCore - selections, transitions, data, localization,- selections, transitions, data, localization, colors, etc.colors, etc.  ScalesScales - convert between data and visual- convert between data and visual encodingsencodings  SVGSVG - utilities for Scalable Vector Graphics- utilities for Scalable Vector Graphics  TimeTime - parse or format times, compute calendar- parse or format times, compute calendar intervals, etc.intervals, etc.  LayoutsLayouts - derive secondary data for positioning- derive secondary data for positioning elementselements  GeographyGeography - project spherical coordinates,- project spherical coordinates, latitude & longitude mathlatitude & longitude math  GeometryGeometry - utilities for 2D geometry, such as- utilities for 2D geometry, such as Voronoi diagrams and quadtreesVoronoi diagrams and quadtrees  BehaviorsBehaviors - reusable interaction behaviors- reusable interaction behaviors
  • 7. Loading External ResourcesLoading External Resources  d3.xhrd3.xhr - request using XMLHttpRequest (AJAX)- request using XMLHttpRequest (AJAX)  d3.textd3.text - request a text file- request a text file  d3.jsond3.json - request a JSON blob- request a JSON blob  d3.htmld3.html - request an HTML document fragment- request an HTML document fragment  d3.xmld3.xml - request an XML document fragment- request an XML document fragment  d3.csvd3.csv - request a comma-separated values file- request a comma-separated values file  d3.tsvd3.tsv - request a tab-separated values file- request a tab-separated values file
  • 8. Browser SupportBrowser Support  FirefoxFirefox  Chrome (Google)Chrome (Google)  Safari (WebKit)Safari (WebKit)  OperaOpera  IE9 and laterIE9 and later
  • 9. Include D3 JSInclude D3 JS  IncludeInclude <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>  Self-HostSelf-Host  CDNs AvailableCDNs Available
  • 12. Advanced Charts & MapsAdvanced Charts & Maps
  • 14. Visualizing Web Site UsageVisualizing Web Site Usage WebActivity.swf
  • 15. d3.geod3.geo var projection = d3.geo.robinson() .scale(200) // 150 = normal, 200 = zoom .translate([1256/2, 480/2 + 40]) // +40=bias north .rotate([71.4553, 0]) .precision(0.5); var path = d3.geo.path().projection(projection); var arc = d3.geo.greatArc() .source(function (d) { return d.client_loc; }) .target(function (d) { return d.server_loc; }); var svg = d3.select("#main").append("svg") .attr("width", 1256) .attr("height", 480); var container = svg.append("g").attr("id", "container"); var arcs = container.append("g").attr("id", "arcs"); arcs.selectAll("path.arc") .data(conns).enter() .append("path") .attr("class", "arc") .attr("d", function (d) { return path(arc(d)); });
  • 16. Voronoi-based point pickerVoronoi-based point picker http://bl.ocks.org/njvack/1405439
  • 18. Force Directed NodesForce Directed Nodes Voronoi Diagram with Force Directed Nodes and Delaunay Links http://christophermanning.org/projects/voronoi-diagram-with-force-directed-nodes-and-delaunay-links/ VoronoiForceDirected.swf
  • 19. Parallel SetsParallel Sets Multidimensional categorical data http://www.jasondavies.com/parallel-sets/ TitanicSurvivors.swf
  • 20. Motion ChartMotion Chart The Wealth & Health of NationsThe Wealth & Health of Nations http://bost.ocks.org/mike/nations/ WealthOfNations.swf
  • 21. ResourcesResources  d3js.orgd3js.org d3js.org  D3 Cheat SheetD3 Cheat Sheet www.jeromecukier.net/wp-content/uploads/2012/10/d3-cheat-sheet.pdf chimera.labs.oreilly.com/books/1230000000345/ Free OnlineEdition