Command Palette

Search for a command to run...

Hectal
Phase 12: Big Data: Canvas, Hit-Testing and Performance
Data Visualization · Exercise 4 of 4 Previous
Advanced

Put the hover ring on its own layer

Two canvases are stacked: #base holds a station dot and #over is on top. The ring is drawn on the base canvas, which repaints the dot on every move.

Draw the ring on #over only, and clear it when the pointer leaves the dot. The base canvas must not change.

What Check tests

  1. Moving onto the dot draws a ring on the top canvas
  2. The base canvas has no ring and keeps its dot
  3. Moving away clears the ring

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.