GeomBin2d
2D rectangular bin heatmap: partitions continuous x×y into a grid and maps fill to bin count by default. Empty bins are dropped unless params.drop is false.
Defaults
- geom
bin_2d- default stat
bin_2d- default position
identity- params type
Bin2dParams
Svelte component
import { GGPlot, GeomBin2d } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomBin2d />
</GGPlot> JSON layer
{
"geom": "bin_2d",
"stat": "bin_2d"
} Params
binsnumberNumber of bins on each axis. Default 30. Applies equally to x and y in v1.
binwidthnumberShared bin width in data units for both axes (overrides bins). Prefer when the scale units are meaningful.
dropbooleanWhen true (default), omit zero-count bins from the output.
alphanumberCell opacity. Must be between 0 and 1 (inclusive). Default 1.
linewidthnumberOutline stroke width in px when color is set. Must be greater than 0.
Allowed stats
bin_2ddefault
Allowed positions
identitydefault