liveBook · Manning

React

As explained in D3.js in Action, Third Edition

React is a JavaScript library for building user interfaces from composable components.

React is a JavaScript library for building user interfaces from composable components. It supports single-page applications, where one loaded HTML file updates dynamically, and works with D3 in interactive visualization projects. section 8.0

A practical D3 integration keeps responsibilities clear:

  • Let React render the component structure, then pass data and shared scales through props. section 8.0 section 8.5.1
  • Create a ref with useRef(), attach it to the element D3 should control, and select its current DOM node. section 8.5.1
  • Run D3 operations inside useEffect(), where the referenced element is up to date. section 8.5.1

Interactive framework dashboard

A React application combines a scatterplot of framework retention versus users with a bar chart of framework awareness. The scatterplot receives experience data and a D3 ordinal color scale as props, while D3 builds axes and marks inside the referenced group. section 8.0

How D3.js in Action, Third Edition covers it

How deep it goes
Explains component integration through useRef(), useEffect(), props, scales, axes, and a working scatterplot, without detailing React internals.
Examples
Uses a frontend-framework dashboard, a retention-versus-usage scatterplot, a framework-awareness bar chart, and a D3 color scale.
What you can do after
Builds React visualizations that pass data through props and let D3 control selected DOM regions through refs and effects.
How it connects
Connects React to D3, JavaScript frameworks, hooks, refs, components, props, and single-page applications.

Also explained in

Compare how 5 books explain React →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.