Class ContPalette

Representation of a continuous palette. Can be used to determine a color given a data value.

Hierarchy

  • ContPalette

Index

Accessors

slot

  • get slot(): string | null
  • Returns the name of the slot this palette is linked to, or null if the palette is not linked to a slot.

    Returns string | null

Methods

getColorStops

  • Given a slot, returns the color stops for that slot. If the slot is not defined, then a set of default color stops are returned.

    Parameters

    • Optional _slot: Slot

      The slot for which to return the color stops.

    Returns ColorStops

    The color stops for the specified slot.

getFillColor

  • Determine the fill color for a data point. The fill follows the 'selected' state of a data point. If the data set has selected data points, then the ones that are selected get the normal color as fill color and the ones that are not selected get a 60% transparent color.

    Parameters

    • _dp: DataPoint

      The data point to determine the color for.

    Returns string

    The color of the data point as a string.

getOutlineColor

  • getOutlineColor(_dp: DataPoint): string | null
  • Determine the outline color for a data point. The outline color depends on both the 'highlight' state and the 'selected' state. If the point is neither highlighted or selected, null is returned to indicate that no outline needs to be rendered. If the point is highlighted or part of a selection, then the returned color is a darker version of the actual data point color.

    Parameters

    • _dp: DataPoint

      The data point to determine the color for.

    Returns string | null

    The color of the data point as a string or null if no outline is needed.