1 | import React from 'react';
|
2 | type IOptions = Record<string, any>;
|
3 | type IPlotCfg = {
|
4 | plotType: string;
|
5 | options: IOptions;
|
6 | };
|
7 | interface IAdapterProps {
|
8 | /**
|
9 | * 可覆盖组件displayName
|
10 | */
|
11 | chartName?: string;
|
12 | /**
|
13 | * options 转换器
|
14 | * @example
|
15 | * // 合并图表类型,或者做配置项转换
|
16 | * (opt) => {
|
17 | * const options = {
|
18 | * // 可配置默认数据
|
19 | * data: [...],
|
20 | * ...opt,
|
21 | * }
|
22 | *
|
23 | * return {
|
24 | * plotType: opt.stackField ? 'StackColumn' : 'Column',
|
25 | * options,
|
26 | * }
|
27 | * }
|
28 | */
|
29 | adapter?: (IOptions: any) => IPlotCfg;
|
30 | [key: string]: any;
|
31 | }
|
32 | declare const PlotAdapter: React.FC<IAdapterProps>;
|
33 | export default PlotAdapter;
|