evui 3.3.8 → 3.3.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/dist/evui.common.js +87 -4
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +87 -4
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/element/element.bar.js +2 -2
- package/src/components/chart/element/element.pie.js +62 -0
- package/src/components/chart/helpers/helpers.constant.js +7 -0
- package/src/components/chart/model/model.store.js +6 -0
- package/src/components/chart/plugins/plugins.pie.js +2 -0
package/dist/evui.common.js
CHANGED
|
@@ -7886,7 +7886,7 @@ $({ target: 'Number', stat: true }, {
|
|
|
7886
7886
|
/***/ "9224":
|
|
7887
7887
|
/***/ (function(module) {
|
|
7888
7888
|
|
|
7889
|
-
module.exports = JSON.parse("{\"a\":\"3.3.
|
|
7889
|
+
module.exports = JSON.parse("{\"a\":\"3.3.9\"}");
|
|
7890
7890
|
|
|
7891
7891
|
/***/ }),
|
|
7892
7892
|
|
|
@@ -31870,6 +31870,11 @@ var modules = {
|
|
|
31870
31870
|
dataIndex = _ref.dataIndex;
|
|
31871
31871
|
var useApproximate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
31872
31872
|
var dataInfo = this.getDataByValues(seriesID, dataIndex);
|
|
31873
|
+
|
|
31874
|
+
if (!dataInfo || !(dataInfo !== null && dataInfo !== void 0 && dataInfo.xp) || !(dataInfo !== null && dataInfo !== void 0 && dataInfo.yp)) {
|
|
31875
|
+
return null;
|
|
31876
|
+
}
|
|
31877
|
+
|
|
31873
31878
|
return this.getItemByPosition([dataInfo.xp, dataInfo.yp], useApproximate);
|
|
31874
31879
|
},
|
|
31875
31880
|
|
|
@@ -32931,7 +32936,8 @@ var BAR_OPTION = {
|
|
|
32931
32936
|
use: false,
|
|
32932
32937
|
fontSize: 12,
|
|
32933
32938
|
textColor: '#000000',
|
|
32934
|
-
formatter: null
|
|
32939
|
+
formatter: null,
|
|
32940
|
+
decimalPoint: 0
|
|
32935
32941
|
}
|
|
32936
32942
|
};
|
|
32937
32943
|
var PIE_OPTION = {
|
|
@@ -32941,6 +32947,12 @@ var PIE_OPTION = {
|
|
|
32941
32947
|
show: true,
|
|
32942
32948
|
color: '#FFFFFF',
|
|
32943
32949
|
lineWidth: 2
|
|
32950
|
+
},
|
|
32951
|
+
showValue: {
|
|
32952
|
+
use: false,
|
|
32953
|
+
fontSize: 12,
|
|
32954
|
+
textColor: '#000000',
|
|
32955
|
+
formatter: null
|
|
32944
32956
|
}
|
|
32945
32957
|
};
|
|
32946
32958
|
var AXIS_OPTION = {
|
|
@@ -34308,7 +34320,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
34308
34320
|
fontSize = _this$showValue.fontSize,
|
|
34309
34321
|
textColor = _this$showValue.textColor,
|
|
34310
34322
|
align = _this$showValue.align,
|
|
34311
|
-
formatter = _this$showValue.formatter
|
|
34323
|
+
formatter = _this$showValue.formatter,
|
|
34324
|
+
decimalPoint = _this$showValue.decimalPoint;
|
|
34312
34325
|
var x = positions.x,
|
|
34313
34326
|
y = positions.y,
|
|
34314
34327
|
w = positions.w,
|
|
@@ -34339,7 +34352,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
34339
34352
|
}
|
|
34340
34353
|
|
|
34341
34354
|
if (!formatter || typeof formattedTxt !== 'string') {
|
|
34342
|
-
formattedTxt = helpers_util.labelSignFormat(value);
|
|
34355
|
+
formattedTxt = helpers_util.labelSignFormat(value, decimalPoint);
|
|
34343
34356
|
}
|
|
34344
34357
|
|
|
34345
34358
|
var vw = Math.round(ctx.measureText(formattedTxt).width);
|
|
@@ -34789,6 +34802,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
34789
34802
|
this.centerX = 0;
|
|
34790
34803
|
this.centerY = 0;
|
|
34791
34804
|
this.radius = 0;
|
|
34805
|
+
this.doughnutHoleSize = 0;
|
|
34792
34806
|
this.startAngle = 0;
|
|
34793
34807
|
this.endAngle = 0;
|
|
34794
34808
|
this.slice = null;
|
|
@@ -34809,9 +34823,12 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
34809
34823
|
_createClass(Pie, [{
|
|
34810
34824
|
key: "draw",
|
|
34811
34825
|
value: function draw(context, strokeOptions) {
|
|
34826
|
+
var _this$showValue;
|
|
34827
|
+
|
|
34812
34828
|
var ctx = context !== null && context !== void 0 ? context : this.ctx;
|
|
34813
34829
|
var slice = new Path2D();
|
|
34814
34830
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
34831
|
+
var doughnutHoleRadius = this.radius * this.doughnutHoleSize;
|
|
34815
34832
|
var color = this.color;
|
|
34816
34833
|
var noneDownplayOpacity = color.includes('rgba') ? helpers_util.getOpacity(color) : 1;
|
|
34817
34834
|
var opacity = this.state === 'downplay' ? 0.1 : noneDownplayOpacity;
|
|
@@ -34829,6 +34846,10 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
34829
34846
|
ctx.stroke(slice);
|
|
34830
34847
|
}
|
|
34831
34848
|
|
|
34849
|
+
if ((_this$showValue = this.showValue) !== null && _this$showValue !== void 0 && _this$showValue.use) {
|
|
34850
|
+
this.drawValueLabels(ctx, doughnutHoleRadius);
|
|
34851
|
+
}
|
|
34852
|
+
|
|
34832
34853
|
ctx.closePath();
|
|
34833
34854
|
this.slice = slice;
|
|
34834
34855
|
this.ctx = ctx;
|
|
@@ -34878,8 +34899,11 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
34878
34899
|
}, {
|
|
34879
34900
|
key: "itemHighlight",
|
|
34880
34901
|
value: function itemHighlight(item, context) {
|
|
34902
|
+
var _this$showValue2;
|
|
34903
|
+
|
|
34881
34904
|
var ctx = context;
|
|
34882
34905
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
34906
|
+
var doughnutHoleRadius = this.radius * this.doughnutHoleSize;
|
|
34883
34907
|
ctx.save();
|
|
34884
34908
|
ctx.shadowOffsetX = 0;
|
|
34885
34909
|
ctx.shadowOffsetY = 0;
|
|
@@ -34892,9 +34916,62 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
34892
34916
|
ctx.arc(this.centerX, this.centerY, radius, this.startAngle, this.endAngle);
|
|
34893
34917
|
ctx.lineTo(this.centerX, this.centerY);
|
|
34894
34918
|
ctx.fill();
|
|
34919
|
+
|
|
34920
|
+
if ((_this$showValue2 = this.showValue) !== null && _this$showValue2 !== void 0 && _this$showValue2.use) {
|
|
34921
|
+
this.drawValueLabels(ctx, doughnutHoleRadius);
|
|
34922
|
+
}
|
|
34923
|
+
|
|
34895
34924
|
ctx.closePath();
|
|
34896
34925
|
ctx.restore();
|
|
34897
34926
|
}
|
|
34927
|
+
/**
|
|
34928
|
+
* Draw value label if series 'use' of showValue option is true
|
|
34929
|
+
*
|
|
34930
|
+
* @param context canvas context
|
|
34931
|
+
*/
|
|
34932
|
+
|
|
34933
|
+
}, {
|
|
34934
|
+
key: "drawValueLabels",
|
|
34935
|
+
value: function drawValueLabels(context) {
|
|
34936
|
+
var _this$showValue3 = this.showValue,
|
|
34937
|
+
fontSize = _this$showValue3.fontSize,
|
|
34938
|
+
textColor = _this$showValue3.textColor,
|
|
34939
|
+
formatter = _this$showValue3.formatter;
|
|
34940
|
+
var ctx = context;
|
|
34941
|
+
ctx.save();
|
|
34942
|
+
ctx.beginPath();
|
|
34943
|
+
ctx.font = "normal normal normal ".concat(fontSize, "px Roboto");
|
|
34944
|
+
ctx.fillStyle = textColor;
|
|
34945
|
+
ctx.lineWidth = 1;
|
|
34946
|
+
ctx.textAlign = 'center';
|
|
34947
|
+
ctx.textBaseline = 'middle';
|
|
34948
|
+
var value = this.data.o;
|
|
34949
|
+
var formattedTxt;
|
|
34950
|
+
|
|
34951
|
+
if (formatter) {
|
|
34952
|
+
formattedTxt = formatter(value);
|
|
34953
|
+
}
|
|
34954
|
+
|
|
34955
|
+
if (!formatter || typeof formattedTxt !== 'string') {
|
|
34956
|
+
formattedTxt = helpers_util.labelSignFormat(value);
|
|
34957
|
+
}
|
|
34958
|
+
|
|
34959
|
+
var ratio = 1.8;
|
|
34960
|
+
var radius = this.radius - this.doughnutHoleSize;
|
|
34961
|
+
var innerAngle = (this.endAngle - this.startAngle) * 180 / Math.PI;
|
|
34962
|
+
var valueHeight = fontSize + 4;
|
|
34963
|
+
var valueWidth = Math.round(ctx.measureText(formattedTxt).width);
|
|
34964
|
+
|
|
34965
|
+
if (innerAngle >= valueWidth * ratio && innerAngle >= valueHeight * ratio && radius >= valueWidth * ratio && radius >= valueHeight * ratio) {
|
|
34966
|
+
var halfRadius = radius / 2 + this.doughnutHoleSize;
|
|
34967
|
+
var centerAngle = (this.endAngle - this.startAngle) / 2 + this.startAngle;
|
|
34968
|
+
var xPos = halfRadius * Math.cos(centerAngle) + this.centerX;
|
|
34969
|
+
var yPos = halfRadius * Math.sin(centerAngle) + this.centerY;
|
|
34970
|
+
ctx.fillText(formattedTxt, xPos, yPos);
|
|
34971
|
+
}
|
|
34972
|
+
|
|
34973
|
+
ctx.restore();
|
|
34974
|
+
}
|
|
34898
34975
|
}]);
|
|
34899
34976
|
|
|
34900
34977
|
return Pie;
|
|
@@ -38569,6 +38646,8 @@ var plugins_pie_modules = {
|
|
|
38569
38646
|
series = this.seriesList[slice.id];
|
|
38570
38647
|
|
|
38571
38648
|
if (value) {
|
|
38649
|
+
var _pieOption$doughnutHo;
|
|
38650
|
+
|
|
38572
38651
|
var strokeOptions = _objectSpread2({}, pieOption.pieStroke);
|
|
38573
38652
|
|
|
38574
38653
|
if (pie.data.length === 1 && pieOption.pieStroke.use) {
|
|
@@ -38584,6 +38663,7 @@ var plugins_pie_modules = {
|
|
|
38584
38663
|
series.centerX = centerX;
|
|
38585
38664
|
series.centerY = centerY;
|
|
38586
38665
|
series.radius = radius;
|
|
38666
|
+
series.doughnutHoleSize = radius * ((_pieOption$doughnutHo = pieOption.doughnutHoleSize) !== null && _pieOption$doughnutHo !== void 0 ? _pieOption$doughnutHo : 0);
|
|
38587
38667
|
series.startAngle = startAngle;
|
|
38588
38668
|
series.endAngle = endAngle;
|
|
38589
38669
|
series.data = {
|
|
@@ -38665,6 +38745,8 @@ var plugins_pie_modules = {
|
|
|
38665
38745
|
series = this.seriesList[slice.id];
|
|
38666
38746
|
|
|
38667
38747
|
if (slice.value) {
|
|
38748
|
+
var _pieOption$doughnutHo2;
|
|
38749
|
+
|
|
38668
38750
|
var strokeOptions = _objectSpread2({}, pieOption.pieStroke);
|
|
38669
38751
|
|
|
38670
38752
|
if (pie.data.length === 1 && pieOption.pieStroke.use) {
|
|
@@ -38680,6 +38762,7 @@ var plugins_pie_modules = {
|
|
|
38680
38762
|
series.centerX = centerX;
|
|
38681
38763
|
series.centerY = centerY;
|
|
38682
38764
|
series.radius = radius;
|
|
38765
|
+
series.doughnutHoleSize = radius * ((_pieOption$doughnutHo2 = pieOption.doughnutHoleSize) !== null && _pieOption$doughnutHo2 !== void 0 ? _pieOption$doughnutHo2 : 0);
|
|
38683
38766
|
series.startAngle = slice.sa;
|
|
38684
38767
|
series.endAngle = slice.ea;
|
|
38685
38768
|
series.data = {
|