liveBook · Manning

Signals section

As explained in Data Storytelling with Altair and AI

A signals section is the part of a Vega specification that declares interactive signals and the events that update them.

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

How Data Storytelling with Altair and AI covers it

How deep it goes
Explains signal declarations and mark update handlers through a hover example, without covering broader control implementations.
Examples
Uses a mouseover and mouseout signal to change a chart element’s stroke color.
What it assumes
Assumes familiarity with Vega JSON structure and marks while teaching signal declarations and handlers directly.
What you can do after
Apply signals via Vega to capture events and update mark properties interactively.
How it connects
Connects signals with marks, event listeners, update expressions, and visual encoding properties.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Storytelling with Altair and AI. The section links point to the parts of the book it draws on.