Marks

Cars scatterplot of horsepower and fuel economy
Quantitative positions with nominal color.

Marks define the semantic form of a layer. Create a mark first, then connect it to data through position, grouping, and appearance encodings. The first mark of each type infers its ID and current dataset when those choices are unambiguous.

Choose a mark family

Point marks Scatterplots, symbols, field-driven shape, size, and opacity. Line and area marks Ordered paths, grouped series, ranged areas, and density geometry. Bar marks Histograms, aggregate bars, grouped layouts, and observed intervals. Rule marks Full-span references, bounded intervals, and diagonal endpoints. Text marks Data labels and annotations attached to points, bars, or rules. Rect marks Discrete heatmap cells and explicit two-dimensional ranges. Arc marks Donuts, rose overlays, and radial bars with Polar positions.

At a glance

Family Create Edit Initial graphic
Point createPointMark editPointMark, jitterPoints, removeJitter Point collection
Line createLineMark editLineMark Path collection
Area createAreaMark editAreaMark Closed path collection
Arc createArcMark editArcMark Closed sector path collection
Bar createBarMark editBarMark Rect collection
Rule createRuleMark Encoding actions Line collection
Text createTextMark editTextMark, layoutLabels, removeLabelLayout Text collection
Rect createRectMark editRectMark Rect collection

Use removeMark({ target? }) to remove one complete stable mark owner. It also removes generated composite children, unreferenced generated datasets, owned legends, and selection/highlight state. Source data and resources shared by another mark remain:

const barsOnly = layeredProgram.removeMark({ target: "points" });

Generated children such as regression lines cannot be removed directly; select their stable owner instead.

Creation establishes semantic ownership but may leave an empty collection. Concrete graphics appear when the required encodings make the mark renderable. Later Canvas, scale, grouping, or appearance edits explicitly rematerialize those graphics.

Shared inference

Encodings · Statistical layers · Complete action reference