@amcharts/amcharts5
Version:
amCharts 5
70 lines • 2.23 kB
TypeScript
import { Pattern, IPatternSettings, IPatternPrivate } from "./Pattern";
export interface ITrianglePatternSettings extends IPatternSettings {
/**
* Gap between triangles, in pixels.
*
* @default 6
*/
gap?: number;
/**
* Width of the triangle, in pixels.
*
* @default 8
*/
maxWidth?: number;
/**
* Height of the triangle, in pixels.
*
* @default 8
*/
maxHeight?: number;
/**
* If set to `true`, will place every second triangle, creating a checkered
* pattern.
*
* @default false
*/
checkered?: boolean;
/**
* Center triangles in their grid cell.
*
* @default true
*/
centered?: boolean;
/**
* If set to `true`, `rotation` rotates each triangle around its own center
* while the grid/tile stays axis-aligned, instead of rotating the whole
* pattern. This tiles seamlessly (a small `width`/`height` is enough) and is
* much faster than rotating the whole pattern on large tiles.
*
* @default false
*/
rotateShapes?: boolean;
}
export interface ITrianglePatternPrivate extends IPatternPrivate {
}
/**
* Triangle pattern.
*
* @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more info
*/
export declare class TrianglePattern extends Pattern {
_settings: ITrianglePatternSettings;
_privateSettings: ITrianglePatternPrivate;
static className: string;
static classNames: Array<string>;
_beforeChanged(): void;
/**
* A triangle pattern's tile is only a repeat unit — the grid repeats every
* cell — so an oversized `width`/`height` just wastes memory and draw time for
* an identical result. Normalise it to a single cell (2x2 cells when
* `checkered`). Skipped for a whole-pattern `rotation` (which isn't periodic
* on an axis-aligned tile — use `rotateShapes` for that) and for non-`repeat`
* repetitions.
* @ignore
*/
protected _optimizeTileSize(): void;
protected _draw(): void;
private _point;
}
//# sourceMappingURL=TrianglePattern.d.ts.map