Stop copy pasting D3 examples,
create data visualizations of your own

Learn how to build scalable dataviz components your whole team can understand with React for Data Visualization.

So you want to build a beautiful data viz. You've got data burning a hole through your pocket, an idea for a juicy story, and your boss or client are waiting for results.

You want something that looks great, works in the browser, performs on mobile, lets users interact with their data, syncs across an entire dashboard, and works as building blocks for future projects.

Cool ... now what?

I remember building my first data visualization back in 2012. Visualized my coding habits from GitHub data.

I was so proud! Only took me a week. 💪

"I've tried D3 in the past, found it powerful but a bit confusing to use"

Dynamic data visualization for the web is a pain in the ass you see. Harder than it looks.

Yeah sure anyone can build a chart in google docs but that's not what you're after is it? You can't build a product on top of google sheets. You definitely can't feed in dynamic data from an API, personalized to the user, and let them navigate and explore.

You've heard people build these amazing things with D3. The New York Times uses it, The Guardian does, so do Netflix, Uber, 23andMe, Visa, Walmart, and many others. I know because they've been to my workshops ;)

You hunt the web for examples and omaigod what is this!? How the hell is D3 doing that? 😳

That's a bar chart by the way. You'd never guess just looking at the code. I've been doing this for years and I still have to simulate D3 examples in my mind to figure out how they work.

You decide that's too much and look for a library. Something easy you can use to finish real quick.

You find a bunch of libraries built on top of D3. Some even combine React and D3. Perfect for any modern web project!

You cobble something together and call it a day. Job well done.

Libraries are hard to customize

Your boss takes one look and says "Ok but can you make it follow our style guide?"

Errr ...

Okay okay, some CSS, a little trickery, tweak the arguments and you got dis. Crisis averted!

"I don't like how this animation looks"

"Can we tweak that margin?"

"Make those bars taller"

"Add a line chart and I want tooltips to show up on all 5 charts when I mouse over the same data point"

Now you're in trouble buster.

You used a library and those always break down when you start customizing stuff. At some point you spend more time fighting the library than building your data visualization.

Time to learn D3.

"There are way too many shitty resources on D3 floating around on the interwebs, and frankly, the D3 docs are shit too because they're WAY TOO COMPLICATED AND VERBOSE for someone that just wants to understand how it works and get shit done."

You can do what everyone else does: Copy paste some examples that look like what you're building, make some tweaks, and hope for the best.

You're not proud of your code and you're not quite sure how it works, but it works and that's what matters. Right?

Yep that works until you have to change something. Or explain how it works to another engineer on your team so they can fix a bug.

God forbid you come back 6 months later looking to fix a thing or add a feature. Time to re-study all of that code and figure out how it works.

ugh

94+ Full HD videos

Watching code appear before your eyes makes it easier to understand.

"without it I'm stuck using stack overflow in a disjointed, incorrect mess"

You can avoid all that and learn how to build scalable and reusable dataviz components your whole team and future you can understand with React for Data Visualization.

Get the confidence you need to excel and build anything you can imagine. 💪

React is the biggest revolution in JavaScript programming since jQuery hit the scene 10 years ago, and D3 is unlike anything you've seen before.

The problem comes from how most of us first learn to code. "It's like a cooking recipe", teachers will say.

Take a bell pepper and cut it up. Then sprinkle some salt and pepper, add olive oil, and voila: you have a refreshing salad. A very simple salad with a single ingredient, but a salad nonetheless. You can follow along and eventually you will understand what the code does.

That's imperative programming. It reads as a series of steps. How to do something.

React and D3 are declarative. You don't write How you want your code to work, you write What you want to achieve. Your bell pepper salad recipe looks more like this:


  <Salad>
    <Oil />
    <BellPepper cut salted />
  </Salad>
  

You look at that and you know it's a salad. It involves oil and bell peppers. You don't have to read the steps to know the result. The recipe declares what it's making.

Declarative code makes your project cleaner and easier to maintain. Means more time creating value for your users and clients.

But learning how to think declaratively is hard. It starts like voodoo magic. We've all been there. It still hurts my brain sometimes.

That's why React for Data Visualization starts with small building blocks then builds up to entire dashboards. Learn the basics in about an hour, then dive as deep as you want

Why use React and D3 for
data visualization

I believe React combined with D3 is the best thing that's ever happened to data visualization on the web.

React's approach to components makes your code more reusable, its advanced algorithms make it fast, and D3 has the best tools for dataviz. Together they represent two of the most popular JavaScript libraries on the web.

Watch some of my conference talks for a sneak peek 👇

The talk shows a proof of concept approach to making fancy animations with React and d3js - a Space Invaders game. I explain the basic approach, where I got the idea, and show off some code.

This talk is more hands on. I show how the animated alphabet, particle generator, and talk about the benefits of componentization when it comes to building modern data visualization.

You don't have to watch the whole talk, it's all in React for Data Visualization.

A Learn with Jason episode where in just an hour we built an animated scatterplot from scratch and proved React-based D3 visualization works great with Gatsby. The dataviz rendered statically at build time.

React for Data Visualization is designed for busy people like you

React for Data Visualization gives you a quick overview of the basics to get you started, followed by a deep dive that solidifies your knowledge through varied projects and examples. Build working code that you can show off to your friends, boss, and coworkers.

Learn the basics with interactive examples right in your browser — no need to install anything. Forget about Npm and Webpack and Babel and Node. Just React and D3.

Dive into complex projects that teach you how it all fits together. Build interactive visualizations, create animations, and build fast performance with canvas. Learn everything there is to know about building beautiful apps with React and D3.

From the very basics of React and D3, to state handling with Redux and MobX, React alternatives like Preact and Inferno.

And the best part?

It's all cut into bite sized pieces. Whether you've got 5 minutes or an hour, you can get through this course. That's a promise.

Start with the building blocks

1.) Start with the basics. Right in your browser.

2.) Learn about blackbox rendering with a reusable axis component. Teaches you all about giving up control, using higher order componnents, and more. You can use this approach to render *anything* inside your React app. Even Vue.

3.) Learn full integration rendering with a scatterplot. Use the axis from before, add a bunch of data, then go as far as usinng render props to make your scatterplot shine.

4.) Both times youre learning how to make your components reusable. Plug-and-play buildign blocks for your team.

5.) Jump into animation with game loops where you learn about havign full control, how to think in frames andn movement. Youll be suprrised how powerful this can be.

6.) When full animation is too much, youll need transitions. Learn about keyframes and easing functions and makign your animation look antural and smooth.

React for Data Visualization builds on practical examples

A piechart transitions to a barchart

Shows you how to use hybrid animation for data-driven effects. Even transitioning between different visualization types.

An interactive choropleth map

Shows you how to work with topographical data, draw maps, and census regions. We implement zooming and map exploration.

An interactive histogram

Teaches you some of D3's statistical functions, and the basics of drawing charts. Drawing shapes, adding axes, parsing data ...

Interactive dashboard

Together they form an interactive dashboard where multiple charts share data, react to common controls, and act together to give users a full picture.

A swipe transition

A swipe transition teaches you about building transition-based animation. Flip a boolean, see complex animation.

An animated alphabet

An animated alphabet teaches you about creating enter/update/exit transitions. Animate elements coming in and out of your data visualization.

A particle generator

A particle generator teaches you the basics of using Redux for state management, pushing your browser to the limits, and animating tens of thousands of elements.

An interactive billiards game

An interactive billiards game teaches you about rendering graphical React components onto HTML5 canvas, making them interactive, and using MobX for state handling.

A dancing pythagorean tree fractal

A dancing pythagorean tree fractal teaches you about component recursion. We use it to compare differences between React, Preact, and Inferno.

Table of Contents

Introduction

Hello new friend 👋 (6:08)

What you need to know (2:16)

How to approach React for Dataviz(3: 16)

Why React and D3(0: 22)

Buzzword soup explained

JSX

What you'll build (2:30)

A quick intro to D3

Why D3 (1:03)

3 key insights to learn D3 from scratch(2: 23)

Data vs.DOM manipulation(6: 07)

Scales(4: 12)

D3 layouts(1: 41)

Recap(1: 49)

How React makes D3 easier

React + D3 = ❤️ (4:53)

What about existing libraries? (2:13)

Victory.js(1: 04)

Recharts(0: 54)

Nivo(1: 11)

VX(1: 07)

When you shouldn't use a library (1:14)

Quickly integrate any D3 code in your React project with Blackbox Components

The idea behind blackbox components (0:57)

A quick blackbox example - a D3 axis (3:36)

A React + D3 axis(5: 19)

A D3 blackbox higher order component - HOC(2: 26)

D3blackbox magic trick - render anything in 30 seconds(5: 11)

Build scalable dataviz components with full integration

The approach (1:52)

When props don't change - a scatterplot (9:26)

A scatterplot When props do change(6: 36)

Making your components more flexible with render props(6: 08)

You're awesome

💪 (0:39)

A note about state and app structure

Handling state in your React app (0:48)

Basic architecture we'll use (2:11)

What about React Context? Redux? MobX?

How to structure your app

Congratz!

Set up a local environment with create-react-app

Local environment setup

Start with create-react-app (1:10)

What you get

Install extra dependencies(0: 43)

176,113 tech salaries visualized – a dataviz dashboard

176,113 tech salaries visualized (2:54)

Show a Preloader

Show a Preloader (1:11)

Step1: get image (0:43)

Step 2: make component (2:01)

Step 3: Update App (1:20)

Step 4: Load styles (1:32)

Load and parse your data

Asynchronously load data (0:37)

Step 0: Get data (0:37)

Step 1: Prep App.js (2:13)

Step 2: Prep data parsing functions (1:46)

Step 3: Load the datasets (2:02)

Step 4: Tie datasets together (1:11)

Render a choropleth map of the US

Render a choropleth map of the US (0:11)

Step 1: Prep App.js (3:54)

Step 2: CountyMap index.js (0:44)

Step 3: CountyMap CountyMap.js (11:56)

Step 4: CountyMap County.js (2:03)

A map appears 🗺 (1:26)

Render a Histogram of salaries

Render a Histogram of salaries (0:23)

Step 1: Prep App.js (2:24)

Step 2: CSS changes (0:27)

Step 3: Histogram component (11:39)

Step 4: HistogramBar (sub)component (4:00)

Step 5: Add an axis (4:04)

Make it understandable with meta info

Add meta info (0:37)

Dynamic title (9:25)

Dynamic description (2:58)

Overlay a median household line (7:47)

Add user controls for exploration

Add user controls for data slicing and dicing (1:10)

Step 1: Update App.js (3:49)

Step 2: Build Controls component (4:26)

Step 3: Build ControlRow component (3:30)

Step 4: Build Toggle component (2:39)

Step 5: Add US state and Job Title filters (3:12)

Make it work in the real world

Add rudimentary routing (1:51)

Prep your app for launch

Twitter and Facebook cards and SEO

Use full dataset (3:05)

Launch! 🚀

Animation

Intro (0:51)

Using a game loop for rich animation (1:15)

A bouncy ball game loop animation example

Begin bouncy ball (0:19)

Step 1: stub out App and Ball (0:15)

Stub out BouncingBall (1:11)

Step 3: Rendering (0:20)

Step 4: The Game Loop (3:09)

Step 5: Correcting for time and frame drops (1:18)

Game loop recap (0:14)

Use transitions for simple animation

Transition basics (0:27)

Build a swipe transition component

A swipe transition component (0:47)

App.js (0:20)

Ball.js (0:20)

Ball.js state transition (6:31)

Enter-update-exit animation

Enter-update-exit animation intro

Build a declarative animated alphabet

Project setup

The Alphabet component

Declarative render for enter-exit transitions

TransitionGroup

The Letter component

onEnter

onExit

componentDidUpdate

render

That's it 👍🏼

Key transition takeaways

Animating with React, Redux, and D3

Redux animation intro

Here's how it works

Some basic terminology

3 presentation components

6 Redux Actions

1 Container component

2 Redux Reducers

What we learned

Speed optimizations

Speed intro

Using canvas

Intro

Why canvas

Isn't canvas too hard?

The trouble with Canvas

Declarative Canvas with Konva and react-konva

Smooth animation with 20,000+ elements

A particle generator pushed to the max

Prepare canvas layer

Use sprites for max redraw speed

But why so many elements?

Build a small interactive canvas game

Simulating billiards with MobX, Canvas, and Konva

Decorators

Part 0: Some setup

A quick MobX primer

Part 1: Rendering our marbles

Part 2: Building the physics

Collision detection

Speedy React Alternatives

Using a React alternative like Preact or Inferno

Stress test your framework with a recursive fractal

Stress testing Preact and Inferno

Refactor your components with React Hooks

An intro to hooks (2:10)

useState, useEffect, and useContext (1:51)

useMemo is your new best friend (0:58)

my useD3 hook (0:34)

Refactoring our big example to hooks (30:09)

Powerful animation with transitions and game loops combined

Merging transitions and game loops (2:53)

Understanding custom tweens (2:38)

Custom tweens in practice (8:42)

Use tweens to drive state

hybrid animation (6:42)

You finished! 🚀

You're the best

Cookbook: Various visualizations and how to build them

Intro to cookbook area

Christmas trees sold in USA - an emoji barchart

Money spent on Christmas - a line chart

Christmas movies at the box office - horizontal bar chart

What Americans want for Christmas - horizontal stack chart

Christmas carols and their words - a word cloud

Will you buy a christmas tree? - a pie chart

What goes in Christmas stockings - a piechart with tooltips

When Americans buy Christmas presents - a curved line chart

When people buy candy - animated barchart with easing

A responsive stack chart of smartphone market share

A Sankey diagram

Try Uber's WebGL dataviz library

Real-time WebGL map of all airplanes in the world

A compound arc chart

$
Basics course
A quick intro to D3
How React makes D3 easier
Quick React+D3 integration
Scalable dataviz components with full integration
Downloadable PDF/epub/mobi
3 extra projects you can use as a cookbook
​Monthly livestream of a real dataviz project

Money-back guarantee
Yours forever
$

FULL COURSE

+ consultation

30min consultation where we discuss your usecase
A quick intro to D3
How React makes D3 easier
Quick React+D3 integration
Scalable dataviz components with full integration
Detailed walkthrough of a large dataviz dashboard project
Game loop animation
Animating with transitions
Hybrid animation for complex interactions
Enter/update/exit animation
Redux and MobX basics
Rendering to Canvas
Refactoring to React Hooks
Downloadable PDF/epub/mobi
14 extra projects you can use as a cookbook
​Monthly livestream of a real dataviz project

Money-back guarantee
Yours forever
$
FULL COURSE
A quick intro to D3
How React makes D3 easier
Quick React+D3 integration
Scalable dataviz components with full integration
Detailed walkthrough of a large dataviz dashboard project
Game loop animation
Animating with transitions
Hybrid animation for complex interactions
Enter/update/exit animation
Redux and MobX basics
Rendering to Canvas
Refactoring to React Hooks
Downloadable PDF/epub/mobi
14 extra projects you can use as a cookbook
​Monthly livestream of a real dataviz project

Money-back guarantee
Yours forever

Try a free chapter

See what React for Data Visualization is like and learn some basics.

Free Chapter 👾 and Email Crash Course 💌

Leave your email
get a free sample of React for Data Visualization and an email crash course.

    No spam. Unsubscribe any time.

    Powered By ConvertKit

    About the Author

    Hi, I’m Swizec Teller. I help coders become software engineers.

    Story time 👇

    React+D3 started as a bet in April 2015. A friend wanted to learn React and challenged me to publish a book. A month later React+D3 launched with 79 pages of hard earned knowledge.

    In April 2016 it became React+D3 ES6. 117 pages and growing beyond a single big project it was a huge success. I kept going, started live streaming, and publishing videos on YouTube.

    In 2017, after 10 months of work, React + D3v4 became the best book I'd ever written. At 249 pages, many examples, and code to play with it was designed like a step-by-step course. But I felt something was missing.

    So in late 2018 I rebuilt the entire thing as React for Data Visualization — a proper video course. Designed for busy people with real lives like you. Over 8 hours of video material, split into chunks no longer than 5 minutes, a bunch of new chapters, and techniques I discovered along the way.

    React for Data Visualization is the best way to learn how to build scalable dataviz components your whole team can understand.

    Some of my work has been featured in 👇

    94+ Full HD videos

    Watching code appear before your eyes makes it easier to understand.

    $
    Basics course
    A quick intro to D3
    How React makes D3 easier
    Quick React+D3 integration
    Scalable dataviz components with full integration
    Downloadable PDF/epub/mobi
    3 extra projects you can use as a cookbook
    ​Monthly livestream of a real dataviz project

    Money-back guarantee
    Yours forever
    $

    FULL COURSE

    + consultation

    30min consultation where we discuss your usecase
    A quick intro to D3
    How React makes D3 easier
    Quick React+D3 integration
    Scalable dataviz components with full integration
    Detailed walkthrough of a large dataviz dashboard project
    Game loop animation
    Animating with transitions
    Hybrid animation for complex interactions
    Enter/update/exit animation
    Redux and MobX basics
    Rendering to Canvas
    Refactoring to React Hooks
    Downloadable PDF/epub/mobi
    14 extra projects you can use as a cookbook
    ​Monthly livestream of a real dataviz project

    Money-back guarantee
    Yours forever
    $
    FULL COURSE
    A quick intro to D3
    How React makes D3 easier
    Quick React+D3 integration
    Scalable dataviz components with full integration
    Detailed walkthrough of a large dataviz dashboard project
    Game loop animation
    Animating with transitions
    Hybrid animation for complex interactions
    Enter/update/exit animation
    Redux and MobX basics
    Rendering to Canvas
    Refactoring to React Hooks
    Downloadable PDF/epub/mobi
    14 extra projects you can use as a cookbook
    ​Monthly livestream of a real dataviz project

    Money-back guarantee
    Yours forever

    FAQ

    IS REACT FOR DATA VISUALIZATION FOR ME?
    WHICH PACKAGE SHOULD I CHOOSE?
    coming soon
    I DON'T LIKE REACT. IS REACT FOR DATA VISUALIZATION STILL USEFUL?

    Yes! You can apply the core ideas behind React for Data Visualization to any modern framework. Angular, Vue, or anything else that aims to separate business and rendering logic with a declarative approach.

    WHAT IF I HATE YOUR COURSE?

    Send me an email and I'll click the magic refund button. You even get to keep the downloadable resources.

    How does this compare to React + D3v4?

    A lot of the underlying principles are still the same. I've updated a lot of the code itself so it fits modern React and D3 versions. There's a whole new chapter on React Hooks. Also a chapter on existing React+D3 libraries to help you decide if you'd prefer using a library instead of rolling your own.

    I also discovered a new hybrid approach to transitions/animation that I'm adding a chapter for this week. And I plan to add a chapter on React Native and WebGL. There's also a new section with 14 cookbook-like projects you can explore.

    Oh and most everything comes with video now. About 9 hours of video content for the core content and another 10 or so for the cookbook projects.