Marks
A mark is the visual primitive that data rows become — bars, lines,
arcs, etc. Specify via top-level mark (shorthand string) or
mark: {type: "...", ...properties}.
Catalog
Basic marks (Vega-Lite parity)
| Mark | When to use |
|---|---|
bar | Compare categories. The default. |
line | Continuous trends; ordered x-axis. |
area | Filled trends. Supports negative values + stacks. |
point | Scatter, dot plots. |
circle, square | Convenience aliases for point with shape preset. |
tick | Strip plots, ranking dot plots. |
rect | Heatmap cells, custom rectangular layouts. |
rule | Reference lines, benchmarks, ranges. |
text | Inline labels, annotations. |
arc | Primitive for pie / donut / sankey links. |
Composite marks
| Mark | Internally expands to |
|---|---|
histogram | bar + auto-bin transform. |
heatmap | rect + 2D bin + sequential color scale. |
boxplot | rect (IQR) + rule (whiskers) + point (outliers). |
violin | area symmetric around centerline (Epanechnikov KDE). |
pie | arc with theta computed from share. |
donut | arc with inner_radius_ratio > 0. |
Specialty marks
| Mark | When to use |
|---|---|
sankey | Flow diagrams (source/target/value table). |
funnel | Conversion funnels — stacked trapezoids. |
sparkline | Inline micro-line charts, no axes. |
image | Sprites / data-URL images at position. |
path | Raw SVG path data — escape hatch. |
geoshape | Country / admin-1 polygons (choropleth). See Geographic Marks. |
geopoint | Lon/lat → point overlay. See Geographic Marks. |
Tree / dendrogram / network
Hierarchical and relational marks share a small layout package
(encode/marks/layout) and decompose to existing primitives (path,
point, rect, text) so the SVG and PDF renderers handle them without
new geometry types.
| Mark | When to use |
|---|---|
tree | Rooted hierarchy (org charts, decision trees). Reingold-Tilford tidy layout. |
dendrogram | Clustering tree — tree variant with link_shape: step + node_shape: none defaults. |
network | Undirected / directed node-link diagram. Force-directed layout (deterministic seed). |
Channel bindings:
source— parent / from-node id field (required for tree/dendrogram/network).target— child / to-node id field (required).value— optional edge weight (network) / node size (tree).text— optional per-node label.color,fill,stroke,opacity,size— standard mark props.
Mark-def options:
orient—vertical(default),horizontal,radial.link_shape—step(default),curve,straight.node_shape—circle(default),rect,none.node_size— base radius / side length (default 6).layout(network) —force(default),random.iterations,link_distance,charge,seed(network).
Validate rules: PRISM_SPEC_028 (missing source/target),
PRISM_SPEC_029 (multi-root tree). Encode-time:
PRISM_ENCODE_TREE_CYCLE, PRISM_ENCODE_NETWORK_NONFINITE,
PRISM_WARN_NETWORK_CYCLE.
Channel allowlists
Not every channel is valid for every mark — theta only makes sense
on arc, source/target only on sankey, etc. The validator
catches mismatches with PRISM_SPEC_003.
Worked examples
Every mark above has a fixture in the gallery. Start with: