@advt-gpt-chart/package 0.0.9
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/README.md +55 -0
- package/dist/Area/index.d.ts +3 -0
- package/dist/Area/types.d.ts +9 -0
- package/dist/Bar/index.d.ts +3 -0
- package/dist/Bar/types.d.ts +9 -0
- package/dist/ChartCodeRender/Loading.d.ts +2 -0
- package/dist/ChartCodeRender/VisChart.d.ts +11 -0
- package/dist/ChartCodeRender/index.d.ts +8 -0
- package/dist/ChartCodeRender/type.d.ts +54 -0
- package/dist/ChartContainer/chartContextProvider.d.ts +10 -0
- package/dist/ChartContainer/index.d.ts +9 -0
- package/dist/ChartContainer/style.d.ts +5 -0
- package/dist/ConfigProvider/context.d.ts +3 -0
- package/dist/ConfigProvider/hooks/index.d.ts +1 -0
- package/dist/ConfigProvider/hooks/useConfig.d.ts +32 -0
- package/dist/ConfigProvider/index.d.ts +7 -0
- package/dist/Donut/index.d.ts +3 -0
- package/dist/Donut/types.d.ts +8 -0
- package/dist/Funnel/index.d.ts +3 -0
- package/dist/Funnel/types.d.ts +8 -0
- package/dist/GPTVis/Lite.d.ts +19 -0
- package/dist/GPTVis/hooks/useContext.d.ts +8 -0
- package/dist/GPTVis/hooks/useEvent.d.ts +1 -0
- package/dist/GPTVis/index.d.ts +6 -0
- package/dist/Gauge/index.d.ts +3 -0
- package/dist/Gauge/types.d.ts +8 -0
- package/dist/Heatmap/index.d.ts +3 -0
- package/dist/Heatmap/types.d.ts +8 -0
- package/dist/Indicator/contants.d.ts +5 -0
- package/dist/Indicator/index.d.ts +3 -0
- package/dist/Indicator/styles.d.ts +7 -0
- package/dist/Indicator/types.d.ts +15 -0
- package/dist/Line/index.d.ts +3 -0
- package/dist/Line/types.d.ts +9 -0
- package/dist/Pie/index.d.ts +3 -0
- package/dist/Pie/types.d.ts +8 -0
- package/dist/Radar/index.d.ts +3 -0
- package/dist/Radar/types.d.ts +9 -0
- package/dist/Radar/utils.d.ts +2 -0
- package/dist/Rank/index.d.ts +3 -0
- package/dist/Rank/types.d.ts +9 -0
- package/dist/Scatter/index.d.ts +3 -0
- package/dist/Scatter/types.d.ts +9 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Table/theme.d.ts +2 -0
- package/dist/Table/types.d.ts +7 -0
- package/dist/Text/VisText.d.ts +3 -0
- package/dist/Text/config.d.ts +19 -0
- package/dist/Text/custom-icons/index.d.ts +2 -0
- package/dist/Text/index.d.ts +3 -0
- package/dist/Text/mini-charts/hooks/getElementFontSize.d.ts +1 -0
- package/dist/Text/mini-charts/hooks/index.d.ts +1 -0
- package/dist/Text/mini-charts/hooks/useSvgWrapper.d.ts +5 -0
- package/dist/Text/mini-charts/index.d.ts +2 -0
- package/dist/Text/mini-charts/line/SingleLineChart.d.ts +3 -0
- package/dist/Text/mini-charts/line/index.d.ts +1 -0
- package/dist/Text/mini-charts/line/scaleLinear.d.ts +4 -0
- package/dist/Text/mini-charts/line/useLineCompute.d.ts +6 -0
- package/dist/Text/mini-charts/proportion/getArcPath.d.ts +1 -0
- package/dist/Text/mini-charts/proportion/index.d.ts +3 -0
- package/dist/Text/theme.d.ts +24 -0
- package/dist/Text/types.d.ts +20 -0
- package/dist/Text/utils/getThemeColor.d.ts +11 -0
- package/dist/Text/utils/index.d.ts +2 -0
- package/dist/Text/utils/useAntdDarkAlgorithm.d.ts +2 -0
- package/dist/VChartBase/constants.d.ts +54 -0
- package/dist/VChartBase/index.d.ts +3 -0
- package/dist/VChartBase/tooltip.d.ts +1 -0
- package/dist/VChartBase/transformed.d.ts +129 -0
- package/dist/VChartBase/types.d.ts +15 -0
- package/dist/VChartBase/utils.d.ts +15 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/light.d.ts +2 -0
- package/dist/export.d.ts +34 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.es.js +136615 -0
- package/dist/index.es.js.br +0 -0
- package/dist/index.umd.js +825 -0
- package/dist/index.umd.js.br +0 -0
- package/dist/types/chart.d.ts +27 -0
- package/dist/types/config.d.ts +16 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/date.d.ts +3 -0
- package/dist/utils/echart.d.ts +4 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/version.d.ts +2 -0
- package/package.json +94 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ICartesianAxisSpec } from '@visactor/vchart';
|
|
2
|
+
import { DataItem } from '../types';
|
|
3
|
+
import { AxesType } from './utils';
|
|
4
|
+
type CartesianOptions = {
|
|
5
|
+
xField: string;
|
|
6
|
+
yField: string;
|
|
7
|
+
};
|
|
8
|
+
type CartesianTooltipOptions = CartesianOptions & {
|
|
9
|
+
seriesField?: string;
|
|
10
|
+
};
|
|
11
|
+
type PolarTooltipOptions = {
|
|
12
|
+
categoryField: string;
|
|
13
|
+
valueField: string;
|
|
14
|
+
seriesField?: string;
|
|
15
|
+
showPercent?: boolean;
|
|
16
|
+
categoryFieldType?: AxesType;
|
|
17
|
+
};
|
|
18
|
+
export declare const getPolarLegend: (seriesField: string | boolean | undefined, categoryFieldType?: AxesType) => {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
item: {
|
|
21
|
+
label: {
|
|
22
|
+
formatMethod: (val: any) => string | number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const getCartesianLegend: (xField?: string, seriesField?: string | boolean) => any;
|
|
27
|
+
export declare const getPolarTooltip: ({ categoryField, valueField, seriesField, showPercent, categoryFieldType, }: PolarTooltipOptions) => any;
|
|
28
|
+
export declare const getDefaultTooltip: (seriesField: string | boolean | undefined) => {
|
|
29
|
+
mark: {
|
|
30
|
+
title: {
|
|
31
|
+
visible: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
dimension: {
|
|
35
|
+
title: {
|
|
36
|
+
visible: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const getCartesianTootip: (data: DataItem[], { xField, yField, seriesField }: CartesianTooltipOptions) => any;
|
|
41
|
+
export declare const getCartesianAxes: (data: DataItem[], options: CartesianOptions) => ICartesianAxisSpec[];
|
|
42
|
+
export declare const getLineStyle: () => {
|
|
43
|
+
line: {
|
|
44
|
+
style: {
|
|
45
|
+
lineWidth: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
point: {
|
|
49
|
+
style: {
|
|
50
|
+
size: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tooltipHtml(data: string[][], title?: string, focusedRow?: number): string;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { DataItem } from '../types';
|
|
2
|
+
export declare enum DSType {
|
|
3
|
+
sdsm = "singleDemensionSingleMetric",
|
|
4
|
+
sdmm = "singleDemensionMultiMetric",
|
|
5
|
+
mdsm = "multiDemensionSingleMetric",
|
|
6
|
+
mdmm = "multiDemensionMultiMetric"
|
|
7
|
+
}
|
|
8
|
+
export declare function transform2CartesianData(data: DataItem[], options: {
|
|
9
|
+
id: string;
|
|
10
|
+
xField: string;
|
|
11
|
+
yField: string;
|
|
12
|
+
metrics?: string[];
|
|
13
|
+
dimensions?: string[];
|
|
14
|
+
separator?: string;
|
|
15
|
+
}): {
|
|
16
|
+
data: DataItem[];
|
|
17
|
+
transformedData: DataItem[];
|
|
18
|
+
needFold: boolean;
|
|
19
|
+
needFoldFields: string[];
|
|
20
|
+
dsType: DSType;
|
|
21
|
+
metricsKey?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
data: DataItem[];
|
|
24
|
+
transformedData: DataItem[];
|
|
25
|
+
metricsKey: string;
|
|
26
|
+
needFold: boolean;
|
|
27
|
+
dsType: DSType;
|
|
28
|
+
needFoldFields?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
data: DataItem[];
|
|
31
|
+
transformedData: any[];
|
|
32
|
+
needFold: boolean;
|
|
33
|
+
dsType: DSType;
|
|
34
|
+
needFoldFields?: undefined;
|
|
35
|
+
metricsKey?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
data: DataItem[];
|
|
38
|
+
transformedData: DataItem[];
|
|
39
|
+
needFold: boolean;
|
|
40
|
+
needFoldFields?: undefined;
|
|
41
|
+
dsType?: undefined;
|
|
42
|
+
metricsKey?: undefined;
|
|
43
|
+
};
|
|
44
|
+
export declare function transformCartesianFoldData(data: DataItem[], options: {
|
|
45
|
+
id: string;
|
|
46
|
+
xField: string;
|
|
47
|
+
yField: string;
|
|
48
|
+
metricsKey?: string;
|
|
49
|
+
needFold?: boolean;
|
|
50
|
+
needFoldFields?: string[];
|
|
51
|
+
}): {
|
|
52
|
+
foldData: DataItem[];
|
|
53
|
+
seriesField: string | undefined;
|
|
54
|
+
foldKey?: undefined;
|
|
55
|
+
foldValue?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
foldData: any;
|
|
58
|
+
foldKey: string;
|
|
59
|
+
foldValue: string;
|
|
60
|
+
seriesField: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function transform2PolarData(data: DataItem[], options: {
|
|
63
|
+
id: string;
|
|
64
|
+
nameField: string;
|
|
65
|
+
valField: string;
|
|
66
|
+
metrics?: string[];
|
|
67
|
+
dimensions?: string[];
|
|
68
|
+
separator?: string;
|
|
69
|
+
}): {
|
|
70
|
+
data: DataItem[];
|
|
71
|
+
transformedData: DataItem[];
|
|
72
|
+
needFold: boolean;
|
|
73
|
+
dsType: DSType;
|
|
74
|
+
needFoldFields?: undefined;
|
|
75
|
+
metricsKey?: undefined;
|
|
76
|
+
isOneDemension?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
data: DataItem[];
|
|
79
|
+
transformedData: DataItem[];
|
|
80
|
+
needFold: boolean;
|
|
81
|
+
needFoldFields: string[];
|
|
82
|
+
dsType: DSType;
|
|
83
|
+
metricsKey?: undefined;
|
|
84
|
+
isOneDemension?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
data: DataItem[];
|
|
87
|
+
transformedData: {
|
|
88
|
+
[key: string]: string | number;
|
|
89
|
+
}[];
|
|
90
|
+
metricsKey: string;
|
|
91
|
+
needFold: boolean;
|
|
92
|
+
dsType: DSType;
|
|
93
|
+
isOneDemension: boolean;
|
|
94
|
+
needFoldFields?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
data: DataItem[];
|
|
97
|
+
transformedData: {
|
|
98
|
+
[key: string]: string | number;
|
|
99
|
+
}[];
|
|
100
|
+
metricsKey: string;
|
|
101
|
+
needFold: boolean;
|
|
102
|
+
needFoldFields: string[];
|
|
103
|
+
dsType: DSType;
|
|
104
|
+
isOneDemension: boolean;
|
|
105
|
+
} | {
|
|
106
|
+
data: DataItem[];
|
|
107
|
+
transformedData: DataItem[];
|
|
108
|
+
needFold: boolean;
|
|
109
|
+
dsType?: undefined;
|
|
110
|
+
needFoldFields?: undefined;
|
|
111
|
+
metricsKey?: undefined;
|
|
112
|
+
isOneDemension?: undefined;
|
|
113
|
+
};
|
|
114
|
+
export declare function transformPolarFoldData(data: DataItem[], options: {
|
|
115
|
+
id: string;
|
|
116
|
+
nameField: string;
|
|
117
|
+
valField: string;
|
|
118
|
+
metricsKey?: string;
|
|
119
|
+
needFold?: boolean;
|
|
120
|
+
needFoldFields?: string[] | null;
|
|
121
|
+
}): {
|
|
122
|
+
foldData: DataItem[];
|
|
123
|
+
foldKey?: undefined;
|
|
124
|
+
foldValue?: undefined;
|
|
125
|
+
} | {
|
|
126
|
+
foldData: any;
|
|
127
|
+
foldKey: string;
|
|
128
|
+
foldValue: string;
|
|
129
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IChartSpec } from '@visactor/vchart';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import { BaseChartProps, DataItem } from '../types';
|
|
4
|
+
export interface VChartBaseProps extends BaseChartProps {
|
|
5
|
+
VChart: ComponentType<any>;
|
|
6
|
+
spec?: Partial<IChartSpec>;
|
|
7
|
+
}
|
|
8
|
+
export interface BaseVChartConfig<T = DataItem> {
|
|
9
|
+
data: T[];
|
|
10
|
+
spec?: Partial<IChartSpec>;
|
|
11
|
+
chartName?: string;
|
|
12
|
+
chartTheme?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BaseVChartProps extends BaseChartProps, BaseVChartConfig {
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxisType } from '@visactor/vchart/esm/component/axis';
|
|
2
|
+
export declare enum GenericDataType {
|
|
3
|
+
Number = 0,
|
|
4
|
+
String = 1,
|
|
5
|
+
Timestamp = 2,
|
|
6
|
+
Date = 3,
|
|
7
|
+
Boolean = 4,
|
|
8
|
+
Other = 5
|
|
9
|
+
}
|
|
10
|
+
export declare const getDataType: (val: any, field?: string) => GenericDataType;
|
|
11
|
+
export type AxesType = {
|
|
12
|
+
axisType: AxisType;
|
|
13
|
+
dataType: GenericDataType;
|
|
14
|
+
};
|
|
15
|
+
export declare const getAxesType: (val: any, field?: string) => AxesType;
|
package/dist/export.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/********** Vcharts chart **********/
|
|
3
|
+
import { default as Area } from './Area';
|
|
4
|
+
import { AreaProps } from './Area/types';
|
|
5
|
+
import { default as Bar } from './Bar';
|
|
6
|
+
import type { BarProps } from './Bar/types';
|
|
7
|
+
import { default as Donut } from './Donut';
|
|
8
|
+
import type { DonutProps } from './Donut/types';
|
|
9
|
+
import { default as Funnel } from './Funnel';
|
|
10
|
+
import type { FunnelProps } from './Funnel/types';
|
|
11
|
+
import { default as Gauge } from './Gauge';
|
|
12
|
+
import type { GaugeProps } from './Gauge/types';
|
|
13
|
+
import { default as Heatmap } from './Heatmap';
|
|
14
|
+
import type { HeatmapProps } from './Heatmap/types';
|
|
15
|
+
/********** Indicator *********/
|
|
16
|
+
import { default as Indicator } from './Indicator';
|
|
17
|
+
import type { IndicatorProps } from './Indicator/types';
|
|
18
|
+
import { default as Line } from './Line';
|
|
19
|
+
import type { LineProps } from './Line/types';
|
|
20
|
+
import { default as Pie } from './Pie';
|
|
21
|
+
import type { PieProps } from './Pie/types';
|
|
22
|
+
import { default as Radar } from './Radar';
|
|
23
|
+
import type { RadarProps } from './Radar/types';
|
|
24
|
+
import { default as Rank } from './Rank';
|
|
25
|
+
import type { RankProps } from './Rank/types';
|
|
26
|
+
import { default as Scatter } from './Scatter';
|
|
27
|
+
import type { ScatterProps } from './Scatter/types';
|
|
28
|
+
/********** Table **********/
|
|
29
|
+
import { default as Table } from './Table';
|
|
30
|
+
import type { TableProps } from './Table/types';
|
|
31
|
+
/********** NTV **********/
|
|
32
|
+
export { VisText, type VisTextProps } from './Text';
|
|
33
|
+
export { Area, type AreaProps, Bar, type BarProps, Donut, type DonutProps, Funnel, type FunnelProps, Gauge, type GaugeProps, Heatmap, type HeatmapProps, Indicator, type IndicatorProps, Line, type LineProps, Pie, type PieProps, Radar, type RadarProps, Rank, type RankProps, Scatter, type ScatterProps, Table, type TableProps, };
|
|
34
|
+
export declare const DEFAULT_CHART_COMPONENTS: Record<string, React.FC<any>>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********** export chart **********/
|
|
2
|
+
export * from './export';
|
|
3
|
+
/********** export types **********/
|
|
4
|
+
export * from './types';
|
|
5
|
+
/********** export GPTVis **********/
|
|
6
|
+
export { withChartCode, withDefaultChartCode } from './ChartCodeRender';
|
|
7
|
+
export type { CodeBlockComponent, WithChartCodeOptions } from './ChartCodeRender/type';
|
|
8
|
+
export { default as ConfigProvider, type ConfigProviderProps } from './ConfigProvider';
|
|
9
|
+
export { default as GPTVis, type GPTVisProps } from './GPTVis';
|
|
10
|
+
export { default as GPTVisLite, type GPTVisLiteProps, useEventPublish } from './GPTVis/Lite';
|
|
11
|
+
export { default as version } from './version';
|