@advt-gpt-chart/package 3.2.3 → 3.2.5
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/ChartWrapper/utils.d.ts +29 -1
- package/dist/Charts/Composite/util.d.ts +2 -2
- package/dist/Charts/common/hooks/useDashLine.d.ts +4 -2
- package/dist/index.es.js +19088 -18961
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +674 -674
- package/dist/index.umd.js.gz +0 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -27,7 +28,34 @@ export declare function chartAdvisor(chartJson: ChartJson): Promise<{
|
|
|
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[];
|
|
@@ -4,10 +4,10 @@ import type { CompositeSeries } from './types';
|
|
|
4
4
|
/**
|
|
5
5
|
* 构建多 Y 轴配置
|
|
6
6
|
* - 第 1 个系列:左轴
|
|
7
|
-
* - 第 2-
|
|
7
|
+
* - 第 2-6 个系列:右轴(带偏移)
|
|
8
8
|
* 注意:不包含 X 轴,X 轴由 getCartesianAxesSpec 生成
|
|
9
9
|
*/
|
|
10
|
-
export declare function buildCompositeAxesSpec(series: CompositeSeries[], tools: Tools): any[];
|
|
10
|
+
export declare function buildCompositeAxesSpec(series: CompositeSeries[], tools: Tools, seriesColors?: string[]): any[];
|
|
11
11
|
/**
|
|
12
12
|
* 为 series 创建 label 格式化函数
|
|
13
13
|
* 使用顶层的 dataFormat 配置(与单图表保持一致)
|
|
@@ -12,16 +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, yField, getFieldType, dashSegments, }: {
|
|
20
|
+
export declare const useDashLine: ({ data, xField, yField, getFieldType, dashSegments, metrics, }: {
|
|
20
21
|
data: any[];
|
|
21
22
|
xField: string;
|
|
22
23
|
yField: string;
|
|
23
24
|
getFieldType?: (fieldName: string, value?: any) => GenericDataType | undefined;
|
|
24
25
|
dashSegments?: DashSegment[];
|
|
26
|
+
metrics?: string[];
|
|
25
27
|
}) => {
|
|
26
28
|
processedData: any[];
|
|
27
29
|
style: any;
|