assui 3.1.82 → 3.1.84
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/es/rc-echart/core.js +5 -9
- package/lib/rc-echart/core.js +5 -9
- package/package.json +3 -3
package/es/rc-echart/core.js
CHANGED
|
@@ -4,7 +4,6 @@ import React, { useRef, useEffect } from 'react';
|
|
|
4
4
|
import useMount from "ahooks/es/useMount";
|
|
5
5
|
import useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import ResizeObserver from 'resize-observer-polyfill';
|
|
8
7
|
var initEmptyObject = {};
|
|
9
8
|
var ReactEchartCore = function ReactEchartCore(props) {
|
|
10
9
|
var _a = props.className,
|
|
@@ -43,6 +42,7 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
43
42
|
};
|
|
44
43
|
var renderEchartDom = function renderEchartDom() {
|
|
45
44
|
if (chartRef.current) {
|
|
45
|
+
console.log('option', option);
|
|
46
46
|
chartRef.current.setOption(option, notMerge, lazyUpdate);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -74,16 +74,12 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
74
74
|
chartRef.current.resize();
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
// 页面卸载,销毁监听
|
|
77
78
|
useEffect(function () {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
console.log('ddd');
|
|
81
|
-
});
|
|
82
|
-
if (chartDomRef.current) {
|
|
83
|
-
resizeObserver.observe(chartDomRef.current);
|
|
84
|
-
}
|
|
79
|
+
// 监听echartsResize函数,实现图表自适应
|
|
80
|
+
window.addEventListener('resize', resizeChart);
|
|
85
81
|
return function () {
|
|
86
|
-
|
|
82
|
+
window.removeEventListener('resize', resizeChart);
|
|
87
83
|
};
|
|
88
84
|
}, []);
|
|
89
85
|
useUpdateEffect(function () {
|
package/lib/rc-echart/core.js
CHANGED
|
@@ -47,7 +47,6 @@ var react_1 = __importStar(require("react"));
|
|
|
47
47
|
var useMount_1 = __importDefault(require("ahooks/lib/useMount"));
|
|
48
48
|
var useUpdateEffect_1 = __importDefault(require("ahooks/lib/useUpdateEffect"));
|
|
49
49
|
var classnames_1 = __importDefault(require("classnames"));
|
|
50
|
-
var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
|
|
51
50
|
var initEmptyObject = {};
|
|
52
51
|
var ReactEchartCore = function ReactEchartCore(props) {
|
|
53
52
|
var _a = props.className,
|
|
@@ -86,6 +85,7 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
86
85
|
};
|
|
87
86
|
var renderEchartDom = function renderEchartDom() {
|
|
88
87
|
if (chartRef.current) {
|
|
88
|
+
console.log('option', option);
|
|
89
89
|
chartRef.current.setOption(option, notMerge, lazyUpdate);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
@@ -117,16 +117,12 @@ var ReactEchartCore = function ReactEchartCore(props) {
|
|
|
117
117
|
chartRef.current.resize();
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
+
// 页面卸载,销毁监听
|
|
120
121
|
(0, react_1.useEffect)(function () {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
console.log('ddd');
|
|
124
|
-
});
|
|
125
|
-
if (chartDomRef.current) {
|
|
126
|
-
resizeObserver.observe(chartDomRef.current);
|
|
127
|
-
}
|
|
122
|
+
// 监听echartsResize函数,实现图表自适应
|
|
123
|
+
window.addEventListener('resize', resizeChart);
|
|
128
124
|
return function () {
|
|
129
|
-
|
|
125
|
+
window.removeEventListener('resize', resizeChart);
|
|
130
126
|
};
|
|
131
127
|
}, []);
|
|
132
128
|
(0, useUpdateEffect_1["default"])(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.84",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
36
|
"@types/react-color": "^3.0.6",
|
|
37
37
|
"@types/react-resizable": "^3.0.0",
|
|
38
|
-
"a-icons": "^1.1.
|
|
38
|
+
"a-icons": "^1.1.70",
|
|
39
39
|
"aa-utils": "^2.1.26",
|
|
40
40
|
"ahooks": "^3.0.8",
|
|
41
41
|
"bignumber.js": "^9.0.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"node": ">=10.0.0"
|
|
82
82
|
},
|
|
83
83
|
"license": "MIT",
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "a1bf36679f8ca56aca50f29f2911e81954d4bef6"
|
|
85
85
|
}
|