ScaleColorGradientn
N-stop continuous color gradient from an ordered color list.
Defaults
- helper
scaleColorGradientn- family
color-fill- aesthetic
color- scale type
sequential- options type
GradientnScaleOptions
Also exported as
ScaleColourGradientn
Svelte component
import { GGPlot, GeomPoint, ScaleColorGradientn } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y", color: "group" }}>
<ScaleColorGradientn />
<GeomPoint />
</GGPlot> JSON scales
{
"scales": {
"color": {
"type": "sequential"
}
}
} Params
domainArray<DomainValue>Explicit semantic domain. Manual/ordinal scales use ordered values; sequential/binned scales use [min, max].
breaksArray<number | string>Explicit semantic reference ticks for sequential colorbars or ordered boundaries for binned colorsteps.
reversebooleanReverse the output color range. Default false.
transform"identity" | "log10" | "sqrt"Pre-training quantitative transform for sequential/binned color values. log10/sqrt require non-temporal values; ordinal, manual, and identity families do not accept a transform.
oob"censor" | "squish"Out-of-bounds policy for an explicit continuous/binned domain: "censor" (default) or "squish".
naValuestringColor for null/missing values. Default9.
unknownValuestringColor for invalid, out-of-domain, or unmapped values. Default9.
labelsstringGuide label format: numeric (".1f", ",d", ".0%") or temporal strftime-style text.
guideGuideSpecGuide presentation override (legend, colorbar, colorsteps, or none).
coloursstring[]Ordered #rgb/#rrggbb stops (British spelling alias of colors).
colorsstring[]Ordered #rgb/#rrggbb stops.
valuesnumber[]Optional stop positions in [0, 1] (or data units for some helpers).
Guide interaction
Colorbar guide by default for continuous ramps. Use guide helpers or guide: "none" to suppress.