Agentic data-vis workshops
  • Home
  • Sessions
    • Session 1 · 2026-09-29 · The Office
    • Workbook, end of session
    • Workbook, version 2
    • Slides

    • Session 2 · 2026-10-16 · Rolling Stone albums
    • Workbook

    • 2026-10-09 · Preparation: candidate datasets
    • Global fertility (gapminder)
    • A&E waits and delayed discharges (NHS Scotland)

    • 2026-10-13 · Preparation: whole-system patient flow
    • Front door, ward, back door (NHS Scotland)
  • How a spec works
  • Mapping builder

Mapping builder

Proof of concept: draw mapping rules from variables to aesthetics, and watch the figure follow

NoteWhat this is, and how to use it

A point-and-click way to write the same mapping rules the sessions dictate to the agent. Drag from a variable (rectangle) to an aesthetic (ellipse) to add a rule, or click a variable and then an aesthetic. Click an arrow to remove it. The figure redraws as soon as the rules are complete enough to draw something.

The drawing runs in your browser with Vega-Lite, so it responds instantly. Below the figure are the same rules as a gg-spec YAML file and as the ggplot2 code the agent would compile from it. Use the YAML to hand a design to the agent, and the code to run it in R. The two renderers have different defaults, so the figures won’t match pixel for pixel. Where ggplot2 would refuse something or behave differently, the page says so. Its refusals and warnings come from the same rules file the agent checks specs against (assets/gg-rules.json), so the page and the agent object to the same things in the same words.

The URL records the current rules, so a link reproduces the design. This is a proof of concept: it supports six geoms, one smoother, and three coordinate systems.

Datasets

Active dataset

Loading…

Mapping rules: variables → aesthetics

    Drag from a variable to an aesthetic, or click one and then the other.

    Figure