Metis — Save Viz Recipe
save_viz_recipeStores a visualization's reusable method—mark meaning, encoding, data contract, and caveats—so teams can recreate or validate charts independent of styling.
Instructions
Store the METHOD of a visualization — the half that survives a restyle.
A recipe is what makes a figure work: what the mark represents, what maps to
which channel, and what data shape it demands. Not the colours.
Args:
name: Descriptive, e.g. "unit-dot transition flow".
kind: chart | map | diagram | flow | table | layout.
one_liner: What it shows, and why that framing beats the obvious one.
encoding: What maps to position, colour, size, order.
mark_unit: What ONE mark is. Usually the decisive choice — "one dot =
one person" and "one bar = a percentage" are different arguments
about the same numbers.
data_contract: JSON object of role -> meaning, e.g.
'{"unit_id":"one row per person","start_class":"origin group",
"end_class":"destination group"}'
The field that makes reuse mechanical. Without it the recipe is a
description; with it, a dataset can be checked against it.
interaction: static | hover | scroll-step | click-filter | animated.
medium: html/d3 | ggplot2 | plotly | svg | leaflet.
code: Working code if there is any. Never required — a recipe with a
precise contract and no code is still reusable.
caveats: How this figure can mislead. Please fill this in; a stored
method with no stored failure mode is a way to be wrong faster.
default_style: viz_styles.slug to use unless told otherwise.
derived_from: viz_exemplars.slug this came from, copied verbatim.
Returns:
The stored recipe, plus warnings for anything left dangling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| kind | Yes | ||
| name | Yes | ||
| medium | No | ||
| caveats | No | ||
| encoding | No | ||
| mark_unit | No | ||
| one_liner | No | ||
| interaction | No | ||
| derived_from | No | ||
| data_contract | No | ||
| default_style | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |