GeomRule

Rule geometry: reference lines spanning the panel. Two forms: (1) annotation — set params.xintercept and/or params.yintercept to fixed data values and map neither aes.x nor aes.y; (2) data-driven — map exactly one of aes.x (vertical rules) or aes.y (horizontal rules) to a field. Never mix the forms in one layer.

Defaults

geom
rule
default stat
identity
default position
identity
params type
RuleParams

Svelte component

import { GGPlot, GeomRule } from "@ggsvelte/svelte";

<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
  <GeomRule />
</GGPlot>

JSON layer

{
  "geom": "rule"
}

Params

xintercept

RuleIntercept

ANNOTATION FORM ONLY: draw a vertical rule at each of these fixed x positions. Mutually exclusive with mapping aes.x/aes.y on this layer.

yintercept

RuleIntercept

ANNOTATION FORM ONLY: draw a horizontal rule at each of these fixed y positions. Mutually exclusive with mapping aes.x/aes.y on this layer.

alpha

number

Rule opacity. Must be between 0 and 1 (inclusive). Default 1.

linewidth

number

Stroke width in px. Must be greater than 0. Default 1.

strokePaint

GradientPaint

Within-mark gradient stroke paint (not a data scale). Requires a solid fallback.

glow

GlowSpec

Bounded within-mark glow treatment (not theme decoration).

Allowed stats

Allowed positions

Examples

← All geoms · Getting started