This video is available to students only

Creating our scales in React

Next, we need to create our scales. We also create scaled accessor functions to pass to the children of our Timeline, so they don't need to know about our scales.

Creating our scales#

Next up, we need to create the scales to convert from the data domain to the pixel domain. Let's pop back to src/Timeline.jsx.

We'll create scales just like we did in Module 1 — we'll need an time-based xScale and a linear yScale.


This page is a preview of Fullstack D3 Masterclass

No discussions yet