dtable-statistic 4.1.9 → 4.2.0
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.
|
@@ -429,6 +429,16 @@
|
|
|
429
429
|
display: flex;
|
|
430
430
|
overflow: auto;
|
|
431
431
|
height: 100%;
|
|
432
|
+
width: 100%;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
#exported-chart-container .statistic-chart-container.map {
|
|
436
|
+
padding: 20px;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
#exported-chart-container .statistic-chart-container > div {
|
|
440
|
+
height: 100%;
|
|
441
|
+
width: 100%;
|
|
432
442
|
}
|
|
433
443
|
|
|
434
444
|
/* specific color */
|
package/es/service/map-json.js
CHANGED
|
@@ -29,19 +29,12 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
|
|
|
29
29
|
var exportContainerID = 'exported-chart-container';
|
|
30
30
|
var exportContainer = document.createElement('div');
|
|
31
31
|
exportContainer.setAttribute('id', exportContainerID);
|
|
32
|
-
|
|
33
|
-
// for charts rendered with `<canvas>`
|
|
34
|
-
var id = statItem._id;
|
|
35
|
-
var originalElement = document.querySelector("#stat-item-".concat(id, " .statistic-chart-container > div"));
|
|
36
|
-
if (originalElement) {
|
|
37
|
-
originalElement.style.width = "".concat(window.innerWidth, "px");
|
|
38
|
-
originalElement.style.height = "".concat(window.innerHeight, "px");
|
|
39
|
-
var containerWidth = originalElement.scrollWidth + 15 * 2;
|
|
40
|
-
var containerHeight = originalElement.scrollHeight + 15 * 2;
|
|
41
|
-
exportContainer.setAttribute('style', "width: ".concat(containerWidth, "px; height: ").concat(containerHeight, "px;"));
|
|
42
|
-
}
|
|
32
|
+
exportContainer.setAttribute('style', "width: ".concat(window.innerWidth, "px; height: ").concat(window.innerHeight, "px;"));
|
|
43
33
|
document.body.appendChild(exportContainer);
|
|
44
|
-
ReactDOM.render(_this.renderChart(statItem
|
|
34
|
+
ReactDOM.render(_this.renderChart(statItem, {
|
|
35
|
+
isPreview: false,
|
|
36
|
+
isEnlarge: true
|
|
37
|
+
}), exportContainer);
|
|
45
38
|
setTimeout(function () {
|
|
46
39
|
var ele = document.querySelector("#".concat(exportContainerID, " .statistic-chart-container"));
|
|
47
40
|
if (!ele) return;
|
|
@@ -54,10 +47,6 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
|
|
|
54
47
|
eleA.download = "".concat(statItem.name || 'image', ".png");
|
|
55
48
|
eleA.click();
|
|
56
49
|
document.body.removeChild(exportContainer);
|
|
57
|
-
if (originalElement) {
|
|
58
|
-
originalElement.style.width = 'unset';
|
|
59
|
-
originalElement.style.height = 'unset';
|
|
60
|
-
}
|
|
61
50
|
});
|
|
62
51
|
}, 1000);
|
|
63
52
|
};
|
|
@@ -73,7 +62,11 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
|
|
|
73
62
|
statisticalResult: statisticalResult
|
|
74
63
|
});
|
|
75
64
|
};
|
|
76
|
-
_this.renderChart = function (statItem) {
|
|
65
|
+
_this.renderChart = function (statItem, _ref) {
|
|
66
|
+
var _ref$isPreview = _ref.isPreview,
|
|
67
|
+
isPreview = _ref$isPreview === void 0 ? true : _ref$isPreview,
|
|
68
|
+
_ref$isEnlarge = _ref.isEnlarge,
|
|
69
|
+
isEnlarge = _ref$isEnlarge === void 0 ? false : _ref$isEnlarge;
|
|
77
70
|
var _this$props = _this.props,
|
|
78
71
|
dtableChangedTime = _this$props.dtableChangedTime,
|
|
79
72
|
chartCalculator = _this$props.chartCalculator,
|
|
@@ -81,12 +74,12 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
|
|
|
81
74
|
colorThemeName = _this$props.colorThemeName,
|
|
82
75
|
eventBus = _this$props.eventBus;
|
|
83
76
|
return /*#__PURE__*/React.createElement(StatView, {
|
|
84
|
-
ref: function ref(
|
|
85
|
-
return _this.chartView =
|
|
77
|
+
ref: function ref(_ref2) {
|
|
78
|
+
return _this.chartView = _ref2;
|
|
86
79
|
},
|
|
87
|
-
isPreview:
|
|
80
|
+
isPreview: isPreview,
|
|
81
|
+
isEnlarge: isEnlarge,
|
|
88
82
|
dtableChangedTime: dtableChangedTime,
|
|
89
|
-
isEnlarge: false,
|
|
90
83
|
theme: theme,
|
|
91
84
|
colorThemeName: colorThemeName,
|
|
92
85
|
statItem: statItem,
|
|
@@ -141,7 +134,10 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
|
|
|
141
134
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
142
135
|
id: "stat-item-".concat(statItem._id),
|
|
143
136
|
className: "statistic-chart-preview-container"
|
|
144
|
-
}, this.renderChart(statItem
|
|
137
|
+
}, this.renderChart(statItem, {
|
|
138
|
+
isPreview: true,
|
|
139
|
+
isEnlarge: false
|
|
140
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
145
141
|
className: "statistic-chart-preview-container-resize"
|
|
146
142
|
}));
|
|
147
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-statistic",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "statistics",
|
|
5
5
|
"main": "dist/dtable-statistic.js",
|
|
6
6
|
"author": "seafile",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@seafile/seafile-calendar": "0.0.24",
|
|
13
13
|
"comlink": "^4.3.1",
|
|
14
14
|
"dayjs": "1.10.7",
|
|
15
|
-
"dtable-store": "4.
|
|
15
|
+
"dtable-store": "4.2.3",
|
|
16
16
|
"dtable-web-api": "4.0.11",
|
|
17
17
|
"glamor": "^2.20.40",
|
|
18
18
|
"html2canvas": "^1.4.1",
|