A signals section declares interactive signals and the events that update them. Signals support controls such as sliders, dropdowns, check boxes, and hover interactions. section 3.1.1
Build an interaction in two connected parts:
- Declare a signal with a name and event listeners, such as mouseover and mouseout, plus updates that store the selected datum or null. section 3.1.1
- Add an update handler inside the marks section; the handler checks the signal and changes a visual property such as stroke color. section 3.1.1
Hover to change a mark
A changeColor signal records the datum under the mouse on mouseover and clears it on mouseout. A mark’s update block then uses a condition such as changeColor === datum to switch its stroke. section 3.1.1
