ScaleLinewidthDiscrete

Discrete linewidth scale for categories (ordinal).

Defaults

helper
scaleLinewidthDiscrete
family
numeric-style
aesthetic
linewidth
scale type
ordinal
options type
DiscreteNumericStyleScaleOptions

Also exported as

  • ScaleLinewidthOrdinal

Svelte component

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

<GGPlot data={rows} aes={{ x: "x", y: "y", linewidth: "weight" }}>
  <ScaleLinewidthDiscrete />
  <GeomLine />
</GGPlot>

JSON scales

{
  "scales": {
    "linewidth": {
      "type": "ordinal"
    }
  }
}

Params

domain

Array<DomainValue>

Explicit semantic domain. Continuous scales use [min, max]; ordinal uses ordered values.

domainMode

"grow" | "data"

Ordinal domain stability: "grow" (default) preserves assignments across filters; "data" rebuilds from current data.

range

Array<number>

Explicit output range for the mapped aesthetic.

reverse

boolean

Reverse the scale's output direction. Default false.

naValue

number

Replacement for missing/null source values.

unknownValue

number

Replacement for invalid, out-of-domain, or unmapped values.

onExhaust

"cycle" | "error"

Ordinal palette exhaustion policy: "cycle" (default) with a warning, or "error".

guide

GuideSpec

Guide presentation override (legend, colorbar, colorsteps, or none).

Guide interaction

Legend guide for the mapped style channel. Set guide: "none" to hide.

Examples

← All scales · Palettes · Scales and guides