1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    How to Use scaleLinear Invert to Find a Data Point to Highlight on Mouse Move

    reactReact

    In this lesson we'll use scaleLinear to render a line, and additionally add data points using circle. Using onMouseMove we will call the invert function to do a reverse range to domain value interpolation. Then we will use Math.round and adjust the radius of the circle to highlight the selected point.