UNPKG

1.15 kBTypeScriptView Raw
1import React from 'react';
2import { Plot } from '@antv/g2plot/lib/core/plot';
3interface BasePlotOptions {
4 /**
5 * 获取g2Plot实例的勾子函数
6 */
7 onGetG2Instance?: (chart: Plot<any>) => void;
8 errorContent?: React.ReactNode;
9 /**
10 * 图表事件
11 */
12 events?: Record<string, Function>;
13 /**
14 * 图表标题。如需绑定事件请直接使用ReactNode。
15 */
16 readonly title?: React.ReactNode;
17 /**
18 * 图表副标题。如需绑定事件请直接使用ReactNode。
19 */
20 readonly description?: React.ReactNode;
21 /**
22 * 请使用autoFit替代forceFit
23 */
24 forceFit?: boolean;
25 /**
26 * 是否是物料组件,因搭建引擎消费ref和原来的组件吐的react实例不兼容。
27 * 该属性会影响ref的消费,为ali-lowcode-engine消费而生。
28 */
29 isMaterial?: boolean;
30}
31export { BasePlotOptions };
32declare function createPlot<IPlotConfig extends Record<string, any>>(PlotClass: any, name: string, transCfg?: Function): React.ForwardRefExoticComponent<React.PropsWithoutRef<IPlotConfig> & React.RefAttributes<any>>;
33export default createPlot;