Command Palette

Search for a command to run...

Hectal
Phase 18: Interviews and Capstone
Data Visualization · Exercise 3 of 5 PreviousNext
Advanced

Timed: a sparkline that survives odd data (5 minutes)

Interview-style task, about 5 minutes. Finish spark(values), which draws into #spark (an SVG 120 by 24) and is available as window.spark.

Normal data: one <path> through every finite value and an end dot. No data (an empty list): no marks and #note says No data. One value: a dot and no path. Values that are null or NaN are skipped. The SVG must never hold NaN.

What Check tests

  1. Four values draw a path with four points and a dot
  2. An empty list draws nothing and says No data
  3. One value draws a dot and no path
  4. null and NaN are skipped
  5. Flat data stays clean

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.

Your page

Press Run to see the page.

Console

Nothing logged yet.