SlideShare a Scribd company logo
Data
Visualizations
with D3.js
Charlotte Front-End
Developers 

Thursday, July 27, 2017

6:30 PM to 8:30 PM

Brian Greig
Who am I
• Brian Greig

• Third Party Software Engineer
at BoA

• 13 years of web development
and data analysis

• Recent Charlotte transpant

• Requisite Social Media

@IgnoreIntuition

github.com/ignoreintuition/

linkedin.com/in/bgreig/
Data Visualization with D3.js
• Data Visualization concepts

• Accessing data via API

• Basic components

• Binding data

• Building visualizations

• Making your visuals interactive
Data Visualization
• What is Data Visualization?

• What makes a Data Visualization good or bad?
Subjective? Objective?

• Does your chart tell a story? Does it give insight into the
underlying data?

• Why D3?
Data Visualization
http://graphics.wsj.com/elections/2016/field-guide-red-blue-america/
https://tctechcrunch2011.files.wordpress.com/2014/02/power-map.png?w=738
Data Visualization
Dimension Determine how the data in your visualization is grouped
Measure Calculations used in visuzalitions.  Composed of aggregations.
Hierarchy
Data fields expanding into larger data sets and groups of data
sets, with each subsequently larger data set of a higher rank
than the set that came before it.
Detail Dimension Provides descriptive data about a dimension object 
Schema Organization of data (blueprint)
Subset Set of which all the elements are contained in another set.
Key Terms
Accessing Data Via API
• Spinning up an API Server

• Using public APIs

• Preprocessing data on your server and exposing it via
your own API.
Accessing Data Via API
• XMLHttpRequest

• jQuery

• d3.request - make an asynchronous request. 

• d3.queue - manage the concurrent evaluation of
asynchronous tasks.
Basic Components
Preparing your data for reporting

• Server-side vs client-side

• Pre-aggregation / real-time aggregation

• Obtaining your data

• Aggregating your data (d3.nest)

• Filtering your data (array.prototype.filter)

• Sorting your data (array.prototype.sort)
Basic Components
Structuring your application

• init: This is where you create your scales, ranges, domains, as well
as binding your data to the DOM element that is going to use it. 

• enter: This is the initial, static visualization.  here you will assign
attributes and values to the different components of your element. 

• update: Here you will update any of the dynamic attributes of your
graph if the user changes the context or scope of your data. 

• exit: Any cleanup.
Basic Components
Your basic D3 Starter Kit

• Define the dataset [1]

• Create a container [3-5]

• Bind your data [8]

• Append visual
components & set
attributes [11-18]

• Clean up [24]
Binding Data
• Access data via
API

• Load data
synchronously

• Await runs on
success
Binding Data
• Aggregate as much
as possible on the
server

• Use rollup to further
aggregate data on
the front-end

• Use array functions
(filter, sort) to create
subsets
The commonality between science and art is in trying to see profoundly
- to develop strategies of seeing and showing. - Edward Tufte
Build Visualizations
Build Visualizations
_init()

• set metric

• set scale

• scaleOrdinal

• scaleLinear

• set domains

• set axis

• bind data
Build Visualizations
_enter()

• append the
elements to the
SVG

• set attributes

• static 

• as a function
of the data

• draw axis
Build Visualizations
Giving your data context

• Titles: Always, ALWAYS, include titles. Just enough to give
proper context

• Tooltips. Allowing your users to highlight the components of
your graph reduces clutter

• Axis. Terse and explanatory

• Colors. Varied and considerate of ADA

• Legends. Only if they provide value
Making it Interactive
Leverage the DOM
API

• Event listeners

• Array prototype
functions
Making it Interactive
_update()

• runs when the
graph needs to be
redrawn

• transitions

• update attributes

• Attributes that
don’t need to be
recalculated should
be left alone
Questions
Appendix
• D3 API Reference: https://d3js.org/

• JSON Placeholder: https://jsonplaceholder.typicode.com/

• Github Repo: https://github.com/ignoreintuition/
dataviz_boilerplate 

• 20 Years of Games: https://www.kaggle.com/egrinstein/
20-years-of-games

More Related Content

PDF
Introduction to einstein analytics
PDF
Automating Regional Data Integration with Python & ArcPy (Heather Widlund)
PPTX
Dynamic Data Visualization with Tableau
PPTX
Future.ready().watson dataplatform 01
PDF
Data migration services
PPTX
Introducing Entity Framework Core
PPTX
Faster is the New Fast - with Mi Express You can Analyze Location Data Faster
PDF
Creating Data Visualisations for the Web
Introduction to einstein analytics
Automating Regional Data Integration with Python & ArcPy (Heather Widlund)
Dynamic Data Visualization with Tableau
Future.ready().watson dataplatform 01
Data migration services
Introducing Entity Framework Core
Faster is the New Fast - with Mi Express You can Analyze Location Data Faster
Creating Data Visualisations for the Web

What's hot (20)

DOCX
What is Revit Structure - Dhyan Academy
PDF
Interactive Visualization of Software Components with Virtual Reality Headsets
PPTX
JoTechies -Azure Machine Learning
PPTX
Aws community day pune 2020 v3
PPTX
A Big Data Analysis Framework for Model-Based Web User Behavior Analytics
PDF
Pitkin Maps & More (Mary Lakner)
PPTX
PPT
L21 sharing data using data synchronization
PPTX
DB Generator 2016
PDF
Let's analyze how world reacts to road traffic by sentiment analysis final
PDF
Mind the Gap - Data Science Meets Software Engineering
PDF
This Week in Neo4j - 24th November 2018
PPTX
Network analysis on HR strategy
PPTX
Edge processing and High Level Visualization versus Cloud computing and Kibana
PDF
Data Visualization With Tableau | Edureka
PPTX
Internship Presentation
PPTX
Introducing greenspaceLive and gTools
PDF
Relevant Search Leveraging Knowledge Graphs with Neo4j
PPT
GIS As-Builts - How & Why
PPT
business intelligence
What is Revit Structure - Dhyan Academy
Interactive Visualization of Software Components with Virtual Reality Headsets
JoTechies -Azure Machine Learning
Aws community day pune 2020 v3
A Big Data Analysis Framework for Model-Based Web User Behavior Analytics
Pitkin Maps & More (Mary Lakner)
L21 sharing data using data synchronization
DB Generator 2016
Let's analyze how world reacts to road traffic by sentiment analysis final
Mind the Gap - Data Science Meets Software Engineering
This Week in Neo4j - 24th November 2018
Network analysis on HR strategy
Edge processing and High Level Visualization versus Cloud computing and Kibana
Data Visualization With Tableau | Edureka
Internship Presentation
Introducing greenspaceLive and gTools
Relevant Search Leveraging Knowledge Graphs with Neo4j
GIS As-Builts - How & Why
business intelligence
Ad

Similar to Data Visualizations with D3.js (20)

PDF
Data Collection and Consumption
PPTX
20180701 - 1st Meeting - Data Science Orientation
PDF
Power BI vs Tableau vs Cognos: A Data Analytics Research
PDF
Data visualization in a Nutshell
PPTX
Interactive Data Visualization Tools
PPTX
chapter 6 data visualization ppt.pptx
PDF
Visualize PeopleSoft Data with Pivot Grids
PPTX
[Seminar] 200605 seunghyeong choe
PPTX
Extending Power BI with your own custom visual
PPTX
CI/CD for a Data Platform
PPTX
Graph all the things - PRathle
PPTX
Visualising montioring and evaluation data
PDF
Introduction to Advanced Analytics with SharePoint Composites
PPTX
SPS Vancouver 2018 - What is CDM and CDS
PDF
Introduction to Advanced Analytics with SharePoint Composites
PDF
Big query
PPTX
Data visualization-tools
PDF
Denodo DataFest 2016: Comparing and Contrasting Data Virtualization With Data...
PDF
How Celtra Optimizes its Advertising Platform with Databricks
PDF
Power BI Updates - ____November 2023.pdf
Data Collection and Consumption
20180701 - 1st Meeting - Data Science Orientation
Power BI vs Tableau vs Cognos: A Data Analytics Research
Data visualization in a Nutshell
Interactive Data Visualization Tools
chapter 6 data visualization ppt.pptx
Visualize PeopleSoft Data with Pivot Grids
[Seminar] 200605 seunghyeong choe
Extending Power BI with your own custom visual
CI/CD for a Data Platform
Graph all the things - PRathle
Visualising montioring and evaluation data
Introduction to Advanced Analytics with SharePoint Composites
SPS Vancouver 2018 - What is CDM and CDS
Introduction to Advanced Analytics with SharePoint Composites
Big query
Data visualization-tools
Denodo DataFest 2016: Comparing and Contrasting Data Virtualization With Data...
How Celtra Optimizes its Advertising Platform with Databricks
Power BI Updates - ____November 2023.pdf
Ad

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Pharma ospi slides which help in ospi learning
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Basic Mud Logging Guide for educational purpose
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Pre independence Education in Inndia.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pharma ospi slides which help in ospi learning
Abdominal Access Techniques with Prof. Dr. R K Mishra
O7-L3 Supply Chain Operations - ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Final Presentation General Medicine 03-08-2024.pptx
Computing-Curriculum for Schools in Ghana
Basic Mud Logging Guide for educational purpose
VCE English Exam - Section C Student Revision Booklet
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pre independence Education in Inndia.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Microbial disease of the cardiovascular and lymphatic systems
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
102 student loan defaulters named and shamed – Is someone you know on the list?
Insiders guide to clinical Medicine.pdf

Data Visualizations with D3.js

  • 1. Data Visualizations with D3.js Charlotte Front-End Developers Thursday, July 27, 2017 6:30 PM to 8:30 PM Brian Greig
  • 2. Who am I • Brian Greig • Third Party Software Engineer at BoA • 13 years of web development and data analysis • Recent Charlotte transpant • Requisite Social Media
 @IgnoreIntuition
 github.com/ignoreintuition/
 linkedin.com/in/bgreig/
  • 3. Data Visualization with D3.js • Data Visualization concepts • Accessing data via API • Basic components • Binding data • Building visualizations • Making your visuals interactive
  • 4. Data Visualization • What is Data Visualization? • What makes a Data Visualization good or bad? Subjective? Objective? • Does your chart tell a story? Does it give insight into the underlying data? • Why D3?
  • 6. Data Visualization Dimension Determine how the data in your visualization is grouped Measure Calculations used in visuzalitions.  Composed of aggregations. Hierarchy Data fields expanding into larger data sets and groups of data sets, with each subsequently larger data set of a higher rank than the set that came before it. Detail Dimension Provides descriptive data about a dimension object  Schema Organization of data (blueprint) Subset Set of which all the elements are contained in another set. Key Terms
  • 7. Accessing Data Via API • Spinning up an API Server • Using public APIs • Preprocessing data on your server and exposing it via your own API.
  • 8. Accessing Data Via API • XMLHttpRequest • jQuery • d3.request - make an asynchronous request. • d3.queue - manage the concurrent evaluation of asynchronous tasks.
  • 9. Basic Components Preparing your data for reporting • Server-side vs client-side • Pre-aggregation / real-time aggregation • Obtaining your data • Aggregating your data (d3.nest) • Filtering your data (array.prototype.filter) • Sorting your data (array.prototype.sort)
  • 10. Basic Components Structuring your application • init: This is where you create your scales, ranges, domains, as well as binding your data to the DOM element that is going to use it. • enter: This is the initial, static visualization.  here you will assign attributes and values to the different components of your element. • update: Here you will update any of the dynamic attributes of your graph if the user changes the context or scope of your data. • exit: Any cleanup.
  • 11. Basic Components Your basic D3 Starter Kit • Define the dataset [1] • Create a container [3-5] • Bind your data [8] • Append visual components & set attributes [11-18] • Clean up [24]
  • 12. Binding Data • Access data via API • Load data synchronously • Await runs on success
  • 13. Binding Data • Aggregate as much as possible on the server • Use rollup to further aggregate data on the front-end • Use array functions (filter, sort) to create subsets
  • 14. The commonality between science and art is in trying to see profoundly - to develop strategies of seeing and showing. - Edward Tufte Build Visualizations
  • 15. Build Visualizations _init() • set metric • set scale • scaleOrdinal • scaleLinear • set domains • set axis • bind data
  • 16. Build Visualizations _enter() • append the elements to the SVG • set attributes • static • as a function of the data • draw axis
  • 17. Build Visualizations Giving your data context • Titles: Always, ALWAYS, include titles. Just enough to give proper context • Tooltips. Allowing your users to highlight the components of your graph reduces clutter • Axis. Terse and explanatory • Colors. Varied and considerate of ADA • Legends. Only if they provide value
  • 18. Making it Interactive Leverage the DOM API • Event listeners • Array prototype functions
  • 19. Making it Interactive _update() • runs when the graph needs to be redrawn • transitions • update attributes • Attributes that don’t need to be recalculated should be left alone
  • 21. Appendix • D3 API Reference: https://d3js.org/ • JSON Placeholder: https://jsonplaceholder.typicode.com/ • Github Repo: https://github.com/ignoreintuition/ dataviz_boilerplate • 20 Years of Games: https://www.kaggle.com/egrinstein/ 20-years-of-games