ScaleColorViridisD

Viridis-family color scale — discrete (viridis_d).

Defaults

helper
scaleColorViridisD
family
color-fill
aesthetic
color
scale type
ordinal
options type
ViridisScaleOptions

Also exported as

  • ScaleColourViridisD

Svelte component

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

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

JSON scales

{
  "scales": {
    "color": {
      "type": "ordinal"
    }
  }
}

Params

option

"viridis" | "magma" | "plasma" | "inferno" | "cividis" | "turbo"

Viridis family option (default viridis).

domain

Array<DomainValue>

Explicit semantic domain. Manual/ordinal scales use ordered values; sequential/binned scales use [min, max].

breaks

Array<number | string>

Explicit semantic reference ticks for sequential colorbars or ordered boundaries for binned colorsteps.

range

Array<string>

Explicit #rgb/#rrggbb colors. Manual pairs them with domain values; sequential/binned interpolate or sample them.

reverse

boolean

Reverse 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".

naValue

string

Color for null/missing values. Default9.

unknownValue

string

Color for invalid, out-of-domain, or unmapped values. Default9.

labels

string

Guide label format: numeric (".1f", ",d", ".0%") or temporal strftime-style text.

guide

GuideSpec

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

Guide interaction

Legend guide for discrete/manual/identity color. Set guide: "none" to hide.

Examples

← All scales · Palettes · Scales and guides