UNPKG

ag-charts-community

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

100 lines (99 loc) 4.22 kB
import { BBox } from './bbox'; import type { ChildNodeCounts, IScene, RenderContext } from './node'; import { Node } from './node'; import { type CanvasContext } from './shape/shape'; import { type RotatableType, type ScalableType, type TranslatableType } from './transformable'; import { type ZIndex } from './zIndex'; export declare class Group<TDatum = unknown> extends Node<TDatum> { static readonly className: string; static is(value: unknown): value is Group; static computeChildrenBBox(nodes: Iterable<Node>, skipInvisible?: boolean): BBox; private static compareChildren; private readonly childNodes; dirty: boolean; private dirtyZIndex; private clipRect; opacity: number; private _childFontDirty; private _cachedChildFont; renderToOffscreenCanvas: boolean; optimizeForInfrequentRedraws: boolean; private layer; private image; constructor(opts?: { readonly name?: string; readonly zIndex?: ZIndex; readonly renderToOffscreenCanvas?: boolean; readonly optimizeForInfrequentRedraws?: boolean; }); containsPoint(_x: number, _y: number): boolean; protected computeBBox(): BBox | undefined; private computeSafeClippingBBox; private prepareSharedCanvas; setScene(scene?: IScene): void; resolveFont(): string | undefined; private resolveChildFont; markDirty(property?: string): void; markDirtyChildrenOrder(): void; /** * Appends one or more new node instances to this parent. * If one needs to: * - move a child to the end of the list of children * - move a child from one parent to another (including parents in other scenes) * one should use the {@link insertBefore} method instead. * @param nodes A node or nodes to append. */ append(nodes: Iterable<Node> | Node): void; appendChild<T extends Node>(node: T): T; removeChild(node: Node): void; clear(): void; /** * Hit testing method. * Recursively checks if the given point is inside this node or any of its children. * Returns the first matching node or `undefined`. * Nodes that render later (show on top) are hit tested first. */ pickNode(x: number, y: number): Node | undefined; pickNodes(x: number, y: number, into?: Node[]): Node[]; private _lastWidth; private _lastHeight; private _lastDevicePixelRatio; private isDirty; preRender(renderCtx: RenderContext): ChildNodeCounts; render(renderCtx: RenderContext): void; protected applyClip(ctx: CanvasContext, clipRect: BBox): void; protected renderInContext(childRenderCtx: RenderContext): void; private sortChildren; children(): Generator<Node, void, undefined>; excludeChildren(exclude: { instance?: any; name?: string; }): Generator<Node<unknown>, void, unknown>; descendants(): Generator<Node, void, undefined>; /** * Transforms bbox given in the canvas coordinate space to bbox in this group's coordinate space and * sets this group's clipRect to the transformed bbox. * @param bbox clipRect bbox in the canvas coordinate space. */ setClipRect(bbox?: BBox): void; /** * Set the clip rect within the canvas coordinate space. * @param bbox clipRect bbox in the canvas coordinate space. */ setClipRectCanvasSpace(bbox?: BBox): void; private getVisibility; toSVG(): { elements: SVGElement[]; defs?: SVGElement[]; } | undefined; } export type ScalableGroup<D = unknown> = ScalableType<Group<D>>; export type RotatableGroup<D = unknown> = RotatableType<Group<D>>; export type TranslatableGroup<D = unknown> = TranslatableType<Group<D>>; export type TransformableGroup<D = unknown> = RotatableType<TranslatableType<Group<D>>>; type P = ConstructorParameters<typeof Group>[0]; export declare const ScalableGroup: new <D = unknown>(p?: P) => ScalableGroup<D>; export declare const RotatableGroup: new <D = unknown>(p?: P) => RotatableGroup<D>; export declare const TranslatableGroup: new <D = unknown>(p?: P) => TranslatableGroup<D>; export declare const TransformableGroup: new <D = unknown>(p?: P) => TransformableGroup<D>; export {};