Marks
Bars, lines, dots, areas, pies, rules, and text – the mark types that compose every Szum chart.
A mark is a visual encoding – bars, lines, dots, areas, text, rules. Each entry in the marks array draws one layer. Later marks draw on top of earlier ones.
Mark types
Bar
barY and barX, stacking and dodging.
Line
Single and multi-series lines.
Dot
Scatter plots and point marks.
Area
areaY and areaX, stacked areas.
Pie
Pie and donut charts.
Text
Data labels and annotations.
Rule
ruleX and ruleY reference lines.
Common properties
Every mark uses the same structural vocabulary, but semantic support depends on what it can draw. In particular, use fill for areas, pies, and text; stroke for rules; either one (not both) for lines; and either or both for dots and bars:
| Field | Type | Default | Description |
|---|---|---|---|
type | string | – | Required. The mark type. |
data | Datum[] | – | Mark-specific data. Overrides top-level data. |
x | string | "x" | Field name for x position. The default requires an "x" key in the resolved data. |
y | string | "y" | Field name for y position. The default requires a "y" key in the resolved data. |
fill | string | – | Fill color: field name for color scale, or #hex literal. |
stroke | string | – | Stroke color: field name for color scale, or #hex literal. |
strokeWidth | number | 1 | Stroke width in pixels. |
Composition
Layer marks when each layer adds a distinct visual role. A scatter plot with quadrant lines is dot + ruleX + ruleY. Standard data labels belong on the primary mark's built-in label property; reserve text for annotations:
The quadrant lines divide features into high-impact/low-effort (top-left) vs low-impact/high-effort (bottom-right). Three marks, one config.