SlideShare a Scribd company logo
D3 Data Visualization
Presented By Vinod – Architect – Crestron Electronics
Visualizing Data Process Steps
• Acquire
• Obtain the data, whether from a file on a disk or a source over a network.
• Parse
• Provide some structure for the data's meaning, and order it into categories.
• Filter
• Remove all but the data of interest.
• Mine
• Apply methods from statistics or data mining as a way to discern patterns or place the data in mathematical
context.
• Represent
• Choose a basic visual model, such as a bar graph, list, or tree.
• Refine
• Improve the basic representation to make it clearer and more visually engaging.
• Interact
• Add methods for manipulating the data or controlling what features are visible.
Basic Building Blocks
Adding Dom elements using D3
Adding an SVG Element
Select/Data/Enter/Append
SelectAll/Data/Enter/Append
• D3.js SelectAll Method
• The D3.js SelectAll method uses CSS3 selectors to grab DOM elements.
• But wait! The basic HTML page doesn't contain any <p> yet. What is it actually
doing?
• What it is doing is selecting all of the <p> available on the page. Which in this
case is none. So it returns an empty selection.
• Later use of .data(theData) and .enter( ) will allow us to bind the data to the
empty selection.
SelectAll/Data/Enter/Append
• D3.js Data Operator
• The data operator joins an array of data (which can be numbers, objects or
other arrays) with the current selection.
• The first element 1 is assigned to the first <p> element, the second to the
second, so on and so forth.
• But wait! The basic page doesn't contain any <p> yet. What is it actually
doing?
D3.js Virtual Selections (Thinking with Joins)
• The D3.js Data Operator returns three virtual selections rather than
just the regular one like other methods.
• The three virtual selections are enter, update and exit.
• The enter selection contains placeholders for any missing elements.
• The update selection contains existing elements, bound to data.
• Any remaining elements end up in the exit selection for removal.
D3.js Virtual Selections (Thinking with Joins)
• d3.select("body").selectAll("p") => was empty
• The virtual enter selection now contains placeholders for our <p>
elements.
D3.js Enter Method
• The D3.js Enter Method returns the virtual enter selection from the
Data Operator.
• This method only works on the Data Operator because the Data
Operator is the only one that returns three virtual selections.
• Only allows chaining of append, insert and select operators to be
used on it
D3.js Append Operator Revisited
• var p = d3.select("body").selectAll("p")
.data(theData)
.enter()
.append("p")
For each placeholder element created in the previous step, a p element
is inserted.
D3.js Text Operator
D3.js Data Operator Revisited
You can also see that the last (third) paragraph element has
the __data__ property with a value of 3.
Which came from our data set!
Using Data Bound to DOM Elements
Variables Available inside D3.js Operators
• The are two other variables provided to us by D3.js - this and i.
• this => refers to the current DOM element being evaluated.
• i => refers to the index of the current HTML element being evaluated
in the selected elements selection.
Variables Available inside D3.js Operators
Creating SVG Elements Based on Data
Using the SVG Coordinate Space
Data Structures D3.js Accepts
• Loading External Data Resources
• D3.js has built in functionality to load in the following types of external
resources:
• an XMLHttpRequest
• a text file
• a JSON blob
• an HTML document fragment
• an XML document fragment
• a comma-separated values (CSV) file
• a tab-separated values (TSV) file
• The only thing to pay attention to is to make sure you construct an array
out of the data.
Using JSON data
SVG Paths and D3.js
• Accessor Function
Different types of line interpolations
Dynamic SVG Coordinate Space
• Three SVG Rectangle Example
• The SVG Viewport (container)
has a width of 100 units and
a height of 100 units.
Dynamic SVG Coordinate Space
• What if our purple
rectangle x-coordinate,
suddenly quadrupled
from 40 to 160?
Dynamic SVG Coordinate Space
D3.js Scales
• what if our data attributes suddenly quadrupled. And then,
quadrupled again. And then....etc.
• This is a problem once the SVG Viewport/Coordinate Space is bigger
than the browser window.
• The purple rectangle would be so far to the right that it would be
practically impossible to see.
D3.js Scales
• D3.js provides functions to perform data transformations.
• These functions map an input domain to an output range.
D3.js Scales
SVG Group Element and D3.js
SVG Transformation and D3.js
• Transformation
• Translate
• Scale
• Rotate
• Skew
D3.js based reusable visualization frameworks
• DC.JS => https://dc-js.github.io/dc.js/
• Dimple.js => http://dimplejs.org/
• Dance.js => https://github.com/michael/dance
• NVD3 => http://nvd3.org/index.html
• C3.js => http://c3js.org/
Thank You

More Related Content

PDF
The D3 Toolbox
PDF
Data centric Metaprogramming by Vlad Ulreche
PPTX
For Beginners - Ado.net
PDF
Three steps to untangle data traffic jams
PDF
Ado.net
PPT
Introduction to ADO.NET
PPS
VISUAL BASIC .net data accesss vii
PDF
Learn D3.js in 90 minutes
The D3 Toolbox
Data centric Metaprogramming by Vlad Ulreche
For Beginners - Ado.net
Three steps to untangle data traffic jams
Ado.net
Introduction to ADO.NET
VISUAL BASIC .net data accesss vii
Learn D3.js in 90 minutes

What's hot (20)

PPT
Database Connection
PPT
Chap14 ado.net
PDF
D3 Basic Tutorial
PPT
Ado.net
PPT
ADO.NET
PPTX
Collections Training
PPTX
Ado .net
PPT
ADO.net control
PDF
D3 data visualization
PPT
Ado.net &amp; data persistence frameworks
PPSX
ADO.NET
PDF
Developing Dynamic Reports for TMS Using Crystal Reports
PPT
ADO .Net
PPTX
Chapter 3: ado.net
PPTX
ADO.NET -database connection
PDF
Performing Data Science with HBase
PPTX
Ado.net
PPTX
Ado.Net Tutorial
PPTX
ADO.NET by ASP.NET Development Company in india
PDF
Visual Basic.Net & Ado.Net
Database Connection
Chap14 ado.net
D3 Basic Tutorial
Ado.net
ADO.NET
Collections Training
Ado .net
ADO.net control
D3 data visualization
Ado.net &amp; data persistence frameworks
ADO.NET
Developing Dynamic Reports for TMS Using Crystal Reports
ADO .Net
Chapter 3: ado.net
ADO.NET -database connection
Performing Data Science with HBase
Ado.net
Ado.Net Tutorial
ADO.NET by ASP.NET Development Company in india
Visual Basic.Net & Ado.Net
Ad

Similar to D3 data visualization (20)

PDF
Advanced D3 Charting
PPTX
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
PDF
Data Collection and Consumption
PPTX
Dreamforce 2014 - Introduction to d3.js
PDF
A Quick and Dirty D3.js Tutorial
PPTX
ADO architecture of XML andd Windows form
PPT
joijoiiiiiiiiiiiiiiiiiiiiijoijiojoijoijoijoij
PDF
Data science at the command line
PPTX
D3 & MeteorJS
PPTX
D3 & MeteorJS
PPTX
Machine Learning with ML.NET and Azure - Andy Cross
PPT
data structures queue stack insert and delete time complexity
PPT
PPTX
How Clean is your Database? Data Scrubbing for all Skill Sets
PPT
Intro_2.ppt
PPT
Intro.ppt
PPT
Intro.ppt
PPT
Datastage Introduction To Data Warehousing
PPTX
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
PPTX
Doctrine Data migrations | May 2017
Advanced D3 Charting
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
Data Collection and Consumption
Dreamforce 2014 - Introduction to d3.js
A Quick and Dirty D3.js Tutorial
ADO architecture of XML andd Windows form
joijoiiiiiiiiiiiiiiiiiiiiijoijiojoijoijoijoij
Data science at the command line
D3 & MeteorJS
D3 & MeteorJS
Machine Learning with ML.NET and Azure - Andy Cross
data structures queue stack insert and delete time complexity
How Clean is your Database? Data Scrubbing for all Skill Sets
Intro_2.ppt
Intro.ppt
Intro.ppt
Datastage Introduction To Data Warehousing
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
Doctrine Data migrations | May 2017
Ad

More from Vinod Wilson (15)

PPTX
Representational state transfer (rest) architectural style1.1
PPTX
UI Design - Organizing the page
PPTX
Service oriented architecture introduction
PPTX
Togaf – models for phase A
PPTX
The components of togaf architecture
PPTX
Togaf – architecture development method (adm)
PPTX
Togaf 9 introduction
PPTX
Ssas mdx language
PPTX
Unit testing
PPTX
Event driven architecture
PPTX
Domain driven design simplified
PPTX
Data partitioning
PPTX
Developing saas application in azure
PPTX
Iot cloud service v2.0
PPTX
IoT mobile app device cloud identity and security architecture
Representational state transfer (rest) architectural style1.1
UI Design - Organizing the page
Service oriented architecture introduction
Togaf – models for phase A
The components of togaf architecture
Togaf – architecture development method (adm)
Togaf 9 introduction
Ssas mdx language
Unit testing
Event driven architecture
Domain driven design simplified
Data partitioning
Developing saas application in azure
Iot cloud service v2.0
IoT mobile app device cloud identity and security architecture

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
Modernizing your data center with Dell and AMD
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine learning based COVID-19 study performance prediction

D3 data visualization

  • 1. D3 Data Visualization Presented By Vinod – Architect – Crestron Electronics
  • 2. Visualizing Data Process Steps • Acquire • Obtain the data, whether from a file on a disk or a source over a network. • Parse • Provide some structure for the data's meaning, and order it into categories. • Filter • Remove all but the data of interest. • Mine • Apply methods from statistics or data mining as a way to discern patterns or place the data in mathematical context. • Represent • Choose a basic visual model, such as a bar graph, list, or tree. • Refine • Improve the basic representation to make it clearer and more visually engaging. • Interact • Add methods for manipulating the data or controlling what features are visible.
  • 3. Basic Building Blocks Adding Dom elements using D3
  • 4. Adding an SVG Element
  • 6. SelectAll/Data/Enter/Append • D3.js SelectAll Method • The D3.js SelectAll method uses CSS3 selectors to grab DOM elements. • But wait! The basic HTML page doesn't contain any <p> yet. What is it actually doing? • What it is doing is selecting all of the <p> available on the page. Which in this case is none. So it returns an empty selection. • Later use of .data(theData) and .enter( ) will allow us to bind the data to the empty selection.
  • 7. SelectAll/Data/Enter/Append • D3.js Data Operator • The data operator joins an array of data (which can be numbers, objects or other arrays) with the current selection. • The first element 1 is assigned to the first <p> element, the second to the second, so on and so forth. • But wait! The basic page doesn't contain any <p> yet. What is it actually doing?
  • 8. D3.js Virtual Selections (Thinking with Joins) • The D3.js Data Operator returns three virtual selections rather than just the regular one like other methods. • The three virtual selections are enter, update and exit. • The enter selection contains placeholders for any missing elements. • The update selection contains existing elements, bound to data. • Any remaining elements end up in the exit selection for removal.
  • 9. D3.js Virtual Selections (Thinking with Joins) • d3.select("body").selectAll("p") => was empty • The virtual enter selection now contains placeholders for our <p> elements.
  • 10. D3.js Enter Method • The D3.js Enter Method returns the virtual enter selection from the Data Operator. • This method only works on the Data Operator because the Data Operator is the only one that returns three virtual selections. • Only allows chaining of append, insert and select operators to be used on it
  • 11. D3.js Append Operator Revisited • var p = d3.select("body").selectAll("p") .data(theData) .enter() .append("p") For each placeholder element created in the previous step, a p element is inserted.
  • 13. D3.js Data Operator Revisited You can also see that the last (third) paragraph element has the __data__ property with a value of 3. Which came from our data set!
  • 14. Using Data Bound to DOM Elements
  • 15. Variables Available inside D3.js Operators • The are two other variables provided to us by D3.js - this and i. • this => refers to the current DOM element being evaluated. • i => refers to the index of the current HTML element being evaluated in the selected elements selection.
  • 16. Variables Available inside D3.js Operators
  • 17. Creating SVG Elements Based on Data
  • 18. Using the SVG Coordinate Space
  • 19. Data Structures D3.js Accepts • Loading External Data Resources • D3.js has built in functionality to load in the following types of external resources: • an XMLHttpRequest • a text file • a JSON blob • an HTML document fragment • an XML document fragment • a comma-separated values (CSV) file • a tab-separated values (TSV) file • The only thing to pay attention to is to make sure you construct an array out of the data.
  • 21. SVG Paths and D3.js • Accessor Function
  • 22. Different types of line interpolations
  • 23. Dynamic SVG Coordinate Space • Three SVG Rectangle Example • The SVG Viewport (container) has a width of 100 units and a height of 100 units.
  • 24. Dynamic SVG Coordinate Space • What if our purple rectangle x-coordinate, suddenly quadrupled from 40 to 160?
  • 26. D3.js Scales • what if our data attributes suddenly quadrupled. And then, quadrupled again. And then....etc. • This is a problem once the SVG Viewport/Coordinate Space is bigger than the browser window. • The purple rectangle would be so far to the right that it would be practically impossible to see.
  • 27. D3.js Scales • D3.js provides functions to perform data transformations. • These functions map an input domain to an output range.
  • 29. SVG Group Element and D3.js
  • 30. SVG Transformation and D3.js • Transformation • Translate • Scale • Rotate • Skew
  • 31. D3.js based reusable visualization frameworks • DC.JS => https://dc-js.github.io/dc.js/ • Dimple.js => http://dimplejs.org/ • Dance.js => https://github.com/michael/dance • NVD3 => http://nvd3.org/index.html • C3.js => http://c3js.org/