Command Palette

Search for a command to run...

Hectal
Phase 5: D3 Core: Selections and the Data Join
Data Visualization · Exercise 4 of 5 PreviousNext
Intermediate

Click a bar to see its station

Clicking a bar should write the station's name and rides into #info, like Lantern: 7,260 rides. Use .on("click", (event, d) => ...).

Keep draw safe to call again: it runs twice at the start, and one click must still run the handler once.

What Check tests

  1. Clicking the first bar shows Lantern: 7,260 rides
  2. Clicking the third bar shows Library: 6,390 rides
  3. One click runs the handler once, even after two draws
  4. The old d3.event is not used

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.