On this page

CoordFlip

Swap display axes so semantic x paints vertically and y horizontally. The mechanism for horizontal bar charts; stack, dodge, and hit-testing follow the flip.

Svelte component

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

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

Declaration-only: emits no markup. Registers a live coord layer on init; inert without a <GGPlot> ancestor. Coords are REPLACE — the last registered coord wins.

JSON and helpers

// Builder
import { gg } from "@ggsvelte/spec";

gg(rows, aes({ x: "category", y: "value" }))
  .geomCol()
  .coordFlip()
  .build();
// → { …, coord: { type: "flip" } }
{
  "coord": { "type": "flip" }
}

No free-standing helper — use <CoordFlip />, builder.coordFlip(), or builder.coord("flip"). Schema type: CoordCartesianSpec. Portable type: "flip". Builder: .coordFlip(), .coord().

Props

CoordFlip has no option props — only the fixed portable type: "flip".

← All coords · Scales · Facets and coordinates