@advt-gpt-chart/package 0.0.20 → 0.0.27
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 +2 -2
- package/dist/Chart/ChartBase/transformed.d.ts +16 -117
- package/dist/Chart/ChartBase/types.d.ts +2 -1
- package/dist/Chart/ChartCodeRender/type.d.ts +2 -0
- package/dist/Chart/ChartCodeRender/visChart/ChartStoreContext.d.ts +1 -1
- package/dist/Chart/ChartControllers/TimeRange/types.d.ts +2 -1
- package/dist/Chart/ChartControllers/TimeRange/utils.d.ts +13 -2
- package/dist/Chart/ChartControllers/index.d.ts +2 -1
- package/dist/Chart/ChartEvents/ChartContextMenu/utils.d.ts +1 -1
- package/dist/Chart/ChartEvents/DrillBy/utils.d.ts +7 -0
- package/dist/Chart/ChartWrapper/utils.d.ts +2 -1
- package/dist/Chart/DataSource/useChartDataQuery.d.ts +1 -1
- package/dist/Chart/Dataset/types.d.ts +17 -1
- package/dist/Chart/Dataset/useDataset.d.ts +84 -0
- package/dist/GPTVis/hooks/{useStore.d.ts → useChartStore.d.ts} +5 -1
- package/dist/index.es.js +133953 -133654
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +2940 -2927
- package/dist/index.umd.js.gz +0 -0
- package/dist/types/chart.d.ts +6 -1
- package/dist/types/config.d.ts +8 -1
- package/dist/utils/data.d.ts +6 -0
- package/dist/utils/date.d.ts +14 -3
- package/dist/utils/useTools.d.ts +8 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js.gz
CHANGED
|
Binary file
|
package/dist/types/chart.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ChartJson } from '../Chart/ChartCodeRender/type';
|
|
3
|
+
import { TimeGrainType } from '../utils';
|
|
3
4
|
export declare enum ChartType {
|
|
4
5
|
Area = "area",
|
|
5
6
|
Bar = "bar",
|
|
@@ -51,14 +52,17 @@ export declare const handleChartTypeChange: (chartType: ChartType, preChartJson:
|
|
|
51
52
|
metrics?: string[];
|
|
52
53
|
dataSource?: import("../Chart/DataSource/types").DataSource;
|
|
53
54
|
columns?: import("../Chart/Dataset/types").FieldInfoItem[];
|
|
55
|
+
timeGrain?: TimeGrainType;
|
|
54
56
|
};
|
|
55
57
|
export type ChangeInfo = {
|
|
56
58
|
metrics: string[];
|
|
57
59
|
dimensions: string[];
|
|
60
|
+
timeGrain?: TimeGrainType;
|
|
58
61
|
chartJson: ChartJson;
|
|
59
62
|
data: DataItem[];
|
|
63
|
+
isInit?: Boolean;
|
|
60
64
|
};
|
|
61
|
-
export declare const handleChartDataSourceChange: ({ metrics, dimensions, chartJson, data, }: ChangeInfo) => {
|
|
65
|
+
export declare const handleChartDataSourceChange: ({ metrics, dimensions, timeGrain, chartJson, data, isInit, }: ChangeInfo) => {
|
|
62
66
|
metrics: string[];
|
|
63
67
|
dimensions: string[];
|
|
64
68
|
data: DataItem[];
|
|
@@ -71,5 +75,6 @@ export declare const handleChartDataSourceChange: ({ metrics, dimensions, chartJ
|
|
|
71
75
|
valField?: string;
|
|
72
76
|
dataSource?: import("../Chart/DataSource/types").DataSource;
|
|
73
77
|
columns?: import("../Chart/Dataset/types").FieldInfoItem[];
|
|
78
|
+
timeGrain?: TimeGrainType;
|
|
74
79
|
};
|
|
75
80
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Charts, ChartType } from './chart';
|
|
2
2
|
export type CommonGlobalConfig = {
|
|
3
3
|
theme?: string;
|
|
4
4
|
lang?: string;
|
|
@@ -14,4 +14,11 @@ export type GlobalConfig = {
|
|
|
14
14
|
vchart?: VChartGlobalConfig;
|
|
15
15
|
components?: ComponentsGlobalConfig;
|
|
16
16
|
};
|
|
17
|
+
export declare const DEFAULT_CHART_JSON: {
|
|
18
|
+
type: ChartType;
|
|
19
|
+
data: never[];
|
|
20
|
+
columns: never[];
|
|
21
|
+
metrics: never[];
|
|
22
|
+
dimensions: never[];
|
|
23
|
+
};
|
|
17
24
|
export {};
|
package/dist/utils/data.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export declare const fieldTypeMap: {
|
|
|
12
12
|
date: GenericDataType;
|
|
13
13
|
time: GenericDataType;
|
|
14
14
|
number: GenericDataType;
|
|
15
|
+
double: GenericDataType;
|
|
15
16
|
bigint: GenericDataType;
|
|
17
|
+
numerical: GenericDataType;
|
|
18
|
+
ratio: GenericDataType;
|
|
19
|
+
count: GenericDataType;
|
|
20
|
+
float: GenericDataType;
|
|
21
|
+
int: GenericDataType;
|
|
16
22
|
string: GenericDataType;
|
|
17
23
|
};
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
export declare const DATE_FORMAT = "YYYY/MM/DD HH:mm:ss";
|
|
2
2
|
export declare const DATE_FORMAT_API = "YYYY-MM-DD HH:mm:ss";
|
|
3
3
|
export declare const DATE_FORMATS: string[];
|
|
4
|
+
export declare enum TimeGrainValue {
|
|
5
|
+
Second = "second",
|
|
6
|
+
Minute = "minute",
|
|
7
|
+
Hour = "hour",
|
|
8
|
+
Day = "day",
|
|
9
|
+
Week = "week",
|
|
10
|
+
Month = "month",
|
|
11
|
+
Quarter = "quarter",
|
|
12
|
+
Year = "year"
|
|
13
|
+
}
|
|
14
|
+
export type TimeGrainType = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
4
15
|
export declare const timeGrainFormater: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
second: string;
|
|
17
|
+
minute: string;
|
|
18
|
+
hour: string;
|
|
8
19
|
day: string;
|
|
9
20
|
week: string;
|
|
10
21
|
month: string;
|
package/dist/utils/useTools.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { FieldInfoItem } from '../Chart/Dataset/types';
|
|
1
2
|
import { GenericDataType } from './data';
|
|
3
|
+
import { TimeGrainValue } from './date';
|
|
4
|
+
export declare const formatTimeTool: (value: string | number, formatStr?: string) => string | number;
|
|
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;
|
|
7
|
+
export declare const formatTimestampTool: (fieldInfo: FieldInfoItem[] | undefined, fieldName: string, value: any) => any;
|
|
2
8
|
export declare const useTools: () => {
|
|
3
9
|
formatTime: (value: string | number, formatStr?: string) => string | number;
|
|
4
10
|
getFieldType: (fieldName: string, value?: any) => GenericDataType | undefined;
|
|
5
11
|
formatValue: (fieldName: string, value: any, formatStr?: string) => any;
|
|
12
|
+
getAxesType: (fieldName: string) => "linear" | "band";
|
|
6
13
|
};
|
|
14
|
+
export declare function estimateTimeGrain(data: any[], timeFieldNames: string[]): TimeGrainValue;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.0.
|
|
1
|
+
declare const _default: "0.0.27";
|
|
2
2
|
export default _default;
|