GuideAxis
Axis guide for positional aesthetics x and y: title, tick marks, labels, and collision. Not valid on color, fill, or other style channels.
Channels
Bind this guide with the shell channel prop (or the matching
key under guides in JSON). Only these aesthetics validate:
xy
Only x and y. Style aesthetics never accept an
axis guide — use legend, colorbar, colorsteps, or none instead.
Svelte component
import { GGPlot, GeomPoint, GuideAxis } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "displ", y: "hwy", color: "class" }}>
<GeomPoint />
<GuideAxis channel="x" title="Label" showTicks={false} />
</GGPlot> JSON and helpers
import { guideAxis, guides } from "@ggsvelte/spec";
guides({ x: guideAxis({ title: "Label", showTicks: false }) })
// → { guides: { x: { type: "axis", … } } } {
"guides": {
"x": {
"type": "axis"
}
}
} Props
Every shell takes a required channel prop (not part of the
portable guide object — it is the key under guides). Options
below map 1:1 to the guide JSON fields.
channelrequired"x" | "y"Aesthetic this guide configures. Must be one of the channels listed above.
titlestringOptional guide title string (max 256 characters). Omit to use the scale or labs title.
showTicksbooleanWhen false, hide tick marks on the axis or colorbar.
showLabelsbooleanWhen false, hide tick or step labels on the axis, colorbar, or colorsteps guide.
collision"auto" | "preserve" | "ellipsis"How long labels behave when they do not fit: ellipsis, wrap (legend only), preserve (axis), auto (axis), or error.
themeGuideThemeSpecBounded presentation overrides for this guide block (title/label size, gaps, colorbar size).