chartkick 5.2.0 → 5.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +8 -8
- data/lib/chartkick/version.rb +1 -1
- data/vendor/assets/javascripts/Chart.bundle.js +577 -478
- metadata +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Chart.js v4.
|
|
2
|
+
* Chart.js v4.6.1
|
|
3
3
|
* https://www.chartjs.org
|
|
4
|
-
* (c)
|
|
4
|
+
* (c) 2026 Chart.js Contributors
|
|
5
5
|
* Released under the MIT License
|
|
6
6
|
*
|
|
7
7
|
* @kurkle/color v0.3.2
|
|
@@ -231,15 +231,15 @@
|
|
|
231
231
|
function _toConsumableArray(r) {
|
|
232
232
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread();
|
|
233
233
|
}
|
|
234
|
-
function _toPrimitive(t,
|
|
234
|
+
function _toPrimitive(t, e) {
|
|
235
235
|
if ("object" != typeof t || !t) return t;
|
|
236
|
-
var
|
|
237
|
-
if (void 0 !==
|
|
238
|
-
var i =
|
|
236
|
+
var r;
|
|
237
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
238
|
+
var i = r.call(t, e || "default");
|
|
239
239
|
if ("object" != typeof i) return i;
|
|
240
240
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
241
241
|
}
|
|
242
|
-
return ("string" ===
|
|
242
|
+
return ("string" === e ? String : Number)(t);
|
|
243
243
|
}
|
|
244
244
|
function _toPropertyKey(t) {
|
|
245
245
|
var i = _toPrimitive(t, "string");
|
|
@@ -3169,19 +3169,19 @@
|
|
|
3169
3169
|
try {
|
|
3170
3170
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
3171
3171
|
var scope = _step9.value;
|
|
3172
|
-
var
|
|
3172
|
+
var _iterator0 = _createForOfIteratorHelper$1(Object.keys(scope).filter(function (k) {
|
|
3173
3173
|
return !k.startsWith('_');
|
|
3174
3174
|
})),
|
|
3175
|
-
|
|
3175
|
+
_step0;
|
|
3176
3176
|
try {
|
|
3177
|
-
for (
|
|
3178
|
-
var key =
|
|
3177
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
3178
|
+
var key = _step0.value;
|
|
3179
3179
|
set.add(key);
|
|
3180
3180
|
}
|
|
3181
3181
|
} catch (err) {
|
|
3182
|
-
|
|
3182
|
+
_iterator0.e(err);
|
|
3183
3183
|
} finally {
|
|
3184
|
-
|
|
3184
|
+
_iterator0.f();
|
|
3185
3185
|
}
|
|
3186
3186
|
}
|
|
3187
3187
|
} catch (err) {
|
|
@@ -3565,10 +3565,10 @@
|
|
|
3565
3565
|
*/
|
|
3566
3566
|
function retinaScale(chart, forceRatio, forceStyle) {
|
|
3567
3567
|
var pixelRatio = forceRatio || 1;
|
|
3568
|
-
var deviceHeight =
|
|
3569
|
-
var deviceWidth =
|
|
3570
|
-
chart.height =
|
|
3571
|
-
chart.width =
|
|
3568
|
+
var deviceHeight = round1(chart.height * pixelRatio);
|
|
3569
|
+
var deviceWidth = round1(chart.width * pixelRatio);
|
|
3570
|
+
chart.height = round1(chart.height);
|
|
3571
|
+
chart.width = round1(chart.width);
|
|
3572
3572
|
var canvas = chart.canvas;
|
|
3573
3573
|
// If no style has been set on the canvas, the render size is used as display size,
|
|
3574
3574
|
// making the chart visually bigger, so let's enforce it to the "correct" values.
|
|
@@ -3577,10 +3577,12 @@
|
|
|
3577
3577
|
canvas.style.height = "".concat(chart.height, "px");
|
|
3578
3578
|
canvas.style.width = "".concat(chart.width, "px");
|
|
3579
3579
|
}
|
|
3580
|
-
|
|
3580
|
+
var canvasHeight = Math.floor(deviceHeight);
|
|
3581
|
+
var canvasWidth = Math.floor(deviceWidth);
|
|
3582
|
+
if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== canvasHeight || canvas.width !== canvasWidth) {
|
|
3581
3583
|
chart.currentDevicePixelRatio = pixelRatio;
|
|
3582
|
-
canvas.height =
|
|
3583
|
-
canvas.width =
|
|
3584
|
+
canvas.height = canvasHeight;
|
|
3585
|
+
canvas.width = canvasWidth;
|
|
3584
3586
|
chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
|
|
3585
3587
|
return true;
|
|
3586
3588
|
}
|
|
@@ -3985,11 +3987,11 @@
|
|
|
3985
3987
|
start = e % count;
|
|
3986
3988
|
}
|
|
3987
3989
|
}
|
|
3988
|
-
var
|
|
3989
|
-
|
|
3990
|
+
var _iterator1 = _createForOfIteratorHelper$1(segments),
|
|
3991
|
+
_step1;
|
|
3990
3992
|
try {
|
|
3991
|
-
for (
|
|
3992
|
-
var segment =
|
|
3993
|
+
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
3994
|
+
var segment = _step1.value;
|
|
3993
3995
|
start = spanGaps ? start : segment.start;
|
|
3994
3996
|
var prev = points[start % count];
|
|
3995
3997
|
var style = void 0;
|
|
@@ -4014,9 +4016,9 @@
|
|
|
4014
4016
|
}
|
|
4015
4017
|
}
|
|
4016
4018
|
} catch (err) {
|
|
4017
|
-
|
|
4019
|
+
_iterator1.e(err);
|
|
4018
4020
|
} finally {
|
|
4019
|
-
|
|
4021
|
+
_iterator1.f();
|
|
4020
4022
|
}
|
|
4021
4023
|
return result;
|
|
4022
4024
|
}
|
|
@@ -4682,7 +4684,7 @@
|
|
|
4682
4684
|
var parsed = _step2.value;
|
|
4683
4685
|
var stacks = parsed._stacks;
|
|
4684
4686
|
if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {
|
|
4685
|
-
|
|
4687
|
+
continue;
|
|
4686
4688
|
}
|
|
4687
4689
|
delete stacks[axis][datasetIndex];
|
|
4688
4690
|
if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {
|
|
@@ -6430,14 +6432,15 @@
|
|
|
6430
6432
|
circumference: 360,
|
|
6431
6433
|
radius: '100%',
|
|
6432
6434
|
spacing: 0,
|
|
6435
|
+
spacingMode: 'angular',
|
|
6433
6436
|
indexAxis: 'r'
|
|
6434
6437
|
});
|
|
6435
6438
|
_defineProperty$1(DoughnutController, "descriptors", {
|
|
6436
6439
|
_scriptable: function _scriptable(name) {
|
|
6437
|
-
return name !== 'spacing';
|
|
6440
|
+
return name !== 'spacing' && name !== 'spacingMode';
|
|
6438
6441
|
},
|
|
6439
6442
|
_indexable: function _indexable(name) {
|
|
6440
|
-
return name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash');
|
|
6443
|
+
return name !== 'spacing' && name !== 'spacingMode' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash');
|
|
6441
6444
|
}
|
|
6442
6445
|
});
|
|
6443
6446
|
_defineProperty$1(DoughnutController, "overrides", {
|
|
@@ -6447,21 +6450,29 @@
|
|
|
6447
6450
|
labels: {
|
|
6448
6451
|
generateLabels: function generateLabels(chart) {
|
|
6449
6452
|
var data = chart.data;
|
|
6453
|
+
var _chart$legend$options2 = chart.legend.options.labels,
|
|
6454
|
+
pointStyle = _chart$legend$options2.pointStyle,
|
|
6455
|
+
textAlign = _chart$legend$options2.textAlign,
|
|
6456
|
+
color = _chart$legend$options2.color,
|
|
6457
|
+
useBorderRadius = _chart$legend$options2.useBorderRadius,
|
|
6458
|
+
borderRadius = _chart$legend$options2.borderRadius;
|
|
6450
6459
|
if (data.labels.length && data.datasets.length) {
|
|
6451
|
-
var _chart$legend$options2 = chart.legend.options.labels,
|
|
6452
|
-
pointStyle = _chart$legend$options2.pointStyle,
|
|
6453
|
-
color = _chart$legend$options2.color;
|
|
6454
6460
|
return data.labels.map(function (label, i) {
|
|
6455
6461
|
var meta = chart.getDatasetMeta(0);
|
|
6456
6462
|
var style = meta.controller.getStyle(i);
|
|
6457
6463
|
return {
|
|
6458
6464
|
text: label,
|
|
6459
6465
|
fillStyle: style.backgroundColor,
|
|
6460
|
-
strokeStyle: style.borderColor,
|
|
6461
6466
|
fontColor: color,
|
|
6467
|
+
hidden: !chart.getDataVisibility(i),
|
|
6468
|
+
lineDash: style.borderDash,
|
|
6469
|
+
lineDashOffset: style.borderDashOffset,
|
|
6470
|
+
lineJoin: style.borderJoinStyle,
|
|
6462
6471
|
lineWidth: style.borderWidth,
|
|
6472
|
+
strokeStyle: style.borderColor,
|
|
6473
|
+
textAlign: textAlign,
|
|
6463
6474
|
pointStyle: pointStyle,
|
|
6464
|
-
|
|
6475
|
+
borderRadius: useBorderRadius && (borderRadius || style.borderRadius),
|
|
6465
6476
|
index: i
|
|
6466
6477
|
};
|
|
6467
6478
|
});
|
|
@@ -6719,6 +6730,12 @@
|
|
|
6719
6730
|
endAngle: endAngle,
|
|
6720
6731
|
options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)
|
|
6721
6732
|
};
|
|
6733
|
+
if (properties.options.spacing === 0) {
|
|
6734
|
+
properties.options.spacing = this.options.spacing;
|
|
6735
|
+
}
|
|
6736
|
+
if (properties.options.spacingMode === 'angular') {
|
|
6737
|
+
properties.options.spacingMode = this.options.spacingMode;
|
|
6738
|
+
}
|
|
6722
6739
|
this.updateElement(arc, i, properties, mode);
|
|
6723
6740
|
}
|
|
6724
6741
|
}
|
|
@@ -6756,7 +6773,9 @@
|
|
|
6756
6773
|
}
|
|
6757
6774
|
},
|
|
6758
6775
|
indexAxis: 'r',
|
|
6759
|
-
startAngle: 0
|
|
6776
|
+
startAngle: 0,
|
|
6777
|
+
spacing: 0,
|
|
6778
|
+
spacingMode: 'proportional'
|
|
6760
6779
|
});
|
|
6761
6780
|
_defineProperty$1(PolarAreaController, "overrides", {
|
|
6762
6781
|
aspectRatio: 1,
|
|
@@ -7931,18 +7950,18 @@
|
|
|
7931
7950
|
var canvas = chart.canvas;
|
|
7932
7951
|
var observer = new MutationObserver(function (entries) {
|
|
7933
7952
|
var trigger = false;
|
|
7934
|
-
var
|
|
7935
|
-
|
|
7953
|
+
var _iterator0 = _createForOfIteratorHelper$1(entries),
|
|
7954
|
+
_step0;
|
|
7936
7955
|
try {
|
|
7937
|
-
for (
|
|
7938
|
-
var entry =
|
|
7956
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
7957
|
+
var entry = _step0.value;
|
|
7939
7958
|
trigger = trigger || nodeListContains(entry.removedNodes, canvas);
|
|
7940
7959
|
trigger = trigger && !nodeListContains(entry.addedNodes, canvas);
|
|
7941
7960
|
}
|
|
7942
7961
|
} catch (err) {
|
|
7943
|
-
|
|
7962
|
+
_iterator0.e(err);
|
|
7944
7963
|
} finally {
|
|
7945
|
-
|
|
7964
|
+
_iterator0.f();
|
|
7946
7965
|
}
|
|
7947
7966
|
if (trigger) {
|
|
7948
7967
|
listener();
|
|
@@ -9549,9 +9568,9 @@
|
|
|
9549
9568
|
value: function drawBorder() {
|
|
9550
9569
|
var chart = this.chart,
|
|
9551
9570
|
ctx = this.ctx,
|
|
9552
|
-
_this$
|
|
9553
|
-
border = _this$
|
|
9554
|
-
grid = _this$
|
|
9571
|
+
_this$options0 = this.options,
|
|
9572
|
+
border = _this$options0.border,
|
|
9573
|
+
grid = _this$options0.grid;
|
|
9555
9574
|
var borderOpts = border.setContext(this.getContext());
|
|
9556
9575
|
var axisWidth = border.display ? borderOpts.width : 0;
|
|
9557
9576
|
if (!axisWidth) {
|
|
@@ -9591,11 +9610,11 @@
|
|
|
9591
9610
|
clipArea(ctx, area);
|
|
9592
9611
|
}
|
|
9593
9612
|
var items = this.getLabelItems(chartArea);
|
|
9594
|
-
var
|
|
9595
|
-
|
|
9613
|
+
var _iterator1 = _createForOfIteratorHelper$1(items),
|
|
9614
|
+
_step1;
|
|
9596
9615
|
try {
|
|
9597
|
-
for (
|
|
9598
|
-
var item =
|
|
9616
|
+
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
9617
|
+
var item = _step1.value;
|
|
9599
9618
|
var renderTextOptions = item.options;
|
|
9600
9619
|
var tickFont = item.font;
|
|
9601
9620
|
var label = item.label;
|
|
@@ -9603,9 +9622,9 @@
|
|
|
9603
9622
|
renderText(ctx, label, 0, y, tickFont, renderTextOptions);
|
|
9604
9623
|
}
|
|
9605
9624
|
} catch (err) {
|
|
9606
|
-
|
|
9625
|
+
_iterator1.e(err);
|
|
9607
9626
|
} finally {
|
|
9608
|
-
|
|
9627
|
+
_iterator1.f();
|
|
9609
9628
|
}
|
|
9610
9629
|
if (area) {
|
|
9611
9630
|
unclipArea(ctx);
|
|
@@ -9615,10 +9634,10 @@
|
|
|
9615
9634
|
key: "drawTitle",
|
|
9616
9635
|
value: function drawTitle() {
|
|
9617
9636
|
var ctx = this.ctx,
|
|
9618
|
-
_this$
|
|
9619
|
-
position = _this$
|
|
9620
|
-
title = _this$
|
|
9621
|
-
reverse = _this$
|
|
9637
|
+
_this$options1 = this.options,
|
|
9638
|
+
position = _this$options1.position,
|
|
9639
|
+
title = _this$options1.title,
|
|
9640
|
+
reverse = _this$options1.reverse;
|
|
9622
9641
|
if (!title.display) {
|
|
9623
9642
|
return;
|
|
9624
9643
|
}
|
|
@@ -9645,7 +9664,9 @@
|
|
|
9645
9664
|
rotation: rotation,
|
|
9646
9665
|
textAlign: titleAlign(align, position, reverse),
|
|
9647
9666
|
textBaseline: 'middle',
|
|
9648
|
-
translation: [titleX, titleY]
|
|
9667
|
+
translation: [titleX, titleY],
|
|
9668
|
+
strokeColor: title.strokeColor,
|
|
9669
|
+
strokeWidth: title.strokeWidth
|
|
9649
9670
|
});
|
|
9650
9671
|
}
|
|
9651
9672
|
}, {
|
|
@@ -9663,7 +9684,7 @@
|
|
|
9663
9684
|
}, {
|
|
9664
9685
|
key: "_layers",
|
|
9665
9686
|
value: function _layers() {
|
|
9666
|
-
var
|
|
9687
|
+
var _this0 = this;
|
|
9667
9688
|
var opts = this.options;
|
|
9668
9689
|
var tz = opts.ticks && opts.ticks.z || 0;
|
|
9669
9690
|
var gz = valueOrDefault(opts.grid && opts.grid.z, -1);
|
|
@@ -9672,26 +9693,26 @@
|
|
|
9672
9693
|
return [{
|
|
9673
9694
|
z: tz,
|
|
9674
9695
|
draw: function draw(chartArea) {
|
|
9675
|
-
|
|
9696
|
+
_this0.draw(chartArea);
|
|
9676
9697
|
}
|
|
9677
9698
|
}];
|
|
9678
9699
|
}
|
|
9679
9700
|
return [{
|
|
9680
9701
|
z: gz,
|
|
9681
9702
|
draw: function draw(chartArea) {
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9703
|
+
_this0.drawBackground();
|
|
9704
|
+
_this0.drawGrid(chartArea);
|
|
9705
|
+
_this0.drawTitle();
|
|
9685
9706
|
}
|
|
9686
9707
|
}, {
|
|
9687
9708
|
z: bz,
|
|
9688
9709
|
draw: function draw() {
|
|
9689
|
-
|
|
9710
|
+
_this0.drawBorder();
|
|
9690
9711
|
}
|
|
9691
9712
|
}, {
|
|
9692
9713
|
z: tz,
|
|
9693
9714
|
draw: function draw(chartArea) {
|
|
9694
|
-
|
|
9715
|
+
_this0.drawLabels(chartArea);
|
|
9695
9716
|
}
|
|
9696
9717
|
}];
|
|
9697
9718
|
}
|
|
@@ -9912,23 +9933,23 @@
|
|
|
9912
9933
|
}, {
|
|
9913
9934
|
key: "removeScales",
|
|
9914
9935
|
value: function removeScales() {
|
|
9915
|
-
for (var
|
|
9916
|
-
args[
|
|
9936
|
+
for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
|
9937
|
+
args[_key0] = arguments[_key0];
|
|
9917
9938
|
}
|
|
9918
9939
|
this._each('unregister', args, this.scales);
|
|
9919
9940
|
}
|
|
9920
9941
|
}, {
|
|
9921
9942
|
key: "_each",
|
|
9922
9943
|
value: function _each(method, args, typedRegistry) {
|
|
9923
|
-
var
|
|
9944
|
+
var _this1 = this;
|
|
9924
9945
|
_toConsumableArray(args).forEach(function (arg) {
|
|
9925
|
-
var reg = typedRegistry ||
|
|
9926
|
-
if (typedRegistry || reg.isForType(arg) || reg ===
|
|
9927
|
-
|
|
9946
|
+
var reg = typedRegistry || _this1._getRegistryForType(arg);
|
|
9947
|
+
if (typedRegistry || reg.isForType(arg) || reg === _this1.plugins && arg.id) {
|
|
9948
|
+
_this1._exec(method, reg, arg);
|
|
9928
9949
|
} else {
|
|
9929
9950
|
each(arg, function (item) {
|
|
9930
|
-
var itemReg = typedRegistry ||
|
|
9931
|
-
|
|
9951
|
+
var itemReg = typedRegistry || _this1._getRegistryForType(item);
|
|
9952
|
+
_this1._exec(method, itemReg, item);
|
|
9932
9953
|
});
|
|
9933
9954
|
}
|
|
9934
9955
|
});
|
|
@@ -9967,7 +9988,7 @@
|
|
|
9967
9988
|
var PluginService = /*#__PURE__*/function () {
|
|
9968
9989
|
function PluginService() {
|
|
9969
9990
|
_classCallCheck$1(this, PluginService);
|
|
9970
|
-
this._init =
|
|
9991
|
+
this._init = undefined;
|
|
9971
9992
|
}
|
|
9972
9993
|
return _createClass$1(PluginService, [{
|
|
9973
9994
|
key: "notify",
|
|
@@ -9976,11 +9997,15 @@
|
|
|
9976
9997
|
this._init = this._createDescriptors(chart, true);
|
|
9977
9998
|
this._notify(this._init, chart, 'install');
|
|
9978
9999
|
}
|
|
10000
|
+
if (this._init === undefined) {
|
|
10001
|
+
return;
|
|
10002
|
+
}
|
|
9979
10003
|
var descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);
|
|
9980
10004
|
var result = this._notify(descriptors, chart, hook, args);
|
|
9981
10005
|
if (hook === 'afterDestroy') {
|
|
9982
10006
|
this._notify(descriptors, chart, 'stop');
|
|
9983
10007
|
this._notify(this._init, chart, 'uninstall');
|
|
10008
|
+
this._init = undefined;
|
|
9984
10009
|
}
|
|
9985
10010
|
return result;
|
|
9986
10011
|
}
|
|
@@ -9988,11 +10013,11 @@
|
|
|
9988
10013
|
key: "_notify",
|
|
9989
10014
|
value: function _notify(descriptors, chart, hook, args) {
|
|
9990
10015
|
args = args || {};
|
|
9991
|
-
var
|
|
9992
|
-
|
|
10016
|
+
var _iterator10 = _createForOfIteratorHelper$1(descriptors),
|
|
10017
|
+
_step10;
|
|
9993
10018
|
try {
|
|
9994
|
-
for (
|
|
9995
|
-
var descriptor =
|
|
10019
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
10020
|
+
var descriptor = _step10.value;
|
|
9996
10021
|
var plugin = descriptor.plugin;
|
|
9997
10022
|
var method = plugin[hook];
|
|
9998
10023
|
var params = [chart, args, descriptor.options];
|
|
@@ -10001,9 +10026,9 @@
|
|
|
10001
10026
|
}
|
|
10002
10027
|
}
|
|
10003
10028
|
} catch (err) {
|
|
10004
|
-
|
|
10029
|
+
_iterator10.e(err);
|
|
10005
10030
|
} finally {
|
|
10006
|
-
|
|
10031
|
+
_iterator10.f();
|
|
10007
10032
|
}
|
|
10008
10033
|
return true;
|
|
10009
10034
|
}
|
|
@@ -10084,11 +10109,11 @@
|
|
|
10084
10109
|
localIds = _ref2.localIds;
|
|
10085
10110
|
var result = [];
|
|
10086
10111
|
var context = chart.getContext();
|
|
10087
|
-
var
|
|
10088
|
-
|
|
10112
|
+
var _iterator11 = _createForOfIteratorHelper$1(plugins),
|
|
10113
|
+
_step11;
|
|
10089
10114
|
try {
|
|
10090
|
-
for (
|
|
10091
|
-
var plugin =
|
|
10115
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
10116
|
+
var plugin = _step11.value;
|
|
10092
10117
|
var id = plugin.id;
|
|
10093
10118
|
var opts = getOpts(options[id], all);
|
|
10094
10119
|
if (opts === null) {
|
|
@@ -10103,9 +10128,9 @@
|
|
|
10103
10128
|
});
|
|
10104
10129
|
}
|
|
10105
10130
|
} catch (err) {
|
|
10106
|
-
|
|
10131
|
+
_iterator11.e(err);
|
|
10107
10132
|
} finally {
|
|
10108
|
-
|
|
10133
|
+
_iterator11.f();
|
|
10109
10134
|
}
|
|
10110
10135
|
return result;
|
|
10111
10136
|
}
|
|
@@ -10157,8 +10182,8 @@
|
|
|
10157
10182
|
if (idMatchesAxis(id)) {
|
|
10158
10183
|
return id;
|
|
10159
10184
|
}
|
|
10160
|
-
for (var
|
|
10161
|
-
scaleOptions[
|
|
10185
|
+
for (var _len1 = arguments.length, scaleOptions = new Array(_len1 > 1 ? _len1 - 1 : 0), _key1 = 1; _key1 < _len1; _key1++) {
|
|
10186
|
+
scaleOptions[_key1 - 1] = arguments[_key1];
|
|
10162
10187
|
}
|
|
10163
10188
|
for (var _i3 = 0, _scaleOptions = scaleOptions; _i3 < _scaleOptions.length; _i3++) {
|
|
10164
10189
|
var opts = _scaleOptions[_i3];
|
|
@@ -10424,17 +10449,17 @@
|
|
|
10424
10449
|
var subResolver = this.createResolver(scopes, context, subPrefixes);
|
|
10425
10450
|
options = _attachContext(resolver, context, subResolver);
|
|
10426
10451
|
}
|
|
10427
|
-
var
|
|
10428
|
-
|
|
10452
|
+
var _iterator12 = _createForOfIteratorHelper$1(names),
|
|
10453
|
+
_step12;
|
|
10429
10454
|
try {
|
|
10430
|
-
for (
|
|
10431
|
-
var prop =
|
|
10455
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
10456
|
+
var prop = _step12.value;
|
|
10432
10457
|
result[prop] = options[prop];
|
|
10433
10458
|
}
|
|
10434
10459
|
} catch (err) {
|
|
10435
|
-
|
|
10460
|
+
_iterator12.e(err);
|
|
10436
10461
|
} finally {
|
|
10437
|
-
|
|
10462
|
+
_iterator12.f();
|
|
10438
10463
|
}
|
|
10439
10464
|
return result;
|
|
10440
10465
|
}
|
|
@@ -10478,11 +10503,11 @@
|
|
|
10478
10503
|
var _descriptors2 = _descriptors(proxy),
|
|
10479
10504
|
isScriptable = _descriptors2.isScriptable,
|
|
10480
10505
|
isIndexable = _descriptors2.isIndexable;
|
|
10481
|
-
var
|
|
10482
|
-
|
|
10506
|
+
var _iterator13 = _createForOfIteratorHelper$1(names),
|
|
10507
|
+
_step13;
|
|
10483
10508
|
try {
|
|
10484
|
-
for (
|
|
10485
|
-
var prop =
|
|
10509
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
10510
|
+
var prop = _step13.value;
|
|
10486
10511
|
var scriptable = isScriptable(prop);
|
|
10487
10512
|
var indexable = isIndexable(prop);
|
|
10488
10513
|
var value = (indexable || scriptable) && proxy[prop];
|
|
@@ -10491,13 +10516,13 @@
|
|
|
10491
10516
|
}
|
|
10492
10517
|
}
|
|
10493
10518
|
} catch (err) {
|
|
10494
|
-
|
|
10519
|
+
_iterator13.e(err);
|
|
10495
10520
|
} finally {
|
|
10496
|
-
|
|
10521
|
+
_iterator13.f();
|
|
10497
10522
|
}
|
|
10498
10523
|
return false;
|
|
10499
10524
|
}
|
|
10500
|
-
var version = "4.
|
|
10525
|
+
var version = "4.6.1";
|
|
10501
10526
|
var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
|
|
10502
10527
|
function positionIsHorizontal(position, axis) {
|
|
10503
10528
|
return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
|
|
@@ -10561,7 +10586,7 @@
|
|
|
10561
10586
|
}
|
|
10562
10587
|
var Chart = /*#__PURE__*/function () {
|
|
10563
10588
|
function Chart(item, userConfig) {
|
|
10564
|
-
var
|
|
10589
|
+
var _this10 = this;
|
|
10565
10590
|
_classCallCheck$1(this, Chart);
|
|
10566
10591
|
var config = this.config = new Config(userConfig);
|
|
10567
10592
|
var initialCanvas = getCanvas(item);
|
|
@@ -10602,7 +10627,7 @@
|
|
|
10602
10627
|
this._animationsDisabled = undefined;
|
|
10603
10628
|
this.$context = undefined;
|
|
10604
10629
|
this._doResize = debounce(function (mode) {
|
|
10605
|
-
return
|
|
10630
|
+
return _this10.update(mode);
|
|
10606
10631
|
}, options.resizeDelay || 0);
|
|
10607
10632
|
this._dataChanges = [];
|
|
10608
10633
|
instances[this.id] = this;
|
|
@@ -10620,9 +10645,9 @@
|
|
|
10620
10645
|
return _createClass$1(Chart, [{
|
|
10621
10646
|
key: "aspectRatio",
|
|
10622
10647
|
get: function get() {
|
|
10623
|
-
var _this$
|
|
10624
|
-
aspectRatio = _this$
|
|
10625
|
-
maintainAspectRatio = _this$
|
|
10648
|
+
var _this$options10 = this.options,
|
|
10649
|
+
aspectRatio = _this$options10.aspectRatio,
|
|
10650
|
+
maintainAspectRatio = _this$options10.maintainAspectRatio,
|
|
10626
10651
|
width = this.width,
|
|
10627
10652
|
height = this.height,
|
|
10628
10653
|
_aspectRatio = this._aspectRatio;
|
|
@@ -10729,7 +10754,7 @@
|
|
|
10729
10754
|
}, {
|
|
10730
10755
|
key: "buildOrUpdateScales",
|
|
10731
10756
|
value: function buildOrUpdateScales() {
|
|
10732
|
-
var
|
|
10757
|
+
var _this11 = this;
|
|
10733
10758
|
var options = this.options;
|
|
10734
10759
|
var scaleOpts = options.scales;
|
|
10735
10760
|
var scales = this.scales;
|
|
@@ -10768,8 +10793,8 @@
|
|
|
10768
10793
|
scale = new scaleClass({
|
|
10769
10794
|
id: id,
|
|
10770
10795
|
type: scaleType,
|
|
10771
|
-
ctx:
|
|
10772
|
-
chart:
|
|
10796
|
+
ctx: _this11.ctx,
|
|
10797
|
+
chart: _this11
|
|
10773
10798
|
});
|
|
10774
10799
|
scales[scale.id] = scale;
|
|
10775
10800
|
}
|
|
@@ -10781,8 +10806,8 @@
|
|
|
10781
10806
|
}
|
|
10782
10807
|
});
|
|
10783
10808
|
each(scales, function (scale) {
|
|
10784
|
-
layouts.configure(
|
|
10785
|
-
layouts.addBox(
|
|
10809
|
+
layouts.configure(_this11, scale, scale.options);
|
|
10810
|
+
layouts.addBox(_this11, scale);
|
|
10786
10811
|
});
|
|
10787
10812
|
}
|
|
10788
10813
|
}, {
|
|
@@ -10805,7 +10830,7 @@
|
|
|
10805
10830
|
}, {
|
|
10806
10831
|
key: "_removeUnreferencedMetasets",
|
|
10807
10832
|
value: function _removeUnreferencedMetasets() {
|
|
10808
|
-
var
|
|
10833
|
+
var _this12 = this;
|
|
10809
10834
|
var metasets = this._metasets,
|
|
10810
10835
|
datasets = this.data.datasets;
|
|
10811
10836
|
if (metasets.length > datasets.length) {
|
|
@@ -10815,7 +10840,7 @@
|
|
|
10815
10840
|
if (datasets.filter(function (x) {
|
|
10816
10841
|
return x === meta._dataset;
|
|
10817
10842
|
}).length === 0) {
|
|
10818
|
-
|
|
10843
|
+
_this12._destroyDatasetMeta(index);
|
|
10819
10844
|
}
|
|
10820
10845
|
});
|
|
10821
10846
|
}
|
|
@@ -10862,9 +10887,9 @@
|
|
|
10862
10887
|
}, {
|
|
10863
10888
|
key: "_resetElements",
|
|
10864
10889
|
value: function _resetElements() {
|
|
10865
|
-
var
|
|
10890
|
+
var _this13 = this;
|
|
10866
10891
|
each(this.data.datasets, function (dataset, datasetIndex) {
|
|
10867
|
-
|
|
10892
|
+
_this13.getDatasetMeta(datasetIndex).controller.reset();
|
|
10868
10893
|
}, this);
|
|
10869
10894
|
}
|
|
10870
10895
|
}, {
|
|
@@ -10924,9 +10949,9 @@
|
|
|
10924
10949
|
}, {
|
|
10925
10950
|
key: "_updateScales",
|
|
10926
10951
|
value: function _updateScales() {
|
|
10927
|
-
var
|
|
10952
|
+
var _this14 = this;
|
|
10928
10953
|
each(this.scales, function (scale) {
|
|
10929
|
-
layouts.removeBox(
|
|
10954
|
+
layouts.removeBox(_this14, scale);
|
|
10930
10955
|
});
|
|
10931
10956
|
this.ensureScalesHaveIDs();
|
|
10932
10957
|
this.buildOrUpdateScales();
|
|
@@ -10947,21 +10972,21 @@
|
|
|
10947
10972
|
value: function _updateHiddenIndices() {
|
|
10948
10973
|
var _hiddenIndices = this._hiddenIndices;
|
|
10949
10974
|
var changes = this._getUniformDataChanges() || [];
|
|
10950
|
-
var
|
|
10951
|
-
|
|
10975
|
+
var _iterator14 = _createForOfIteratorHelper$1(changes),
|
|
10976
|
+
_step14;
|
|
10952
10977
|
try {
|
|
10953
|
-
for (
|
|
10954
|
-
var
|
|
10955
|
-
method =
|
|
10956
|
-
start =
|
|
10957
|
-
count =
|
|
10978
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
10979
|
+
var _step14$value = _step14.value,
|
|
10980
|
+
method = _step14$value.method,
|
|
10981
|
+
start = _step14$value.start,
|
|
10982
|
+
count = _step14$value.count;
|
|
10958
10983
|
var move = method === '_removeElements' ? -count : count;
|
|
10959
10984
|
moveNumericKeys(_hiddenIndices, start, move);
|
|
10960
10985
|
}
|
|
10961
10986
|
} catch (err) {
|
|
10962
|
-
|
|
10987
|
+
_iterator14.e(err);
|
|
10963
10988
|
} finally {
|
|
10964
|
-
|
|
10989
|
+
_iterator14.f();
|
|
10965
10990
|
}
|
|
10966
10991
|
}
|
|
10967
10992
|
}, {
|
|
@@ -10999,7 +11024,7 @@
|
|
|
10999
11024
|
}, {
|
|
11000
11025
|
key: "_updateLayout",
|
|
11001
11026
|
value: function _updateLayout(minPadding) {
|
|
11002
|
-
var
|
|
11027
|
+
var _this15 = this;
|
|
11003
11028
|
if (this.notifyPlugins('beforeLayout', {
|
|
11004
11029
|
cancelable: true
|
|
11005
11030
|
}) === false) {
|
|
@@ -11010,14 +11035,14 @@
|
|
|
11010
11035
|
var noArea = area.width <= 0 || area.height <= 0;
|
|
11011
11036
|
this._layers = [];
|
|
11012
11037
|
each(this.boxes, function (box) {
|
|
11013
|
-
var
|
|
11038
|
+
var _this15$_layers;
|
|
11014
11039
|
if (noArea && box.position === 'chartArea') {
|
|
11015
11040
|
return;
|
|
11016
11041
|
}
|
|
11017
11042
|
if (box.configure) {
|
|
11018
11043
|
box.configure();
|
|
11019
11044
|
}
|
|
11020
|
-
(
|
|
11045
|
+
(_this15$_layers = _this15._layers).push.apply(_this15$_layers, _toConsumableArray(box._layers()));
|
|
11021
11046
|
}, this);
|
|
11022
11047
|
this._layers.forEach(function (item, index) {
|
|
11023
11048
|
item._idx = index;
|
|
@@ -11332,17 +11357,17 @@
|
|
|
11332
11357
|
}, {
|
|
11333
11358
|
key: "bindUserEvents",
|
|
11334
11359
|
value: function bindUserEvents() {
|
|
11335
|
-
var
|
|
11360
|
+
var _this16 = this;
|
|
11336
11361
|
var listeners = this._listeners;
|
|
11337
11362
|
var platform = this.platform;
|
|
11338
11363
|
var _add = function _add(type, listener) {
|
|
11339
|
-
platform.addEventListener(
|
|
11364
|
+
platform.addEventListener(_this16, type, listener);
|
|
11340
11365
|
listeners[type] = listener;
|
|
11341
11366
|
};
|
|
11342
11367
|
var listener = function listener(e, x, y) {
|
|
11343
11368
|
e.offsetX = x;
|
|
11344
11369
|
e.offsetY = y;
|
|
11345
|
-
|
|
11370
|
+
_this16._eventHandler(e);
|
|
11346
11371
|
};
|
|
11347
11372
|
each(this.options.events, function (type) {
|
|
11348
11373
|
return _add(type, listener);
|
|
@@ -11351,40 +11376,40 @@
|
|
|
11351
11376
|
}, {
|
|
11352
11377
|
key: "bindResponsiveEvents",
|
|
11353
11378
|
value: function bindResponsiveEvents() {
|
|
11354
|
-
var
|
|
11379
|
+
var _this17 = this;
|
|
11355
11380
|
if (!this._responsiveListeners) {
|
|
11356
11381
|
this._responsiveListeners = {};
|
|
11357
11382
|
}
|
|
11358
11383
|
var listeners = this._responsiveListeners;
|
|
11359
11384
|
var platform = this.platform;
|
|
11360
11385
|
var _add = function _add(type, listener) {
|
|
11361
|
-
platform.addEventListener(
|
|
11386
|
+
platform.addEventListener(_this17, type, listener);
|
|
11362
11387
|
listeners[type] = listener;
|
|
11363
11388
|
};
|
|
11364
11389
|
var _remove = function _remove(type, listener) {
|
|
11365
11390
|
if (listeners[type]) {
|
|
11366
|
-
platform.removeEventListener(
|
|
11391
|
+
platform.removeEventListener(_this17, type, listener);
|
|
11367
11392
|
delete listeners[type];
|
|
11368
11393
|
}
|
|
11369
11394
|
};
|
|
11370
11395
|
var listener = function listener(width, height) {
|
|
11371
|
-
if (
|
|
11372
|
-
|
|
11396
|
+
if (_this17.canvas) {
|
|
11397
|
+
_this17.resize(width, height);
|
|
11373
11398
|
}
|
|
11374
11399
|
};
|
|
11375
11400
|
var detached;
|
|
11376
11401
|
var _attached = function attached() {
|
|
11377
11402
|
_remove('attach', _attached);
|
|
11378
|
-
|
|
11379
|
-
|
|
11403
|
+
_this17.attached = true;
|
|
11404
|
+
_this17.resize();
|
|
11380
11405
|
_add('resize', listener);
|
|
11381
11406
|
_add('detach', detached);
|
|
11382
11407
|
};
|
|
11383
11408
|
detached = function detached() {
|
|
11384
|
-
|
|
11409
|
+
_this17.attached = false;
|
|
11385
11410
|
_remove('resize', listener);
|
|
11386
|
-
|
|
11387
|
-
|
|
11411
|
+
_this17._stop();
|
|
11412
|
+
_this17._resize(0, 0);
|
|
11388
11413
|
_add('attach', _attached);
|
|
11389
11414
|
};
|
|
11390
11415
|
if (platform.isAttached(this.canvas)) {
|
|
@@ -11396,13 +11421,13 @@
|
|
|
11396
11421
|
}, {
|
|
11397
11422
|
key: "unbindEvents",
|
|
11398
11423
|
value: function unbindEvents() {
|
|
11399
|
-
var
|
|
11424
|
+
var _this18 = this;
|
|
11400
11425
|
each(this._listeners, function (listener, type) {
|
|
11401
|
-
|
|
11426
|
+
_this18.platform.removeEventListener(_this18, type, listener);
|
|
11402
11427
|
});
|
|
11403
11428
|
this._listeners = {};
|
|
11404
11429
|
each(this._responsiveListeners, function (listener, type) {
|
|
11405
|
-
|
|
11430
|
+
_this18.platform.removeEventListener(_this18, type, listener);
|
|
11406
11431
|
});
|
|
11407
11432
|
this._responsiveListeners = undefined;
|
|
11408
11433
|
}
|
|
@@ -11431,12 +11456,12 @@
|
|
|
11431
11456
|
}, {
|
|
11432
11457
|
key: "setActiveElements",
|
|
11433
11458
|
value: function setActiveElements(activeElements) {
|
|
11434
|
-
var
|
|
11459
|
+
var _this19 = this;
|
|
11435
11460
|
var lastActive = this._active || [];
|
|
11436
11461
|
var active = activeElements.map(function (_ref4) {
|
|
11437
11462
|
var datasetIndex = _ref4.datasetIndex,
|
|
11438
11463
|
index = _ref4.index;
|
|
11439
|
-
var meta =
|
|
11464
|
+
var meta = _this19.getDatasetMeta(datasetIndex);
|
|
11440
11465
|
if (!meta) {
|
|
11441
11466
|
throw new Error('No dataset found at index ' + datasetIndex);
|
|
11442
11467
|
}
|
|
@@ -11488,7 +11513,7 @@
|
|
|
11488
11513
|
}, {
|
|
11489
11514
|
key: "_eventHandler",
|
|
11490
11515
|
value: function _eventHandler(e, replay) {
|
|
11491
|
-
var
|
|
11516
|
+
var _this20 = this;
|
|
11492
11517
|
var args = {
|
|
11493
11518
|
event: e,
|
|
11494
11519
|
replay: replay,
|
|
@@ -11496,7 +11521,7 @@
|
|
|
11496
11521
|
inChartArea: this.isPointInArea(e)
|
|
11497
11522
|
};
|
|
11498
11523
|
var eventFilter = function eventFilter(plugin) {
|
|
11499
|
-
return (plugin.options.events ||
|
|
11524
|
+
return (plugin.options.events || _this20.options.events).includes(e["native"].type);
|
|
11500
11525
|
};
|
|
11501
11526
|
if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {
|
|
11502
11527
|
return;
|
|
@@ -11663,6 +11688,23 @@
|
|
|
11663
11688
|
y: y + r * Math.sin(theta)
|
|
11664
11689
|
};
|
|
11665
11690
|
}
|
|
11691
|
+
function pathFullCircle(ctx, element, offset, spacing) {
|
|
11692
|
+
var x = element.x,
|
|
11693
|
+
y = element.y,
|
|
11694
|
+
start = element.startAngle,
|
|
11695
|
+
pixelMargin = element.pixelMargin,
|
|
11696
|
+
innerR = element.innerRadius;
|
|
11697
|
+
var outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);
|
|
11698
|
+
var innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;
|
|
11699
|
+
ctx.beginPath();
|
|
11700
|
+
ctx.arc(x, y, outerRadius, start, start + TAU);
|
|
11701
|
+
if (innerRadius > 0) {
|
|
11702
|
+
// Start the inner contour as a separate subpath to avoid a seam connector.
|
|
11703
|
+
ctx.moveTo(x + Math.cos(start) * innerRadius, y + Math.sin(start) * innerRadius);
|
|
11704
|
+
ctx.arc(x, y, innerRadius, start + TAU, start, true);
|
|
11705
|
+
}
|
|
11706
|
+
ctx.closePath();
|
|
11707
|
+
}
|
|
11666
11708
|
/**
|
|
11667
11709
|
* Path the arc, respecting border radius by separating into left and right halves.
|
|
11668
11710
|
*
|
|
@@ -11683,37 +11725,73 @@
|
|
|
11683
11725
|
start = element.startAngle,
|
|
11684
11726
|
pixelMargin = element.pixelMargin,
|
|
11685
11727
|
innerR = element.innerRadius;
|
|
11728
|
+
var _element$options$spac = element.options.spacingMode,
|
|
11729
|
+
spacingMode = _element$options$spac === void 0 ? 'angular' : _element$options$spac;
|
|
11730
|
+
var alpha = end - start;
|
|
11731
|
+
if (circular && element.options.selfJoin && Math.abs(alpha) >= TAU - 1e-4) {
|
|
11732
|
+
pathFullCircle(ctx, element, offset, spacing);
|
|
11733
|
+
return;
|
|
11734
|
+
}
|
|
11686
11735
|
var outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);
|
|
11687
11736
|
var innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;
|
|
11688
|
-
var
|
|
11689
|
-
var
|
|
11737
|
+
var outerSpacingOffset = 0;
|
|
11738
|
+
var innerSpacingOffset = 0;
|
|
11739
|
+
var beta = outerRadius > 0 ? Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius : 0.001;
|
|
11740
|
+
var angleOffset = (alpha - beta) / 2;
|
|
11690
11741
|
if (spacing) {
|
|
11691
11742
|
// When spacing is present, it is the same for all items
|
|
11692
11743
|
// So we adjust the start and end angle of the arc such that
|
|
11693
11744
|
// the distance is the same as it would be without the spacing
|
|
11694
11745
|
var noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;
|
|
11695
11746
|
var noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;
|
|
11696
|
-
var
|
|
11697
|
-
var
|
|
11698
|
-
|
|
11747
|
+
var avgNoSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;
|
|
11748
|
+
var proportionalOffset = function () {
|
|
11749
|
+
var adjustedAngle = avgNoSpacingRadius !== 0 ? alpha * avgNoSpacingRadius / (avgNoSpacingRadius + spacing) : alpha;
|
|
11750
|
+
return (alpha - adjustedAngle) / 2;
|
|
11751
|
+
}();
|
|
11752
|
+
var angularOffset = avgNoSpacingRadius > 0 ? Math.asin(Math.min(1, spacing / avgNoSpacingRadius)) : 0;
|
|
11753
|
+
// Keep spacing trims below half the available span after base offset trimming.
|
|
11754
|
+
var maxOffset = Math.max(0, beta / 2 - 0.001);
|
|
11755
|
+
var maxOffsetSin = Math.sin(maxOffset);
|
|
11756
|
+
if (spacingMode === 'parallel') {
|
|
11757
|
+
if (innerRadius === 0 && maxOffsetSin > 0) {
|
|
11758
|
+
// A root radius of zero cannot realize a non-zero parallel separator width.
|
|
11759
|
+
// Raise the root just enough for the available angular span.
|
|
11760
|
+
var minInnerRadius = spacing / maxOffsetSin;
|
|
11761
|
+
var maxInnerRadius = Math.max(0, outerRadius - 0.001);
|
|
11762
|
+
innerRadius = Math.min(minInnerRadius, maxInnerRadius);
|
|
11763
|
+
}
|
|
11764
|
+
// Use one bounded spacing value for both radii so large spacing keeps stable geometry.
|
|
11765
|
+
var maxParallelSpacing = Math.min(outerRadius > 0 ? outerRadius * maxOffsetSin : Number.POSITIVE_INFINITY, innerRadius > 0 ? innerRadius * maxOffsetSin : Number.POSITIVE_INFINITY);
|
|
11766
|
+
var parallelSpacing = Math.min(spacing, maxParallelSpacing);
|
|
11767
|
+
outerSpacingOffset = outerRadius > 0 ? Math.asin(Math.min(1, parallelSpacing / outerRadius)) : Math.min(maxOffset, angularOffset);
|
|
11768
|
+
innerSpacingOffset = innerRadius > 0 ? Math.asin(Math.min(1, parallelSpacing / innerRadius)) : outerSpacingOffset;
|
|
11769
|
+
} else if (spacingMode === 'proportional') {
|
|
11770
|
+
outerSpacingOffset = Math.min(maxOffset, proportionalOffset);
|
|
11771
|
+
innerSpacingOffset = Math.min(maxOffset, proportionalOffset);
|
|
11772
|
+
} else {
|
|
11773
|
+
outerSpacingOffset = Math.min(maxOffset, angularOffset);
|
|
11774
|
+
innerSpacingOffset = Math.min(maxOffset, angularOffset);
|
|
11775
|
+
}
|
|
11699
11776
|
}
|
|
11700
|
-
var
|
|
11701
|
-
var
|
|
11702
|
-
var
|
|
11703
|
-
var
|
|
11704
|
-
var
|
|
11777
|
+
var outerStartAngle = start + angleOffset + outerSpacingOffset;
|
|
11778
|
+
var outerEndAngle = end - angleOffset - outerSpacingOffset;
|
|
11779
|
+
var innerStartAngle = start + angleOffset + innerSpacingOffset;
|
|
11780
|
+
var innerEndAngle = end - angleOffset - innerSpacingOffset;
|
|
11781
|
+
var angleDelta = Math.min(outerEndAngle - outerStartAngle, innerEndAngle - innerStartAngle);
|
|
11782
|
+
var _parseBorderRadius$ = parseBorderRadius$1(element, innerRadius, outerRadius, angleDelta),
|
|
11705
11783
|
outerStart = _parseBorderRadius$.outerStart,
|
|
11706
11784
|
outerEnd = _parseBorderRadius$.outerEnd,
|
|
11707
11785
|
innerStart = _parseBorderRadius$.innerStart,
|
|
11708
11786
|
innerEnd = _parseBorderRadius$.innerEnd;
|
|
11709
11787
|
var outerStartAdjustedRadius = outerRadius - outerStart;
|
|
11710
11788
|
var outerEndAdjustedRadius = outerRadius - outerEnd;
|
|
11711
|
-
var outerStartAdjustedAngle =
|
|
11712
|
-
var outerEndAdjustedAngle =
|
|
11789
|
+
var outerStartAdjustedAngle = outerStartAngle + outerStart / outerStartAdjustedRadius;
|
|
11790
|
+
var outerEndAdjustedAngle = outerEndAngle - outerEnd / outerEndAdjustedRadius;
|
|
11713
11791
|
var innerStartAdjustedRadius = innerRadius + innerStart;
|
|
11714
11792
|
var innerEndAdjustedRadius = innerRadius + innerEnd;
|
|
11715
|
-
var innerStartAdjustedAngle =
|
|
11716
|
-
var innerEndAdjustedAngle =
|
|
11793
|
+
var innerStartAdjustedAngle = innerStartAngle + innerStart / innerStartAdjustedRadius;
|
|
11794
|
+
var innerEndAdjustedAngle = innerEndAngle - innerEnd / innerEndAdjustedRadius;
|
|
11717
11795
|
ctx.beginPath();
|
|
11718
11796
|
if (circular) {
|
|
11719
11797
|
// The first arc segments from point 1 to point a to point 2
|
|
@@ -11723,32 +11801,32 @@
|
|
|
11723
11801
|
// The corner segment from point 2 to point 3
|
|
11724
11802
|
if (outerEnd > 0) {
|
|
11725
11803
|
var pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);
|
|
11726
|
-
ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle,
|
|
11804
|
+
ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, outerEndAngle + HALF_PI);
|
|
11727
11805
|
}
|
|
11728
11806
|
// The line from point 3 to point 4
|
|
11729
|
-
var p4 = rThetaToXY(innerEndAdjustedRadius,
|
|
11807
|
+
var p4 = rThetaToXY(innerEndAdjustedRadius, innerEndAngle, x, y);
|
|
11730
11808
|
ctx.lineTo(p4.x, p4.y);
|
|
11731
11809
|
// The corner segment from point 4 to point 5
|
|
11732
11810
|
if (innerEnd > 0) {
|
|
11733
11811
|
var _pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);
|
|
11734
|
-
ctx.arc(_pCenter.x, _pCenter.y, innerEnd,
|
|
11812
|
+
ctx.arc(_pCenter.x, _pCenter.y, innerEnd, innerEndAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);
|
|
11735
11813
|
}
|
|
11736
11814
|
// The inner arc from point 5 to point b to point 6
|
|
11737
|
-
var innerMidAdjustedAngle = (
|
|
11738
|
-
ctx.arc(x, y, innerRadius,
|
|
11739
|
-
ctx.arc(x, y, innerRadius, innerMidAdjustedAngle,
|
|
11815
|
+
var innerMidAdjustedAngle = (innerEndAngle - innerEnd / innerRadius + (innerStartAngle + innerStart / innerRadius)) / 2;
|
|
11816
|
+
ctx.arc(x, y, innerRadius, innerEndAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);
|
|
11817
|
+
ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, innerStartAngle + innerStart / innerRadius, true);
|
|
11740
11818
|
// The corner segment from point 6 to point 7
|
|
11741
11819
|
if (innerStart > 0) {
|
|
11742
11820
|
var _pCenter2 = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);
|
|
11743
|
-
ctx.arc(_pCenter2.x, _pCenter2.y, innerStart, innerStartAdjustedAngle + Math.PI,
|
|
11821
|
+
ctx.arc(_pCenter2.x, _pCenter2.y, innerStart, innerStartAdjustedAngle + Math.PI, innerStartAngle - HALF_PI);
|
|
11744
11822
|
}
|
|
11745
11823
|
// The line from point 7 to point 8
|
|
11746
|
-
var p8 = rThetaToXY(outerStartAdjustedRadius,
|
|
11824
|
+
var p8 = rThetaToXY(outerStartAdjustedRadius, outerStartAngle, x, y);
|
|
11747
11825
|
ctx.lineTo(p8.x, p8.y);
|
|
11748
11826
|
// The corner segment from point 8 to point 1
|
|
11749
11827
|
if (outerStart > 0) {
|
|
11750
11828
|
var _pCenter3 = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);
|
|
11751
|
-
ctx.arc(_pCenter3.x, _pCenter3.y, outerStart,
|
|
11829
|
+
ctx.arc(_pCenter3.x, _pCenter3.y, outerStart, outerStartAngle - HALF_PI, outerStartAdjustedAngle);
|
|
11752
11830
|
}
|
|
11753
11831
|
} else {
|
|
11754
11832
|
ctx.moveTo(x, y);
|
|
@@ -11803,6 +11881,7 @@
|
|
|
11803
11881
|
ctx.lineJoin = borderJoinStyle || 'bevel';
|
|
11804
11882
|
}
|
|
11805
11883
|
var endAngle = element.endAngle;
|
|
11884
|
+
var isFullCircle = Math.abs(endAngle - startAngle) >= TAU - 1e-4;
|
|
11806
11885
|
if (fullCircles) {
|
|
11807
11886
|
pathArc(ctx, element, offset, spacing, endAngle, circular);
|
|
11808
11887
|
for (var i = 0; i < fullCircles; ++i) {
|
|
@@ -11815,7 +11894,8 @@
|
|
|
11815
11894
|
if (inner) {
|
|
11816
11895
|
clipArc(ctx, element, endAngle);
|
|
11817
11896
|
}
|
|
11818
|
-
|
|
11897
|
+
var skipSelfClip = isFullCircle && element.innerRadius > 0;
|
|
11898
|
+
if (!skipSelfClip && options.selfJoin && endAngle - startAngle >= PI && borderRadius === 0 && borderJoinStyle !== 'miter') {
|
|
11819
11899
|
clipSelf(ctx, element, endAngle);
|
|
11820
11900
|
}
|
|
11821
11901
|
if (!fullCircles) {
|
|
@@ -11825,28 +11905,30 @@
|
|
|
11825
11905
|
}
|
|
11826
11906
|
var ArcElement = /*#__PURE__*/function (_Element3) {
|
|
11827
11907
|
function ArcElement(cfg) {
|
|
11828
|
-
var
|
|
11908
|
+
var _this21;
|
|
11829
11909
|
_classCallCheck$1(this, ArcElement);
|
|
11830
|
-
|
|
11831
|
-
_defineProperty$1(
|
|
11832
|
-
_defineProperty$1(
|
|
11833
|
-
_defineProperty$1(
|
|
11834
|
-
_defineProperty$1(
|
|
11835
|
-
_defineProperty$1(
|
|
11836
|
-
_defineProperty$1(
|
|
11837
|
-
_defineProperty$1(
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11910
|
+
_this21 = _callSuper(this, ArcElement);
|
|
11911
|
+
_defineProperty$1(_this21, "circumference", void 0);
|
|
11912
|
+
_defineProperty$1(_this21, "endAngle", void 0);
|
|
11913
|
+
_defineProperty$1(_this21, "fullCircles", void 0);
|
|
11914
|
+
_defineProperty$1(_this21, "innerRadius", void 0);
|
|
11915
|
+
_defineProperty$1(_this21, "outerRadius", void 0);
|
|
11916
|
+
_defineProperty$1(_this21, "pixelMargin", void 0);
|
|
11917
|
+
_defineProperty$1(_this21, "startAngle", void 0);
|
|
11918
|
+
_defineProperty$1(_this21, "circular", void 0);
|
|
11919
|
+
_this21.options = undefined;
|
|
11920
|
+
_this21.circumference = undefined;
|
|
11921
|
+
_this21.startAngle = undefined;
|
|
11922
|
+
_this21.endAngle = undefined;
|
|
11923
|
+
_this21.innerRadius = undefined;
|
|
11924
|
+
_this21.outerRadius = undefined;
|
|
11925
|
+
_this21.pixelMargin = 0;
|
|
11926
|
+
_this21.fullCircles = 0;
|
|
11927
|
+
_this21.circular = false;
|
|
11846
11928
|
if (cfg) {
|
|
11847
|
-
Object.assign(
|
|
11929
|
+
Object.assign(_this21, cfg);
|
|
11848
11930
|
}
|
|
11849
|
-
return
|
|
11931
|
+
return _this21;
|
|
11850
11932
|
}
|
|
11851
11933
|
_inherits$1(ArcElement, _Element3);
|
|
11852
11934
|
return _createClass$1(ArcElement, [{
|
|
@@ -11882,9 +11964,9 @@
|
|
|
11882
11964
|
endAngle = _this$getProps3.endAngle,
|
|
11883
11965
|
innerRadius = _this$getProps3.innerRadius,
|
|
11884
11966
|
outerRadius = _this$getProps3.outerRadius;
|
|
11885
|
-
var _this$
|
|
11886
|
-
offset = _this$
|
|
11887
|
-
spacing = _this$
|
|
11967
|
+
var _this$options11 = this.options,
|
|
11968
|
+
offset = _this$options11.offset,
|
|
11969
|
+
spacing = _this$options11.spacing;
|
|
11888
11970
|
var halfAngle = (startAngle + endAngle) / 2;
|
|
11889
11971
|
var halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;
|
|
11890
11972
|
return {
|
|
@@ -11934,6 +12016,7 @@
|
|
|
11934
12016
|
borderWidth: 2,
|
|
11935
12017
|
offset: 0,
|
|
11936
12018
|
spacing: 0,
|
|
12019
|
+
spacingMode: 'angular',
|
|
11937
12020
|
angle: undefined,
|
|
11938
12021
|
circular: true,
|
|
11939
12022
|
selfJoin: false
|
|
@@ -12102,11 +12185,11 @@
|
|
|
12102
12185
|
var segments = line.segments,
|
|
12103
12186
|
options = line.options;
|
|
12104
12187
|
var segmentMethod = _getSegmentMethod(line);
|
|
12105
|
-
var
|
|
12106
|
-
|
|
12188
|
+
var _iterator15 = _createForOfIteratorHelper$1(segments),
|
|
12189
|
+
_step15;
|
|
12107
12190
|
try {
|
|
12108
|
-
for (
|
|
12109
|
-
var segment =
|
|
12191
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
12192
|
+
var segment = _step15.value;
|
|
12110
12193
|
setStyle(ctx, options, segment.style);
|
|
12111
12194
|
ctx.beginPath();
|
|
12112
12195
|
if (segmentMethod(ctx, line, segment, {
|
|
@@ -12118,9 +12201,9 @@
|
|
|
12118
12201
|
ctx.stroke();
|
|
12119
12202
|
}
|
|
12120
12203
|
} catch (err) {
|
|
12121
|
-
|
|
12204
|
+
_iterator15.e(err);
|
|
12122
12205
|
} finally {
|
|
12123
|
-
|
|
12206
|
+
_iterator15.f();
|
|
12124
12207
|
}
|
|
12125
12208
|
}
|
|
12126
12209
|
var usePath2D = typeof Path2D === 'function';
|
|
@@ -12133,24 +12216,24 @@
|
|
|
12133
12216
|
}
|
|
12134
12217
|
var LineElement = /*#__PURE__*/function (_Element4) {
|
|
12135
12218
|
function LineElement(cfg) {
|
|
12136
|
-
var
|
|
12219
|
+
var _this22;
|
|
12137
12220
|
_classCallCheck$1(this, LineElement);
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12145
|
-
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12221
|
+
_this22 = _callSuper(this, LineElement);
|
|
12222
|
+
_this22.animated = true;
|
|
12223
|
+
_this22.options = undefined;
|
|
12224
|
+
_this22._chart = undefined;
|
|
12225
|
+
_this22._loop = undefined;
|
|
12226
|
+
_this22._fullLoop = undefined;
|
|
12227
|
+
_this22._path = undefined;
|
|
12228
|
+
_this22._points = undefined;
|
|
12229
|
+
_this22._segments = undefined;
|
|
12230
|
+
_this22._decimated = false;
|
|
12231
|
+
_this22._pointsUpdated = false;
|
|
12232
|
+
_this22._datasetIndex = undefined;
|
|
12150
12233
|
if (cfg) {
|
|
12151
|
-
Object.assign(
|
|
12234
|
+
Object.assign(_this22, cfg);
|
|
12152
12235
|
}
|
|
12153
|
-
return
|
|
12236
|
+
return _this22;
|
|
12154
12237
|
}
|
|
12155
12238
|
_inherits$1(LineElement, _Element4);
|
|
12156
12239
|
return _createClass$1(LineElement, [{
|
|
@@ -12242,20 +12325,20 @@
|
|
|
12242
12325
|
var loop = this._loop;
|
|
12243
12326
|
start = start || 0;
|
|
12244
12327
|
count = count || this.points.length - start;
|
|
12245
|
-
var
|
|
12246
|
-
|
|
12328
|
+
var _iterator16 = _createForOfIteratorHelper$1(segments),
|
|
12329
|
+
_step16;
|
|
12247
12330
|
try {
|
|
12248
|
-
for (
|
|
12249
|
-
var segment =
|
|
12331
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
12332
|
+
var segment = _step16.value;
|
|
12250
12333
|
loop &= segmentMethod(ctx, this, segment, {
|
|
12251
12334
|
start: start,
|
|
12252
12335
|
end: start + count - 1
|
|
12253
12336
|
});
|
|
12254
12337
|
}
|
|
12255
12338
|
} catch (err) {
|
|
12256
|
-
|
|
12339
|
+
_iterator16.e(err);
|
|
12257
12340
|
} finally {
|
|
12258
|
-
|
|
12341
|
+
_iterator16.f();
|
|
12259
12342
|
}
|
|
12260
12343
|
return !!loop;
|
|
12261
12344
|
}
|
|
@@ -12308,20 +12391,20 @@
|
|
|
12308
12391
|
}
|
|
12309
12392
|
var PointElement = /*#__PURE__*/function (_Element5) {
|
|
12310
12393
|
function PointElement(cfg) {
|
|
12311
|
-
var
|
|
12394
|
+
var _this23;
|
|
12312
12395
|
_classCallCheck$1(this, PointElement);
|
|
12313
|
-
|
|
12314
|
-
_defineProperty$1(
|
|
12315
|
-
_defineProperty$1(
|
|
12316
|
-
_defineProperty$1(
|
|
12317
|
-
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
|
|
12396
|
+
_this23 = _callSuper(this, PointElement);
|
|
12397
|
+
_defineProperty$1(_this23, "parsed", void 0);
|
|
12398
|
+
_defineProperty$1(_this23, "skip", void 0);
|
|
12399
|
+
_defineProperty$1(_this23, "stop", void 0);
|
|
12400
|
+
_this23.options = undefined;
|
|
12401
|
+
_this23.parsed = undefined;
|
|
12402
|
+
_this23.skip = undefined;
|
|
12403
|
+
_this23.stop = undefined;
|
|
12321
12404
|
if (cfg) {
|
|
12322
|
-
Object.assign(
|
|
12405
|
+
Object.assign(_this23, cfg);
|
|
12323
12406
|
}
|
|
12324
|
-
return
|
|
12407
|
+
return _this23;
|
|
12325
12408
|
}
|
|
12326
12409
|
_inherits$1(PointElement, _Element5);
|
|
12327
12410
|
return _createClass$1(PointElement, [{
|
|
@@ -12518,28 +12601,28 @@
|
|
|
12518
12601
|
}
|
|
12519
12602
|
var BarElement = /*#__PURE__*/function (_Element6) {
|
|
12520
12603
|
function BarElement(cfg) {
|
|
12521
|
-
var
|
|
12604
|
+
var _this24;
|
|
12522
12605
|
_classCallCheck$1(this, BarElement);
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12606
|
+
_this24 = _callSuper(this, BarElement);
|
|
12607
|
+
_this24.options = undefined;
|
|
12608
|
+
_this24.horizontal = undefined;
|
|
12609
|
+
_this24.base = undefined;
|
|
12610
|
+
_this24.width = undefined;
|
|
12611
|
+
_this24.height = undefined;
|
|
12612
|
+
_this24.inflateAmount = undefined;
|
|
12530
12613
|
if (cfg) {
|
|
12531
|
-
Object.assign(
|
|
12614
|
+
Object.assign(_this24, cfg);
|
|
12532
12615
|
}
|
|
12533
|
-
return
|
|
12616
|
+
return _this24;
|
|
12534
12617
|
}
|
|
12535
12618
|
_inherits$1(BarElement, _Element6);
|
|
12536
12619
|
return _createClass$1(BarElement, [{
|
|
12537
12620
|
key: "draw",
|
|
12538
12621
|
value: function draw(ctx) {
|
|
12539
12622
|
var inflateAmount = this.inflateAmount,
|
|
12540
|
-
_this$
|
|
12541
|
-
borderColor = _this$
|
|
12542
|
-
backgroundColor = _this$
|
|
12623
|
+
_this$options12 = this.options,
|
|
12624
|
+
borderColor = _this$options12.borderColor,
|
|
12625
|
+
backgroundColor = _this$options12.backgroundColor;
|
|
12543
12626
|
var _boundingRects = boundingRects(this),
|
|
12544
12627
|
inner = _boundingRects.inner,
|
|
12545
12628
|
outer = _boundingRects.outer;
|
|
@@ -12904,11 +12987,11 @@
|
|
|
12904
12987
|
var points = line.points;
|
|
12905
12988
|
var tpoints = target.points;
|
|
12906
12989
|
var parts = [];
|
|
12907
|
-
var
|
|
12908
|
-
|
|
12990
|
+
var _iterator17 = _createForOfIteratorHelper$1(segments),
|
|
12991
|
+
_step17;
|
|
12909
12992
|
try {
|
|
12910
|
-
for (
|
|
12911
|
-
var segment =
|
|
12993
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
12994
|
+
var segment = _step17.value;
|
|
12912
12995
|
var start = segment.start,
|
|
12913
12996
|
end = segment.end;
|
|
12914
12997
|
end = _findSegmentEnd(start, end, points);
|
|
@@ -12923,18 +13006,18 @@
|
|
|
12923
13006
|
continue;
|
|
12924
13007
|
}
|
|
12925
13008
|
var targetSegments = _boundSegments(target, bounds);
|
|
12926
|
-
var
|
|
12927
|
-
|
|
13009
|
+
var _iterator18 = _createForOfIteratorHelper$1(targetSegments),
|
|
13010
|
+
_step18;
|
|
12928
13011
|
try {
|
|
12929
|
-
for (
|
|
12930
|
-
var tgt =
|
|
13012
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
|
13013
|
+
var tgt = _step18.value;
|
|
12931
13014
|
var subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);
|
|
12932
13015
|
var fillSources = _boundSegment(segment, points, subBounds);
|
|
12933
|
-
var
|
|
12934
|
-
|
|
13016
|
+
var _iterator19 = _createForOfIteratorHelper$1(fillSources),
|
|
13017
|
+
_step19;
|
|
12935
13018
|
try {
|
|
12936
|
-
for (
|
|
12937
|
-
var fillSource =
|
|
13019
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
|
13020
|
+
var fillSource = _step19.value;
|
|
12938
13021
|
parts.push({
|
|
12939
13022
|
source: fillSource,
|
|
12940
13023
|
target: tgt,
|
|
@@ -12943,21 +13026,21 @@
|
|
|
12943
13026
|
});
|
|
12944
13027
|
}
|
|
12945
13028
|
} catch (err) {
|
|
12946
|
-
|
|
13029
|
+
_iterator19.e(err);
|
|
12947
13030
|
} finally {
|
|
12948
|
-
|
|
13031
|
+
_iterator19.f();
|
|
12949
13032
|
}
|
|
12950
13033
|
}
|
|
12951
13034
|
} catch (err) {
|
|
12952
|
-
|
|
13035
|
+
_iterator18.e(err);
|
|
12953
13036
|
} finally {
|
|
12954
|
-
|
|
13037
|
+
_iterator18.f();
|
|
12955
13038
|
}
|
|
12956
13039
|
}
|
|
12957
13040
|
} catch (err) {
|
|
12958
|
-
|
|
13041
|
+
_iterator17.e(err);
|
|
12959
13042
|
} finally {
|
|
12960
|
-
|
|
13043
|
+
_iterator17.f();
|
|
12961
13044
|
}
|
|
12962
13045
|
return parts;
|
|
12963
13046
|
}
|
|
@@ -13338,7 +13421,7 @@
|
|
|
13338
13421
|
var meta = chart.getDatasetMeta(index);
|
|
13339
13422
|
var clip = getDatasetClipArea(chart, meta);
|
|
13340
13423
|
if (target && line.points.length) {
|
|
13341
|
-
clipArea(ctx, area);
|
|
13424
|
+
clipArea(ctx, clipToIndexBounds(area, meta.iScale));
|
|
13342
13425
|
doFill(ctx, {
|
|
13343
13426
|
line: line,
|
|
13344
13427
|
target: target,
|
|
@@ -13352,6 +13435,22 @@
|
|
|
13352
13435
|
unclipArea(ctx);
|
|
13353
13436
|
}
|
|
13354
13437
|
}
|
|
13438
|
+
function clipToIndexBounds(area, iScale) {
|
|
13439
|
+
if (!iScale || iScale.getPointPositionForValue) {
|
|
13440
|
+
return area;
|
|
13441
|
+
}
|
|
13442
|
+
var p1 = iScale.getPixelForValue(iScale.min);
|
|
13443
|
+
var p2 = iScale.getPixelForValue(iScale.max);
|
|
13444
|
+
var lo = Math.min(p1, p2);
|
|
13445
|
+
var hi = Math.max(p1, p2);
|
|
13446
|
+
return iScale.isHorizontal() ? _objectSpread2(_objectSpread2({}, area), {}, {
|
|
13447
|
+
left: Math.max(area.left, lo),
|
|
13448
|
+
right: Math.min(area.right, hi)
|
|
13449
|
+
}) : _objectSpread2(_objectSpread2({}, area), {}, {
|
|
13450
|
+
top: Math.max(area.top, lo),
|
|
13451
|
+
bottom: Math.min(area.bottom, hi)
|
|
13452
|
+
});
|
|
13453
|
+
}
|
|
13355
13454
|
function doFill(ctx, cfg) {
|
|
13356
13455
|
var line = cfg.line,
|
|
13357
13456
|
target = cfg.target,
|
|
@@ -13409,11 +13508,11 @@
|
|
|
13409
13508
|
var first = true;
|
|
13410
13509
|
var lineLoop = false;
|
|
13411
13510
|
ctx.beginPath();
|
|
13412
|
-
var
|
|
13413
|
-
|
|
13511
|
+
var _iterator20 = _createForOfIteratorHelper$1(segments),
|
|
13512
|
+
_step20;
|
|
13414
13513
|
try {
|
|
13415
|
-
for (
|
|
13416
|
-
var segment =
|
|
13514
|
+
for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
|
|
13515
|
+
var segment = _step20.value;
|
|
13417
13516
|
var start = segment.start,
|
|
13418
13517
|
end = segment.end;
|
|
13419
13518
|
var firstPoint = points[start];
|
|
@@ -13435,9 +13534,9 @@
|
|
|
13435
13534
|
}
|
|
13436
13535
|
}
|
|
13437
13536
|
} catch (err) {
|
|
13438
|
-
|
|
13537
|
+
_iterator20.e(err);
|
|
13439
13538
|
} finally {
|
|
13440
|
-
|
|
13539
|
+
_iterator20.f();
|
|
13441
13540
|
}
|
|
13442
13541
|
ctx.lineTo(target.first().x, clipY);
|
|
13443
13542
|
ctx.closePath();
|
|
@@ -13449,11 +13548,11 @@
|
|
|
13449
13548
|
var first = true;
|
|
13450
13549
|
var lineLoop = false;
|
|
13451
13550
|
ctx.beginPath();
|
|
13452
|
-
var
|
|
13453
|
-
|
|
13551
|
+
var _iterator21 = _createForOfIteratorHelper$1(segments),
|
|
13552
|
+
_step21;
|
|
13454
13553
|
try {
|
|
13455
|
-
for (
|
|
13456
|
-
var segment =
|
|
13554
|
+
for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
|
|
13555
|
+
var segment = _step21.value;
|
|
13457
13556
|
var start = segment.start,
|
|
13458
13557
|
end = segment.end;
|
|
13459
13558
|
var firstPoint = points[start];
|
|
@@ -13475,9 +13574,9 @@
|
|
|
13475
13574
|
}
|
|
13476
13575
|
}
|
|
13477
13576
|
} catch (err) {
|
|
13478
|
-
|
|
13577
|
+
_iterator21.e(err);
|
|
13479
13578
|
} finally {
|
|
13480
|
-
|
|
13579
|
+
_iterator21.f();
|
|
13481
13580
|
}
|
|
13482
13581
|
ctx.lineTo(clipX, target.first().y);
|
|
13483
13582
|
ctx.closePath();
|
|
@@ -13491,15 +13590,15 @@
|
|
|
13491
13590
|
scale = cfg.scale,
|
|
13492
13591
|
clip = cfg.clip;
|
|
13493
13592
|
var segments = _segments(line, target, property);
|
|
13494
|
-
var
|
|
13495
|
-
|
|
13593
|
+
var _iterator22 = _createForOfIteratorHelper$1(segments),
|
|
13594
|
+
_step22;
|
|
13496
13595
|
try {
|
|
13497
|
-
for (
|
|
13498
|
-
var
|
|
13499
|
-
src =
|
|
13500
|
-
tgt =
|
|
13501
|
-
start =
|
|
13502
|
-
end =
|
|
13596
|
+
for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
|
|
13597
|
+
var _step22$value = _step22.value,
|
|
13598
|
+
src = _step22$value.source,
|
|
13599
|
+
tgt = _step22$value.target,
|
|
13600
|
+
start = _step22$value.start,
|
|
13601
|
+
end = _step22$value.end;
|
|
13503
13602
|
var _src$style = src.style,
|
|
13504
13603
|
_src$style2 = _src$style === void 0 ? {} : _src$style,
|
|
13505
13604
|
_src$style2$backgroun = _src$style2.backgroundColor,
|
|
@@ -13531,17 +13630,17 @@
|
|
|
13531
13630
|
ctx.restore();
|
|
13532
13631
|
}
|
|
13533
13632
|
} catch (err) {
|
|
13534
|
-
|
|
13633
|
+
_iterator22.e(err);
|
|
13535
13634
|
} finally {
|
|
13536
|
-
|
|
13635
|
+
_iterator22.f();
|
|
13537
13636
|
}
|
|
13538
13637
|
}
|
|
13539
13638
|
function clipBounds(ctx, scale, clip, bounds) {
|
|
13540
13639
|
var chartArea = scale.chart.chartArea;
|
|
13541
|
-
var
|
|
13542
|
-
property =
|
|
13543
|
-
start =
|
|
13544
|
-
end =
|
|
13640
|
+
var _ref0 = bounds || {},
|
|
13641
|
+
property = _ref0.property,
|
|
13642
|
+
start = _ref0.start,
|
|
13643
|
+
end = _ref0.end;
|
|
13545
13644
|
if (property === 'x' || property === 'y') {
|
|
13546
13645
|
var left, top, right, bottom;
|
|
13547
13646
|
if (property === 'x') {
|
|
@@ -13663,32 +13762,32 @@
|
|
|
13663
13762
|
};
|
|
13664
13763
|
var Legend = /*#__PURE__*/function (_Element7) {
|
|
13665
13764
|
function Legend(config) {
|
|
13666
|
-
var
|
|
13765
|
+
var _this25;
|
|
13667
13766
|
_classCallCheck$1(this, Legend);
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
return
|
|
13767
|
+
_this25 = _callSuper(this, Legend);
|
|
13768
|
+
_this25._added = false;
|
|
13769
|
+
_this25.legendHitBoxes = [];
|
|
13770
|
+
_this25._hoveredItem = null;
|
|
13771
|
+
_this25.doughnutMode = false;
|
|
13772
|
+
_this25.chart = config.chart;
|
|
13773
|
+
_this25.options = config.options;
|
|
13774
|
+
_this25.ctx = config.ctx;
|
|
13775
|
+
_this25.legendItems = undefined;
|
|
13776
|
+
_this25.columnSizes = undefined;
|
|
13777
|
+
_this25.lineWidths = undefined;
|
|
13778
|
+
_this25.maxHeight = undefined;
|
|
13779
|
+
_this25.maxWidth = undefined;
|
|
13780
|
+
_this25.top = undefined;
|
|
13781
|
+
_this25.bottom = undefined;
|
|
13782
|
+
_this25.left = undefined;
|
|
13783
|
+
_this25.right = undefined;
|
|
13784
|
+
_this25.height = undefined;
|
|
13785
|
+
_this25.width = undefined;
|
|
13786
|
+
_this25._margins = undefined;
|
|
13787
|
+
_this25.position = undefined;
|
|
13788
|
+
_this25.weight = undefined;
|
|
13789
|
+
_this25.fullSize = undefined;
|
|
13790
|
+
return _this25;
|
|
13692
13791
|
}
|
|
13693
13792
|
_inherits$1(Legend, _Element7);
|
|
13694
13793
|
return _createClass$1(Legend, [{
|
|
@@ -13717,17 +13816,17 @@
|
|
|
13717
13816
|
}, {
|
|
13718
13817
|
key: "buildLabels",
|
|
13719
13818
|
value: function buildLabels() {
|
|
13720
|
-
var
|
|
13819
|
+
var _this26 = this;
|
|
13721
13820
|
var labelOpts = this.options.labels || {};
|
|
13722
13821
|
var legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];
|
|
13723
13822
|
if (labelOpts.filter) {
|
|
13724
13823
|
legendItems = legendItems.filter(function (item) {
|
|
13725
|
-
return labelOpts.filter(item,
|
|
13824
|
+
return labelOpts.filter(item, _this26.chart.data);
|
|
13726
13825
|
});
|
|
13727
13826
|
}
|
|
13728
13827
|
if (labelOpts.sort) {
|
|
13729
13828
|
legendItems = legendItems.sort(function (a, b) {
|
|
13730
|
-
return labelOpts.sort(a, b,
|
|
13829
|
+
return labelOpts.sort(a, b, _this26.chart.data);
|
|
13731
13830
|
});
|
|
13732
13831
|
}
|
|
13733
13832
|
if (this.options.reverse) {
|
|
@@ -13849,19 +13948,19 @@
|
|
|
13849
13948
|
}
|
|
13850
13949
|
var titleHeight = this._computeTitleHeight();
|
|
13851
13950
|
var hitboxes = this.legendHitBoxes,
|
|
13852
|
-
_this$
|
|
13853
|
-
align = _this$
|
|
13854
|
-
padding = _this$
|
|
13855
|
-
rtl = _this$
|
|
13951
|
+
_this$options13 = this.options,
|
|
13952
|
+
align = _this$options13.align,
|
|
13953
|
+
padding = _this$options13.labels.padding,
|
|
13954
|
+
rtl = _this$options13.rtl;
|
|
13856
13955
|
var rtlHelper = getRtlAdapter(rtl, this.left, this.width);
|
|
13857
13956
|
if (this.isHorizontal()) {
|
|
13858
13957
|
var row = 0;
|
|
13859
13958
|
var left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
|
|
13860
|
-
var
|
|
13861
|
-
|
|
13959
|
+
var _iterator23 = _createForOfIteratorHelper$1(hitboxes),
|
|
13960
|
+
_step23;
|
|
13862
13961
|
try {
|
|
13863
|
-
for (
|
|
13864
|
-
var hitbox =
|
|
13962
|
+
for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
|
|
13963
|
+
var hitbox = _step23.value;
|
|
13865
13964
|
if (row !== hitbox.row) {
|
|
13866
13965
|
row = hitbox.row;
|
|
13867
13966
|
left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
|
|
@@ -13871,18 +13970,18 @@
|
|
|
13871
13970
|
left += hitbox.width + padding;
|
|
13872
13971
|
}
|
|
13873
13972
|
} catch (err) {
|
|
13874
|
-
|
|
13973
|
+
_iterator23.e(err);
|
|
13875
13974
|
} finally {
|
|
13876
|
-
|
|
13975
|
+
_iterator23.f();
|
|
13877
13976
|
}
|
|
13878
13977
|
} else {
|
|
13879
13978
|
var col = 0;
|
|
13880
13979
|
var top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
|
|
13881
|
-
var
|
|
13882
|
-
|
|
13980
|
+
var _iterator24 = _createForOfIteratorHelper$1(hitboxes),
|
|
13981
|
+
_step24;
|
|
13883
13982
|
try {
|
|
13884
|
-
for (
|
|
13885
|
-
var _hitbox =
|
|
13983
|
+
for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
|
|
13984
|
+
var _hitbox = _step24.value;
|
|
13886
13985
|
if (_hitbox.col !== col) {
|
|
13887
13986
|
col = _hitbox.col;
|
|
13888
13987
|
top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
|
|
@@ -13893,9 +13992,9 @@
|
|
|
13893
13992
|
top += _hitbox.height + padding;
|
|
13894
13993
|
}
|
|
13895
13994
|
} catch (err) {
|
|
13896
|
-
|
|
13995
|
+
_iterator24.e(err);
|
|
13897
13996
|
} finally {
|
|
13898
|
-
|
|
13997
|
+
_iterator24.f();
|
|
13899
13998
|
}
|
|
13900
13999
|
}
|
|
13901
14000
|
}
|
|
@@ -13917,7 +14016,7 @@
|
|
|
13917
14016
|
}, {
|
|
13918
14017
|
key: "_draw",
|
|
13919
14018
|
value: function _draw() {
|
|
13920
|
-
var
|
|
14019
|
+
var _this27 = this;
|
|
13921
14020
|
var opts = this.options,
|
|
13922
14021
|
columnSizes = this.columnSizes,
|
|
13923
14022
|
lineWidths = this.lineWidths,
|
|
@@ -14019,21 +14118,21 @@
|
|
|
14019
14118
|
var width = boxWidth + halfFontSize + textWidth;
|
|
14020
14119
|
var x = cursor.x;
|
|
14021
14120
|
var y = cursor.y;
|
|
14022
|
-
rtlHelper.setWidth(
|
|
14121
|
+
rtlHelper.setWidth(_this27.width);
|
|
14023
14122
|
if (isHorizontal) {
|
|
14024
|
-
if (i > 0 && x + width + padding >
|
|
14123
|
+
if (i > 0 && x + width + padding > _this27.right) {
|
|
14025
14124
|
y = cursor.y += lineHeight;
|
|
14026
14125
|
cursor.line++;
|
|
14027
|
-
x = cursor.x = _alignStartEnd(align,
|
|
14126
|
+
x = cursor.x = _alignStartEnd(align, _this27.left + padding, _this27.right - lineWidths[cursor.line]);
|
|
14028
14127
|
}
|
|
14029
|
-
} else if (i > 0 && y + lineHeight >
|
|
14128
|
+
} else if (i > 0 && y + lineHeight > _this27.bottom) {
|
|
14030
14129
|
x = cursor.x = x + columnSizes[cursor.line].width + padding;
|
|
14031
14130
|
cursor.line++;
|
|
14032
|
-
y = cursor.y = _alignStartEnd(align,
|
|
14131
|
+
y = cursor.y = _alignStartEnd(align, _this27.top + titleHeight + padding, _this27.bottom - columnSizes[cursor.line].height);
|
|
14033
14132
|
}
|
|
14034
14133
|
var realX = rtlHelper.x(x);
|
|
14035
14134
|
drawLegendBox(realX, y, legendItem);
|
|
14036
|
-
x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width :
|
|
14135
|
+
x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : _this27.right, opts.rtl);
|
|
14037
14136
|
fillText(rtlHelper.x(x), y, legendItem);
|
|
14038
14137
|
if (isHorizontal) {
|
|
14039
14138
|
cursor.x += width + padding;
|
|
@@ -14277,23 +14376,23 @@
|
|
|
14277
14376
|
};
|
|
14278
14377
|
var Title = /*#__PURE__*/function (_Element8) {
|
|
14279
14378
|
function Title(config) {
|
|
14280
|
-
var
|
|
14379
|
+
var _this28;
|
|
14281
14380
|
_classCallCheck$1(this, Title);
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
return
|
|
14381
|
+
_this28 = _callSuper(this, Title);
|
|
14382
|
+
_this28.chart = config.chart;
|
|
14383
|
+
_this28.options = config.options;
|
|
14384
|
+
_this28.ctx = config.ctx;
|
|
14385
|
+
_this28._padding = undefined;
|
|
14386
|
+
_this28.top = undefined;
|
|
14387
|
+
_this28.bottom = undefined;
|
|
14388
|
+
_this28.left = undefined;
|
|
14389
|
+
_this28.right = undefined;
|
|
14390
|
+
_this28.width = undefined;
|
|
14391
|
+
_this28.height = undefined;
|
|
14392
|
+
_this28.position = undefined;
|
|
14393
|
+
_this28.weight = undefined;
|
|
14394
|
+
_this28.fullSize = undefined;
|
|
14395
|
+
return _this28;
|
|
14297
14396
|
}
|
|
14298
14397
|
_inherits$1(Title, _Element8);
|
|
14299
14398
|
return _createClass$1(Title, [{
|
|
@@ -14812,37 +14911,37 @@
|
|
|
14812
14911
|
}
|
|
14813
14912
|
var Tooltip = /*#__PURE__*/function (_Element9) {
|
|
14814
14913
|
function Tooltip(config) {
|
|
14815
|
-
var
|
|
14914
|
+
var _this29;
|
|
14816
14915
|
_classCallCheck$1(this, Tooltip);
|
|
14817
|
-
|
|
14818
|
-
|
|
14819
|
-
|
|
14820
|
-
|
|
14821
|
-
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
return
|
|
14916
|
+
_this29 = _callSuper(this, Tooltip);
|
|
14917
|
+
_this29.opacity = 0;
|
|
14918
|
+
_this29._active = [];
|
|
14919
|
+
_this29._eventPosition = undefined;
|
|
14920
|
+
_this29._size = undefined;
|
|
14921
|
+
_this29._cachedAnimations = undefined;
|
|
14922
|
+
_this29._tooltipItems = [];
|
|
14923
|
+
_this29.$animations = undefined;
|
|
14924
|
+
_this29.$context = undefined;
|
|
14925
|
+
_this29.chart = config.chart;
|
|
14926
|
+
_this29.options = config.options;
|
|
14927
|
+
_this29.dataPoints = undefined;
|
|
14928
|
+
_this29.title = undefined;
|
|
14929
|
+
_this29.beforeBody = undefined;
|
|
14930
|
+
_this29.body = undefined;
|
|
14931
|
+
_this29.afterBody = undefined;
|
|
14932
|
+
_this29.footer = undefined;
|
|
14933
|
+
_this29.xAlign = undefined;
|
|
14934
|
+
_this29.yAlign = undefined;
|
|
14935
|
+
_this29.x = undefined;
|
|
14936
|
+
_this29.y = undefined;
|
|
14937
|
+
_this29.height = undefined;
|
|
14938
|
+
_this29.width = undefined;
|
|
14939
|
+
_this29.caretX = undefined;
|
|
14940
|
+
_this29.caretY = undefined;
|
|
14941
|
+
_this29.labelColors = undefined;
|
|
14942
|
+
_this29.labelPointStyles = undefined;
|
|
14943
|
+
_this29.labelTextColors = undefined;
|
|
14944
|
+
return _this29;
|
|
14846
14945
|
}
|
|
14847
14946
|
_inherits$1(Tooltip, _Element9);
|
|
14848
14947
|
return _createClass$1(Tooltip, [{
|
|
@@ -14894,7 +14993,7 @@
|
|
|
14894
14993
|
}, {
|
|
14895
14994
|
key: "getBody",
|
|
14896
14995
|
value: function getBody(tooltipItems, options) {
|
|
14897
|
-
var
|
|
14996
|
+
var _this30 = this;
|
|
14898
14997
|
var callbacks = options.callbacks;
|
|
14899
14998
|
var bodyItems = [];
|
|
14900
14999
|
each(tooltipItems, function (context) {
|
|
@@ -14904,9 +15003,9 @@
|
|
|
14904
15003
|
after: []
|
|
14905
15004
|
};
|
|
14906
15005
|
var scoped = overrideCallbacks(callbacks, context);
|
|
14907
|
-
pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel',
|
|
14908
|
-
pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label',
|
|
14909
|
-
pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel',
|
|
15006
|
+
pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', _this30, context)));
|
|
15007
|
+
pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', _this30, context));
|
|
15008
|
+
pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', _this30, context)));
|
|
14910
15009
|
bodyItems.push(bodyItem);
|
|
14911
15010
|
});
|
|
14912
15011
|
return bodyItems;
|
|
@@ -14932,7 +15031,7 @@
|
|
|
14932
15031
|
}, {
|
|
14933
15032
|
key: "_createItems",
|
|
14934
15033
|
value: function _createItems(options) {
|
|
14935
|
-
var
|
|
15034
|
+
var _this31 = this;
|
|
14936
15035
|
var active = this._active;
|
|
14937
15036
|
var data = this.chart.data;
|
|
14938
15037
|
var labelColors = [];
|
|
@@ -14955,9 +15054,9 @@
|
|
|
14955
15054
|
}
|
|
14956
15055
|
each(tooltipItems, function (context) {
|
|
14957
15056
|
var scoped = overrideCallbacks(options.callbacks, context);
|
|
14958
|
-
labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor',
|
|
14959
|
-
labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle',
|
|
14960
|
-
labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor',
|
|
15057
|
+
labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', _this31, context));
|
|
15058
|
+
labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', _this31, context));
|
|
15059
|
+
labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', _this31, context));
|
|
14961
15060
|
});
|
|
14962
15061
|
this.labelColors = labelColors;
|
|
14963
15062
|
this.labelPointStyles = labelPointStyles;
|
|
@@ -15364,12 +15463,12 @@
|
|
|
15364
15463
|
}, {
|
|
15365
15464
|
key: "setActiveElements",
|
|
15366
15465
|
value: function setActiveElements(activeElements, eventPosition) {
|
|
15367
|
-
var
|
|
15466
|
+
var _this32 = this;
|
|
15368
15467
|
var lastActive = this._active;
|
|
15369
|
-
var active = activeElements.map(function (
|
|
15370
|
-
var datasetIndex =
|
|
15371
|
-
index =
|
|
15372
|
-
var meta =
|
|
15468
|
+
var active = activeElements.map(function (_ref1) {
|
|
15469
|
+
var datasetIndex = _ref1.datasetIndex,
|
|
15470
|
+
index = _ref1.index;
|
|
15471
|
+
var meta = _this32.chart.getDatasetMeta(datasetIndex);
|
|
15373
15472
|
if (!meta) {
|
|
15374
15473
|
throw new Error('Cannot find a dataset at index ' + datasetIndex);
|
|
15375
15474
|
}
|
|
@@ -15416,14 +15515,14 @@
|
|
|
15416
15515
|
}, {
|
|
15417
15516
|
key: "_getActiveElements",
|
|
15418
15517
|
value: function _getActiveElements(e, lastActive, replay, inChartArea) {
|
|
15419
|
-
var
|
|
15518
|
+
var _this33 = this;
|
|
15420
15519
|
var options = this.options;
|
|
15421
15520
|
if (e.type === 'mouseout') {
|
|
15422
15521
|
return [];
|
|
15423
15522
|
}
|
|
15424
15523
|
if (!inChartArea) {
|
|
15425
15524
|
return lastActive.filter(function (i) {
|
|
15426
|
-
return
|
|
15525
|
+
return _this33.chart.data.datasets[i.datasetIndex] && _this33.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined;
|
|
15427
15526
|
});
|
|
15428
15527
|
}
|
|
15429
15528
|
var active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);
|
|
@@ -15608,13 +15707,13 @@
|
|
|
15608
15707
|
}
|
|
15609
15708
|
var CategoryScale = /*#__PURE__*/function (_Scale) {
|
|
15610
15709
|
function CategoryScale(cfg) {
|
|
15611
|
-
var
|
|
15710
|
+
var _this34;
|
|
15612
15711
|
_classCallCheck$1(this, CategoryScale);
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15617
|
-
return
|
|
15712
|
+
_this34 = _callSuper(this, CategoryScale, [cfg]);
|
|
15713
|
+
_this34._startValue = undefined;
|
|
15714
|
+
_this34._valueRange = 0;
|
|
15715
|
+
_this34._addedLabels = [];
|
|
15716
|
+
return _this34;
|
|
15618
15717
|
}
|
|
15619
15718
|
_inherits$1(CategoryScale, _Scale);
|
|
15620
15719
|
return _createClass$1(CategoryScale, [{
|
|
@@ -15623,21 +15722,21 @@
|
|
|
15623
15722
|
var added = this._addedLabels;
|
|
15624
15723
|
if (added.length) {
|
|
15625
15724
|
var labels = this.getLabels();
|
|
15626
|
-
var
|
|
15627
|
-
|
|
15725
|
+
var _iterator25 = _createForOfIteratorHelper$1(added),
|
|
15726
|
+
_step25;
|
|
15628
15727
|
try {
|
|
15629
|
-
for (
|
|
15630
|
-
var
|
|
15631
|
-
_index3 =
|
|
15632
|
-
label =
|
|
15728
|
+
for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
|
|
15729
|
+
var _step25$value = _step25.value,
|
|
15730
|
+
_index3 = _step25$value.index,
|
|
15731
|
+
label = _step25$value.label;
|
|
15633
15732
|
if (labels[_index3] === label) {
|
|
15634
15733
|
labels.splice(_index3, 1);
|
|
15635
15734
|
}
|
|
15636
15735
|
}
|
|
15637
15736
|
} catch (err) {
|
|
15638
|
-
|
|
15737
|
+
_iterator25.e(err);
|
|
15639
15738
|
} finally {
|
|
15640
|
-
|
|
15739
|
+
_iterator25.f();
|
|
15641
15740
|
}
|
|
15642
15741
|
this._addedLabels = [];
|
|
15643
15742
|
}
|
|
@@ -15845,9 +15944,9 @@
|
|
|
15845
15944
|
}
|
|
15846
15945
|
return ticks;
|
|
15847
15946
|
}
|
|
15848
|
-
function relativeLabelSize(value, minSpacing,
|
|
15849
|
-
var horizontal =
|
|
15850
|
-
minRotation =
|
|
15947
|
+
function relativeLabelSize(value, minSpacing, _ref10) {
|
|
15948
|
+
var horizontal = _ref10.horizontal,
|
|
15949
|
+
minRotation = _ref10.minRotation;
|
|
15851
15950
|
var rad = toRadians(minRotation);
|
|
15852
15951
|
var ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;
|
|
15853
15952
|
var length = 0.75 * minSpacing * ('' + value).length;
|
|
@@ -15855,15 +15954,15 @@
|
|
|
15855
15954
|
}
|
|
15856
15955
|
var LinearScaleBase = /*#__PURE__*/function (_Scale2) {
|
|
15857
15956
|
function LinearScaleBase(cfg) {
|
|
15858
|
-
var
|
|
15957
|
+
var _this35;
|
|
15859
15958
|
_classCallCheck$1(this, LinearScaleBase);
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
return
|
|
15959
|
+
_this35 = _callSuper(this, LinearScaleBase, [cfg]);
|
|
15960
|
+
_this35.start = undefined;
|
|
15961
|
+
_this35.end = undefined;
|
|
15962
|
+
_this35._startValue = undefined;
|
|
15963
|
+
_this35._endValue = undefined;
|
|
15964
|
+
_this35._valueRange = 0;
|
|
15965
|
+
return _this35;
|
|
15867
15966
|
}
|
|
15868
15967
|
_inherits$1(LinearScaleBase, _Scale2);
|
|
15869
15968
|
return _createClass$1(LinearScaleBase, [{
|
|
@@ -16067,9 +16166,9 @@
|
|
|
16067
16166
|
}
|
|
16068
16167
|
return Math.min(rangeExp, log10Floor(min));
|
|
16069
16168
|
}
|
|
16070
|
-
function generateTicks(generationOptions,
|
|
16071
|
-
var min =
|
|
16072
|
-
max =
|
|
16169
|
+
function generateTicks(generationOptions, _ref11) {
|
|
16170
|
+
var min = _ref11.min,
|
|
16171
|
+
max = _ref11.max;
|
|
16073
16172
|
min = finiteOrDefault(generationOptions.min, min);
|
|
16074
16173
|
var ticks = [];
|
|
16075
16174
|
var minExp = log10Floor(min);
|
|
@@ -16109,14 +16208,14 @@
|
|
|
16109
16208
|
}
|
|
16110
16209
|
var LogarithmicScale = /*#__PURE__*/function (_Scale3) {
|
|
16111
16210
|
function LogarithmicScale(cfg) {
|
|
16112
|
-
var
|
|
16211
|
+
var _this36;
|
|
16113
16212
|
_classCallCheck$1(this, LogarithmicScale);
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
return
|
|
16213
|
+
_this36 = _callSuper(this, LogarithmicScale, [cfg]);
|
|
16214
|
+
_this36.start = undefined;
|
|
16215
|
+
_this36.end = undefined;
|
|
16216
|
+
_this36._startValue = undefined;
|
|
16217
|
+
_this36._valueRange = 0;
|
|
16218
|
+
return _this36;
|
|
16120
16219
|
}
|
|
16121
16220
|
_inherits$1(LogarithmicScale, _Scale3);
|
|
16122
16221
|
return _createClass$1(LogarithmicScale, [{
|
|
@@ -16509,15 +16608,15 @@
|
|
|
16509
16608
|
}
|
|
16510
16609
|
var RadialLinearScale = /*#__PURE__*/function (_LinearScaleBase2) {
|
|
16511
16610
|
function RadialLinearScale(cfg) {
|
|
16512
|
-
var
|
|
16611
|
+
var _this37;
|
|
16513
16612
|
_classCallCheck$1(this, RadialLinearScale);
|
|
16514
|
-
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
return
|
|
16613
|
+
_this37 = _callSuper(this, RadialLinearScale, [cfg]);
|
|
16614
|
+
_this37.xCenter = undefined;
|
|
16615
|
+
_this37.yCenter = undefined;
|
|
16616
|
+
_this37.drawingArea = undefined;
|
|
16617
|
+
_this37._pointLabels = [];
|
|
16618
|
+
_this37._pointLabelItems = [];
|
|
16619
|
+
return _this37;
|
|
16521
16620
|
}
|
|
16522
16621
|
_inherits$1(RadialLinearScale, _LinearScaleBase2);
|
|
16523
16622
|
return _createClass$1(RadialLinearScale, [{
|
|
@@ -16548,13 +16647,13 @@
|
|
|
16548
16647
|
}, {
|
|
16549
16648
|
key: "generateTickLabels",
|
|
16550
16649
|
value: function generateTickLabels(ticks) {
|
|
16551
|
-
var
|
|
16650
|
+
var _this38 = this;
|
|
16552
16651
|
LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
|
|
16553
16652
|
this._pointLabels = this.getLabels().map(function (value, index) {
|
|
16554
|
-
var label = callback(
|
|
16653
|
+
var label = callback(_this38.options.pointLabels.callback, [value, index], _this38);
|
|
16555
16654
|
return label || label === 0 ? label : '';
|
|
16556
16655
|
}).filter(function (v, i) {
|
|
16557
|
-
return
|
|
16656
|
+
return _this38.chart.getDataVisibility(i);
|
|
16558
16657
|
});
|
|
16559
16658
|
}
|
|
16560
16659
|
}, {
|
|
@@ -16650,9 +16749,9 @@
|
|
|
16650
16749
|
}, {
|
|
16651
16750
|
key: "drawBackground",
|
|
16652
16751
|
value: function drawBackground() {
|
|
16653
|
-
var _this$
|
|
16654
|
-
backgroundColor = _this$
|
|
16655
|
-
circular = _this$
|
|
16752
|
+
var _this$options14 = this.options,
|
|
16753
|
+
backgroundColor = _this$options14.backgroundColor,
|
|
16754
|
+
circular = _this$options14.grid.circular;
|
|
16656
16755
|
if (backgroundColor) {
|
|
16657
16756
|
var ctx = this.ctx;
|
|
16658
16757
|
ctx.save();
|
|
@@ -16667,7 +16766,7 @@
|
|
|
16667
16766
|
}, {
|
|
16668
16767
|
key: "drawGrid",
|
|
16669
16768
|
value: function drawGrid() {
|
|
16670
|
-
var
|
|
16769
|
+
var _this39 = this;
|
|
16671
16770
|
var ctx = this.ctx;
|
|
16672
16771
|
var opts = this.options;
|
|
16673
16772
|
var angleLines = opts.angleLines,
|
|
@@ -16680,12 +16779,12 @@
|
|
|
16680
16779
|
}
|
|
16681
16780
|
if (grid.display) {
|
|
16682
16781
|
this.ticks.forEach(function (tick, index) {
|
|
16683
|
-
if (index !== 0 || index === 0 &&
|
|
16684
|
-
offset =
|
|
16685
|
-
var context =
|
|
16782
|
+
if (index !== 0 || index === 0 && _this39.min < 0) {
|
|
16783
|
+
offset = _this39.getDistanceFromCenterForValue(tick.value);
|
|
16784
|
+
var context = _this39.getContext(index);
|
|
16686
16785
|
var optsAtIndex = grid.setContext(context);
|
|
16687
16786
|
var optsAtIndexBorder = border.setContext(context);
|
|
16688
|
-
drawRadiusLine(
|
|
16787
|
+
drawRadiusLine(_this39, optsAtIndex, offset, labelCount, optsAtIndexBorder);
|
|
16689
16788
|
}
|
|
16690
16789
|
});
|
|
16691
16790
|
}
|
|
@@ -16718,7 +16817,7 @@
|
|
|
16718
16817
|
}, {
|
|
16719
16818
|
key: "drawLabels",
|
|
16720
16819
|
value: function drawLabels() {
|
|
16721
|
-
var
|
|
16820
|
+
var _this40 = this;
|
|
16722
16821
|
var ctx = this.ctx;
|
|
16723
16822
|
var opts = this.options;
|
|
16724
16823
|
var tickOpts = opts.ticks;
|
|
@@ -16733,12 +16832,12 @@
|
|
|
16733
16832
|
ctx.textAlign = 'center';
|
|
16734
16833
|
ctx.textBaseline = 'middle';
|
|
16735
16834
|
this.ticks.forEach(function (tick, index) {
|
|
16736
|
-
if (index === 0 &&
|
|
16835
|
+
if (index === 0 && _this40.min >= 0 && !opts.reverse) {
|
|
16737
16836
|
return;
|
|
16738
16837
|
}
|
|
16739
|
-
var optsAtIndex = tickOpts.setContext(
|
|
16838
|
+
var optsAtIndex = tickOpts.setContext(_this40.getContext(index));
|
|
16740
16839
|
var tickFont = toFont(optsAtIndex.font);
|
|
16741
|
-
offset =
|
|
16840
|
+
offset = _this40.getDistanceFromCenterForValue(_this40.ticks[index].value);
|
|
16742
16841
|
if (optsAtIndex.showLabelBackdrop) {
|
|
16743
16842
|
ctx.font = tickFont.string;
|
|
16744
16843
|
width = ctx.measureText(tick.label).width;
|
|
@@ -16944,20 +17043,20 @@
|
|
|
16944
17043
|
}
|
|
16945
17044
|
var TimeScale = /*#__PURE__*/function (_Scale4) {
|
|
16946
17045
|
function TimeScale(props) {
|
|
16947
|
-
var
|
|
17046
|
+
var _this41;
|
|
16948
17047
|
_classCallCheck$1(this, TimeScale);
|
|
16949
|
-
|
|
16950
|
-
|
|
17048
|
+
_this41 = _callSuper(this, TimeScale, [props]);
|
|
17049
|
+
_this41._cache = {
|
|
16951
17050
|
data: [],
|
|
16952
17051
|
labels: [],
|
|
16953
17052
|
all: []
|
|
16954
17053
|
};
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
return
|
|
17054
|
+
_this41._unit = 'day';
|
|
17055
|
+
_this41._majorUnit = undefined;
|
|
17056
|
+
_this41._offsets = {};
|
|
17057
|
+
_this41._normalized = false;
|
|
17058
|
+
_this41._parseOpts = undefined;
|
|
17059
|
+
return _this41;
|
|
16961
17060
|
}
|
|
16962
17061
|
_inherits$1(TimeScale, _Scale4);
|
|
16963
17062
|
return _createClass$1(TimeScale, [{
|
|
@@ -17314,13 +17413,13 @@
|
|
|
17314
17413
|
}
|
|
17315
17414
|
var TimeSeriesScale = /*#__PURE__*/function (_TimeScale2) {
|
|
17316
17415
|
function TimeSeriesScale(props) {
|
|
17317
|
-
var
|
|
17416
|
+
var _this42;
|
|
17318
17417
|
_classCallCheck$1(this, TimeSeriesScale);
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
return
|
|
17418
|
+
_this42 = _callSuper(this, TimeSeriesScale, [props]);
|
|
17419
|
+
_this42._table = [];
|
|
17420
|
+
_this42._minPos = undefined;
|
|
17421
|
+
_this42._tableRange = undefined;
|
|
17422
|
+
return _this42;
|
|
17324
17423
|
}
|
|
17325
17424
|
_inherits$1(TimeSeriesScale, _TimeScale2);
|
|
17326
17425
|
return _createClass$1(TimeSeriesScale, [{
|
|
@@ -21125,15 +21224,15 @@
|
|
|
21125
21224
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
21126
21225
|
}
|
|
21127
21226
|
|
|
21128
|
-
function toPrimitive(t,
|
|
21227
|
+
function toPrimitive(t, e) {
|
|
21129
21228
|
if ("object" != _typeof(t) || !t) return t;
|
|
21130
|
-
var
|
|
21131
|
-
if (void 0 !==
|
|
21132
|
-
var i =
|
|
21229
|
+
var r;
|
|
21230
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
21231
|
+
var i = r.call(t, e || "default");
|
|
21133
21232
|
if ("object" != _typeof(i)) return i;
|
|
21134
21233
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
21135
21234
|
}
|
|
21136
|
-
return ("string" ===
|
|
21235
|
+
return ("string" === e ? String : Number)(t);
|
|
21137
21236
|
}
|
|
21138
21237
|
|
|
21139
21238
|
function toPropertyKey(t) {
|