@easyv/charts 1.6.13 → 1.6.14
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/.babelrc +8 -8
- package/.husky/commit-msg +3 -3
- package/CHANGELOG.md +18 -18
- package/commitlint.config.js +1 -1
- package/lib/components/Axis.js +1 -1
- package/lib/components/Background.js +2 -2
- package/lib/components/Band.js +3 -3
- package/lib/components/Brush.js +2 -2
- package/lib/components/Chart.js +2 -2
- package/lib/components/ChartContainer.js +3 -3
- package/lib/components/ConicalGradient.js +21 -21
- package/lib/components/Control.js +1 -1
- package/lib/components/ExtentData.js +2 -2
- package/lib/components/Indicator.js +2 -2
- package/lib/components/Label.js +7 -5
- package/lib/components/Legend.js +2 -2
- package/lib/components/Lighter.js +2 -2
- package/lib/components/Line.js +2 -2
- package/lib/components/LinearGradient.js +2 -2
- package/lib/components/Marquee.js +1 -1
- package/lib/components/StereoBar.js +2 -2
- package/lib/components/TextOverflow.js +1 -1
- package/lib/css/index.module.css +42 -42
- package/lib/css/piechart.module.css +26 -26
- package/lib/hooks/useAnimateData.js +6 -6
- package/lib/hooks/useAxes.js +1 -2
- package/lib/hooks/useFilterData.js +5 -5
- package/lib/hooks/useStackData.js +5 -5
- package/lib/hooks/useTooltip.js +11 -11
- package/lib/utils/index.js +3 -3
- package/package.json +55 -55
- package/src/components/Background.tsx +61 -61
- package/src/components/Band.tsx +271 -271
- package/src/components/Brush.js +159 -159
- package/src/components/Chart.js +154 -154
- package/src/components/ChartContainer.tsx +71 -71
- package/src/components/ConicalGradient.js +258 -258
- package/src/components/Control.jsx +241 -241
- package/src/components/ExtentData.js +18 -18
- package/src/components/Indicator.js +58 -58
- package/src/components/Label.js +247 -246
- package/src/components/Legend.js +166 -166
- package/src/components/Lighter.jsx +173 -173
- package/src/components/Line.js +153 -153
- package/src/components/LinearGradient.js +29 -29
- package/src/components/PieTooltip.jsx +160 -160
- package/src/components/StereoBar.tsx +307 -307
- package/src/components/index.js +59 -59
- package/src/context/index.js +2 -2
- package/src/css/index.module.css +42 -42
- package/src/css/piechart.module.css +26 -26
- package/src/element/ConicGradient.jsx +55 -55
- package/src/element/Line.tsx +33 -33
- package/src/element/index.ts +3 -3
- package/src/formatter/index.js +1 -1
- package/src/formatter/legend.js +112 -112
- package/src/hooks/index.js +20 -20
- package/src/hooks/useAnimateData.ts +68 -68
- package/src/hooks/useAxes.js +1 -2
- package/src/hooks/useFilterData.js +78 -78
- package/src/hooks/useStackData.js +102 -102
- package/src/hooks/useTooltip.ts +104 -104
- package/src/index.js +6 -6
- package/src/types/index.d.ts +68 -68
- package/src/utils/index.js +782 -782
- package/tsconfig.json +23 -23
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { group } from 'd3v7';
|
|
3
|
-
import {
|
|
4
|
-
dataYOrZ,
|
|
5
|
-
seriesYOrZ,
|
|
6
|
-
getCurrentStack,
|
|
7
|
-
getStacks,
|
|
8
|
-
resetStacks,
|
|
9
|
-
} from '../utils';
|
|
10
|
-
|
|
11
|
-
const getSeriesMap = (series) => {
|
|
12
|
-
const seriesMap = new Map();
|
|
13
|
-
series.forEach(({ name, ...rest }) => {
|
|
14
|
-
seriesMap.set(name, {
|
|
15
|
-
...rest,
|
|
16
|
-
name,
|
|
17
|
-
data: [],
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
return seriesMap;
|
|
21
|
-
};
|
|
22
|
-
const resetStackData = (series) => {
|
|
23
|
-
series.forEach((series) => {
|
|
24
|
-
series.data = [];
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const setStackData = (data, series, stacks) => {
|
|
29
|
-
const dataMap = group(data, (d) => d.x);
|
|
30
|
-
dataMap.forEach((value) => {
|
|
31
|
-
resetStacks(stacks);
|
|
32
|
-
for (let i = 0, j = value.length; i < j; i++) {
|
|
33
|
-
const d = value[i];
|
|
34
|
-
const currentSeries = series.get(d.s);
|
|
35
|
-
if(currentSeries){
|
|
36
|
-
const type = currentSeries.type;
|
|
37
|
-
const currentStack = getCurrentStack(currentSeries, stacks);
|
|
38
|
-
if (d && d.y !== undefined && (type!="band" || type=="band" && !isNaN(d.y))) {
|
|
39
|
-
if (currentStack) {
|
|
40
|
-
if (d.y >= 0) {
|
|
41
|
-
currentSeries.data.push({
|
|
42
|
-
data: d,
|
|
43
|
-
index: currentStack.index,
|
|
44
|
-
bound: [currentStack.positive, currentStack.positive + d.y],
|
|
45
|
-
});
|
|
46
|
-
currentStack.positive += d.y;
|
|
47
|
-
} else {
|
|
48
|
-
currentSeries.data.push({
|
|
49
|
-
data: d,
|
|
50
|
-
index: currentStack.index,
|
|
51
|
-
bound: [currentStack.negative, currentStack.negative + d.y],
|
|
52
|
-
});
|
|
53
|
-
currentStack.negative += d.y;
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
currentSeries.data.push({
|
|
57
|
-
data: d,
|
|
58
|
-
bound: [0, d.y],
|
|
59
|
-
index: 0,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
dataMap.clear();
|
|
68
|
-
return series;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 计算堆叠数据
|
|
73
|
-
* @param {Array} data 数据
|
|
74
|
-
* @param {Map} series 系列
|
|
75
|
-
* @returns {Array} 返回堆叠后的数据,由一开始的{x, y, s}变成{data: {x, y, s}, bound: [start, end], index}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
export default ({ data, series }) => {
|
|
79
|
-
const _series = useMemo(() => {
|
|
80
|
-
const stacks = getStacks(series);
|
|
81
|
-
const _series = getSeriesMap(series);
|
|
82
|
-
return { stacks, series: seriesYOrZ(_series) };
|
|
83
|
-
}, [series]);
|
|
84
|
-
|
|
85
|
-
const _data = useMemo(() => dataYOrZ(data, _series.series), [data, _series]);
|
|
86
|
-
const tmp = useMemo(() => {
|
|
87
|
-
const { y: dataY, z: dataZ } = _data;
|
|
88
|
-
const {
|
|
89
|
-
stacks,
|
|
90
|
-
series: { y: seriesY, z: seriesZ },
|
|
91
|
-
} = _series;
|
|
92
|
-
resetStackData(seriesY);
|
|
93
|
-
resetStackData(seriesZ);
|
|
94
|
-
setStackData(dataY, seriesY, stacks);
|
|
95
|
-
setStackData(dataZ, seriesZ, stacks);
|
|
96
|
-
return {
|
|
97
|
-
bandLength: stacks.filter((item) => item.type == 'band').length,
|
|
98
|
-
series: [...seriesY.values(), ...seriesZ.values()],
|
|
99
|
-
};
|
|
100
|
-
}, [_data, _series]);
|
|
101
|
-
return tmp;
|
|
102
|
-
};
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { group } from 'd3v7';
|
|
3
|
+
import {
|
|
4
|
+
dataYOrZ,
|
|
5
|
+
seriesYOrZ,
|
|
6
|
+
getCurrentStack,
|
|
7
|
+
getStacks,
|
|
8
|
+
resetStacks,
|
|
9
|
+
} from '../utils';
|
|
10
|
+
|
|
11
|
+
const getSeriesMap = (series) => {
|
|
12
|
+
const seriesMap = new Map();
|
|
13
|
+
series.forEach(({ name, ...rest }) => {
|
|
14
|
+
seriesMap.set(name, {
|
|
15
|
+
...rest,
|
|
16
|
+
name,
|
|
17
|
+
data: [],
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return seriesMap;
|
|
21
|
+
};
|
|
22
|
+
const resetStackData = (series) => {
|
|
23
|
+
series.forEach((series) => {
|
|
24
|
+
series.data = [];
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const setStackData = (data, series, stacks) => {
|
|
29
|
+
const dataMap = group(data, (d) => d.x);
|
|
30
|
+
dataMap.forEach((value) => {
|
|
31
|
+
resetStacks(stacks);
|
|
32
|
+
for (let i = 0, j = value.length; i < j; i++) {
|
|
33
|
+
const d = value[i];
|
|
34
|
+
const currentSeries = series.get(d.s);
|
|
35
|
+
if(currentSeries){
|
|
36
|
+
const type = currentSeries.type;
|
|
37
|
+
const currentStack = getCurrentStack(currentSeries, stacks);
|
|
38
|
+
if (d && d.y !== undefined && (type!="band" || type=="band" && !isNaN(d.y))) {
|
|
39
|
+
if (currentStack) {
|
|
40
|
+
if (d.y >= 0) {
|
|
41
|
+
currentSeries.data.push({
|
|
42
|
+
data: d,
|
|
43
|
+
index: currentStack.index,
|
|
44
|
+
bound: [currentStack.positive, currentStack.positive + d.y],
|
|
45
|
+
});
|
|
46
|
+
currentStack.positive += d.y;
|
|
47
|
+
} else {
|
|
48
|
+
currentSeries.data.push({
|
|
49
|
+
data: d,
|
|
50
|
+
index: currentStack.index,
|
|
51
|
+
bound: [currentStack.negative, currentStack.negative + d.y],
|
|
52
|
+
});
|
|
53
|
+
currentStack.negative += d.y;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
currentSeries.data.push({
|
|
57
|
+
data: d,
|
|
58
|
+
bound: [0, d.y],
|
|
59
|
+
index: 0,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
dataMap.clear();
|
|
68
|
+
return series;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 计算堆叠数据
|
|
73
|
+
* @param {Array} data 数据
|
|
74
|
+
* @param {Map} series 系列
|
|
75
|
+
* @returns {Array} 返回堆叠后的数据,由一开始的{x, y, s}变成{data: {x, y, s}, bound: [start, end], index}
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
export default ({ data, series }) => {
|
|
79
|
+
const _series = useMemo(() => {
|
|
80
|
+
const stacks = getStacks(series);
|
|
81
|
+
const _series = getSeriesMap(series);
|
|
82
|
+
return { stacks, series: seriesYOrZ(_series) };
|
|
83
|
+
}, [series]);
|
|
84
|
+
|
|
85
|
+
const _data = useMemo(() => dataYOrZ(data, _series.series), [data, _series]);
|
|
86
|
+
const tmp = useMemo(() => {
|
|
87
|
+
const { y: dataY, z: dataZ } = _data;
|
|
88
|
+
const {
|
|
89
|
+
stacks,
|
|
90
|
+
series: { y: seriesY, z: seriesZ },
|
|
91
|
+
} = _series;
|
|
92
|
+
resetStackData(seriesY);
|
|
93
|
+
resetStackData(seriesZ);
|
|
94
|
+
setStackData(dataY, seriesY, stacks);
|
|
95
|
+
setStackData(dataZ, seriesZ, stacks);
|
|
96
|
+
return {
|
|
97
|
+
bandLength: stacks.filter((item) => item.type == 'band').length,
|
|
98
|
+
series: [...seriesY.values(), ...seriesZ.values()],
|
|
99
|
+
};
|
|
100
|
+
}, [_data, _series]);
|
|
101
|
+
return tmp;
|
|
102
|
+
};
|
package/src/hooks/useTooltip.ts
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { useCallback, useState, useEffect } from "react";
|
|
2
|
-
import { getMousePos } from "../utils";
|
|
3
|
-
const callback = () => {};
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 主要用于轴类图表,返回当前选中的是哪一个x
|
|
7
|
-
* @param {Array} svg svg的dom实例
|
|
8
|
-
* @param {Number} marginLeft 左间距
|
|
9
|
-
* @param {Number} marginTop 上间距
|
|
10
|
-
* @param {Number} width 宽
|
|
11
|
-
* @param {Number} height 高
|
|
12
|
-
* @param {Number} axisX 类目轴
|
|
13
|
-
* @param {Object} config 轮播动画参数
|
|
14
|
-
* @param {Boolean} active 组件是否处于活跃状态
|
|
15
|
-
* @returns {Object} 返回被选中的名称,坐标,选中方法
|
|
16
|
-
*/
|
|
17
|
-
type Props = {
|
|
18
|
-
svg: any;
|
|
19
|
-
marginLeft: number;
|
|
20
|
-
marginTop: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
axisX: any;
|
|
24
|
-
isHover: boolean;
|
|
25
|
-
config: { auto?: boolean; interval?: number; manual?: boolean };
|
|
26
|
-
active:boolean
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default ({
|
|
30
|
-
svg,
|
|
31
|
-
marginLeft,
|
|
32
|
-
marginTop,
|
|
33
|
-
width,
|
|
34
|
-
height,
|
|
35
|
-
axisX,
|
|
36
|
-
isHover,
|
|
37
|
-
config: { auto, interval = 0, manual } = {},
|
|
38
|
-
active
|
|
39
|
-
}: Props) => {
|
|
40
|
-
const [currentIndex, setCurrentIndex] = useState<number | null>(null);
|
|
41
|
-
const tickLength = axisX.allTicks.length;
|
|
42
|
-
const setIndex = useCallback(
|
|
43
|
-
(e: any) => {
|
|
44
|
-
if (svg) {
|
|
45
|
-
const {
|
|
46
|
-
x: mouseX,
|
|
47
|
-
y: mouseY,
|
|
48
|
-
w: boundWidth,
|
|
49
|
-
h: boundHeight,
|
|
50
|
-
} = getMousePos(e, svg.current);
|
|
51
|
-
const { carousel, allTicks, ticks, scaler, direction } = axisX;
|
|
52
|
-
const _ticks = carousel ? ticks : allTicks;
|
|
53
|
-
const ratioX = parseInt(svg.current.style.width) / boundWidth;
|
|
54
|
-
const ratioY = parseInt(svg.current.style.height) / boundHeight;
|
|
55
|
-
const resetX = mouseX * ratioX;
|
|
56
|
-
const resetY = mouseY * ratioY;
|
|
57
|
-
const x = resetX - marginLeft;
|
|
58
|
-
const y = resetY - marginTop;
|
|
59
|
-
if (x > 0 && x < width && y > 0 && y < height && _ticks.length) {
|
|
60
|
-
const position = direction === "vertical" ? y : x;
|
|
61
|
-
const name = _ticks.reduce((prev: string, current: string) =>
|
|
62
|
-
Math.abs(scaler(prev) - position) >
|
|
63
|
-
Math.abs(scaler(current) - position)
|
|
64
|
-
? current
|
|
65
|
-
: prev
|
|
66
|
-
);
|
|
67
|
-
setCurrentIndex(allTicks.findIndex((tick: string) => tick == name));
|
|
68
|
-
} else {
|
|
69
|
-
// 鼠标划出后,如果开启了自动轮播,就不需要让提示框消失了
|
|
70
|
-
if (!auto) {
|
|
71
|
-
setCurrentIndex(null);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
[svg, marginLeft, axisX, auto]
|
|
77
|
-
);
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
const on = auto && tickLength && !isHover && active;
|
|
80
|
-
// if (!!on) setCurrentIndex(0);
|
|
81
|
-
const intervalHandler = on
|
|
82
|
-
? setInterval(() => {
|
|
83
|
-
setCurrentIndex((index) => {
|
|
84
|
-
const tmp = index == null ? 0 : index;
|
|
85
|
-
const currentIndex = tmp + 1;
|
|
86
|
-
if (currentIndex >= tickLength) {
|
|
87
|
-
return 0;
|
|
88
|
-
}
|
|
89
|
-
return currentIndex;
|
|
90
|
-
});
|
|
91
|
-
}, interval * 1000)
|
|
92
|
-
: null;
|
|
93
|
-
return () => {
|
|
94
|
-
intervalHandler && clearInterval(intervalHandler);
|
|
95
|
-
};
|
|
96
|
-
}, [auto, tickLength, interval, isHover, active]);
|
|
97
|
-
const name = currentIndex === null ? null : axisX.allTicks[currentIndex];
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
name,
|
|
101
|
-
x: axisX.scaler(name),
|
|
102
|
-
setIndex: manual ? setIndex : callback,
|
|
103
|
-
};
|
|
104
|
-
};
|
|
1
|
+
import { useCallback, useState, useEffect } from "react";
|
|
2
|
+
import { getMousePos } from "../utils";
|
|
3
|
+
const callback = () => {};
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 主要用于轴类图表,返回当前选中的是哪一个x
|
|
7
|
+
* @param {Array} svg svg的dom实例
|
|
8
|
+
* @param {Number} marginLeft 左间距
|
|
9
|
+
* @param {Number} marginTop 上间距
|
|
10
|
+
* @param {Number} width 宽
|
|
11
|
+
* @param {Number} height 高
|
|
12
|
+
* @param {Number} axisX 类目轴
|
|
13
|
+
* @param {Object} config 轮播动画参数
|
|
14
|
+
* @param {Boolean} active 组件是否处于活跃状态
|
|
15
|
+
* @returns {Object} 返回被选中的名称,坐标,选中方法
|
|
16
|
+
*/
|
|
17
|
+
type Props = {
|
|
18
|
+
svg: any;
|
|
19
|
+
marginLeft: number;
|
|
20
|
+
marginTop: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
axisX: any;
|
|
24
|
+
isHover: boolean;
|
|
25
|
+
config: { auto?: boolean; interval?: number; manual?: boolean };
|
|
26
|
+
active:boolean
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default ({
|
|
30
|
+
svg,
|
|
31
|
+
marginLeft,
|
|
32
|
+
marginTop,
|
|
33
|
+
width,
|
|
34
|
+
height,
|
|
35
|
+
axisX,
|
|
36
|
+
isHover,
|
|
37
|
+
config: { auto, interval = 0, manual } = {},
|
|
38
|
+
active
|
|
39
|
+
}: Props) => {
|
|
40
|
+
const [currentIndex, setCurrentIndex] = useState<number | null>(null);
|
|
41
|
+
const tickLength = axisX.allTicks.length;
|
|
42
|
+
const setIndex = useCallback(
|
|
43
|
+
(e: any) => {
|
|
44
|
+
if (svg) {
|
|
45
|
+
const {
|
|
46
|
+
x: mouseX,
|
|
47
|
+
y: mouseY,
|
|
48
|
+
w: boundWidth,
|
|
49
|
+
h: boundHeight,
|
|
50
|
+
} = getMousePos(e, svg.current);
|
|
51
|
+
const { carousel, allTicks, ticks, scaler, direction } = axisX;
|
|
52
|
+
const _ticks = carousel ? ticks : allTicks;
|
|
53
|
+
const ratioX = parseInt(svg.current.style.width) / boundWidth;
|
|
54
|
+
const ratioY = parseInt(svg.current.style.height) / boundHeight;
|
|
55
|
+
const resetX = mouseX * ratioX;
|
|
56
|
+
const resetY = mouseY * ratioY;
|
|
57
|
+
const x = resetX - marginLeft;
|
|
58
|
+
const y = resetY - marginTop;
|
|
59
|
+
if (x > 0 && x < width && y > 0 && y < height && _ticks.length) {
|
|
60
|
+
const position = direction === "vertical" ? y : x;
|
|
61
|
+
const name = _ticks.reduce((prev: string, current: string) =>
|
|
62
|
+
Math.abs(scaler(prev) - position) >
|
|
63
|
+
Math.abs(scaler(current) - position)
|
|
64
|
+
? current
|
|
65
|
+
: prev
|
|
66
|
+
);
|
|
67
|
+
setCurrentIndex(allTicks.findIndex((tick: string) => tick == name));
|
|
68
|
+
} else {
|
|
69
|
+
// 鼠标划出后,如果开启了自动轮播,就不需要让提示框消失了
|
|
70
|
+
if (!auto) {
|
|
71
|
+
setCurrentIndex(null);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
[svg, marginLeft, axisX, auto]
|
|
77
|
+
);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
const on = auto && tickLength && !isHover && active;
|
|
80
|
+
// if (!!on) setCurrentIndex(0);
|
|
81
|
+
const intervalHandler = on
|
|
82
|
+
? setInterval(() => {
|
|
83
|
+
setCurrentIndex((index) => {
|
|
84
|
+
const tmp = index == null ? 0 : index;
|
|
85
|
+
const currentIndex = tmp + 1;
|
|
86
|
+
if (currentIndex >= tickLength) {
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
return currentIndex;
|
|
90
|
+
});
|
|
91
|
+
}, interval * 1000)
|
|
92
|
+
: null;
|
|
93
|
+
return () => {
|
|
94
|
+
intervalHandler && clearInterval(intervalHandler);
|
|
95
|
+
};
|
|
96
|
+
}, [auto, tickLength, interval, isHover, active]);
|
|
97
|
+
const name = currentIndex === null ? null : axisX.allTicks[currentIndex];
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
name,
|
|
101
|
+
x: axisX.scaler(name),
|
|
102
|
+
setIndex: manual ? setIndex : callback,
|
|
103
|
+
};
|
|
104
|
+
};
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './hooks';
|
|
3
|
-
export * from './context';
|
|
4
|
-
export * from './formatter';
|
|
5
|
-
export * as utils from './utils';
|
|
6
|
-
export * from '@easyv/utils';
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './context';
|
|
4
|
+
export * from './formatter';
|
|
5
|
+
export * as utils from './utils';
|
|
6
|
+
export * from '@easyv/utils';
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
declare module 'd3v7' {
|
|
2
|
-
export * from 'd3-timer';
|
|
3
|
-
export * from 'd3-array';
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
type DataAnimation = {
|
|
7
|
-
show: boolean;
|
|
8
|
-
duration: number;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type DataType = {
|
|
12
|
-
x: string;
|
|
13
|
-
y: number;
|
|
14
|
-
s: string;
|
|
15
|
-
};
|
|
16
|
-
type DataWithBoundType = {
|
|
17
|
-
index: number;
|
|
18
|
-
data: DataType;
|
|
19
|
-
bound: Array<number>;
|
|
20
|
-
flag: boolean;
|
|
21
|
-
};
|
|
22
|
-
type Context = {
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
id: string;
|
|
26
|
-
triggerOnRelative: Function;
|
|
27
|
-
svg: Object;
|
|
28
|
-
onEmit: Function;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type ChartLine = {
|
|
32
|
-
show: boolean;
|
|
33
|
-
color: string;
|
|
34
|
-
lineWidth: number;
|
|
35
|
-
strokeDasharray?: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type Orientation = 'top' | 'bottom' | 'left' | 'right';
|
|
39
|
-
type TextAlign = "left" | "center" | "right" | "justify";
|
|
40
|
-
|
|
41
|
-
type Translate = {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
};
|
|
45
|
-
type Size = {
|
|
46
|
-
width: number;
|
|
47
|
-
height: number;
|
|
48
|
-
};
|
|
49
|
-
type Font = {
|
|
50
|
-
bold: boolean;
|
|
51
|
-
color: string;
|
|
52
|
-
fontFamily: string;
|
|
53
|
-
fontSize: number;
|
|
54
|
-
italic: boolean;
|
|
55
|
-
letterSpacing: number;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
type Align = { textAnchor: string; dominantBaseline: string };
|
|
59
|
-
|
|
60
|
-
type Tick = { show: boolean; tick: string };
|
|
61
|
-
|
|
62
|
-
type AxisX = {
|
|
63
|
-
carousel: boolean;
|
|
64
|
-
allTicks: Array<string>;
|
|
65
|
-
ticks: Array<string>;
|
|
66
|
-
scaler: Function;
|
|
67
|
-
direction: 'vertical' | 'horizontal';
|
|
68
|
-
};
|
|
1
|
+
declare module 'd3v7' {
|
|
2
|
+
export * from 'd3-timer';
|
|
3
|
+
export * from 'd3-array';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
type DataAnimation = {
|
|
7
|
+
show: boolean;
|
|
8
|
+
duration: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type DataType = {
|
|
12
|
+
x: string;
|
|
13
|
+
y: number;
|
|
14
|
+
s: string;
|
|
15
|
+
};
|
|
16
|
+
type DataWithBoundType = {
|
|
17
|
+
index: number;
|
|
18
|
+
data: DataType;
|
|
19
|
+
bound: Array<number>;
|
|
20
|
+
flag: boolean;
|
|
21
|
+
};
|
|
22
|
+
type Context = {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
id: string;
|
|
26
|
+
triggerOnRelative: Function;
|
|
27
|
+
svg: Object;
|
|
28
|
+
onEmit: Function;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type ChartLine = {
|
|
32
|
+
show: boolean;
|
|
33
|
+
color: string;
|
|
34
|
+
lineWidth: number;
|
|
35
|
+
strokeDasharray?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type Orientation = 'top' | 'bottom' | 'left' | 'right';
|
|
39
|
+
type TextAlign = "left" | "center" | "right" | "justify";
|
|
40
|
+
|
|
41
|
+
type Translate = {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
45
|
+
type Size = {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
};
|
|
49
|
+
type Font = {
|
|
50
|
+
bold: boolean;
|
|
51
|
+
color: string;
|
|
52
|
+
fontFamily: string;
|
|
53
|
+
fontSize: number;
|
|
54
|
+
italic: boolean;
|
|
55
|
+
letterSpacing: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type Align = { textAnchor: string; dominantBaseline: string };
|
|
59
|
+
|
|
60
|
+
type Tick = { show: boolean; tick: string };
|
|
61
|
+
|
|
62
|
+
type AxisX = {
|
|
63
|
+
carousel: boolean;
|
|
64
|
+
allTicks: Array<string>;
|
|
65
|
+
ticks: Array<string>;
|
|
66
|
+
scaler: Function;
|
|
67
|
+
direction: 'vertical' | 'horizontal';
|
|
68
|
+
};
|