GeomHex

Hexagonal bin heatmap: partitions continuous x×y into a hexagonal lattice and maps fill to bin count by default.

Defaults

geom
hex
default stat
bin_hex
default position
identity
params type
HexParams

Svelte component

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

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

JSON layer

{
  "geom": "hex",
  "stat": "bin_hex"
}

Params

bins

number

Approximate number of hex bins across the x range. Default 30.

drop

boolean

When true (default), omit zero-count hexes from the output.

alpha

number

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

linewidth

number

Outline stroke width in px when color is set. Default 0 (no outline).

Allowed stats

Allowed positions

Examples

← All geoms · Getting started