@amcharts/amcharts5
Version:
amCharts 5
52 lines • 2.5 kB
TypeScript
import { Color } from "../core/util/Color";
import { Theme } from "../core/Theme";
import type { Root } from "../core/Root";
import type { Pattern } from "../core/render/patterns/Pattern";
/**
* Builds a fresh, varied set of patterns. One set is made per theme rule (i.e.
* per root), shared by all charts of that class — mirroring how the default
* theme shares a single ColorSet per root.
*
* Angled hatches use each pattern's `angle` setting (which tiles seamlessly at a
* small tile size) rather than rotating the whole pattern, and the set mixes in
* dots, stars, triangles and grids so consecutive series stay easy to tell
* apart by shape alone.
*/
export declare function buildPatterns(root: Root, color: Color): Array<Pattern>;
/**
* Stroke widths cycled across line series (which can't carry a fill pattern), so
* they are told apart by weight as well as tone.
*/
export declare const PATTERN_STROKE_WIDTHS: Array<number>;
/**
* Stroke dash arrays cycled across line series (0 = solid), paired with the
* widths above for extra separation.
*/
export declare const PATTERN_STROKE_DASHARRAYS: Array<number | Array<number>>;
/**
* A ramp of gray fills cycled across series (ordered so neighbours contrast), so
* series differ by tone as well as by their overlaid white pattern. Kept mid-dark
* enough that the white texture always reads.
*/
export declare const PATTERN_GRAYS: Array<Color>;
/**
* "Patterns" — a monochrome, texture-driven theme in the spirit of engraved or
* newspaper charts: every filled series shares one gray fill overlaid with a
* distinct white pattern (hatch / dot / star / triangle / grid), so series are
* told apart purely by texture rather than hue.
*
* Line series (which have no fill for a pattern to attach to) are all gray too
* and are told apart by stroke width and dash. Because categories are encoded by
* shape rather than hue, it prints cleanly and stays legible for all forms of
* color blindness. It layers on the default (light) look.
*
* This is a standalone theme; it does not modify any built-in theme.
*
* @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/#Pattern_sets} for more info
* @see {@link https://www.amcharts.com/docs/v5/concepts/themes/} for more info
* @important
*/
export declare class PatternsTheme extends Theme {
protected setupDefaultRules(): void;
}
//# sourceMappingURL=PatternsTheme.d.ts.map