Scales

Every public Scale* component: position, color/fill, and style channels. Props match the fluent helpers on @ggsvelte/spec and the PortableSpec scales object. For palette specimens, see Palettes; for guide behavior, see Scales and guides.

100 scales (100 primary components; search also matches Colour/Ordinal aliases)

Position — continuous

Position — binned

Position — temporal

Position — discrete

Color and fill

Size, linewidth, and alpha

Shape and linetype

How to set a scale

Nest a Scale* child under GGPlot, call the matching fluent helper on a builder, or write the PortableSpec scales object. Channels not configured are inferred from data.

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

<GGPlot data={rows} aes={{ x: "year", y: "value", color: "temp" }}>
  <ScaleXContinuous labels="d" />
  <ScaleColorContinuous scheme="viridis" />
  <GeomPoint />
</GGPlot>