| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import { IRenderer, RendererPlugin, Canvas as GCanvas } from '@antv/g';
- import { G2Context } from '../runtime';
- import { ViewComposition } from '../spec';
- import { G2ViewTree } from '../runtime/types/options';
- import { NodePropertyDescriptor } from './props';
- import { ValueAttribute, Concrete, ArrayAttribute, ObjectAttribute } from './types';
- import { Mark } from './mark';
- import { Composition, View } from './composition';
- export declare const G2_CHART_KEY = "G2_CHART_KEY";
- export type ChartOptions = ViewComposition & {
- container?: string | HTMLElement;
- canvas?: GCanvas;
- width?: number;
- height?: number;
- autoFit?: boolean;
- renderer?: IRenderer;
- plugins?: RendererPlugin[];
- theme?: string;
- };
- type ChartProps = Concrete<ViewComposition>;
- export interface Chart extends Composition, Mark {
- data: ValueAttribute<ChartProps['data'], Chart>;
- width: ValueAttribute<ChartProps['width'], Chart>;
- height: ValueAttribute<ChartProps['height'], Chart>;
- coordinate: ValueAttribute<ChartProps['coordinate'], Chart>;
- interaction: ObjectAttribute<ChartProps['interaction'], Chart>;
- key: ValueAttribute<ChartProps['key'], Chart>;
- transform: ArrayAttribute<ChartProps['transform'], Chart>;
- theme: ObjectAttribute<ChartProps['theme'], Chart>;
- title: ValueAttribute<ChartProps['title'], Chart>;
- scale: ObjectAttribute<ChartOptions['scale'], Chart>;
- axis: ObjectAttribute<ChartOptions['axis'], Chart>;
- legend: ObjectAttribute<ChartOptions['legend'], Chart>;
- style: ObjectAttribute<ChartOptions['style'], Chart>;
- labelTransform: ArrayAttribute<ChartOptions['labelTransform'], Chart>;
- }
- export declare const props: NodePropertyDescriptor[];
- export declare class Chart extends View<ChartOptions> {
- private _container;
- private _context;
- private _emitter;
- private _width;
- private _height;
- private _renderer;
- private _plugins;
- private _hasBindAutoFit;
- private _rendering;
- private _trailing;
- private _trailingResolve;
- private _trailingReject;
- private _previousDefinedType;
- constructor(options: ChartOptions);
- render(): Promise<Chart>;
- /**
- * @overload
- * @returns {G2ViewTree}
- */
- options(): G2ViewTree;
- /**
- * @overload
- * @param {G2ViewTree} options
- * @returns {Chart}
- */
- options(options: G2ViewTree): Chart;
- getContainer(): HTMLElement;
- getContext(): G2Context;
- on(event: string, callback: (...args: any[]) => any, once?: boolean): this;
- once(event: string, callback: (...args: any[]) => any): this;
- emit(event: string, ...args: any[]): this;
- off(event?: string, callback?: (...args: any[]) => any): this;
- clear(): void;
- destroy(): void;
- forceFit(): Promise<Chart>;
- changeSize(width: number, height: number): Promise<Chart>;
- private _reset;
- private _renderTrailing;
- private _createResolve;
- private _createReject;
- private _computedOptions;
- private _createCanvas;
- private _addToTrailing;
- private _onResize;
- private _bindAutoFit;
- private _unbindAutoFit;
- }
- export {};
|