SlideShare a Scribd company logo
React, D3 andReact, D3 and
the dataviz ecosystemthe dataviz ecosystem
React, D3 and the dataviz ecosystem
OnlineOnline
@golodhros
Eventbrite Engineering Blog
React, D3 and the dataviz ecosystem
Next upNext up
D3
React
React + D3
Choosing an approach
React, D3 and the dataviz ecosystem
What is D3.js?What is D3.js?
Data-Driven Documents
Low level, General Purpose Visualization Library
Manipulates data based documents
Open web standards (SVG, HTML, CSS and now
Canvas)
Allows interactions with your graphs
How does it work?How does it work?
Loads data
Binds data to elements
Transforms those elements
Transitions between states
D3 DemoD3 Demo
D3 v4 UpdateD3 v4 Update
More modular
API improvements
Breaking changes
Highly adopted
D3 DATA JOINSD3 DATA JOINS
Transforms the DOM byTransforms the DOM by
selecting elements andselecting elements and
joining to datajoining to data
Data JoinData Join
Update, EnterUpdate, Enter
and Exit Patternand Exit Pattern
Resources
D3 PATTERNS ANDD3 PATTERNS AND
BEST PRACTICESBEST PRACTICES
Component PatternsComponent Patterns
The Reusable API
Object Oriented approach
d3-component
D3 TestingD3 Testing
D3 is hard
D3 LIBRARIESD3 LIBRARIES
http://plottablejs.org/
React, D3 and the dataviz ecosystem
http://c3js.org/
React, D3 and the dataviz ecosystem
https://vega.github.io/vega/
React, D3 and the dataviz ecosystem
https://d3fc.io/
React, D3 and the dataviz ecosystem
http://eventbrite.github.io/britecharts
React, D3 and the dataviz ecosystem
React, D3 and the dataviz ecosystem
Dynamic Child ComponentsDynamic Child Components
Unique 'key' to each child component rendered
More efficient rendering
Similar to D3's data joins
Reconciliation - React Docs
React FiberReact Fiber
Renderer and Reconciler are separated
New reconciliating algorithm
From batching DOM operations, now React can...
Prioritize tasks
Split into chunks and schedule
Parallelize operations
by Lin ClarkA Cartoon Intro to Fiber
React, D3 and the dataviz ecosystem
CommonalitiesCommonalities
Help us with the DOM
Love pure functions
ChallengesChallenges
D3 creates and transforms the DOM
React as well, and keeps track of it
Not meant to work together
REACT + D3REACT + D3
APPROACHESAPPROACHES
D3 within ReactD3 within React
React renders root svg element
D3 creates chart in componentDidUpdate
Block chart updates with shouldComponentUpdate
D3 within ReactD3 within React
PROS/CONSPROS/CONS
✓ Works fine
✓ Easiest when visualization is already
implemented
✗ Not idiomatic on React
✗ A bit nasty
React Faux DOMReact Faux DOM
It's a way to use existing D3 tooling
but render it efficiently through
React with the React ethos.
D3 within React the right way
React Faux DOMReact Faux DOM
PROS/CONSPROS/CONS
✓ Use all D3 APIs
✓ Good integration with already built D3
✓ Server Side Rendering
✗/✓ Need to use React Animations
✗ Less performant
✗ Limited to small/medium size dataviz
Lifecycle Methods MappingLifecycle Methods Mapping
Lightweight React Component Wrapper
D3-only file with create, update and unmount
methods
Integrating D3.js visualizations in a React app
Lifecycle Methods MappingLifecycle Methods Mapping
PROS/CONSPROS/CONS
✓ Easy to integrate D3 on
✓ Flexible, could encapsulate any chart
D3 for the Math,D3 for the Math,
React for the DOMReact for the DOM
D3 is used for math and formats
React rules the DOM
React-D3 Layouts
D3 sub-modules: Non-DOMD3 sub-modules: Non-DOM
RelatedRelated
Arrays (d3-array)
Chords (d3-chord)
Collections (d3-collection)
Colors (d3-color)
Dispatches (d3-dispatch)
Easings (d3-ease)
Forces (d3-force)
Number Formats (d3-format)
Hierarchies (d3-hierarchy)
D3 sub-modules: DOMD3 sub-modules: DOM
RelatedRelated
Selections (d3-selection)
Transitions (d3-transition)
Axes (d3-axis)
Zooming (d3-zoom)
Dragging (d3-drag)
Brushes (d3-brush)
Geographies (d3-geo)
Shapes (d3-shape)
D3 for the Math,D3 for the Math,
React for the DOMReact for the DOM
PROS/CONSPROS/CONS
✓ Consistent with the React way
✗ A lot of work upfront
✗ D3 Reimplementation of certain parts
✗ Limited to SVG rendering
Reference
REACT + D3REACT + D3
LIBRARIESLIBRARIES
Research InsightsResearch Insights
Non-maintained libraries
Not easy to keep up with D3 and React
D3 v4 cleaned up the field
React, D3 and the dataviz ecosystem
Linechart CodeLinechart Code
VictoryJSVictoryJS
Easy to get started
Zoom and Voronoi
React Native option
React, D3 and the dataviz ecosystem
Linechart CodeLinechart Code
RechartsRecharts
Really well tested
Charts plus legend, tooltip and brush
Great docs
React, D3 and the dataviz ecosystem
Linechart CodeLinechart Code
react-visreact-vis
react-motion animations
Sunburst and Sankey
Lack of tooltips
Demo: https://golodhros.github.io/talk-react-d3/
Code: https://github.com/Golodhros/talk-react-d3
http://tinyurl.com/d3-react-lib-comparative
CHOOSING ANCHOOSING AN
APPROACHAPPROACH
Choosing criteriaChoosing criteria
Well tested
D3 V4
Great docs
Long term investment?
Needs to be done ASAP?
Basic charts?
One-off work?
Highly customized?
Budget
Training
ConclusionsConclusions
D3 and React can work together
They both move fast
Hard to decide!
Thanks for listening!Thanks for listening!
Twitter:
Slides:
Demo:
@golodhros
http://golodhros.github.io/react-d3
https://github.com/Golodhros/talk-react-d3
RESOURCESRESOURCES
D3 ResourcesD3 Resources
Mike Bostock
D3 Reference
d3 slack channel
Data-Joins ResourcesData-Joins Resources
How Selections Work
Thinking with joins
General Update Pattern
Selection API Reference
React-D3 ResourcesReact-D3 Resources
Sam Jones - A Well Factored Pie Graph: React + D3
Adil Baaj - A starting point on using D3 with React
Mike Williamson - D3 and React 3 ways
Abhisek Jana - How to create reusable charts with
React
Collection of links/tools on how to integrate React &
D3
http://tinyurl.com/d3-react-lib-comparative

More Related Content

PDF
How Graph Databases started the Multi Model revolution
PDF
State of GeoServer 2.12
PPT
ENOVIA 3Dcom Architecture
PDF
H2O at Berlin R Meetup
PDF
Automatic and Interpretable Machine Learning with H2O and LIME
PPTX
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
PDF
Goodbye D3, Hello ECharts
PDF
React and d3
How Graph Databases started the Multi Model revolution
State of GeoServer 2.12
ENOVIA 3Dcom Architecture
H2O at Berlin R Meetup
Automatic and Interpretable Machine Learning with H2O and LIME
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
Goodbye D3, Hello ECharts
React and d3

Similar to React, D3 and the dataviz ecosystem (20)

PPTX
7 Redux challenges
PDF
New Developments in Spark
PDF
Works with persistent graphs using OrientDB
PDF
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
PDF
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
PPTX
Spsmi13 charts
PPTX
React.js at Cortex
PDF
Vue Js vs React: Which is the Best JS Technology in 2023
PPTX
Introduction to D3.js
PDF
Why Use React Js A Complete Guide (1).pdf
PPTX
CQRS: A More Effective Way of Writing the Same Applications
PPTX
Onion Architecture with S#arp
PDF
D3 Basic Tutorial
PDF
Mastering-Reactjs-Your-Path-to-Web-Development.pdf
PDF
React ChartJS
PDF
Angular vs React vs Vue – The Right Framework For You.pdf
PDF
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
PDF
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
PDF
Demystifying large PointCloud datasets for simple integration on complex proj...
PDF
React Native +Redux + ES6 (Updated)
7 Redux challenges
New Developments in Spark
Works with persistent graphs using OrientDB
The Modern Data Team for the Modern Data Stack: dbt and the Role of the Analy...
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Spsmi13 charts
React.js at Cortex
Vue Js vs React: Which is the Best JS Technology in 2023
Introduction to D3.js
Why Use React Js A Complete Guide (1).pdf
CQRS: A More Effective Way of Writing the Same Applications
Onion Architecture with S#arp
D3 Basic Tutorial
Mastering-Reactjs-Your-Path-to-Web-Development.pdf
React ChartJS
Angular vs React vs Vue – The Right Framework For You.pdf
'React+d3=LOVE' by Illia Olenchenko at OdessaJS'2020
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
Demystifying large PointCloud datasets for simple integration on complex proj...
React Native +Redux + ES6 (Updated)
Ad

Recently uploaded (20)

PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
medical staffing services at VALiNTRY
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
System and Network Administraation Chapter 3
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
How to Choose the Right IT Partner for Your Business in Malaysia
Operating system designcfffgfgggggggvggggggggg
Upgrade and Innovation Strategies for SAP ERP Customers
medical staffing services at VALiNTRY
Digital Systems & Binary Numbers (comprehensive )
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Designing Intelligence for the Shop Floor.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
How to Migrate SBCGlobal Email to Yahoo Easily
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PTS Company Brochure 2025 (1).pdf.......
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
System and Network Administraation Chapter 3
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
Ad

React, D3 and the dataviz ecosystem