Professional Documents
Culture Documents
Introduction To D3.js: Datalab Seminar
Introduction To D3.js: Datalab Seminar
Introduction to D3.js
Interactive Data Visualization in the Web Browser
Data Visualization
Data Visualization
• Information Visualization
– Abstract representation
– Discrete data
• Scientific Visualization
– Artefacts with well-defined 2D/3D representation in reality
– Continuous data (e.g., computational fluid dynamics, weather models)
Zürcher Fachhochschule 4
InfoVis and Big Data / Open Data
– The Guardian
http://www.theguardian.com/news/datablog
D3.js
Data in d3.js
Data Binding
Scales
– Log scale
– Power scale
– Time range
– Color categories
Zürcher Fachhochschule 12
Scales
Zürcher Fachhochschule 13
Axes
• Labeling of scales
– Create an axis for a given scale
var xAxis = d3.svg.axis()
.scale(x)
.orient(“right");
• By generating
HTML div elements
../Demos/d3js/
A01_Bar_htmlDIVs.html
• By generating
SVG rect elements
and axes
../Demos/d3js/
A02_Bar_chart.html
Zürcher Fachhochschule 15
Layouts
../Demos/d3js/
A03_Pie_chart.html
Zürcher Fachhochschule 17
Zürcher Fachhochschule 18
Let‘s Visualize a Network Graph
../Demos/d3js/
A04_Network_graph.html
Zürcher Fachhochschule 19
Geographical Maps
• GeoJSON
– Maps geographic data to SVG polygon elements
• TopoJSON
– Borders are stitched together from segments called arcs
– Arcs are shared by borders à compact data
• Many different geo projections in d3.geo.js available
Zürcher Fachhochschule 20
Let‘s Create a Swiss Map
• By using d3.topojson.js
../Demos/d3js/
A05_Swiss_map.html
Zürcher Fachhochschule 21
Zürcher Fachhochschule 22
Example: Visualize content from DB
Zürcher Fachhochschule 24
Student Project: eHealth Info Vis
Zürcher Fachhochschule
• Combine
multiple &
linked views
• Temporal
filtering &
animation
• Interactive
legends
http://www.metason.net/artistnet/India_Arie.html
Zürcher Fachhochschule 26
A Typical d3.js Application
Zürcher Fachhochschule 28
Dive Deeper
• Learning by doing
– Checkout d3.js Web site www.d3js.org
– Use existing tutorials https://github.com/mbostock/d3/wiki/Tutorials
– Take small steps
– Learn from examples
• Study d3.js visualization samples
– https://github.com/mbostock/d3/wiki/Gallery
– http://bl.ocks.org/mbostock
– ...
Zürcher Fachhochschule 29
ß Continuum à
Zürcher Fachhochschule 30
Visual Data Mining
Zürcher Fachhochschule 31
Recommended Reading
PDF: http://portal.acm.org/ft_gateway.cfm?id=1805128&type=pdf
HTML: http://queue.acm.org/detail.cfm?id=1805128
Zürcher Fachhochschule 32
Recommended Reading
Zürcher Fachhochschule 33