CoordFixed

Fixed physical data-unit aspect ratio (y-unit length / x-unit length). Layout fits the largest centered data rectangle after chart chrome; rejects free positional facet scales.

Svelte component

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

<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
  <GeomPoint />
  <CoordFixed ratio={1} />
</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

import { coordFixed } from "@ggsvelte/spec";

coordFixed({ ratio: 1 })
// → { type: "fixed" }  // ratio 1 is the default and normalize() may drop it
{
  "coord": { "type": "fixed", "ratio": 2 }
}

Helper: coordFixed (alias coord_fixed) · also coordEqual, coord_equal. Schema type: CoordFixedSpec. Portable type: "fixed". Builder: .coordFixed(), .coordEqual(), .coord().

Props

Options map 1:1 to the portable coord object (excluding the type discriminant). On CoordTransform, x and y also accept a bare transform name string via the helper/shell sugar.

ratio

number

Physical y-unit length divided by physical x-unit length (default 1, equal units).

Also exported as

  • CoordEqual

Binding-identical re-export of CoordFixed (equal-unit spelling of fixed aspect).

← All coords · Scales · Facets and coordinates