Skip to content

Interface: PatternFill ​

Experimental

Pattern fills of a primitive's items (rects, arcs or fill polygons), resolved per item by the lazily loaded code with Plotly's rules: where fgcolor / bgcolor are unset, fillmode: 'replace' draws the item's color on a transparent background, 'overlay' draws the item's contrast color (white on dark colors, #444 on light ones) at fgopacity 0.5 over the item's color. Items without a shape keep their plain fill.

Properties ​

PropertyTypeDescription
background?unknownExperimental The CSS color behind the items (e.g. plot_bgcolor): translucent colors are composited over it before picking their contrast color. Default white (Plotly).
colorArrayLike<number>Experimental Each item's color (sRGB RGBA, 4 floats per item, before opacity): the default colors.
index?ArrayLike<number>Experimental Item → index into color, opacity and array attributes, or -1 for no pattern (default: the item's own index), e.g. for items drawn out of a longer list.
legend?booleanExperimental Legend glyphs (per-item patterns): Plotly draws their first item's shape and colors, arrays of size / solidity at 8 / 0.5, sizes above 10 at 10, and scales the tiles by 0.8.
opacity?number | ArrayLike<number>Experimental Each item's opacity, or one for all, multiplying the pattern's colors. Default 1.
parse(css) => RGBA | null | undefinedExperimental Parses fgcolor, bgcolor and background (e.g. core's toRGBA).
pattern| Readonly<Record<string, unknown>> | readonly (Readonly<Record<string, unknown>> | null | undefined)[]Experimental One pattern for every item (array attributes index the items), or one per item.

Released under the MIT License.