position: "nudge"

Apply a fixed offset (positionParams.x / y) per mark — useful for labels beside points. Offsets are data units or band-step fractions.

Usage

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

<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
  <GeomPoint position="nudge" />
</GGPlot>
{
  "geom": "point",
  "position": "nudge"
}

positionParams

x

number

NUDGE ONLY: horizontal offset — data units on continuous x, band-step fractions on discrete x. Default 0.

y

number

NUDGE ONLY: vertical offset — data units on continuous y, band-step fractions on discrete y. Default 0.

Default for geoms

No geom uses this as its default position. Set it explicitly when needed.

Compatible geoms

← All positions · Geoms · Stats