SlideShare a Scribd company logo
Academy PRO: D3, part 1
What is data visualisation?
Data visualization is the presentation of data in a graphical format.
Why you should visualize data?
● Visuals are processed faster by the brain
● Visuals are committed to long-term memory easier than text
● Visuals can reveal patterns, trends, changes, and correlations
● Visuals can help simplify complex information
● Visuals can often be more effective than words at changing people’s
minds
● Visuals help people see things that were not obvious to them before
History
The concept of using pictures to understand data has been around for
centuries, from maps and graphs in the 17th century to the invention of the
pie chart in the early 1800s.
Nowadays
● HTML
● SVG
● Canvas
Data-driven documents
D3 (or D3.js) is a JavaScript library for visualizing data using web standards. D3
helps you bring data to life using SVG, Canvas and HTML.
It was created by Mike Bostock. He now works at the New York Times who
sponsors his open source work.
D3 is good at
● being general purpose visualization library
● providing a way to map data to documents
● handling data transformation
● providing basic math and layout algorithms
Why D3?
You choose how to visualize
https://bl.ocks.org/kerryrodden/raw/7090426/
https://bl.ocks.org/curran/raw/a9555f8041f04a5cbfb53e6f5c53caae/
https://bl.ocks.org/mbostock/raw/4062045/
Instalation
● via NPM:
npm install d3-selection
● load directly from d3js.org:
<script src="https://d3js.org/d3-selection.v1.min.js"></script>
npm install d3
<script src="https://d3js.org/d3.v4.js"></script>
D3 vs jQuery
d3.json('foo.json',
function(err, data) { });
d3.select('#foo')
.style('background', '#000')
.attr('height', '500')
.on('click', function() {})
.append('div');
$.getJSON('foo.json',
function(data) { });
$('#foo')
.css('background', '#000')
.attr('width', '500')
.click(function() {})
.append($('<div></div>'));
What is SVG?
● SVG stands for Scalable Vector Graphics
● SVG is used to define vector-based graphics for the Web
● SVG defines the graphics in XML format
● SVG graphics do NOT lose any quality if they are zoomed or resized
● Every element and every attribute in SVG files can be animated
SVG Shapes
● Rectangle <rect>
● Circle <circle>
● Ellipse <ellipse>
● Line <line>
● Polyline <polyline>
● Polygon <polygon>
● Path <path>
● Text <text>
https://codepen.io/sahanr/pen/JrLEEY
Selections
Selections allow powerful data-driven transformation of the document object
model (DOM).
const block = d3.select('.container');
const rectangles = block.selectAll('rect');
https://codepen.io/sahanr/pen/aLYOQr
Selections
Difference
Only selectAll has special behavior regarding grouping; select preserves the
existing grouping. The select method differs because there is exactly one
element in the new selection for each element in the old selection. Thus,
select also propagates data from parent to child, whereas selectAll does not
(hence the need for a data-join)!
Modifying Elements
const svg = d3
.select('svg')
.attr('name', 'container') // add attribute
.classed('green', true); // add class
const paragraphs = svg
.selectAll('text')
.filter(':nth-child(even)')
.style('text-decoration', 'underline') // add styles
.text('new inner text'); // added text
https://codepen.io/sahanr/pen/yzKeqV
Creating element
The append and insert methods are wrappers on top of select, so they also
preserve grouping and propagate data.
const svg = d3
.select('svg')
.append('rect') // add new element
.attr('y', 30) // modify <rect> element
.attr('x', 0);
svg.select('text)
.remove(); // remove first text element
https://codepen.io/sahanr/pen/aLYmgG
Bound to data
The magic of D3 comes from the ability to use data and web page elements
together.
Elements can be selected and their appearance modified to reflect differences
in the data.
Data is not a property of the selection, but a property of its elements (__data__
property).
The data join
● pairs an object and an element;
● keeps track of new and old objects;
● lets you animate differences
between new & old.
d3.selectAll('text')
.data(data)
.enter()
.append('text');
Binding data
const block = d3.select('.container')
.selectAll('p') // an enmpty selection, looking for data
.data(['first', 'second', 'third']); // data, which would be bound to selection
block
.enter() // for every time that we see data, but we do not see an element
.append('p') // append an element
.text(function (d) {
return d;
}); // fill the element with text
https://codepen.io/sahanr/pen/NaMPdm
Binding data
Data is bound to elements one of several ways:
● Joined to groups of elements via selection.data
● Assigned to individual elements via selection.datum
● Inherited from a parent via append, insert, or select
Loading data
d3-request
This module provides a convenient alternative to XMLHttpRequest.
d3.text("/path/to/file.txt", function(error, text) {
if (error) throw error;
console.log(text); // Hello, world!
});
d3.json()
d3.tsv()
d3.csv()
d3.xml()
d3.html()
svg output
https://codepen.io/sahanr/pen/KXopZZ?editors=0010
Scale
Scales are a convenient abstraction for a fundamental task in visualization:
mapping a dimension of abstract data to a visual representation.
Scale
var scores = [96, 74, 88, 65, 82 ];
const xScale = d3.scaleLinear()
.domain([0, d3.max(scores)]) -----> value range of the dataset
.range([0, 300]); ----------------> value range for the visualized graph
newItemGroup
.append('rect')
.attr('class', 'bar')
.attr('width', (d) => xScale(d))
.attr('height', barHeight - 5);
https://codepen.io/sahanr/pen/YraXeP
Scale types
● linear - https://codepen.io/sahanr/pen/MEVbRP
● time - https://codepen.io/sahanr/pen/wrmobr
● sequential- https://codepen.io/sahanr/pen/oGyrNV
● quantize- https://codepen.io/sahanr/pen/gGeLNm
● ordinal - https://codepen.io/sahanr/pen/BwrQgd
Handling events
We can bind an event listener to any DOM element using d3.selection.on()
method.
https://codepen.io/sahanr/pen/mBxJxP
Links
https://bost.ocks.org/mike/join/ - Thinking with Joins,
https://bost.ocks.org/mike/circles/ - Three Little Circles,
https://bost.ocks.org/mike/selection/ - How Selections Work,
https://github.com/d3 - D3 docs
To be continued...

More Related Content

PPTX
Silverlight week5
iedotnetug
 
PDF
Basics of google chrome developer tools
Digital Shende
 
PPT
econstruct summary
Reinout van Rees
 
PDF
3DRepo
MongoDB
 
DOCX
Online data deduplication for in memory big-data analytic systems
Shakas Technologies
 
PDF
3D + MongoDB = 3D Repo
MongoDB
 
Silverlight week5
iedotnetug
 
Basics of google chrome developer tools
Digital Shende
 
econstruct summary
Reinout van Rees
 
3DRepo
MongoDB
 
Online data deduplication for in memory big-data analytic systems
Shakas Technologies
 
3D + MongoDB = 3D Repo
MongoDB
 

What's hot (10)

PPTX
UMLtoNoSQL : From UML domain models to NoSQL Databases
Jordi Cabot
 
PDF
Advanced D3 Charting
dcryan
 
PDF
Exploring Large Chemical Data Sets
kylelutz
 
PDF
NOSQL IMPLEMENTATION OF A CONCEPTUAL DATA MODEL: UML CLASS DIAGRAM TO A DOCUM...
IJDMS
 
PDF
D3 data visualization
Keenan Holloway
 
PDF
Adding new type to Druid
Navis Ryu
 
PDF
A Quick and Dirty D3.js Tutorial
Young-Ho Kim
 
PPTX
Dom(document object model)
Partnered Health
 
PPTX
The GetLOD Story
Piergiorgio Cipriano
 
PPTX
Data base
bodabody
 
UMLtoNoSQL : From UML domain models to NoSQL Databases
Jordi Cabot
 
Advanced D3 Charting
dcryan
 
Exploring Large Chemical Data Sets
kylelutz
 
NOSQL IMPLEMENTATION OF A CONCEPTUAL DATA MODEL: UML CLASS DIAGRAM TO A DOCUM...
IJDMS
 
D3 data visualization
Keenan Holloway
 
Adding new type to Druid
Navis Ryu
 
A Quick and Dirty D3.js Tutorial
Young-Ho Kim
 
Dom(document object model)
Partnered Health
 
The GetLOD Story
Piergiorgio Cipriano
 
Data base
bodabody
 
Ad

Similar to Academy PRO: D3, part 1 (20)

PDF
Learn D3.js in 90 minutes
Jos Dirksen
 
PDF
The D3 Toolbox
Mark Rickerby
 
PPTX
Introduction to D3.js
Oleksii Prohonnyi
 
PPTX
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
Oleksii Prohonnyi
 
PDF
Introduction to data visualisation with D3
Aleksander Fabijan
 
PPTX
D3
Xi SiZhe
 
PDF
Introduction to d3js (and SVG)
zahid-mian
 
PPTX
Dreamforce 2014 - Introduction to d3.js
ramanathanp82
 
PPT
Data Visualizations with D3
Doug Domeny
 
PDF
D3 js in Action Data visualization with JavaScript Second Edition Elijah Meeks
gvbzbhfc9119
 
PPTX
D3 data visualization
Vinod Wilson
 
PDF
Introduction to D3
Marcos Iglesias
 
PDF
Learning d3
Ishi von Meier
 
PPTX
Data visualisation with D3
Florian Evéquoz
 
PPTX
Data Visualization with D3
Usman Shabbir
 
PPTX
D3 brown-bag
Awalin Sopan
 
PDF
D3.js in Action: Data visualization with JavaScript 2nd Edition Elijah Meeks
bsgehioa3549
 
PPTX
chapter 6 data visualization ppt.pptx
sayalisonavane3
 
PDF
Data Visualization on the Web - Intro to D3
Angela Zoss
 
Learn D3.js in 90 minutes
Jos Dirksen
 
The D3 Toolbox
Mark Rickerby
 
Introduction to D3.js
Oleksii Prohonnyi
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
Oleksii Prohonnyi
 
Introduction to data visualisation with D3
Aleksander Fabijan
 
Introduction to d3js (and SVG)
zahid-mian
 
Dreamforce 2014 - Introduction to d3.js
ramanathanp82
 
Data Visualizations with D3
Doug Domeny
 
D3 js in Action Data visualization with JavaScript Second Edition Elijah Meeks
gvbzbhfc9119
 
D3 data visualization
Vinod Wilson
 
Introduction to D3
Marcos Iglesias
 
Learning d3
Ishi von Meier
 
Data visualisation with D3
Florian Evéquoz
 
Data Visualization with D3
Usman Shabbir
 
D3 brown-bag
Awalin Sopan
 
D3.js in Action: Data visualization with JavaScript 2nd Edition Elijah Meeks
bsgehioa3549
 
chapter 6 data visualization ppt.pptx
sayalisonavane3
 
Data Visualization on the Web - Intro to D3
Angela Zoss
 
Ad

More from Binary Studio (20)

PPTX
Academy PRO: D3, part 3
Binary Studio
 
PPTX
Academy PRO: Cryptography 3
Binary Studio
 
PPTX
Academy PRO: Cryptography 1
Binary Studio
 
PPTX
Academy PRO: Advanced React Ecosystem. MobX
Binary Studio
 
PPTX
Academy PRO: Docker. Part 4
Binary Studio
 
PPTX
Academy PRO: Docker. Part 2
Binary Studio
 
PPTX
Academy PRO: Docker. Part 1
Binary Studio
 
PPTX
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio
 
PPTX
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio
 
PPTX
Academy PRO: React native - miscellaneous
Binary Studio
 
PPTX
Academy PRO: React native - publish
Binary Studio
 
PPTX
Academy PRO: React native - navigation
Binary Studio
 
PPTX
Academy PRO: React native - building first scenes
Binary Studio
 
PPTX
Academy PRO: React Native - introduction
Binary Studio
 
PPTX
Academy PRO: Push notifications. Denis Beketsky
Binary Studio
 
PPTX
Academy PRO: Docker. Lecture 4
Binary Studio
 
PPTX
Academy PRO: Docker. Lecture 3
Binary Studio
 
PPTX
Academy PRO: Docker. Lecture 2
Binary Studio
 
PPTX
Academy PRO: Docker. Lecture 1
Binary Studio
 
PPTX
Academy PRO: Node.js - miscellaneous. Lecture 5
Binary Studio
 
Academy PRO: D3, part 3
Binary Studio
 
Academy PRO: Cryptography 3
Binary Studio
 
Academy PRO: Cryptography 1
Binary Studio
 
Academy PRO: Advanced React Ecosystem. MobX
Binary Studio
 
Academy PRO: Docker. Part 4
Binary Studio
 
Academy PRO: Docker. Part 2
Binary Studio
 
Academy PRO: Docker. Part 1
Binary Studio
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio
 
Academy PRO: React native - miscellaneous
Binary Studio
 
Academy PRO: React native - publish
Binary Studio
 
Academy PRO: React native - navigation
Binary Studio
 
Academy PRO: React native - building first scenes
Binary Studio
 
Academy PRO: React Native - introduction
Binary Studio
 
Academy PRO: Push notifications. Denis Beketsky
Binary Studio
 
Academy PRO: Docker. Lecture 4
Binary Studio
 
Academy PRO: Docker. Lecture 3
Binary Studio
 
Academy PRO: Docker. Lecture 2
Binary Studio
 
Academy PRO: Docker. Lecture 1
Binary Studio
 
Academy PRO: Node.js - miscellaneous. Lecture 5
Binary Studio
 

Recently uploaded (20)

PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Doc9.....................................
SofiaCollazos
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 

Academy PRO: D3, part 1

  • 2. What is data visualisation? Data visualization is the presentation of data in a graphical format.
  • 3. Why you should visualize data? ● Visuals are processed faster by the brain ● Visuals are committed to long-term memory easier than text ● Visuals can reveal patterns, trends, changes, and correlations ● Visuals can help simplify complex information ● Visuals can often be more effective than words at changing people’s minds ● Visuals help people see things that were not obvious to them before
  • 4. History The concept of using pictures to understand data has been around for centuries, from maps and graphs in the 17th century to the invention of the pie chart in the early 1800s.
  • 6. Data-driven documents D3 (or D3.js) is a JavaScript library for visualizing data using web standards. D3 helps you bring data to life using SVG, Canvas and HTML. It was created by Mike Bostock. He now works at the New York Times who sponsors his open source work.
  • 7. D3 is good at ● being general purpose visualization library ● providing a way to map data to documents ● handling data transformation ● providing basic math and layout algorithms
  • 8. Why D3? You choose how to visualize https://bl.ocks.org/kerryrodden/raw/7090426/ https://bl.ocks.org/curran/raw/a9555f8041f04a5cbfb53e6f5c53caae/ https://bl.ocks.org/mbostock/raw/4062045/
  • 9. Instalation ● via NPM: npm install d3-selection ● load directly from d3js.org: <script src="https://d3js.org/d3-selection.v1.min.js"></script> npm install d3 <script src="https://d3js.org/d3.v4.js"></script>
  • 10. D3 vs jQuery d3.json('foo.json', function(err, data) { }); d3.select('#foo') .style('background', '#000') .attr('height', '500') .on('click', function() {}) .append('div'); $.getJSON('foo.json', function(data) { }); $('#foo') .css('background', '#000') .attr('width', '500') .click(function() {}) .append($('<div></div>'));
  • 11. What is SVG? ● SVG stands for Scalable Vector Graphics ● SVG is used to define vector-based graphics for the Web ● SVG defines the graphics in XML format ● SVG graphics do NOT lose any quality if they are zoomed or resized ● Every element and every attribute in SVG files can be animated
  • 12. SVG Shapes ● Rectangle <rect> ● Circle <circle> ● Ellipse <ellipse> ● Line <line> ● Polyline <polyline> ● Polygon <polygon> ● Path <path> ● Text <text> https://codepen.io/sahanr/pen/JrLEEY
  • 13. Selections Selections allow powerful data-driven transformation of the document object model (DOM). const block = d3.select('.container'); const rectangles = block.selectAll('rect'); https://codepen.io/sahanr/pen/aLYOQr Selections
  • 14. Difference Only selectAll has special behavior regarding grouping; select preserves the existing grouping. The select method differs because there is exactly one element in the new selection for each element in the old selection. Thus, select also propagates data from parent to child, whereas selectAll does not (hence the need for a data-join)!
  • 15. Modifying Elements const svg = d3 .select('svg') .attr('name', 'container') // add attribute .classed('green', true); // add class const paragraphs = svg .selectAll('text') .filter(':nth-child(even)') .style('text-decoration', 'underline') // add styles .text('new inner text'); // added text https://codepen.io/sahanr/pen/yzKeqV
  • 16. Creating element The append and insert methods are wrappers on top of select, so they also preserve grouping and propagate data. const svg = d3 .select('svg') .append('rect') // add new element .attr('y', 30) // modify <rect> element .attr('x', 0); svg.select('text) .remove(); // remove first text element https://codepen.io/sahanr/pen/aLYmgG
  • 17. Bound to data The magic of D3 comes from the ability to use data and web page elements together. Elements can be selected and their appearance modified to reflect differences in the data. Data is not a property of the selection, but a property of its elements (__data__ property).
  • 18. The data join ● pairs an object and an element; ● keeps track of new and old objects; ● lets you animate differences between new & old. d3.selectAll('text') .data(data) .enter() .append('text');
  • 19. Binding data const block = d3.select('.container') .selectAll('p') // an enmpty selection, looking for data .data(['first', 'second', 'third']); // data, which would be bound to selection block .enter() // for every time that we see data, but we do not see an element .append('p') // append an element .text(function (d) { return d; }); // fill the element with text https://codepen.io/sahanr/pen/NaMPdm
  • 20. Binding data Data is bound to elements one of several ways: ● Joined to groups of elements via selection.data ● Assigned to individual elements via selection.datum ● Inherited from a parent via append, insert, or select
  • 21. Loading data d3-request This module provides a convenient alternative to XMLHttpRequest. d3.text("/path/to/file.txt", function(error, text) { if (error) throw error; console.log(text); // Hello, world! }); d3.json() d3.tsv() d3.csv() d3.xml() d3.html()
  • 23. Scale Scales are a convenient abstraction for a fundamental task in visualization: mapping a dimension of abstract data to a visual representation.
  • 24. Scale var scores = [96, 74, 88, 65, 82 ]; const xScale = d3.scaleLinear() .domain([0, d3.max(scores)]) -----> value range of the dataset .range([0, 300]); ----------------> value range for the visualized graph newItemGroup .append('rect') .attr('class', 'bar') .attr('width', (d) => xScale(d)) .attr('height', barHeight - 5); https://codepen.io/sahanr/pen/YraXeP
  • 25. Scale types ● linear - https://codepen.io/sahanr/pen/MEVbRP ● time - https://codepen.io/sahanr/pen/wrmobr ● sequential- https://codepen.io/sahanr/pen/oGyrNV ● quantize- https://codepen.io/sahanr/pen/gGeLNm ● ordinal - https://codepen.io/sahanr/pen/BwrQgd
  • 26. Handling events We can bind an event listener to any DOM element using d3.selection.on() method. https://codepen.io/sahanr/pen/mBxJxP
  • 27. Links https://bost.ocks.org/mike/join/ - Thinking with Joins, https://bost.ocks.org/mike/circles/ - Three Little Circles, https://bost.ocks.org/mike/selection/ - How Selections Work, https://github.com/d3 - D3 docs

Editor's Notes

  • #10: dependency
  • #14: select, selectAll, null, parentNode, filter, function(d,i,n) empty, node, nodes, size
  • #16: property, html second parameter null
  • #18: what is data
  • #19: Instead of telling D3 how to do something, tell D3 what you want. why? how it works? perfomance
  • #20: key
  • #22: request, header, send, error, load
  • #23: add margins
  • #26: power, log, sqrt, identity Utc
  • #27: event, mouse, touch