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

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:

FieldTypeDefaultDescription
typestringRequired. The mark type.
dataDatum[]Mark-specific data. Overrides top-level data.
xstring"x"Field name for x position. The default requires an "x" key in the resolved data.
ystring"y"Field name for y position. The default requires a "y" key in the resolved data.
fillstringFill color: field name for color scale, or #hex literal.
strokestringStroke color: field name for color scale, or #hex literal.
strokeWidthnumber1Stroke 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.

On this page