GeomBar
Bar geometry with counting or binning: one rectangle per distinct x value (stat count, discrete x) or per bin (stat bin, continuous x). Do not map aes.y — the stat computes it. Prefer GeomCol when bar heights are already in the data.
Defaults
- geom
bar- default stat
count- default position
stack- params type
BarParams
Svelte component
import { GGPlot, GeomBar } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x" }}>
<GeomBar />
</GGPlot> JSON layer
{
"geom": "bar",
"stat": "count"
} Params
alphanumberBar opacity. Must be between 0 and 1 (inclusive). Default 1.
widthnumberBar width as a fraction of the band step (count-stat bars only; binned bars span their bin). Must be greater than 0 and at most 1. Default 0.9.
binsnumberSTAT BIN ONLY: number of bins (an integer of at least 1). Default 30 — an advisory reminds you to pick a real value. Overridden by binwidth.
binwidthnumberSTAT BIN ONLY: bin width in data units (must be greater than 0). Takes precedence over bins. Usually the better knob: pick a width meaningful for the data.
boundarynumberSTAT BIN ONLY: align a bin EDGE with this x value (e.g. 0 puts bin edges at multiples of the width). Mutually exclusive with center.
centernumberSTAT BIN ONLY: align a bin CENTER with this x value. Mutually exclusive with boundary.
closed"right" | "left"STAT BIN ONLY: which edge of each bin is inclusive: "right" (default, matches) or "left".
fillPaintGradientPaintWithin-mark gradient fill paint (not a data scale). Requires a solid fallback.
glowGlowSpecBounded within-mark glow treatment (not theme decoration).