Command Palette

Search for a command to run...

Hectal
Phase 3: Charts by Hand, No Library
Data Visualization · Exercise 3 of 5 PreviousNext
Beginner

Write a linear scale

Write scale(v) so that 0 rides gives y = 160 and 4,000 rides gives y = 0 (the y axis is flipped). 2,000 should give 80.

Use y = m·x + b. The page logs three test values.

What Check tests

  1. scale(0) is 160
  2. scale(4000) is 0
  3. scale(2000) is 80

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Console

Nothing printed yet.