Skip to content

Type Alias: FillPaint ​

ts
type FillPaint =
  | {
      kind: 'solid';
    }
  | {
      colorscale: Colorscale;
      direction: FillGradientDirection;
      kind: 'gradient';
      start?: number;
      stop?: number;
    }
  | {
      kind: 'pattern';
      pattern: PatternFill;
    };

Experimental

How the polygons are painted.

  • 'solid': per-polygon FillData.color.

  • 'gradient' (Plotly fillgradient): a colorscale along x (horizontal), y (vertical), or outwards from the center of the bounding box of all vertices (radial); see writeFillGradient for the exact mapping. Colors (and their alpha) come from the colorscale; FillData.opacity still multiplies them. The colorscale is a shared LUT texture, so a colorscale change uploads one 256×1 texture and nothing else.

  • 'pattern' (plan E8.10, Plotly fillpattern): per-polygon hatch patterns (see pattern.ts; the polygons are its items), tiles anchored at the viewport's top-left corner; polygons without a shape keep their FillData.color. The pattern code loads on first use (FillPrimitive.ready).

Union Members ​

Type Literal ​

ts
{
  kind: 'solid';
}

Type Literal ​

ts
{
  colorscale: Colorscale;
  direction: FillGradientDirection;
  kind: "gradient";
  start?: number;
  stop?: number;
}
NameTypeDescription
colorscaleColorscale-
directionFillGradientDirection-
kind"gradient"-
start?numberLinear gradients: data coordinate of colorscale position 0 / 1 (default: the extent).
stop?number-

Type Literal ​

ts
{
  kind: 'pattern';
  pattern: PatternFill;
}

Released under the MIT License.