ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
46 lines (45 loc) • 1.39 kB
TypeScript
import type { AxisID, EventListener } from 'ag-charts-core';
import type { AgScrollbarPlacement } from 'ag-charts-types';
import type { AxisLayout, EventsHub } from '../../core/eventsHub';
import { BBox } from '../../scene/bbox';
export interface LayoutContext {
width: number;
height: number;
layoutBox: BBox;
scrollbars: ScrollbarLayoutMap;
}
export interface ScrollbarLayout {
enabled: boolean;
thickness: number;
spacing: number;
tickSpacing: number;
placement: AgScrollbarPlacement;
}
export type ScrollbarLayoutMap = Partial<Record<AxisID, ScrollbarLayout>>;
export interface LayoutState {
axes?: Record<string, AxisLayout>;
clipSeries?: boolean;
series: {
rect: BBox;
paddedRect: BBox;
visible: boolean;
};
layoutBox: BBox;
}
export declare enum LayoutElement {
Caption = 0,
Legend = 1,
ToolbarLeft = 2,
ToolbarBottom = 3,
Scrollbar = 4,
Navigator = 5,
Overlay = 6
}
export declare class LayoutManager {
private readonly eventsHub;
private readonly elements;
constructor(eventsHub: EventsHub);
registerElement(element: LayoutElement, listener: EventListener<LayoutContext>): () => boolean | undefined;
createContext(width: number, height: number): LayoutContext;
emitLayoutComplete({ width, height }: LayoutContext, options: LayoutState): void;
}