@advt-gpt-chart/package 3.2.1 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Chart/ChartBase/constants.d.ts +8 -19
- package/dist/Chart/ChartBase/transformed.d.ts +1 -1
- package/dist/Chart/ChartBase/types.d.ts +2 -2
- package/dist/Chart/ChartCodeRender/type.d.ts +2 -2
- package/dist/Chart/ChartControllers/ChartDetailData/index.d.ts +1 -1
- package/dist/Chart/ChartControllers/index.d.ts +1 -1
- package/dist/Chart/ChartEvents/ChartContextMenu/utils.d.ts +1 -1
- package/dist/Chart/ChartEvents/DrillBy/DrillByChart.d.ts +1 -1
- package/dist/Chart/ChartWrapper/ChartHeader.d.ts +1 -1
- package/dist/Chart/ChartWrapper/ChartMenu.d.ts +1 -1
- package/dist/Chart/ChartWrapper/utils.d.ts +33 -5
- package/dist/Charts/Area/index.d.ts +1 -2
- package/dist/Charts/Bar/index.d.ts +1 -2
- package/dist/Charts/Composite/index.d.ts +1 -2
- package/dist/Charts/Composite/transform.d.ts +13 -0
- package/dist/Charts/Composite/types.d.ts +14 -23
- package/dist/Charts/Composite/util.d.ts +29 -9
- package/dist/Charts/Donut/index.d.ts +1 -2
- package/dist/Charts/Funnel/index.d.ts +1 -2
- package/dist/Charts/Gauge/index.d.ts +1 -2
- package/dist/Charts/Heatmap/index.d.ts +1 -2
- package/dist/Charts/Line/index.d.ts +1 -2
- package/dist/Charts/Pie/index.d.ts +1 -2
- package/dist/Charts/Radar/index.d.ts +1 -2
- package/dist/Charts/Rank/index.d.ts +1 -2
- package/dist/Charts/Scatter/index.d.ts +1 -2
- package/dist/Charts/common/cartesianCommon.d.ts +34 -0
- package/dist/Charts/common/createChart.d.ts +7 -0
- package/dist/Charts/common/hooks/useDashLine.d.ts +6 -3
- package/dist/Charts/common/index.d.ts +3 -0
- package/dist/Charts/common/polarCommon.d.ts +44 -0
- package/dist/{Chart → DataView}/DataSource/types.d.ts +1 -1
- package/dist/DataView/Dataset/DataView.d.ts +40 -0
- package/dist/DataView/Dataset/constants.d.ts +15 -0
- package/dist/DataView/Dataset/index.d.ts +9 -0
- package/dist/DataView/Dataset/transforms.d.ts +95 -0
- package/dist/{Chart → DataView}/Dataset/types.d.ts +1 -0
- package/dist/DataView/data-set/data-set.d.ts +39 -0
- package/dist/DataView/data-set/index.d.ts +3 -0
- package/dist/DataView/data-set/transforms/format-transform.d.ts +9 -0
- package/dist/DataView/data-set/transforms/index.d.ts +3 -0
- package/dist/DataView/data-set/transforms/multi-dimension-transform.d.ts +3 -0
- package/dist/DataView/data-set/transforms/multi-metric-transform.d.ts +3 -0
- package/dist/DataView/data-set/types.d.ts +55 -0
- package/dist/GPTVis/hooks/useChartStore.d.ts +2 -2
- package/dist/components/CustomTimeRange/types.d.ts +1 -1
- package/dist/components/CustomTimeRange/utils.d.ts +1 -1
- package/dist/index.es.js +34291 -34351
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +753 -753
- package/dist/index.umd.js.gz +0 -0
- package/dist/types/chart.d.ts +12 -12
- package/dist/utils/useTools.d.ts +5 -2
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Chart/Dataset/useDataset.d.ts +0 -92
- package/dist/Charts/Composite/config.d.ts +0 -22
- package/dist/Charts/common/constants/index.d.ts +0 -0
- package/dist/Charts/common/tools/index.d.ts +0 -0
- /package/dist/{Chart → DataView}/DataSource/index.d.ts +0 -0
- /package/dist/{Chart → DataView}/DataSource/metricInsight.d.ts +0 -0
- /package/dist/{Chart → DataView}/DataSource/simpleJson.d.ts +0 -0
- /package/dist/{Chart → DataView}/DataSource/useChartDataQuery.d.ts +0 -0
|
@@ -4,7 +4,7 @@ import { AxesType } from './utils';
|
|
|
4
4
|
type CartesianOptions = {
|
|
5
5
|
xField: string;
|
|
6
6
|
yField: string;
|
|
7
|
-
|
|
7
|
+
isMetricFolded?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type CartesianTooltipOptions = CartesianOptions & {
|
|
10
10
|
seriesField?: string;
|
|
@@ -18,23 +18,13 @@ type PolarTooltipOptions = {
|
|
|
18
18
|
categoryFieldType?: AxesType;
|
|
19
19
|
isMetricFolded?: boolean;
|
|
20
20
|
};
|
|
21
|
-
type CompositeAxisSpec = {
|
|
22
|
-
orient: 'left' | 'right' | 'bottom' | 'top';
|
|
23
|
-
seriesIndex?: number[];
|
|
24
|
-
seriesId?: string[];
|
|
25
|
-
type?: string;
|
|
26
|
-
label?: any;
|
|
27
|
-
grid?: any;
|
|
28
|
-
title?: any;
|
|
29
|
-
offset?: number;
|
|
30
|
-
min?: number;
|
|
31
|
-
max?: number;
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
};
|
|
34
21
|
export type Tools = {
|
|
35
22
|
formatValue: (field: string, value: any) => any;
|
|
23
|
+
formatValueWithoutUnit: (field: string, value: any) => any;
|
|
36
24
|
getAxesType: (field: string) => 'band' | 'linear';
|
|
37
25
|
getFieldType: (fieldName: string, value?: any) => GenericDataType | undefined;
|
|
26
|
+
createLabelFormatMethod: (axesConfig: any, isMetricFolded?: boolean) => (val: any, datum: any) => any;
|
|
27
|
+
getUnit: (field: string) => string;
|
|
38
28
|
};
|
|
39
29
|
export declare const getPolarLegendSpec: (seriesField: string | boolean | undefined, categoryField: string, tools?: Tools) => {
|
|
40
30
|
visible: boolean;
|
|
@@ -51,18 +41,18 @@ export declare const getPolarTooltipSpec: ({ categoryField, valueField, seriesFi
|
|
|
51
41
|
value: (datum: any) => any;
|
|
52
42
|
};
|
|
53
43
|
content: {
|
|
54
|
-
key: () =>
|
|
44
|
+
key: (datum: any) => any;
|
|
55
45
|
value: (datum: any) => any;
|
|
56
|
-
}
|
|
46
|
+
};
|
|
57
47
|
};
|
|
58
48
|
dimension: {
|
|
59
49
|
title: {
|
|
60
50
|
value: (datum: any) => any;
|
|
61
51
|
};
|
|
62
52
|
content: {
|
|
63
|
-
key: () =>
|
|
53
|
+
key: (datum: any) => any;
|
|
64
54
|
value: (datum: any) => any;
|
|
65
|
-
}
|
|
55
|
+
};
|
|
66
56
|
};
|
|
67
57
|
};
|
|
68
58
|
export declare const getLineStyle: () => {
|
|
@@ -88,7 +78,6 @@ export declare const getLineStyle: () => {
|
|
|
88
78
|
};
|
|
89
79
|
};
|
|
90
80
|
export declare const getCartesianAxesSpec: (options: CartesianOptions, tools?: Tools) => ICartesianAxisSpec[];
|
|
91
|
-
export declare const getCompositeAxesSpec: (series: any[], yFields: string[], yAxesConfig?: any[], seriesIds?: string[]) => CompositeAxisSpec[];
|
|
92
81
|
export declare const getCartesianTootipSpec: ({ xField, yField, seriesField, isMetricFolded }: CartesianTooltipOptions, tools?: Tools) => {
|
|
93
82
|
mark: {
|
|
94
83
|
updateTitle: (prev: any) => any;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IChartSpec } from '@visactor/vchart';
|
|
2
2
|
import type { ComponentType } from 'react';
|
|
3
3
|
import type { ChartProps } from '../../Chart/ChartCodeRender/type';
|
|
4
|
+
import { Dataset, FieldInfoItem } from '../../DataView/Dataset/types';
|
|
5
|
+
import { DataSource } from '../../DataView/DataSource/types';
|
|
4
6
|
import { ContextMenu } from '../../GPTVis/hooks/useChartStore';
|
|
5
7
|
import { BaseChartProps, DataItem } from '../../types';
|
|
6
|
-
import { Dataset, FieldInfoItem } from '../Dataset/types';
|
|
7
|
-
import { DataSource } from '../DataSource/types';
|
|
8
8
|
/**
|
|
9
9
|
* 合并后的属性类型,包含上下文菜单回调
|
|
10
10
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import type { Components, ExtraProps } from 'react-markdown';
|
|
4
|
+
import { DataFormat, Dataset, FieldInfoItem } from '../../DataView/Dataset/types';
|
|
5
|
+
import { DataSource } from '../../DataView/DataSource/types';
|
|
4
6
|
import { ChartType, DataItem } from '../../types';
|
|
5
7
|
import { TimeGrainType } from '../../utils';
|
|
6
|
-
import { DataFormat, Dataset, FieldInfoItem } from '../Dataset/types';
|
|
7
|
-
import { DataSource } from '../DataSource/types';
|
|
8
8
|
export interface MetricItem {
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionType, TimeRange } from '../../components/CustomTimeRange/types';
|
|
2
|
+
import { DataSource } from '../../DataView/DataSource/types';
|
|
2
3
|
import { TimeGrainType } from '../../utils/date';
|
|
3
|
-
import { DataSource } from '../DataSource/types';
|
|
4
4
|
import { FilterItemType } from './Filter/types';
|
|
5
5
|
import { OrderItemType } from './Orders/types';
|
|
6
6
|
import { dimensionsOptionType } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldInfoItem } from '
|
|
1
|
+
import { FieldInfoItem } from '../../../DataView/Dataset/types';
|
|
2
2
|
export declare function getRightClickInfo(rightClickValue: any[], fieldInfo: FieldInfoItem[] | undefined, metricTime: {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import VMind from '@visactor/vmind';
|
|
2
|
+
import { MetricFormat } from '../../DataView/Dataset/types';
|
|
2
3
|
import { ChartType } from '../../types';
|
|
3
4
|
import { ChartJson } from '../ChartCodeRender/type';
|
|
4
5
|
export declare const vmind: VMind;
|
|
@@ -9,7 +10,7 @@ export declare function isChartAdvisor(chartJson: ChartJson): boolean;
|
|
|
9
10
|
export declare function chartAdvisor(chartJson: ChartJson): Promise<{
|
|
10
11
|
type: any;
|
|
11
12
|
data: import("../..").DataItem[];
|
|
12
|
-
dataset?: import("
|
|
13
|
+
dataset?: import("../../DataView/Dataset/types").Dataset;
|
|
13
14
|
chartId?: string;
|
|
14
15
|
chartName?: string;
|
|
15
16
|
xField?: string;
|
|
@@ -18,16 +19,43 @@ export declare function chartAdvisor(chartJson: ChartJson): Promise<{
|
|
|
18
19
|
valField?: string;
|
|
19
20
|
dimensions?: string[];
|
|
20
21
|
metrics?: string[];
|
|
21
|
-
dataSource?: import("
|
|
22
|
-
columns?: import("
|
|
22
|
+
dataSource?: import("../../DataView/DataSource/types").DataSource;
|
|
23
|
+
columns?: import("../../DataView/Dataset/types").FieldInfoItem[];
|
|
23
24
|
timeGrain?: import("../../utils").TimeGrainType;
|
|
24
|
-
dataFormat?: import("
|
|
25
|
+
dataFormat?: import("../../DataView/Dataset/types").DataFormat;
|
|
25
26
|
hideChartHeader?: boolean;
|
|
26
27
|
series?: any[];
|
|
27
28
|
agent?: import("../ChartCodeRender/type").AgentConfig;
|
|
28
29
|
availableChartTypes?: string[];
|
|
29
30
|
}>;
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* 计算饼图/环形图数据的占比
|
|
33
|
+
* @param data - 数据数组
|
|
34
|
+
* @param metrics - 指标数组(优先使用)
|
|
35
|
+
* @param valField - 值字段名称(当metrics不存在时使用)
|
|
36
|
+
* @returns 添加了占比列的新数据数组
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculatePieDonutPercentage(data: any[], metrics?: string[], valField?: string): any[];
|
|
39
|
+
/**
|
|
40
|
+
* 合并组合图数据
|
|
41
|
+
* 将多个 series 的数据按公共维度字段合并,每个维度值只保留一行
|
|
42
|
+
* @param series - 组合图的 series 数组
|
|
43
|
+
* @returns 合并后的数据数组
|
|
44
|
+
*/
|
|
45
|
+
export declare function mergeCompositeSeriesData(series: any[]): {
|
|
46
|
+
data: any[];
|
|
47
|
+
metrics: string[];
|
|
48
|
+
};
|
|
49
|
+
export interface ExportToExcelOptions {
|
|
50
|
+
data: any[];
|
|
51
|
+
fileName: string;
|
|
52
|
+
dataFormat?: Record<string, MetricFormat>;
|
|
53
|
+
formatValueWithoutUnit?: (fieldName: string, value: any, formatTimeStr?: any) => any;
|
|
54
|
+
chartType?: ChartType;
|
|
55
|
+
metrics?: string[];
|
|
56
|
+
valField?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function exportToExcel({ data, fileName, dataFormat, formatValueWithoutUnit, chartType, metrics, valField, }: ExportToExcelOptions): void;
|
|
31
59
|
export declare function exportToExcelWithSheets(sheets: Array<{
|
|
32
60
|
name: string;
|
|
33
61
|
data: any[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CompositeSeries } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 将 series 配置转换为内部使用的 xField/yField 格式
|
|
4
|
+
* 支持 dimensions/metrics 和 xField/yField 两种方式
|
|
5
|
+
*
|
|
6
|
+
* 优先级:xField/yField > dimensions/metrics
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeSeriesField(series: CompositeSeries): {
|
|
9
|
+
xField: string;
|
|
10
|
+
yField: string;
|
|
11
|
+
dimensions: string[];
|
|
12
|
+
metrics: string[];
|
|
13
|
+
};
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import type { BaseVChartConfig, BaseVChartProps, DataItem } from '../../types';
|
|
2
|
-
import { BarConfig } from '../Bar/types';
|
|
3
2
|
export type CompositeSeriesType = 'bar' | 'line' | 'area' | 'scatter';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean;
|
|
10
|
-
text?: string;
|
|
11
|
-
};
|
|
12
|
-
label?: Record<string, any>;
|
|
13
|
-
type?: string;
|
|
14
|
-
min?: number;
|
|
15
|
-
max?: number;
|
|
16
|
-
grid?: {
|
|
17
|
-
visible?: boolean;
|
|
18
|
-
};
|
|
19
|
-
offset?: number;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
};
|
|
22
|
-
export type CompositeSeries = Omit<BarConfig, 'data' | 'chartName'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Composite 组合图的 series 配置
|
|
5
|
+
* 只包含数据相关的配置,格式化等全局配置在顶层
|
|
6
|
+
*/
|
|
7
|
+
export type CompositeSeries = {
|
|
23
8
|
type: CompositeSeriesType;
|
|
24
9
|
data?: DataItem[];
|
|
25
|
-
|
|
10
|
+
dimensions?: string[];
|
|
11
|
+
metrics?: string[];
|
|
12
|
+
xField?: string;
|
|
13
|
+
yField?: string;
|
|
26
14
|
};
|
|
27
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Composite 组合图配置
|
|
17
|
+
* 全局配置(dataFormat、columns、timeGrain 等)在顶层,与单图表保持一致
|
|
18
|
+
*/
|
|
19
|
+
export type CompositeConfig = BaseVChartConfig & {
|
|
28
20
|
series: CompositeSeries[];
|
|
29
|
-
yAxes?: YAxisConfig[];
|
|
30
21
|
};
|
|
31
22
|
export type CompositeProps = BaseVChartProps & Partial<CompositeConfig>;
|
|
@@ -1,18 +1,38 @@
|
|
|
1
|
+
import type { Tools } from '../../Chart/ChartBase/constants';
|
|
1
2
|
import { DataItem } from '../../types';
|
|
2
|
-
import { CompositeSeries } from './types';
|
|
3
|
+
import type { CompositeSeries } from './types';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* 构建多 Y 轴配置
|
|
6
|
+
* - 第 1 个系列:左轴
|
|
7
|
+
* - 第 2-5 个系列:右轴(带偏移)
|
|
8
|
+
* 注意:不包含 X 轴,X 轴由 getCartesianAxesSpec 生成
|
|
5
9
|
*/
|
|
6
|
-
export declare function
|
|
10
|
+
export declare function buildCompositeAxesSpec(series: CompositeSeries[], tools: Tools): any[];
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
12
|
+
* 为 series 创建 label 格式化函数
|
|
13
|
+
* 使用顶层的 dataFormat 配置(与单图表保持一致)
|
|
9
14
|
*/
|
|
10
|
-
export declare function
|
|
15
|
+
export declare function createSeriesLabelFormatMethod(series: CompositeSeries, tools: Tools): (val: any) => any;
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
17
|
+
* 为数据添加 series 标识字段
|
|
13
18
|
*/
|
|
14
|
-
export declare function
|
|
19
|
+
export declare function addSeriesMetadata(data: DataItem[] | undefined, seriesType: string, seriesIndex: number): DataItem[];
|
|
15
20
|
/**
|
|
16
|
-
*
|
|
21
|
+
* 构建 tooltip 配置
|
|
17
22
|
*/
|
|
18
|
-
export declare function
|
|
23
|
+
export declare function buildCompositeTooltip(series: CompositeSeries[], xField: string, tools: Tools): {
|
|
24
|
+
mark: {
|
|
25
|
+
updateTitle: (prev: any) => any;
|
|
26
|
+
content: {
|
|
27
|
+
key: (datum: any) => string;
|
|
28
|
+
value: (datum: any) => any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
dimension: {
|
|
32
|
+
updateTitle: (prev: any) => any;
|
|
33
|
+
content: {
|
|
34
|
+
key: (datum: any) => string;
|
|
35
|
+
value: (datum: any) => any;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Tools } from '../../Chart/ChartBase/constants';
|
|
2
|
+
interface CartesianCommonOptions {
|
|
3
|
+
axesConfig: {
|
|
4
|
+
xField: string | string[];
|
|
5
|
+
yField: string;
|
|
6
|
+
seriesField?: string;
|
|
7
|
+
};
|
|
8
|
+
xField: string;
|
|
9
|
+
dataset?: any;
|
|
10
|
+
tools: Tools;
|
|
11
|
+
chartConfig?: any;
|
|
12
|
+
}
|
|
13
|
+
export declare function cartesianCommon(options: CartesianCommonOptions): {
|
|
14
|
+
legends: any;
|
|
15
|
+
axes: import("@visactor/vchart").ICartesianAxisSpec[];
|
|
16
|
+
tooltip: {
|
|
17
|
+
mark: {
|
|
18
|
+
updateTitle: (prev: any) => any;
|
|
19
|
+
content: {
|
|
20
|
+
key: (datum: any) => any;
|
|
21
|
+
value: (datum: any) => any;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
dimension: {
|
|
25
|
+
updateTitle: (prev: any) => any;
|
|
26
|
+
content: {
|
|
27
|
+
key: (datum: any) => any;
|
|
28
|
+
value: (datum: any) => any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
label: any;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tools } from '../../Chart/ChartBase/constants';
|
|
2
|
+
import { ChartConfig } from '../../ConfigProvider/hooks';
|
|
3
|
+
import { Charts } from '../../types';
|
|
4
|
+
import { useChartConfigTools } from './hooks';
|
|
5
|
+
type SpecFactory<TConfig extends ChartConfig> = (props: TConfig, tools: Tools, chartConfig: ReturnType<typeof useChartConfigTools>) => any;
|
|
6
|
+
export declare function createChart<TConfig extends ChartConfig>(chartName: Charts, ChartComponent: any, createSpec: SpecFactory<TConfig>): (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -12,15 +12,18 @@ import type { DashSegment } from '../types';
|
|
|
12
12
|
* data,
|
|
13
13
|
* xField: 'time',
|
|
14
14
|
* getFieldType,
|
|
15
|
-
* dashSegments: [{ from: '00:45' }]
|
|
15
|
+
* dashSegments: [{ from: '00:45' }],
|
|
16
|
+
* metrics: ['actual', 'predicted'],
|
|
16
17
|
* });
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
export declare const useDashLine: ({ data, xField, getFieldType, dashSegments, }: {
|
|
20
|
+
export declare const useDashLine: ({ data, xField, yField, getFieldType, dashSegments, metrics, }: {
|
|
20
21
|
data: any[];
|
|
21
|
-
xField
|
|
22
|
+
xField: string;
|
|
23
|
+
yField: string;
|
|
22
24
|
getFieldType?: (fieldName: string, value?: any) => GenericDataType | undefined;
|
|
23
25
|
dashSegments?: DashSegment[];
|
|
26
|
+
metrics?: string[];
|
|
24
27
|
}) => {
|
|
25
28
|
processedData: any[];
|
|
26
29
|
style: any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Tools } from '../../Chart/ChartBase/constants';
|
|
2
|
+
interface PolarCommonOptions {
|
|
3
|
+
axesConfig: {
|
|
4
|
+
nameField: string;
|
|
5
|
+
valField: string;
|
|
6
|
+
seriesField?: string;
|
|
7
|
+
};
|
|
8
|
+
dataset?: any;
|
|
9
|
+
tools: Tools;
|
|
10
|
+
chartConfig?: any;
|
|
11
|
+
showPercent?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function polarCommon(options: PolarCommonOptions): {
|
|
14
|
+
tooltip: {
|
|
15
|
+
mark: {
|
|
16
|
+
title: {
|
|
17
|
+
value: (datum: any) => any;
|
|
18
|
+
};
|
|
19
|
+
content: {
|
|
20
|
+
key: (datum: any) => any;
|
|
21
|
+
value: (datum: any) => any;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
dimension: {
|
|
25
|
+
title: {
|
|
26
|
+
value: (datum: any) => any;
|
|
27
|
+
};
|
|
28
|
+
content: {
|
|
29
|
+
key: (datum: any) => any;
|
|
30
|
+
value: (datum: any) => any;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
legends: {
|
|
35
|
+
visible: boolean;
|
|
36
|
+
item: {
|
|
37
|
+
label: {
|
|
38
|
+
formatMethod: (val: any) => any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
label: any;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { FilterItem } from '../../Chart/ChartControllers/Filter/types';
|
|
1
2
|
import { TimeRange } from '../../components/CustomTimeRange/types';
|
|
2
|
-
import { FilterItem } from '../ChartControllers/Filter/types';
|
|
3
3
|
import { FieldInfoItem } from '../Dataset/types';
|
|
4
4
|
export declare const DataSourceTypes: {
|
|
5
5
|
METRIC: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataView - 数据视图层(精简版)
|
|
3
|
+
*
|
|
4
|
+
* 核心类,只保留核心业务逻辑
|
|
5
|
+
* 工具函数已提取到 transforms.ts
|
|
6
|
+
*/
|
|
7
|
+
import { ChartJson } from '../../Chart/ChartCodeRender/type';
|
|
8
|
+
import { Dataset, FieldInfoItem } from '../Dataset/types';
|
|
9
|
+
/**
|
|
10
|
+
* DataView 类
|
|
11
|
+
* 核心职责:状态管理 + 流程协调
|
|
12
|
+
*/
|
|
13
|
+
export declare class DataView {
|
|
14
|
+
private chartJson;
|
|
15
|
+
private fieldInfo;
|
|
16
|
+
private transformResult;
|
|
17
|
+
constructor(chartJson: ChartJson);
|
|
18
|
+
/**
|
|
19
|
+
* 转换数据(核心入口)
|
|
20
|
+
* 协调所有转换步骤
|
|
21
|
+
*/
|
|
22
|
+
transform(): Dataset;
|
|
23
|
+
/**
|
|
24
|
+
* 获取转换结果
|
|
25
|
+
*/
|
|
26
|
+
getResult(): Dataset;
|
|
27
|
+
/**
|
|
28
|
+
* 获取字段信息
|
|
29
|
+
*/
|
|
30
|
+
getFieldInfo(): FieldInfoItem[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 独立导出函数(保持与旧代码兼容)
|
|
34
|
+
*/
|
|
35
|
+
export declare const transform2Dataset: (chartJson: ChartJson) => Dataset;
|
|
36
|
+
export declare const checkUptateDataSet: (preJson: ChartJson, newJson: ChartJson, dataset: Dataset) => {
|
|
37
|
+
dataset?: Dataset;
|
|
38
|
+
isShouldUpdate: boolean;
|
|
39
|
+
};
|
|
40
|
+
export default DataView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataView 常量
|
|
3
|
+
*/
|
|
4
|
+
export declare const SEPARATOR = ",";
|
|
5
|
+
export declare const FOLD_KEY_NAME = "fold-key";
|
|
6
|
+
export declare const MERGE_COLUMN_KEY_NAME = "megre-column-name";
|
|
7
|
+
/**
|
|
8
|
+
* 生成唯一键名
|
|
9
|
+
* 每次调用都会生成新的唯一键
|
|
10
|
+
*/
|
|
11
|
+
export declare const getKeys: () => {
|
|
12
|
+
keyId: string;
|
|
13
|
+
FOLD_KEY: string;
|
|
14
|
+
MERGE_COLUMN_NAME: string;
|
|
15
|
+
};
|