Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Color

Color: Tagged<"Color", `#${string}`>

Colors are strings in the form #rrggbb.

HSV

HSV: { h: Degrees; s: Unit; v: Unit } & Tag<"HSV">

HSVSpec

HSVSpec: { h: number; s: number; v: number }

Type declaration

  • h: number
  • s: number
  • v: number

RGB

RGB: { b: Byte; g: Byte; r: Byte } & Tag<"RGB">

RGBSpec

RGBSpec: { b: number; g: number; r: number }

Type declaration

  • b: number
  • g: number
  • r: number

Variables

Const color_scheme

color_scheme: Color[] = ...

The supplied color scheme.

Functions

Const HSVtoRGB

Const RGBtoHSV

Const asColor

  • asColor(c: string): Color

Const asHSV

Const asRGB

Const colorsFor

  • colorsFor(color_scheme: Color[], unknown?: Color): <T>(keys: Iterable<T>) => { domain: any; range: any; unknown: any }
  • Compute a set of color mappings for items in a given set of keys. A higher-order function. Supply color_scheme (and optionally unknown), and it will return a a function that accepts a list of keys

    Parameters

    • color_scheme: Color[]

      a list of colors in '#rrggbb' format.

    • unknown: Color = ...

      the color to use for unknown keys

    Returns <T>(keys: Iterable<T>) => { domain: any; range: any; unknown: any }

    an object equivalent to a d3 ordinal interpolator.

      • <T>(keys: Iterable<T>): { domain: any; range: any; unknown: any }
      • Type parameters

        • T

        Parameters

        • keys: Iterable<T>

        Returns { domain: any; range: any; unknown: any }

Const compute_colors

  • compute_colors(color_scheme: Color[], unknown?: Color): (scenario_list: Scenario[]) => { domain: any; range: any; unknown: any }
  • Compute a set of color mappings for items in a given set of scenarios. A higher-order function. Supply color_scheme (and optionally unknown), and it will return a a function that accepts a list of scenarios

    Parameters

    • color_scheme: Color[]

      a list of colors in '#rrggbb' format.

    • unknown: Color = ...

      the color to use for unknown keys

    Returns (scenario_list: Scenario[]) => { domain: any; range: any; unknown: any }

    a d3 ordinal interpolator.

      • (scenario_list: Scenario[]): { domain: any; range: any; unknown: any }
      • Parameters

        Returns { domain: any; range: any; unknown: any }

Const default_colors

  • default_colors(scenario_list: Scenario[]): { domain: any; range: any; unknown: any }
  • Accept a list of scenarios, and return the default color scheme to use.

    Parameters

    Returns { domain: any; range: any; unknown: any }

Const hsv

Const isHSV

Const isRGB

Const rgb

Const subcolors

  • subcolors(colors: ScaleOrdinal<string, Color, string>, subdomain: Color[]): { domain: any; range: any }
  • Subset a color interpolator to a subdomain. This is used to allow genenrating a swatch for just the relevant items.

    Parameters

    • colors: ScaleOrdinal<string, Color, string>
    • subdomain: Color[]

    Returns { domain: any; range: any }

    a d3 ordinal interpolator.

Generated using TypeDoc