win-chart 2.6.2 → 2.7.1
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/package.json +17 -25
- package/dist/bundle.esm.js +0 -22
- package/dist/bundle.esm.js.map +0 -1
- package/dist/index.d.ts +0 -159
- package/dist/types/app.d.ts +0 -1
- package/dist/types/components/ChartWrapper.d.ts +0 -2
- package/dist/types/components/EarthChart.d.ts +0 -15
- package/dist/types/components/WinChart.d.ts +0 -4
- package/dist/types/index.d.ts +0 -4
- package/dist/types/types/index.d.ts +0 -118
- package/dist/types/utils/const.d.ts +0 -8
- package/dist/types/utils/getAreaSpec.d.ts +0 -14
- package/dist/types/utils/getBarSpec.d.ts +0 -8
- package/dist/types/utils/getChartOptions.d.ts +0 -7
- package/dist/types/utils/getColumnSpec.d.ts +0 -14
- package/dist/types/utils/getDualSpec.d.ts +0 -13
- package/dist/types/utils/getFunnelSpec.d.ts +0 -8
- package/dist/types/utils/getLineSpec.d.ts +0 -8
- package/dist/types/utils/getPieSpec.d.ts +0 -13
- package/dist/types/utils/getRadarSpec.d.ts +0 -7
- package/dist/types/utils/tool.d.ts +0 -76
package/dist/index.d.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as echarts$1 from 'echarts';
|
|
3
|
-
export { echarts$1 as echarts };
|
|
4
|
-
import React$1 from 'react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 标准图表数据
|
|
8
|
-
*/
|
|
9
|
-
interface IChartInfo {
|
|
10
|
-
label?: string;
|
|
11
|
-
value: number;
|
|
12
|
-
type?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface IWinChartProps {
|
|
16
|
-
theme?: 'light' | 'dark';
|
|
17
|
-
sort?: 'asc' | 'desc';
|
|
18
|
-
color?: string[];
|
|
19
|
-
chartType?: WinChartType;
|
|
20
|
-
xAxisLabelRotate?: number;
|
|
21
|
-
xAxisLabelLength?: number;
|
|
22
|
-
data?: IChartInfo[];
|
|
23
|
-
extraData?: IChartInfo[];
|
|
24
|
-
className?: string;
|
|
25
|
-
style?: React.CSSProperties;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* label 与 type 取值互换 (只作用饼图、环图、雷达图图表)
|
|
29
|
-
*/
|
|
30
|
-
reserveValueWithLabelType?: boolean;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Y 轴起始值
|
|
34
|
-
*/
|
|
35
|
-
yStart?: number[];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 系列配置
|
|
39
|
-
*/
|
|
40
|
-
extraSeriesOption?: echarts.SeriesOption[];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 自定义配置,优先级最高,会覆盖默认配置(采用deepmerge,只覆盖差异部分)
|
|
44
|
-
*/
|
|
45
|
-
extraOption?: echarts.EChartsOption;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 环图中心部份配置
|
|
49
|
-
*/
|
|
50
|
-
cycleCenterConfig?: {
|
|
51
|
-
/**
|
|
52
|
-
* 标题(默认为统计)
|
|
53
|
-
*/
|
|
54
|
-
title?: ICenterConfig;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* 内容(默认为合计值)
|
|
58
|
-
*/
|
|
59
|
-
content?: ICenterConfig;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface ICenterConfig {
|
|
64
|
-
/**
|
|
65
|
-
* 自定义统计显示内容
|
|
66
|
-
*/
|
|
67
|
-
value?: string;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 距离头部高度
|
|
71
|
-
*/
|
|
72
|
-
top?: number | string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 字体大小
|
|
76
|
-
*/
|
|
77
|
-
fontSize?: string | number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* 图表类型
|
|
82
|
-
*/
|
|
83
|
-
declare enum WinChartType {
|
|
84
|
-
/**
|
|
85
|
-
* MINI面积图
|
|
86
|
-
*/
|
|
87
|
-
MINI_AREA,
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* 面积图
|
|
91
|
-
*/
|
|
92
|
-
AREA,
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* 双轴图
|
|
96
|
-
*/
|
|
97
|
-
DUAL_LINE_BAR,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 堆叠双轴图
|
|
101
|
-
*/
|
|
102
|
-
STACK_DUAL_LINE_BAR,
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* 柱状图
|
|
106
|
-
*/
|
|
107
|
-
COLUMN,
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* 堆叠柱状图
|
|
111
|
-
*/
|
|
112
|
-
STACK_COLUMN,
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* 折线图
|
|
116
|
-
*/
|
|
117
|
-
LINE,
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 条形图
|
|
121
|
-
*/
|
|
122
|
-
BAR,
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 漏斗图
|
|
126
|
-
*/
|
|
127
|
-
FUNNEL,
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* 饼图
|
|
131
|
-
*/
|
|
132
|
-
PIE,
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 环形图
|
|
136
|
-
*/
|
|
137
|
-
CYCLE,
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* 雷达图
|
|
141
|
-
*/
|
|
142
|
-
RADAR,
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
declare const WinChart: (props: IWinChartProps) => react_jsx_runtime.JSX.Element;
|
|
146
|
-
|
|
147
|
-
interface IProps {
|
|
148
|
-
className: string;
|
|
149
|
-
style: React$1.CSSProperties;
|
|
150
|
-
extraOption?: echarts$1.EChartsOption;
|
|
151
|
-
lineStyles: any;
|
|
152
|
-
pointsStyles: any;
|
|
153
|
-
pointsData: any;
|
|
154
|
-
linesData: any;
|
|
155
|
-
globeOption: any;
|
|
156
|
-
}
|
|
157
|
-
declare const EarthChart: ({ className, style, extraOption, lineStyles, pointsStyles, pointsData, linesData, globeOption, }: Partial<IProps>) => react_jsx_runtime.JSX.Element;
|
|
158
|
-
|
|
159
|
-
export { EarthChart, type IChartInfo, type IWinChartProps, WinChart, WinChartType, WinChart as default };
|
package/dist/types/app.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as echarts from 'echarts';
|
|
2
|
-
import 'echarts-gl';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
interface IProps {
|
|
5
|
-
className: string;
|
|
6
|
-
style: React.CSSProperties;
|
|
7
|
-
extraOption?: echarts.EChartsOption;
|
|
8
|
-
lineStyles: any;
|
|
9
|
-
pointsStyles: any;
|
|
10
|
-
pointsData: any;
|
|
11
|
-
linesData: any;
|
|
12
|
-
globeOption: any;
|
|
13
|
-
}
|
|
14
|
-
declare const EarthChart: ({ className, style, extraOption, lineStyles, pointsStyles, pointsData, linesData, globeOption, }: Partial<IProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export { EarthChart };
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* 标准图表数据
|
|
4
|
-
*/
|
|
5
|
-
export interface IChartInfo {
|
|
6
|
-
label?: string;
|
|
7
|
-
value: number;
|
|
8
|
-
type?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IWinChartProps {
|
|
11
|
-
theme?: 'light' | 'dark';
|
|
12
|
-
sort?: 'asc' | 'desc';
|
|
13
|
-
color?: string[];
|
|
14
|
-
chartType?: WinChartType;
|
|
15
|
-
xAxisLabelRotate?: number;
|
|
16
|
-
xAxisLabelLength?: number;
|
|
17
|
-
data?: IChartInfo[];
|
|
18
|
-
extraData?: IChartInfo[];
|
|
19
|
-
className?: string;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
/**
|
|
22
|
-
* label 与 type 取值互换 (只作用饼图、环图、雷达图图表)
|
|
23
|
-
*/
|
|
24
|
-
reserveValueWithLabelType?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Y 轴起始值
|
|
27
|
-
*/
|
|
28
|
-
yStart?: number[];
|
|
29
|
-
/**
|
|
30
|
-
* 系列配置
|
|
31
|
-
*/
|
|
32
|
-
extraSeriesOption?: echarts.SeriesOption[];
|
|
33
|
-
/**
|
|
34
|
-
* 自定义配置,优先级最高,会覆盖默认配置(采用deepmerge,只覆盖差异部分)
|
|
35
|
-
*/
|
|
36
|
-
extraOption?: echarts.EChartsOption;
|
|
37
|
-
/**
|
|
38
|
-
* 环图中心部份配置
|
|
39
|
-
*/
|
|
40
|
-
cycleCenterConfig?: {
|
|
41
|
-
/**
|
|
42
|
-
* 标题(默认为统计)
|
|
43
|
-
*/
|
|
44
|
-
title?: ICenterConfig;
|
|
45
|
-
/**
|
|
46
|
-
* 内容(默认为合计值)
|
|
47
|
-
*/
|
|
48
|
-
content?: ICenterConfig;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
interface ICenterConfig {
|
|
52
|
-
/**
|
|
53
|
-
* 自定义统计显示内容
|
|
54
|
-
*/
|
|
55
|
-
value?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 距离头部高度
|
|
58
|
-
*/
|
|
59
|
-
top?: number | string;
|
|
60
|
-
/**
|
|
61
|
-
* 字体大小
|
|
62
|
-
*/
|
|
63
|
-
fontSize?: string | number;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* 图表类型
|
|
67
|
-
*/
|
|
68
|
-
export declare enum WinChartType {
|
|
69
|
-
/**
|
|
70
|
-
* MINI面积图
|
|
71
|
-
*/
|
|
72
|
-
MINI_AREA = 0,
|
|
73
|
-
/**
|
|
74
|
-
* 面积图
|
|
75
|
-
*/
|
|
76
|
-
AREA = 1,
|
|
77
|
-
/**
|
|
78
|
-
* 双轴图
|
|
79
|
-
*/
|
|
80
|
-
DUAL_LINE_BAR = 2,
|
|
81
|
-
/**
|
|
82
|
-
* 堆叠双轴图
|
|
83
|
-
*/
|
|
84
|
-
STACK_DUAL_LINE_BAR = 3,
|
|
85
|
-
/**
|
|
86
|
-
* 柱状图
|
|
87
|
-
*/
|
|
88
|
-
COLUMN = 4,
|
|
89
|
-
/**
|
|
90
|
-
* 堆叠柱状图
|
|
91
|
-
*/
|
|
92
|
-
STACK_COLUMN = 5,
|
|
93
|
-
/**
|
|
94
|
-
* 折线图
|
|
95
|
-
*/
|
|
96
|
-
LINE = 6,
|
|
97
|
-
/**
|
|
98
|
-
* 条形图
|
|
99
|
-
*/
|
|
100
|
-
BAR = 7,
|
|
101
|
-
/**
|
|
102
|
-
* 漏斗图
|
|
103
|
-
*/
|
|
104
|
-
FUNNEL = 8,
|
|
105
|
-
/**
|
|
106
|
-
* 饼图
|
|
107
|
-
*/
|
|
108
|
-
PIE = 9,
|
|
109
|
-
/**
|
|
110
|
-
* 环形图
|
|
111
|
-
*/
|
|
112
|
-
CYCLE = 10,
|
|
113
|
-
/**
|
|
114
|
-
* 雷达图
|
|
115
|
-
*/
|
|
116
|
-
RADAR = 11
|
|
117
|
-
}
|
|
118
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IWinChartProps } from '@/types';
|
|
2
|
-
import * as echarts from 'echarts';
|
|
3
|
-
/**
|
|
4
|
-
* Mini 面积图
|
|
5
|
-
* @param winChartProps
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const getMiniAreaOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
9
|
-
/**
|
|
10
|
-
* 面积图
|
|
11
|
-
* @param winChartProps
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
export declare const getAreaOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IWinChartProps } from '@/types';
|
|
2
|
-
import * as echarts from 'echarts';
|
|
3
|
-
/**
|
|
4
|
-
* 柱状图
|
|
5
|
-
* @param winChartProps
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const getColumnOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
9
|
-
/**
|
|
10
|
-
* 堆叠柱状图
|
|
11
|
-
* @param winChartProps
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
export declare const getColumnStackOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IWinChartProps } from '@/types';
|
|
2
|
-
/**
|
|
3
|
-
* 双轴图(分组柱状 折线)
|
|
4
|
-
* @param winChartProps
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare const getDualOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
8
|
-
/**
|
|
9
|
-
* 堆叠双轴图(分组柱状 折线)
|
|
10
|
-
* @param winChartProps
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare const getStackDualOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IWinChartProps } from '@/types';
|
|
2
|
-
/**
|
|
3
|
-
* 饼图
|
|
4
|
-
* @param winChartProps
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare const getPieOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
8
|
-
/**
|
|
9
|
-
* 环图
|
|
10
|
-
* @param winChartProps
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare const getPieCycleOpt: (winChartProps: IWinChartProps) => echarts.EChartsOption;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { IChartInfo, IWinChartProps } from '@/types';
|
|
2
|
-
/**
|
|
3
|
-
* 判断是否为一个非空数组
|
|
4
|
-
* @param data 任意类型的数据
|
|
5
|
-
* @returns 如果是非空数组则为真
|
|
6
|
-
*/
|
|
7
|
-
export declare function isNonEmptyArray<T>(data: unknown): data is T[];
|
|
8
|
-
/**
|
|
9
|
-
* 数据转百分比
|
|
10
|
-
* @param value
|
|
11
|
-
* @param num
|
|
12
|
-
*/
|
|
13
|
-
export declare const handleToPercent: (value: unknown, num?: number) => string;
|
|
14
|
-
/**
|
|
15
|
-
* 数组去重
|
|
16
|
-
* @param data
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export declare function arrDeduplication<T>(data?: T[]): T[];
|
|
20
|
-
/**
|
|
21
|
-
* 数组求和
|
|
22
|
-
* @param list
|
|
23
|
-
*/
|
|
24
|
-
export declare const arraySum: (list?: number[]) => number;
|
|
25
|
-
/**
|
|
26
|
-
* 判断是否为一个有效数组(有值,并且长度大于 0)
|
|
27
|
-
* @param data
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
export declare const checkEntityArr: (data: unknown) => boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 处理数据降序
|
|
33
|
-
* @param data
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
export declare const dataDescOrder: (data?: IChartInfo[]) => IChartInfo[];
|
|
37
|
-
/**
|
|
38
|
-
* 获取 X 轴配置
|
|
39
|
-
* @param winChartProps
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
export declare const getAxisOpt: (winChartProps: IWinChartProps) => echarts.XAXisComponentOption;
|
|
43
|
-
/**
|
|
44
|
-
* 根据 value 排序
|
|
45
|
-
* @param arr
|
|
46
|
-
* @param order
|
|
47
|
-
* @returns
|
|
48
|
-
*/
|
|
49
|
-
export declare const sortArray: (arr: IChartInfo[], order: 'asc' | 'desc') => IChartInfo[];
|
|
50
|
-
/**
|
|
51
|
-
* 根据 label 排序
|
|
52
|
-
* @param arr
|
|
53
|
-
* @param sortedLabels
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
export declare const sortArrayByLabel: (arr: IChartInfo[], sortedLabels: string[]) => IChartInfo[];
|
|
57
|
-
/**
|
|
58
|
-
* 处理数据排序
|
|
59
|
-
* @param winChartProps
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
export declare const handleSort: (winChartProps: IWinChartProps) => IWinChartProps;
|
|
63
|
-
export declare function debounce(func: Function, delay: number): Function;
|
|
64
|
-
/**
|
|
65
|
-
* 合并 series 配置
|
|
66
|
-
* @param option
|
|
67
|
-
* @param seriesOption
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
|
-
export declare const mergeSeriesOption: (option: echarts.EChartsOption, seriesOption?: echarts.SeriesOption[]) => import("echarts").EChartsOption;
|
|
71
|
-
/**
|
|
72
|
-
* 获取 label 颜色
|
|
73
|
-
* @param opt
|
|
74
|
-
* @returns
|
|
75
|
-
*/
|
|
76
|
-
export declare const getLabelColor: (opt: Partial<IWinChartProps>) => "rgba(255, 255, 255, 0.7)" | "rgba(0, 0, 0, 0.7)";
|