@advt-gpt-chart/package 2.1.1 → 2.1.3

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.
Files changed (34) hide show
  1. package/README.md +55 -55
  2. package/dist/Chart/ChartBase/constants.d.ts +8 -24
  3. package/dist/Chart/ChartBase/transformed.d.ts +1 -0
  4. package/dist/Chart/ChartCodeRender/type.d.ts +2 -1
  5. package/dist/Chart/ChartControllers/DataFormat/DataFormat.d.ts +6 -0
  6. package/dist/Chart/ChartControllers/DataFormat/styles.d.ts +3 -0
  7. package/dist/Chart/ChartControllers/DataFormat/types.d.ts +0 -0
  8. package/dist/Chart/ChartControllers/DataFormat/utils.d.ts +12 -0
  9. package/dist/Chart/ChartControllers/TimeRange/types.d.ts +2 -0
  10. package/dist/Chart/ChartControllers/utils.d.ts +14 -0
  11. package/dist/Chart/ChartWrapper/ChartHeader.d.ts +3 -1
  12. package/dist/Chart/ChartWrapper/ChartMenu.d.ts +2 -0
  13. package/dist/Chart/ChartWrapper/ChartWrapper.d.ts +1 -1
  14. package/dist/Chart/ChartWrapper/contants.d.ts +4 -0
  15. package/dist/Chart/ChartWrapper/style.d.ts +4 -5
  16. package/dist/Chart/ChartWrapper/utils.d.ts +2 -0
  17. package/dist/Chart/DataSource/useChartDataQuery.d.ts +1 -1
  18. package/dist/Chart/Dataset/types.d.ts +9 -0
  19. package/dist/Chart/Dataset/useDataset.d.ts +12 -4
  20. package/dist/Charts/Indicator/styles.d.ts +6 -2
  21. package/dist/GPTVis/hooks/useChartStore.d.ts +6 -2
  22. package/dist/index.es.js +131166 -108979
  23. package/dist/index.es.js.gz +0 -0
  24. package/dist/index.umd.js +1560 -978
  25. package/dist/index.umd.js.gz +0 -0
  26. package/dist/locale/en-US.d.ts +14 -0
  27. package/dist/locale/zh-CN.d.ts +14 -0
  28. package/dist/locale/zh-TW.d.ts +14 -0
  29. package/dist/services/index.d.ts +1 -1
  30. package/dist/types/chart.d.ts +25 -0
  31. package/dist/utils/downloadAsImage.d.ts +1 -1
  32. package/dist/utils/useTools.d.ts +4 -3
  33. package/dist/version.d.ts +1 -1
  34. package/package.json +6 -4
Binary file
@@ -100,4 +100,18 @@ export declare const en_US: {
100
100
  metricError: string;
101
101
  chartDataLoadingFailed: string;
102
102
  drillDataLoadingFailed: string;
103
+ DownloadImage: string;
104
+ DownloadExcel: string;
105
+ MetricDataFormat: string;
106
+ fullscreen: string;
107
+ formatType: string;
108
+ decimalPlaces: string;
109
+ metrics: string;
110
+ none: string;
111
+ number: string;
112
+ percentage_raw: string;
113
+ percentage_scaled: string;
114
+ temperature: string;
115
+ currency: string;
116
+ custom_unit: string;
103
117
  };
@@ -100,4 +100,18 @@ export declare const zh_CN: {
100
100
  metricError: string;
101
101
  chartDataLoadingFailed: string;
102
102
  drillDataLoadingFailed: string;
103
+ DownloadImage: string;
104
+ DownloadExcel: string;
105
+ MetricDataFormat: string;
106
+ fullscreen: string;
107
+ formatType: string;
108
+ decimalPlaces: string;
109
+ metrics: string;
110
+ none: string;
111
+ number: string;
112
+ percentage_raw: string;
113
+ percentage_scaled: string;
114
+ temperature: string;
115
+ currency: string;
116
+ custom_unit: string;
103
117
  };
@@ -100,4 +100,18 @@ export declare const zh_TW: {
100
100
  metricError: string;
101
101
  chartDataLoadingFailed: string;
102
102
  drillDataLoadingFailed: string;
103
+ DownloadImage: string;
104
+ DownloadExcel: string;
105
+ MetricDataFormat: string;
106
+ fullscreen: string;
107
+ formatType: string;
108
+ decimalPlaces: string;
109
+ metrics: string;
110
+ none: string;
111
+ number: string;
112
+ percentage_raw: string;
113
+ percentage_scaled: string;
114
+ temperature: string;
115
+ currency: string;
116
+ custom_unit: string;
103
117
  };
@@ -7,7 +7,7 @@ declare class backService {
7
7
  protocol: Protocol;
8
8
  timeout: number;
9
9
  headers: RawAxiosRequestHeaders;
10
- constructor({ baseURL, host, protocol, timeout, headers, }?: InitConfig);
10
+ constructor({ baseURL, host, protocol, timeout, headers }?: InitConfig);
11
11
  get<T extends ParseMethod = 'json'>(requestConfig: RequestConfig & {
12
12
  parseMethod?: T;
13
13
  }): Promise<{
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
  import { ChartJson } from '../Chart/ChartCodeRender/type';
3
+ import { OptionType } from '../Chart/ChartControllers/TimeRange/types';
3
4
  import { TimeGrainType } from '../utils';
4
5
  export declare enum ChartType {
5
6
  Area = "area",
@@ -53,6 +54,7 @@ export declare const handleChartTypeChange: (chartType: ChartType, preChartJson:
53
54
  dataSource?: import("../Chart/DataSource/types").DataSource;
54
55
  columns?: import("../Chart/Dataset/types").FieldInfoItem[];
55
56
  timeGrain?: TimeGrainType;
57
+ dataFormat?: import("../Chart/Dataset/types").DataFormat;
56
58
  };
57
59
  export type ChangeInfo = {
58
60
  metrics: string[];
@@ -76,5 +78,28 @@ export declare const handleChartDataSourceChange: ({ metrics, dimensions, timeGr
76
78
  dataSource?: import("../Chart/DataSource/types").DataSource;
77
79
  columns?: import("../Chart/Dataset/types").FieldInfoItem[];
78
80
  timeGrain?: TimeGrainType;
81
+ dataFormat?: import("../Chart/Dataset/types").DataFormat;
82
+ };
83
+ export type QueryDataInfo = {
84
+ metrics?: OptionType[];
85
+ dimensions?: OptionType[];
86
+ chartJson: ChartJson;
87
+ isInit?: Boolean;
88
+ };
89
+ export declare const transformQueryData2ChartJson: ({ metrics: dataMetrics, dimensions: dataDimensions, chartJson, isInit, }: QueryDataInfo) => {
90
+ metrics: string[];
91
+ dimensions: string[];
92
+ type: ChartType;
93
+ data: DataItem[];
94
+ chartId?: string;
95
+ chartName?: string;
96
+ xField?: string;
97
+ yField?: string;
98
+ nameField?: string;
99
+ valField?: string;
100
+ dataSource?: import("../Chart/DataSource/types").DataSource;
101
+ columns?: import("../Chart/Dataset/types").FieldInfoItem[];
102
+ timeGrain?: TimeGrainType;
103
+ dataFormat?: import("../Chart/Dataset/types").DataFormat;
79
104
  };
80
105
  export {};
@@ -8,4 +8,4 @@ import { SyntheticEvent } from 'react';
8
8
  * @param isExactSelector if false, searches for the closest ancestor that matches selector.
9
9
  * @returns event handler
10
10
  */
11
- export default function downloadAsImage(selector: string, description: string, isExactSelector?: boolean): (event: SyntheticEvent) => Promise<void> | null;
11
+ export default function downloadAsImage(selector: string, description: string, isExactSelector?: boolean): (event?: SyntheticEvent) => Promise<void> | null;
@@ -1,14 +1,15 @@
1
- import { FieldInfoItem } from '../Chart/Dataset/types';
1
+ import { FieldInfoItem, MetricFormat } from '../Chart/Dataset/types';
2
2
  import { GenericDataType } from './data';
3
3
  import { TimeGrainValue } from './date';
4
4
  export declare const formatTimeTool: (value: string | number, formatStr?: string) => string | number;
5
5
  export declare const getFieldTypeTool: (fieldInfo: FieldInfoItem[], fieldName: string, value?: any) => GenericDataType | undefined;
6
- export declare const formatValueTool: (fieldInfo: FieldInfoItem[], fieldName: string, value: any, formatStr?: string) => any;
6
+ export declare const formatTimeValueTool: (fieldInfo: FieldInfoItem[], fieldName: string, value: any, formatStr?: string) => any;
7
7
  export declare const formatTimestampTool: (fieldInfo: FieldInfoItem[] | undefined, fieldName: string, value: any) => any;
8
+ export declare const formatNumberTool: (value: any, dataFormat: MetricFormat) => any;
8
9
  export declare const useTools: () => {
9
10
  formatTime: (value: string | number, formatStr?: string) => string | number;
10
11
  getFieldType: (fieldName: string, value?: any) => GenericDataType | undefined;
11
- formatValue: (fieldName: string, value: any, formatStr?: string) => any;
12
+ formatValue: (fieldName: string, value: any, formatTimeStr?: string) => any;
12
13
  getAxesType: (fieldName: string) => "linear" | "band";
13
14
  };
14
15
  export declare function estimateTimeGrain(data: any[], timeFieldNames: string[]): TimeGrainValue;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const version = "2.1.1";
1
+ declare const version = "2.1.3";
2
2
  export default version;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@advt-gpt-chart/package",
3
3
  "private": false,
4
- "version": "2.1.1",
4
+ "version": "2.1.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -34,8 +34,9 @@
34
34
  "@visactor/vdataset": "^1.0.9",
35
35
  "@visactor/vmind": "^2.0.10",
36
36
  "@visactor/vtable": "^1.19.7",
37
- "antd": "^5.25.4",
37
+ "antd": "^6.1.0",
38
38
  "axios": "^1.10.0",
39
+ "classnames": "^2.5.1",
39
40
  "dayjs": "^1.11.13",
40
41
  "dom-to-image-more": "^3.6.0",
41
42
  "lodash-es": "^4.17.21",
@@ -46,11 +47,12 @@
46
47
  "remark-gfm": "^4.0.1",
47
48
  "styled-components": "^6.1.18",
48
49
  "vite-plugin-svgr": "^4.3.0",
50
+ "xlsx": "^0.18.5",
49
51
  "zustand": "^4.5.2"
50
52
  },
51
53
  "devDependencies": {
52
- "@ant-design/icons": "^6.0.0",
53
- "@ant-design/x": "^1.4.0",
54
+ "@ant-design/icons": "^6.1.0",
55
+ "@ant-design/x": "^2.1.1",
54
56
  "@chromatic-com/storybook": "4.0.0",
55
57
  "@eslint/js": "^9.28.0",
56
58
  "@storybook/addon-actions": "^9.0.4",