<< All versions
Skill v1.0.0
currentAutomated scan100/100mckinsey/vizro/writing-vizro-yaml
──Details
PublishedOctober 22, 2026 at 09:29 PM
Content Hashsha256:abe6b2466598342e...
Git SHAeba43344877e
──Files
Files (1 file, 3.2 KB)
SKILL.md3.2 KBactive
SKILL.md · 84 lines · 3.2 KB
version: "1.0.0" name: writing-vizro-yaml description: Use this skill when writing or debugging Vizro YAML dashboard configurations — component syntax, data_manager registration, custom function wiring, filter/parameter setup, or AG Grid tables. Activate when the user is building a Vizro app, encountering YAML or runtime errors, or asking about Vizro component patterns.
Vizro YAML & Component Reference
Critical Mistakes to Avoid
Each mistake below is expanded with code examples and fixes in yaml-reference.md.
- `@capture("graph")` receives a DataFrame — use
data_framedirectly; never re-lookup viadata_manager[data_frame](causes blank charts). - `data_manager` is not subscriptable — pre-process on raw DataFrame, then register.
- Custom `_target_` needs module prefix —
_target_: custom_charts.my_chart, not_target_: my_chart. - `type: figure` has no `title` field — KPI titles go in
_target_: kpi_cardargs. - `type: table` requires `_target_: dash_ag_grid`.
- Parameter targets — format:
"component_id.argument_name", not"component_id.figure". - Quote YAML special chars in column names —
column: "Version #"(unquoted#starts a comment). - Filter `targets:` — omit when you want to apply it to all components on the page whose data source includes defined filter
column. - Grid must be rectangular — same component index must span same columns in every row.
- Column type consistency — filter column must have same dtype across all targeted datasets.
Quick Patterns
yaml
# Standard chart (scatter — no aggregation needed, each row is one point)- figure:_target_: scatterdata_frame: sales_datax: unitsy: revenuetype: graphtitle: Revenue vs Units# KPI card (title inside figure args, NOT on component)- figure:_target_: kpi_carddata_frame: kpi_datavalue_column: Revenuetitle: Total Revenuevalue_format: "${value:,.0f}"type: figure# AG Grid table- figure:_target_: dash_ag_griddata_frame: sales_datatype: tabletitle: Sales Data# Filter with targetscontrols:- column: regiontargets: [chart_1, chart_2]type: filter
Key Imports
python
import vizro.models as vmfrom vizro import Vizroimport vizro.plotly.express as pxfrom vizro.tables import dash_ag_gridfrom vizro.figures import kpi_card, kpi_card_referencefrom vizro.models.types import capturefrom vizro.managers import data_managerfrom vizro.themes import palettes, colors
Deep Dive
Load yaml-reference.md when you need expanded guidance. Key sections to search for:
| Need | Search for | |
|---|---|---|
| App structure | ## End-to-End Data Flow | |
| Data registration | ## Data Registration | |
| Custom charts | ## Custom Charts | |
| AG Grid (heatmap, inline bars) | ## AG Grid Tables | |
| Containers / Tabs | ## Containers or ## Tabs | |
| Expanded mistake fixes | ## Critical Mistakes |