billboard.js 3.9.0 → 3.9.1
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/README.md +5 -1
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +100 -83
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +340 -192
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +3 -3
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +3 -3
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +242 -111
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +243 -112
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +242 -111
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +243 -112
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +242 -111
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +71 -54
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +23 -23
- package/src/ChartInternal/data/data.ts +2 -12
- package/src/ChartInternal/interactions/eventrect.ts +7 -4
- package/src/ChartInternal/internals/tooltip.ts +55 -41
- package/src/ChartInternal/shape/point.ts +20 -2
package/dist/billboard.pkgd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.
|
|
8
|
+
* @version 3.9.1
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.5
|
|
@@ -1180,10 +1180,10 @@ var store = __webpack_require__(37);
|
|
|
1180
1180
|
(module.exports = function (key, value) {
|
|
1181
1181
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1182
1182
|
})('versions', []).push({
|
|
1183
|
-
version: '3.31.
|
|
1183
|
+
version: '3.31.1',
|
|
1184
1184
|
mode: IS_PURE ? 'pure' : 'global',
|
|
1185
1185
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
1186
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.31.
|
|
1186
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE',
|
|
1187
1187
|
source: 'https://github.com/zloirock/core-js'
|
|
1188
1188
|
});
|
|
1189
1189
|
|
|
@@ -2964,7 +2964,6 @@ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
|
|
|
2964
2964
|
};
|
|
2965
2965
|
|
|
2966
2966
|
// https://tc39.es/ecma262/#sec-nativeerror
|
|
2967
|
-
// https://github.com/tc39/proposal-error-cause
|
|
2968
2967
|
exportGlobalErrorCauseWrapper('Error', function (init) {
|
|
2969
2968
|
return function Error(message) { return apply(init, this, arguments); };
|
|
2970
2969
|
});
|
|
@@ -3596,7 +3595,7 @@ var FORCED = !fails(function () {
|
|
|
3596
3595
|
return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
|
|
3597
3596
|
});
|
|
3598
3597
|
|
|
3599
|
-
// https://
|
|
3598
|
+
// https://tc39.es/ecma262/#sec-aggregate-error
|
|
3600
3599
|
$({ global: true, constructor: true, arity: 2, forced: FORCED }, {
|
|
3601
3600
|
AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
|
|
3602
3601
|
// eslint-disable-next-line no-unused-vars -- required for functions `.length`
|
|
@@ -3618,7 +3617,7 @@ var toIntegerOrInfinity = __webpack_require__(62);
|
|
|
3618
3617
|
var addToUnscopables = __webpack_require__(140);
|
|
3619
3618
|
|
|
3620
3619
|
// `Array.prototype.at` method
|
|
3621
|
-
// https://
|
|
3620
|
+
// https://tc39.es/ecma262/#sec-array.prototype.at
|
|
3622
3621
|
$({ target: 'Array', proto: true }, {
|
|
3623
3622
|
at: function at(index) {
|
|
3624
3623
|
var O = toObject(this);
|
|
@@ -4003,7 +4002,7 @@ var $findLast = (__webpack_require__(155).findLast);
|
|
|
4003
4002
|
var addToUnscopables = __webpack_require__(140);
|
|
4004
4003
|
|
|
4005
4004
|
// `Array.prototype.findLast` method
|
|
4006
|
-
// https://
|
|
4005
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findlast
|
|
4007
4006
|
$({ target: 'Array', proto: true }, {
|
|
4008
4007
|
findLast: function findLast(callbackfn /* , that = undefined */) {
|
|
4009
4008
|
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
@@ -4064,7 +4063,7 @@ var $findLastIndex = (__webpack_require__(155).findLastIndex);
|
|
|
4064
4063
|
var addToUnscopables = __webpack_require__(140);
|
|
4065
4064
|
|
|
4066
4065
|
// `Array.prototype.findLastIndex` method
|
|
4067
|
-
// https://
|
|
4066
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findlastindex
|
|
4068
4067
|
$({ target: 'Array', proto: true }, {
|
|
4069
4068
|
findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) {
|
|
4070
4069
|
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
@@ -5423,7 +5422,7 @@ var addToUnscopables = __webpack_require__(140);
|
|
|
5423
5422
|
var $Array = Array;
|
|
5424
5423
|
|
|
5425
5424
|
// `Array.prototype.toReversed` method
|
|
5426
|
-
// https://tc39.es/
|
|
5425
|
+
// https://tc39.es/ecma262/#sec-array.prototype.toreversed
|
|
5427
5426
|
$({ target: 'Array', proto: true }, {
|
|
5428
5427
|
toReversed: function toReversed() {
|
|
5429
5428
|
return arrayToReversed(toIndexedObject(this), $Array);
|
|
@@ -5468,7 +5467,7 @@ var $Array = Array;
|
|
|
5468
5467
|
var sort = uncurryThis(getVirtual('Array').sort);
|
|
5469
5468
|
|
|
5470
5469
|
// `Array.prototype.toSorted` method
|
|
5471
|
-
// https://tc39.es/
|
|
5470
|
+
// https://tc39.es/ecma262/#sec-array.prototype.tosorted
|
|
5472
5471
|
$({ target: 'Array', proto: true }, {
|
|
5473
5472
|
toSorted: function toSorted(compareFn) {
|
|
5474
5473
|
if (compareFn !== undefined) aCallable(compareFn);
|
|
@@ -5526,7 +5525,7 @@ var max = Math.max;
|
|
|
5526
5525
|
var min = Math.min;
|
|
5527
5526
|
|
|
5528
5527
|
// `Array.prototype.toSpliced` method
|
|
5529
|
-
// https://tc39.es/
|
|
5528
|
+
// https://tc39.es/ecma262/#sec-array.prototype.tospliced
|
|
5530
5529
|
$({ target: 'Array', proto: true }, {
|
|
5531
5530
|
toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
|
|
5532
5531
|
var O = toIndexedObject(this);
|
|
@@ -5647,7 +5646,7 @@ var toIndexedObject = __webpack_require__(12);
|
|
|
5647
5646
|
var $Array = Array;
|
|
5648
5647
|
|
|
5649
5648
|
// `Array.prototype.with` method
|
|
5650
|
-
// https://tc39.es/
|
|
5649
|
+
// https://tc39.es/ecma262/#sec-array.prototype.with
|
|
5651
5650
|
$({ target: 'Array', proto: true }, {
|
|
5652
5651
|
'with': function (index, value) {
|
|
5653
5652
|
return arrayWith(toIndexedObject(this), $Array, index, value);
|
|
@@ -5788,23 +5787,25 @@ var addGetter = function (Constructor, key, getInternalState) {
|
|
|
5788
5787
|
};
|
|
5789
5788
|
|
|
5790
5789
|
var get = function (view, count, index, isLittleEndian) {
|
|
5791
|
-
var intIndex = toIndex(index);
|
|
5792
5790
|
var store = getInternalDataViewState(view);
|
|
5791
|
+
var intIndex = toIndex(index);
|
|
5792
|
+
var boolIsLittleEndian = !!isLittleEndian;
|
|
5793
5793
|
if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
|
5794
5794
|
var bytes = store.bytes;
|
|
5795
5795
|
var start = intIndex + store.byteOffset;
|
|
5796
5796
|
var pack = arraySlice(bytes, start, start + count);
|
|
5797
|
-
return
|
|
5797
|
+
return boolIsLittleEndian ? pack : reverse(pack);
|
|
5798
5798
|
};
|
|
5799
5799
|
|
|
5800
5800
|
var set = function (view, count, index, conversion, value, isLittleEndian) {
|
|
5801
|
-
var intIndex = toIndex(index);
|
|
5802
5801
|
var store = getInternalDataViewState(view);
|
|
5802
|
+
var intIndex = toIndex(index);
|
|
5803
|
+
var pack = conversion(+value);
|
|
5804
|
+
var boolIsLittleEndian = !!isLittleEndian;
|
|
5803
5805
|
if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
|
5804
5806
|
var bytes = store.bytes;
|
|
5805
5807
|
var start = intIndex + store.byteOffset;
|
|
5806
|
-
var
|
|
5807
|
-
for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
|
|
5808
|
+
for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1];
|
|
5808
5809
|
};
|
|
5809
5810
|
|
|
5810
5811
|
if (!NATIVE_ARRAY_BUFFER) {
|
|
@@ -5864,24 +5865,24 @@ if (!NATIVE_ARRAY_BUFFER) {
|
|
|
5864
5865
|
return get(this, 1, byteOffset)[0];
|
|
5865
5866
|
},
|
|
5866
5867
|
getInt16: function getInt16(byteOffset /* , littleEndian */) {
|
|
5867
|
-
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5868
|
+
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
|
|
5868
5869
|
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
|
|
5869
5870
|
},
|
|
5870
5871
|
getUint16: function getUint16(byteOffset /* , littleEndian */) {
|
|
5871
|
-
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5872
|
+
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
|
|
5872
5873
|
return bytes[1] << 8 | bytes[0];
|
|
5873
5874
|
},
|
|
5874
5875
|
getInt32: function getInt32(byteOffset /* , littleEndian */) {
|
|
5875
|
-
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5876
|
+
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));
|
|
5876
5877
|
},
|
|
5877
5878
|
getUint32: function getUint32(byteOffset /* , littleEndian */) {
|
|
5878
|
-
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5879
|
+
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;
|
|
5879
5880
|
},
|
|
5880
5881
|
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
|
|
5881
|
-
return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5882
|
+
return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);
|
|
5882
5883
|
},
|
|
5883
5884
|
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
|
|
5884
|
-
return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] :
|
|
5885
|
+
return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);
|
|
5885
5886
|
},
|
|
5886
5887
|
setInt8: function setInt8(byteOffset, value) {
|
|
5887
5888
|
set(this, 1, byteOffset, packInt8, value);
|
|
@@ -5890,22 +5891,22 @@ if (!NATIVE_ARRAY_BUFFER) {
|
|
|
5890
5891
|
set(this, 1, byteOffset, packInt8, value);
|
|
5891
5892
|
},
|
|
5892
5893
|
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
|
|
5893
|
-
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] :
|
|
5894
|
+
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
|
|
5894
5895
|
},
|
|
5895
5896
|
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
|
|
5896
|
-
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] :
|
|
5897
|
+
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
|
|
5897
5898
|
},
|
|
5898
5899
|
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
|
|
5899
|
-
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] :
|
|
5900
|
+
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
|
|
5900
5901
|
},
|
|
5901
5902
|
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
|
|
5902
|
-
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] :
|
|
5903
|
+
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
|
|
5903
5904
|
},
|
|
5904
5905
|
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
|
|
5905
|
-
set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] :
|
|
5906
|
+
set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);
|
|
5906
5907
|
},
|
|
5907
5908
|
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
|
|
5908
|
-
set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] :
|
|
5909
|
+
set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);
|
|
5909
5910
|
}
|
|
5910
5911
|
});
|
|
5911
5912
|
} else {
|
|
@@ -8994,7 +8995,7 @@ var $ = __webpack_require__(3);
|
|
|
8994
8995
|
var hasOwn = __webpack_require__(39);
|
|
8995
8996
|
|
|
8996
8997
|
// `Object.hasOwn` method
|
|
8997
|
-
// https://
|
|
8998
|
+
// https://tc39.es/ecma262/#sec-object.hasown
|
|
8998
8999
|
$({ target: 'Object', stat: true }, {
|
|
8999
9000
|
hasOwn: hasOwn
|
|
9000
9001
|
});
|
|
@@ -11504,7 +11505,7 @@ var FORCED = fails(function () {
|
|
|
11504
11505
|
});
|
|
11505
11506
|
|
|
11506
11507
|
// `String.prototype.at` method
|
|
11507
|
-
// https://
|
|
11508
|
+
// https://tc39.es/ecma262/#sec-string.prototype.at
|
|
11508
11509
|
$({ target: 'String', proto: true, forced: FORCED }, {
|
|
11509
11510
|
at: function at(index) {
|
|
11510
11511
|
var S = toString(requireObjectCoercible(this));
|
|
@@ -13744,7 +13745,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
13744
13745
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
13745
13746
|
|
|
13746
13747
|
// `%TypedArray%.prototype.at` method
|
|
13747
|
-
// https://
|
|
13748
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.at
|
|
13748
13749
|
exportTypedArrayMethod('at', function at(index) {
|
|
13749
13750
|
var O = aTypedArray(this);
|
|
13750
13751
|
var len = lengthOfArrayLike(O);
|
|
@@ -13931,7 +13932,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
13931
13932
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
13932
13933
|
|
|
13933
13934
|
// `%TypedArray%.prototype.findLast` method
|
|
13934
|
-
// https://
|
|
13935
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlast
|
|
13935
13936
|
exportTypedArrayMethod('findLast', function findLast(predicate /* , thisArg */) {
|
|
13936
13937
|
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
|
13937
13938
|
});
|
|
@@ -13950,7 +13951,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
|
13950
13951
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
13951
13952
|
|
|
13952
13953
|
// `%TypedArray%.prototype.findLastIndex` method
|
|
13953
|
-
// https://
|
|
13954
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlastindex
|
|
13954
13955
|
exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate /* , thisArg */) {
|
|
13955
13956
|
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
|
13956
13957
|
});
|
|
@@ -14496,7 +14497,7 @@ var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
|
14496
14497
|
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
|
|
14497
14498
|
|
|
14498
14499
|
// `%TypedArray%.prototype.toReversed` method
|
|
14499
|
-
// https://tc39.es/
|
|
14500
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed
|
|
14500
14501
|
exportTypedArrayMethod('toReversed', function toReversed() {
|
|
14501
14502
|
return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this));
|
|
14502
14503
|
});
|
|
@@ -14519,7 +14520,7 @@ var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
|
14519
14520
|
var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
|
|
14520
14521
|
|
|
14521
14522
|
// `%TypedArray%.prototype.toSorted` method
|
|
14522
|
-
// https://tc39.es/
|
|
14523
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted
|
|
14523
14524
|
exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
|
|
14524
14525
|
if (compareFn !== undefined) aCallable(compareFn);
|
|
14525
14526
|
var O = aTypedArray(this);
|
|
@@ -14585,7 +14586,7 @@ var PROPER_ORDER = !!function () {
|
|
|
14585
14586
|
}();
|
|
14586
14587
|
|
|
14587
14588
|
// `%TypedArray%.prototype.with` method
|
|
14588
|
-
// https://tc39.es/
|
|
14589
|
+
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.with
|
|
14589
14590
|
exportTypedArrayMethod('with', { 'with': function (index, value) {
|
|
14590
14591
|
var O = aTypedArray(this);
|
|
14591
14592
|
var relativeIndex = toIntegerOrInfinity(index);
|
|
@@ -15789,7 +15790,61 @@ var createDataTransfer = function () {
|
|
|
15789
15790
|
return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null;
|
|
15790
15791
|
};
|
|
15791
15792
|
|
|
15792
|
-
var
|
|
15793
|
+
var cloneBuffer = function (value, map, $type) {
|
|
15794
|
+
if (mapHas(map, value)) return mapGet(map, value);
|
|
15795
|
+
|
|
15796
|
+
var type = $type || classof(value);
|
|
15797
|
+
var clone, length, options, source, target, i;
|
|
15798
|
+
|
|
15799
|
+
if (type === 'SharedArrayBuffer') {
|
|
15800
|
+
if (nativeRestrictedStructuredClone) clone = nativeRestrictedStructuredClone(value);
|
|
15801
|
+
// SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original
|
|
15802
|
+
else clone = value;
|
|
15803
|
+
} else {
|
|
15804
|
+
var DataView = global.DataView;
|
|
15805
|
+
|
|
15806
|
+
// `ArrayBuffer#slice` is not available in IE10
|
|
15807
|
+
// `ArrayBuffer#slice` and `DataView` are not available in old FF
|
|
15808
|
+
if (!DataView && typeof value.slice != 'function') throwUnpolyfillable('ArrayBuffer');
|
|
15809
|
+
// detached buffers throws in `DataView` and `.slice`
|
|
15810
|
+
try {
|
|
15811
|
+
if (typeof value.slice == 'function' && !value.resizable) {
|
|
15812
|
+
clone = value.slice(0);
|
|
15813
|
+
} else {
|
|
15814
|
+
length = value.byteLength;
|
|
15815
|
+
options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined;
|
|
15816
|
+
clone = new ArrayBuffer(length, options);
|
|
15817
|
+
source = new DataView(value);
|
|
15818
|
+
target = new DataView(clone);
|
|
15819
|
+
for (i = 0; i < length; i++) {
|
|
15820
|
+
target.setUint8(i, source.getUint8(i));
|
|
15821
|
+
}
|
|
15822
|
+
}
|
|
15823
|
+
} catch (error) {
|
|
15824
|
+
throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR);
|
|
15825
|
+
}
|
|
15826
|
+
}
|
|
15827
|
+
|
|
15828
|
+
mapSet(map, value, clone);
|
|
15829
|
+
|
|
15830
|
+
return clone;
|
|
15831
|
+
};
|
|
15832
|
+
|
|
15833
|
+
var cloneView = function (value, type, offset, length, map) {
|
|
15834
|
+
var C = global[type];
|
|
15835
|
+
// in some old engines like Safari 9, typeof C is 'object'
|
|
15836
|
+
// on Uint8ClampedArray or some other constructors
|
|
15837
|
+
if (!isObject(C)) throwUnpolyfillable(type);
|
|
15838
|
+
return new C(cloneBuffer(value.buffer, map), offset, length);
|
|
15839
|
+
};
|
|
15840
|
+
|
|
15841
|
+
var Placeholder = function (object, type, metadata) {
|
|
15842
|
+
this.object = object;
|
|
15843
|
+
this.type = type;
|
|
15844
|
+
this.metadata = metadata;
|
|
15845
|
+
};
|
|
15846
|
+
|
|
15847
|
+
var structuredCloneInternal = function (value, map, transferredBuffers) {
|
|
15793
15848
|
if (isSymbol(value)) throwUncloneable('Symbol');
|
|
15794
15849
|
if (!isObject(value)) return value;
|
|
15795
15850
|
// effectively preserves circular references
|
|
@@ -15798,25 +15853,20 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15798
15853
|
} else map = new Map();
|
|
15799
15854
|
|
|
15800
15855
|
var type = classof(value);
|
|
15801
|
-
var
|
|
15802
|
-
var C, name, cloned, dataTransfer, i, length, keys, key, source, target, options;
|
|
15856
|
+
var C, name, cloned, dataTransfer, i, length, keys, key;
|
|
15803
15857
|
|
|
15804
15858
|
switch (type) {
|
|
15805
15859
|
case 'Array':
|
|
15806
15860
|
cloned = Array(lengthOfArrayLike(value));
|
|
15807
|
-
deep = true;
|
|
15808
15861
|
break;
|
|
15809
15862
|
case 'Object':
|
|
15810
15863
|
cloned = {};
|
|
15811
|
-
deep = true;
|
|
15812
15864
|
break;
|
|
15813
15865
|
case 'Map':
|
|
15814
15866
|
cloned = new Map();
|
|
15815
|
-
deep = true;
|
|
15816
15867
|
break;
|
|
15817
15868
|
case 'Set':
|
|
15818
15869
|
cloned = new Set();
|
|
15819
|
-
deep = true;
|
|
15820
15870
|
break;
|
|
15821
15871
|
case 'RegExp':
|
|
15822
15872
|
// in this block because of a Safari 14.1 bug
|
|
@@ -15859,11 +15909,15 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15859
15909
|
default:
|
|
15860
15910
|
cloned = Error();
|
|
15861
15911
|
}
|
|
15862
|
-
deep = true;
|
|
15863
15912
|
break;
|
|
15864
15913
|
case 'DOMException':
|
|
15865
15914
|
cloned = new DOMException(value.message, value.name);
|
|
15866
|
-
|
|
15915
|
+
break;
|
|
15916
|
+
case 'ArrayBuffer':
|
|
15917
|
+
case 'SharedArrayBuffer':
|
|
15918
|
+
cloned = transferredBuffers
|
|
15919
|
+
? new Placeholder(value, type)
|
|
15920
|
+
: cloneBuffer(value, map, type);
|
|
15867
15921
|
break;
|
|
15868
15922
|
case 'DataView':
|
|
15869
15923
|
case 'Int8Array':
|
|
@@ -15873,28 +15927,23 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15873
15927
|
case 'Uint16Array':
|
|
15874
15928
|
case 'Int32Array':
|
|
15875
15929
|
case 'Uint32Array':
|
|
15930
|
+
case 'Float16Array':
|
|
15876
15931
|
case 'Float32Array':
|
|
15877
15932
|
case 'Float64Array':
|
|
15878
15933
|
case 'BigInt64Array':
|
|
15879
15934
|
case 'BigUint64Array':
|
|
15880
|
-
|
|
15881
|
-
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
cloned = new C(
|
|
15885
|
-
// this is safe, since arraybuffer cannot have circular references
|
|
15886
|
-
structuredCloneInternal(value.buffer, map),
|
|
15887
|
-
value.byteOffset,
|
|
15888
|
-
type === 'DataView' ? value.byteLength : value.length
|
|
15889
|
-
);
|
|
15935
|
+
length = type === 'DataView' ? value.byteLength : value.length;
|
|
15936
|
+
cloned = transferredBuffers
|
|
15937
|
+
? new Placeholder(value, type, { offset: value.byteOffset, length: length })
|
|
15938
|
+
: cloneView(value, type, value.byteOffset, length, map);
|
|
15890
15939
|
break;
|
|
15891
15940
|
case 'DOMQuad':
|
|
15892
15941
|
try {
|
|
15893
15942
|
cloned = new DOMQuad(
|
|
15894
|
-
structuredCloneInternal(value.p1, map),
|
|
15895
|
-
structuredCloneInternal(value.p2, map),
|
|
15896
|
-
structuredCloneInternal(value.p3, map),
|
|
15897
|
-
structuredCloneInternal(value.p4, map)
|
|
15943
|
+
structuredCloneInternal(value.p1, map, transferredBuffers),
|
|
15944
|
+
structuredCloneInternal(value.p2, map, transferredBuffers),
|
|
15945
|
+
structuredCloneInternal(value.p3, map, transferredBuffers),
|
|
15946
|
+
structuredCloneInternal(value.p4, map, transferredBuffers)
|
|
15898
15947
|
);
|
|
15899
15948
|
} catch (error) {
|
|
15900
15949
|
cloned = tryNativeRestrictedStructuredClone(value, type);
|
|
@@ -15915,7 +15964,7 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15915
15964
|
dataTransfer = createDataTransfer();
|
|
15916
15965
|
if (dataTransfer) {
|
|
15917
15966
|
for (i = 0, length = lengthOfArrayLike(value); i < length; i++) {
|
|
15918
|
-
dataTransfer.items.add(structuredCloneInternal(value[i], map));
|
|
15967
|
+
dataTransfer.items.add(structuredCloneInternal(value[i], map, transferredBuffers));
|
|
15919
15968
|
}
|
|
15920
15969
|
cloned = dataTransfer.files;
|
|
15921
15970
|
} else cloned = tryNativeRestrictedStructuredClone(value, type);
|
|
@@ -15924,7 +15973,7 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15924
15973
|
// Safari 9 ImageData is a constructor, but typeof ImageData is 'object'
|
|
15925
15974
|
try {
|
|
15926
15975
|
cloned = new ImageData(
|
|
15927
|
-
structuredCloneInternal(value.data, map),
|
|
15976
|
+
structuredCloneInternal(value.data, map, transferredBuffers),
|
|
15928
15977
|
value.width,
|
|
15929
15978
|
value.height,
|
|
15930
15979
|
{ colorSpace: value.colorSpace }
|
|
@@ -15952,32 +16001,6 @@ var structuredCloneInternal = function (value, map) {
|
|
|
15952
16001
|
case 'Date':
|
|
15953
16002
|
cloned = new Date(thisTimeValue(value));
|
|
15954
16003
|
break;
|
|
15955
|
-
case 'ArrayBuffer':
|
|
15956
|
-
C = global.DataView;
|
|
15957
|
-
// `ArrayBuffer#slice` is not available in IE10
|
|
15958
|
-
// `ArrayBuffer#slice` and `DataView` are not available in old FF
|
|
15959
|
-
if (!C && typeof value.slice != 'function') throwUnpolyfillable(type);
|
|
15960
|
-
// detached buffers throws in `DataView` and `.slice`
|
|
15961
|
-
try {
|
|
15962
|
-
if (typeof value.slice == 'function' && !value.resizable) {
|
|
15963
|
-
cloned = value.slice(0);
|
|
15964
|
-
} else {
|
|
15965
|
-
length = value.byteLength;
|
|
15966
|
-
options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined;
|
|
15967
|
-
cloned = new ArrayBuffer(length, options);
|
|
15968
|
-
source = new C(value);
|
|
15969
|
-
target = new C(cloned);
|
|
15970
|
-
for (i = 0; i < length; i++) {
|
|
15971
|
-
target.setUint8(i, source.getUint8(i));
|
|
15972
|
-
}
|
|
15973
|
-
}
|
|
15974
|
-
} catch (error) {
|
|
15975
|
-
throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR);
|
|
15976
|
-
} break;
|
|
15977
|
-
case 'SharedArrayBuffer':
|
|
15978
|
-
// SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original
|
|
15979
|
-
cloned = value;
|
|
15980
|
-
break;
|
|
15981
16004
|
case 'Blob':
|
|
15982
16005
|
try {
|
|
15983
16006
|
cloned = value.slice(0, value.size, value.type);
|
|
@@ -16041,41 +16064,111 @@ var structuredCloneInternal = function (value, map) {
|
|
|
16041
16064
|
|
|
16042
16065
|
mapSet(map, value, cloned);
|
|
16043
16066
|
|
|
16044
|
-
|
|
16067
|
+
switch (type) {
|
|
16045
16068
|
case 'Array':
|
|
16046
16069
|
case 'Object':
|
|
16047
16070
|
keys = objectKeys(value);
|
|
16048
16071
|
for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) {
|
|
16049
16072
|
key = keys[i];
|
|
16050
|
-
createProperty(cloned, key, structuredCloneInternal(value[key], map));
|
|
16073
|
+
createProperty(cloned, key, structuredCloneInternal(value[key], map, transferredBuffers));
|
|
16051
16074
|
} break;
|
|
16052
16075
|
case 'Map':
|
|
16053
16076
|
value.forEach(function (v, k) {
|
|
16054
|
-
mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map));
|
|
16077
|
+
mapSet(cloned, structuredCloneInternal(k, map, transferredBuffers), structuredCloneInternal(v, map, transferredBuffers));
|
|
16055
16078
|
});
|
|
16056
16079
|
break;
|
|
16057
16080
|
case 'Set':
|
|
16058
16081
|
value.forEach(function (v) {
|
|
16059
|
-
setAdd(cloned, structuredCloneInternal(v, map));
|
|
16082
|
+
setAdd(cloned, structuredCloneInternal(v, map, transferredBuffers));
|
|
16060
16083
|
});
|
|
16061
16084
|
break;
|
|
16062
16085
|
case 'Error':
|
|
16063
|
-
createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map));
|
|
16086
|
+
createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map, transferredBuffers));
|
|
16064
16087
|
if (hasOwn(value, 'cause')) {
|
|
16065
|
-
createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map));
|
|
16088
|
+
createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map, transferredBuffers));
|
|
16066
16089
|
}
|
|
16067
16090
|
if (name == 'AggregateError') {
|
|
16068
|
-
cloned.errors = structuredCloneInternal(value.errors, map);
|
|
16091
|
+
cloned.errors = structuredCloneInternal(value.errors, map, transferredBuffers);
|
|
16069
16092
|
} // break omitted
|
|
16070
16093
|
case 'DOMException':
|
|
16071
16094
|
if (ERROR_STACK_INSTALLABLE) {
|
|
16072
|
-
createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map));
|
|
16095
|
+
createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map, transferredBuffers));
|
|
16073
16096
|
}
|
|
16074
16097
|
}
|
|
16075
16098
|
|
|
16076
16099
|
return cloned;
|
|
16077
16100
|
};
|
|
16078
16101
|
|
|
16102
|
+
var replacePlaceholders = function (value, map) {
|
|
16103
|
+
if (!isObject(value)) return value;
|
|
16104
|
+
if (mapHas(map, value)) return mapGet(map, value);
|
|
16105
|
+
|
|
16106
|
+
var type, object, metadata, i, length, keys, key, replacement;
|
|
16107
|
+
|
|
16108
|
+
if (value instanceof Placeholder) {
|
|
16109
|
+
type = value.type;
|
|
16110
|
+
object = value.object;
|
|
16111
|
+
|
|
16112
|
+
switch (type) {
|
|
16113
|
+
case 'ArrayBuffer':
|
|
16114
|
+
case 'SharedArrayBuffer':
|
|
16115
|
+
replacement = cloneBuffer(object, map, type);
|
|
16116
|
+
break;
|
|
16117
|
+
case 'DataView':
|
|
16118
|
+
case 'Int8Array':
|
|
16119
|
+
case 'Uint8Array':
|
|
16120
|
+
case 'Uint8ClampedArray':
|
|
16121
|
+
case 'Int16Array':
|
|
16122
|
+
case 'Uint16Array':
|
|
16123
|
+
case 'Int32Array':
|
|
16124
|
+
case 'Uint32Array':
|
|
16125
|
+
case 'Float16Array':
|
|
16126
|
+
case 'Float32Array':
|
|
16127
|
+
case 'Float64Array':
|
|
16128
|
+
case 'BigInt64Array':
|
|
16129
|
+
case 'BigUint64Array':
|
|
16130
|
+
metadata = value.metadata;
|
|
16131
|
+
replacement = cloneView(object, type, metadata.offset, metadata.length, map);
|
|
16132
|
+
}
|
|
16133
|
+
} else switch (classof(value)) {
|
|
16134
|
+
case 'Array':
|
|
16135
|
+
case 'Object':
|
|
16136
|
+
keys = objectKeys(value);
|
|
16137
|
+
for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) {
|
|
16138
|
+
key = keys[i];
|
|
16139
|
+
value[key] = replacePlaceholders(value[key], map);
|
|
16140
|
+
} break;
|
|
16141
|
+
case 'Map':
|
|
16142
|
+
replacement = new Map();
|
|
16143
|
+
value.forEach(function (v, k) {
|
|
16144
|
+
mapSet(replacement, replacePlaceholders(k, map), replacePlaceholders(v, map));
|
|
16145
|
+
});
|
|
16146
|
+
break;
|
|
16147
|
+
case 'Set':
|
|
16148
|
+
replacement = new Set();
|
|
16149
|
+
value.forEach(function (v) {
|
|
16150
|
+
setAdd(replacement, replacePlaceholders(v, map));
|
|
16151
|
+
});
|
|
16152
|
+
break;
|
|
16153
|
+
case 'Error':
|
|
16154
|
+
value.message = replacePlaceholders(value.message, map);
|
|
16155
|
+
if (hasOwn(value, 'cause')) {
|
|
16156
|
+
value.cause = replacePlaceholders(value.cause, map);
|
|
16157
|
+
}
|
|
16158
|
+
if (value.name == 'AggregateError') {
|
|
16159
|
+
value.errors = replacePlaceholders(value.errors, map);
|
|
16160
|
+
} // break omitted
|
|
16161
|
+
case 'DOMException':
|
|
16162
|
+
if (ERROR_STACK_INSTALLABLE) {
|
|
16163
|
+
value.stack = replacePlaceholders(value.stack, map);
|
|
16164
|
+
}
|
|
16165
|
+
}
|
|
16166
|
+
|
|
16167
|
+
mapSet(map, value, replacement || value);
|
|
16168
|
+
|
|
16169
|
+
return replacement || value;
|
|
16170
|
+
};
|
|
16171
|
+
|
|
16079
16172
|
var tryToTransfer = function (rawTransfer, map) {
|
|
16080
16173
|
if (!isObject(rawTransfer)) throw TypeError('Transfer option cannot be converted to a sequence');
|
|
16081
16174
|
|
|
@@ -16087,18 +16180,24 @@ var tryToTransfer = function (rawTransfer, map) {
|
|
|
16087
16180
|
|
|
16088
16181
|
var i = 0;
|
|
16089
16182
|
var length = lengthOfArrayLike(transfer);
|
|
16090
|
-
var
|
|
16183
|
+
var buffers = [];
|
|
16184
|
+
var value, type, C, transferred, canvas, context;
|
|
16091
16185
|
|
|
16092
|
-
|
|
16093
|
-
transferredArray = nativeStructuredClone(transfer, { transfer: transfer });
|
|
16094
|
-
while (i < length) mapSet(map, transfer[i], transferredArray[i++]);
|
|
16095
|
-
} else while (i < length) {
|
|
16186
|
+
while (i < length) {
|
|
16096
16187
|
value = transfer[i++];
|
|
16097
|
-
if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR);
|
|
16098
16188
|
|
|
16099
16189
|
type = classof(value);
|
|
16100
16190
|
|
|
16101
|
-
|
|
16191
|
+
if (type === 'ArrayBuffer') {
|
|
16192
|
+
push(buffers, value);
|
|
16193
|
+
continue;
|
|
16194
|
+
}
|
|
16195
|
+
|
|
16196
|
+
if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR);
|
|
16197
|
+
|
|
16198
|
+
if (PROPER_TRANSFER) {
|
|
16199
|
+
transferred = nativeStructuredClone(value, { transfer: [value] });
|
|
16200
|
+
} else switch (type) {
|
|
16102
16201
|
case 'ImageBitmap':
|
|
16103
16202
|
C = global.OffscreenCanvas;
|
|
16104
16203
|
if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING);
|
|
@@ -16117,10 +16216,6 @@ var tryToTransfer = function (rawTransfer, map) {
|
|
|
16117
16216
|
value.close();
|
|
16118
16217
|
} catch (error) { /* empty */ }
|
|
16119
16218
|
break;
|
|
16120
|
-
case 'ArrayBuffer':
|
|
16121
|
-
if (!isCallable(value.transfer)) throwUnpolyfillable(type, TRANSFERRING);
|
|
16122
|
-
transferred = value.transfer();
|
|
16123
|
-
break;
|
|
16124
16219
|
case 'MediaSourceHandle':
|
|
16125
16220
|
case 'MessagePort':
|
|
16126
16221
|
case 'OffscreenCanvas':
|
|
@@ -16131,6 +16226,30 @@ var tryToTransfer = function (rawTransfer, map) {
|
|
|
16131
16226
|
}
|
|
16132
16227
|
|
|
16133
16228
|
if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR);
|
|
16229
|
+
|
|
16230
|
+
mapSet(map, value, transferred);
|
|
16231
|
+
}
|
|
16232
|
+
|
|
16233
|
+
return buffers;
|
|
16234
|
+
};
|
|
16235
|
+
|
|
16236
|
+
var tryToTransferBuffers = function (transfer, map) {
|
|
16237
|
+
var i = 0;
|
|
16238
|
+
var length = lengthOfArrayLike(transfer);
|
|
16239
|
+
var value, transferred;
|
|
16240
|
+
|
|
16241
|
+
while (i < length) {
|
|
16242
|
+
value = transfer[i++];
|
|
16243
|
+
|
|
16244
|
+
if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR);
|
|
16245
|
+
|
|
16246
|
+
if (PROPER_TRANSFER) {
|
|
16247
|
+
transferred = nativeStructuredClone(value, { transfer: [value] });
|
|
16248
|
+
} else {
|
|
16249
|
+
if (!isCallable(value.transfer)) throwUnpolyfillable('ArrayBuffer', TRANSFERRING);
|
|
16250
|
+
transferred = value.transfer();
|
|
16251
|
+
}
|
|
16252
|
+
|
|
16134
16253
|
mapSet(map, value, transferred);
|
|
16135
16254
|
}
|
|
16136
16255
|
};
|
|
@@ -16141,14 +16260,26 @@ $({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLA
|
|
|
16141
16260
|
structuredClone: function structuredClone(value /* , { transfer } */) {
|
|
16142
16261
|
var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined;
|
|
16143
16262
|
var transfer = options ? options.transfer : undefined;
|
|
16144
|
-
var
|
|
16263
|
+
var transferredBuffers = false;
|
|
16264
|
+
var map, buffers;
|
|
16145
16265
|
|
|
16146
16266
|
if (transfer !== undefined) {
|
|
16147
16267
|
map = new Map();
|
|
16148
|
-
tryToTransfer(transfer, map);
|
|
16268
|
+
buffers = tryToTransfer(transfer, map);
|
|
16269
|
+
transferredBuffers = !!lengthOfArrayLike(buffers);
|
|
16270
|
+
}
|
|
16271
|
+
|
|
16272
|
+
var clone = structuredCloneInternal(value, map, transferredBuffers);
|
|
16273
|
+
|
|
16274
|
+
// since of an issue with cloning views of transferred buffers, we a forced to transfer / clone them in 2 steps
|
|
16275
|
+
// https://github.com/zloirock/core-js/issues/1265
|
|
16276
|
+
if (transferredBuffers) {
|
|
16277
|
+
map = new Map();
|
|
16278
|
+
tryToTransferBuffers(transfer, map);
|
|
16279
|
+
clone = replacePlaceholders(clone, map);
|
|
16149
16280
|
}
|
|
16150
16281
|
|
|
16151
|
-
return
|
|
16282
|
+
return clone;
|
|
16152
16283
|
}
|
|
16153
16284
|
});
|
|
16154
16285
|
|
|
@@ -27507,22 +27638,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27507
27638
|
findClosest: function findClosest(values, pos) {
|
|
27508
27639
|
var _this36 = this,
|
|
27509
27640
|
$$ = this,
|
|
27510
|
-
config = $$.config,
|
|
27511
27641
|
main = $$.$el.main,
|
|
27512
27642
|
data = values.filter(function (v) {
|
|
27513
27643
|
_newArrowCheck(this, _this36);
|
|
27514
27644
|
return v && isValue(v.value);
|
|
27515
27645
|
}.bind(this)),
|
|
27516
|
-
getSensitivity = function (d) {
|
|
27517
|
-
_newArrowCheck(this, _this36);
|
|
27518
|
-
var sensitivity = config.point_sensitivity;
|
|
27519
|
-
if (isFunction(sensitivity)) {
|
|
27520
|
-
sensitivity = sensitivity.call($$.api, d);
|
|
27521
|
-
} else if (sensitivity === "radius") {
|
|
27522
|
-
sensitivity = d.r;
|
|
27523
|
-
}
|
|
27524
|
-
return sensitivity;
|
|
27525
|
-
}.bind(this),
|
|
27526
27646
|
minDist,
|
|
27527
27647
|
closest;
|
|
27528
27648
|
// find mouseovering bar/candlestick
|
|
@@ -27545,7 +27665,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27545
27665
|
}.bind(this)).forEach(function (v) {
|
|
27546
27666
|
_newArrowCheck(this, _this36);
|
|
27547
27667
|
var d = $$.dist(v, pos);
|
|
27548
|
-
minDist =
|
|
27668
|
+
minDist = $$.getPointSensitivity(v);
|
|
27549
27669
|
if (d < minDist) {
|
|
27550
27670
|
minDist = d;
|
|
27551
27671
|
closest = v;
|
|
@@ -34829,17 +34949,65 @@ function title_getTextPos(pos, width) {
|
|
|
34829
34949
|
getTooltipContentTemplate: function getTooltipContentTemplate(tplStr) {
|
|
34830
34950
|
return (tplStr || "<table class=\"{=CLASS_TOOLTIP}\"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class=\"{=CLASS_TOOLTIP_NAME}\">\n\t\t\t\t\t<td class=\"name\">" + (this.patterns ? "{=COLOR}" : "<span style=\"background-color:{=COLOR}\"></span>") + "{=NAME}</td>\n\t\t\t\t\t<td class=\"value\">{=VALUE}</td>\n\t\t\t\t</tr>}}\n\t\t\t</tbody></table>").replace(/(\r?\n|\t)/g, "").split(/{{(.*)}}/);
|
|
34831
34951
|
},
|
|
34952
|
+
/**
|
|
34953
|
+
* Update tooltip position coordinate
|
|
34954
|
+
* @param {object} dataToShow Data object
|
|
34955
|
+
* @param {SVGElement} eventTarget Event element
|
|
34956
|
+
* @private
|
|
34957
|
+
*/
|
|
34958
|
+
setTooltipPosition: function setTooltipPosition(dataToShow, eventTarget) {
|
|
34959
|
+
var _this4 = this,
|
|
34960
|
+
$$ = this,
|
|
34961
|
+
config = $$.config,
|
|
34962
|
+
scale = $$.scale,
|
|
34963
|
+
state = $$.state,
|
|
34964
|
+
_$$$$el = $$.$el,
|
|
34965
|
+
eventRect = _$$$$el.eventRect,
|
|
34966
|
+
tooltip = _$$$$el.tooltip,
|
|
34967
|
+
bindto = config.tooltip_contents.bindto,
|
|
34968
|
+
datum = tooltip.datum();
|
|
34969
|
+
if (!bindto && datum) {
|
|
34970
|
+
var _config$tooltip_posit,
|
|
34971
|
+
_config$tooltip_posit2,
|
|
34972
|
+
_getPointer = getPointer(state.event, eventTarget != null ? eventTarget : eventRect.node()),
|
|
34973
|
+
x = _getPointer[0],
|
|
34974
|
+
y = _getPointer[1],
|
|
34975
|
+
currPos = {
|
|
34976
|
+
x: x,
|
|
34977
|
+
y: y
|
|
34978
|
+
};
|
|
34979
|
+
// get mouse event position
|
|
34980
|
+
|
|
34981
|
+
if (scale.x && datum && "x" in datum) {
|
|
34982
|
+
currPos.xAxis = scale.x(datum.x);
|
|
34983
|
+
}
|
|
34984
|
+
var _datum$width = datum.width,
|
|
34985
|
+
width = _datum$width === void 0 ? 0 : _datum$width,
|
|
34986
|
+
_datum$height = datum.height,
|
|
34987
|
+
height = _datum$height === void 0 ? 0 : _datum$height,
|
|
34988
|
+
pos = (_config$tooltip_posit = (_config$tooltip_posit2 = config.tooltip_position) == null ? void 0 : _config$tooltip_posit2.bind($$.api)(dataToShow != null ? dataToShow : JSON.parse(datum.current), width, height, eventRect == null ? void 0 : eventRect.node(), currPos)) != null ? _config$tooltip_posit : $$.getTooltipPosition.bind($$)(width, height, currPos); // Get tooltip position
|
|
34989
|
+
["top", "left"].forEach(function (v) {
|
|
34990
|
+
_newArrowCheck(this, _this4);
|
|
34991
|
+
var value = pos[v];
|
|
34992
|
+
tooltip.style(v, value + "px");
|
|
34993
|
+
|
|
34994
|
+
// Remember left pos in percentage to be used on resize call
|
|
34995
|
+
if (v === "left" && !datum.xPosInPercent) {
|
|
34996
|
+
datum.xPosInPercent = value / state.current.width * 100;
|
|
34997
|
+
}
|
|
34998
|
+
}.bind(this));
|
|
34999
|
+
}
|
|
35000
|
+
},
|
|
34832
35001
|
/**
|
|
34833
35002
|
* Returns the position of the tooltip
|
|
34834
|
-
* @param {object} dataToShow data
|
|
34835
35003
|
* @param {string} tWidth Width value of tooltip element
|
|
34836
35004
|
* @param {string} tHeight Height value of tooltip element
|
|
34837
|
-
* @param {
|
|
35005
|
+
* @param {object} currPos Current mouse position
|
|
34838
35006
|
* @returns {object} top, left value
|
|
34839
35007
|
* @private
|
|
34840
35008
|
*/
|
|
34841
|
-
|
|
34842
|
-
var
|
|
35009
|
+
getTooltipPosition: function getTooltipPosition(tWidth, tHeight, currPos) {
|
|
35010
|
+
var _this5 = this,
|
|
34843
35011
|
$$ = this,
|
|
34844
35012
|
config = $$.config,
|
|
34845
35013
|
scale = $$.scale,
|
|
@@ -34850,16 +35018,14 @@ function title_getTextPos(pos, width) {
|
|
|
34850
35018
|
current = _state.current,
|
|
34851
35019
|
isLegendRight = _state.isLegendRight,
|
|
34852
35020
|
inputType = _state.inputType,
|
|
34853
|
-
event = _state.event,
|
|
34854
35021
|
hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
|
34855
35022
|
hasTreemap = state.hasTreemap,
|
|
34856
35023
|
isRotated = config.axis_rotated,
|
|
34857
35024
|
svgLeft = $$.getSvgLeft(!0),
|
|
34858
35025
|
chartRight = svgLeft + current.width - $$.getCurrentPaddingRight(),
|
|
34859
35026
|
chartLeft = $$.getCurrentPaddingLeft(!0),
|
|
34860
|
-
|
|
34861
|
-
|
|
34862
|
-
y = _getPointer[1];
|
|
35027
|
+
x = currPos.x,
|
|
35028
|
+
y = currPos.y;
|
|
34863
35029
|
// Determine tooltip position
|
|
34864
35030
|
if ($$.hasArcType()) {
|
|
34865
35031
|
var raw = inputType === "touch" || $$.hasType("radar");
|
|
@@ -34868,14 +35034,13 @@ function title_getTextPos(pos, width) {
|
|
|
34868
35034
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
34869
35035
|
}
|
|
34870
35036
|
} else if (!hasTreemap) {
|
|
34871
|
-
var dataScale = scale.x(dataToShow[0].x);
|
|
34872
35037
|
if (isRotated) {
|
|
34873
|
-
y =
|
|
35038
|
+
y = currPos.xAxis + 20;
|
|
34874
35039
|
x += svgLeft;
|
|
34875
35040
|
chartRight -= svgLeft;
|
|
34876
35041
|
} else {
|
|
34877
35042
|
y -= 5;
|
|
34878
|
-
x = svgLeft + chartLeft + 20 + (scale.zoom ? x :
|
|
35043
|
+
x = svgLeft + chartLeft + 20 + (scale.zoom ? x : currPos.xAxis);
|
|
34879
35044
|
}
|
|
34880
35045
|
}
|
|
34881
35046
|
|
|
@@ -34894,7 +35059,7 @@ function title_getTextPos(pos, width) {
|
|
|
34894
35059
|
|
|
34895
35060
|
// make sure to not be positioned out of viewport
|
|
34896
35061
|
Object.keys(pos).forEach(function (v) {
|
|
34897
|
-
_newArrowCheck(this,
|
|
35062
|
+
_newArrowCheck(this, _this5);
|
|
34898
35063
|
if (pos[v] < 0) {
|
|
34899
35064
|
pos[v] = 0;
|
|
34900
35065
|
}
|
|
@@ -34904,33 +35069,27 @@ function title_getTextPos(pos, width) {
|
|
|
34904
35069
|
/**
|
|
34905
35070
|
* Show the tooltip
|
|
34906
35071
|
* @param {object} selectedData Data object
|
|
34907
|
-
* @param {SVGElement}
|
|
35072
|
+
* @param {SVGElement} eventTarget Event element
|
|
34908
35073
|
* @private
|
|
34909
35074
|
*/
|
|
34910
|
-
showTooltip: function showTooltip(selectedData,
|
|
34911
|
-
var
|
|
35075
|
+
showTooltip: function showTooltip(selectedData, eventTarget) {
|
|
35076
|
+
var _this6 = this,
|
|
34912
35077
|
$$ = this,
|
|
34913
35078
|
config = $$.config,
|
|
34914
|
-
scale = $$.scale,
|
|
34915
|
-
state = $$.state,
|
|
34916
35079
|
tooltip = $$.$el.tooltip,
|
|
34917
|
-
bindto = config.tooltip_contents.bindto,
|
|
34918
35080
|
dataToShow = selectedData.filter(function (d) {
|
|
34919
|
-
_newArrowCheck(this,
|
|
35081
|
+
_newArrowCheck(this, _this6);
|
|
34920
35082
|
return d && isValue($$.getBaseValue(d));
|
|
34921
35083
|
}.bind(this));
|
|
34922
35084
|
if (!tooltip || dataToShow.length === 0 || !config.tooltip_show) {
|
|
34923
35085
|
return;
|
|
34924
35086
|
}
|
|
34925
|
-
var datum = tooltip.datum()
|
|
34926
|
-
_ref = datum || {},
|
|
34927
|
-
_ref$width = _ref.width,
|
|
34928
|
-
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
34929
|
-
_ref$height = _ref.height,
|
|
34930
|
-
height = _ref$height === void 0 ? 0 : _ref$height;
|
|
35087
|
+
var datum = tooltip.datum();
|
|
34931
35088
|
var dataStr = JSON.stringify(selectedData);
|
|
34932
35089
|
if (!datum || datum.current !== dataStr) {
|
|
34933
|
-
var
|
|
35090
|
+
var _selectedData$concat$ = selectedData.concat().sort()[0],
|
|
35091
|
+
index = _selectedData$concat$.index,
|
|
35092
|
+
x = _selectedData$concat$.x;
|
|
34934
35093
|
callFn(config.tooltip_onshow, $$.api, selectedData);
|
|
34935
35094
|
|
|
34936
35095
|
// set tooltip content
|
|
@@ -34944,57 +35103,28 @@ function title_getTextPos(pos, width) {
|
|
|
34944
35103
|
)).style("display", null).style("visibility", null) // for IE9
|
|
34945
35104
|
.datum(datum = {
|
|
34946
35105
|
index: index,
|
|
35106
|
+
x: x,
|
|
34947
35107
|
current: dataStr,
|
|
34948
|
-
width:
|
|
34949
|
-
height:
|
|
35108
|
+
width: tooltip.property("offsetWidth"),
|
|
35109
|
+
height: tooltip.property("offsetHeight")
|
|
34950
35110
|
});
|
|
34951
35111
|
callFn(config.tooltip_onshown, $$.api, selectedData);
|
|
34952
35112
|
$$._handleLinkedCharts(!0, index);
|
|
34953
35113
|
}
|
|
34954
|
-
|
|
34955
|
-
var _config$tooltip_posit,
|
|
34956
|
-
_selectedData$filter,
|
|
34957
|
-
fnPos = ((_config$tooltip_posit = config.tooltip_position) == null ? void 0 : _config$tooltip_posit.bind($$.api)) || $$.tooltipPosition.bind($$),
|
|
34958
|
-
_getPointer2 = getPointer(state.event, eventRect),
|
|
34959
|
-
x = _getPointer2[0],
|
|
34960
|
-
y = _getPointer2[1],
|
|
34961
|
-
currPos = {
|
|
34962
|
-
x: x,
|
|
34963
|
-
y: y
|
|
34964
|
-
},
|
|
34965
|
-
data = (_selectedData$filter = selectedData.filter(Boolean)) == null ? void 0 : _selectedData$filter.shift();
|
|
34966
|
-
// get mouse event position
|
|
34967
|
-
|
|
34968
|
-
if (scale.x && data && "x" in data) {
|
|
34969
|
-
currPos.xAxis = scale.x(data.x);
|
|
34970
|
-
}
|
|
34971
|
-
|
|
34972
|
-
// Get tooltip dimensions
|
|
34973
|
-
var pos = fnPos(dataToShow, width, height, eventRect, currPos);
|
|
34974
|
-
["top", "left"].forEach(function (v) {
|
|
34975
|
-
_newArrowCheck(this, _this5);
|
|
34976
|
-
var value = pos[v];
|
|
34977
|
-
tooltip.style(v, value + "px");
|
|
34978
|
-
|
|
34979
|
-
// Remember left pos in percentage to be used on resize call
|
|
34980
|
-
if (v === "left" && !datum.xPosInPercent) {
|
|
34981
|
-
datum.xPosInPercent = value / state.current.width * 100;
|
|
34982
|
-
}
|
|
34983
|
-
}.bind(this));
|
|
34984
|
-
}
|
|
35114
|
+
$$.setTooltipPosition(dataToShow, eventTarget);
|
|
34985
35115
|
},
|
|
34986
35116
|
/**
|
|
34987
35117
|
* Adjust tooltip position on resize event
|
|
34988
35118
|
* @private
|
|
34989
35119
|
*/
|
|
34990
35120
|
bindTooltipResizePos: function bindTooltipResizePos() {
|
|
34991
|
-
var
|
|
35121
|
+
var _this7 = this,
|
|
34992
35122
|
$$ = this,
|
|
34993
35123
|
resizeFunction = $$.resizeFunction,
|
|
34994
35124
|
state = $$.state,
|
|
34995
35125
|
tooltip = $$.$el.tooltip;
|
|
34996
35126
|
resizeFunction.add(function () {
|
|
34997
|
-
_newArrowCheck(this,
|
|
35127
|
+
_newArrowCheck(this, _this7);
|
|
34998
35128
|
if (tooltip.style("display") === "block") {
|
|
34999
35129
|
var current = state.current,
|
|
35000
35130
|
_tooltip$datum = tooltip.datum(),
|
|
@@ -35038,7 +35168,7 @@ function title_getTextPos(pos, width) {
|
|
|
35038
35168
|
* @private
|
|
35039
35169
|
*/
|
|
35040
35170
|
_handleLinkedCharts: function _handleLinkedCharts(show, index) {
|
|
35041
|
-
var
|
|
35171
|
+
var _this8 = this,
|
|
35042
35172
|
$$ = this,
|
|
35043
35173
|
charts = $$.charts,
|
|
35044
35174
|
config = $$.config,
|
|
@@ -35048,10 +35178,10 @@ function title_getTextPos(pos, width) {
|
|
|
35048
35178
|
if (event != null && event.isTrusted && config.tooltip_linked && charts.length > 1) {
|
|
35049
35179
|
var linkedName = config.tooltip_linked_name;
|
|
35050
35180
|
charts.filter(function (c) {
|
|
35051
|
-
_newArrowCheck(this,
|
|
35181
|
+
_newArrowCheck(this, _this8);
|
|
35052
35182
|
return c !== $$.api;
|
|
35053
35183
|
}.bind(this)).forEach(function (c) {
|
|
35054
|
-
_newArrowCheck(this,
|
|
35184
|
+
_newArrowCheck(this, _this8);
|
|
35055
35185
|
var _c$internal = c.internal,
|
|
35056
35186
|
config = _c$internal.config,
|
|
35057
35187
|
$el = _c$internal.$el,
|
|
@@ -40642,9 +40772,10 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
40642
40772
|
|
|
40643
40773
|
// Show xgrid focus line
|
|
40644
40774
|
$$.showGridFocus(selectedData);
|
|
40775
|
+
var dist = $$.dist(closest, mouse);
|
|
40645
40776
|
|
|
40646
40777
|
// Show cursor as pointer if point is close to mouse position
|
|
40647
|
-
if ($$.isBarType(closest.id) ||
|
|
40778
|
+
if ($$.isBarType(closest.id) || dist < $$.getPointSensitivity(closest)) {
|
|
40648
40779
|
$$.$el.svg.select("." + $EVENT.eventRect).style("cursor", "pointer");
|
|
40649
40780
|
if (!state.mouseover) {
|
|
40650
40781
|
config.data_onover.call($$.api, closest);
|
|
@@ -40721,9 +40852,11 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
40721
40852
|
index += 1;
|
|
40722
40853
|
}
|
|
40723
40854
|
}
|
|
40855
|
+
var eventOnSameIdx = config.tooltip_grouped && index === eventReceiver.currentIdx;
|
|
40724
40856
|
|
|
40725
40857
|
// do nothing while dragging/flowing
|
|
40726
|
-
if (state.dragging || state.flowing || $$.hasArcType() ||
|
|
40858
|
+
if (state.dragging || state.flowing || $$.hasArcType() || eventOnSameIdx) {
|
|
40859
|
+
eventOnSameIdx && $$.setTooltipPosition();
|
|
40727
40860
|
return;
|
|
40728
40861
|
}
|
|
40729
40862
|
if (index !== eventReceiver.currentIdx) {
|
|
@@ -46791,6 +46924,21 @@ var getTransitionName = function () {
|
|
|
46791
46924
|
}
|
|
46792
46925
|
return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r || this.config.point_sensitivity);
|
|
46793
46926
|
},
|
|
46927
|
+
/**
|
|
46928
|
+
* Get data point sensitivity radius
|
|
46929
|
+
* @param {object} d Data point object
|
|
46930
|
+
* @returns {number} return the sensitivity value
|
|
46931
|
+
*/
|
|
46932
|
+
getPointSensitivity: function getPointSensitivity(d) {
|
|
46933
|
+
var $$ = this;
|
|
46934
|
+
var sensitivity = $$.config.point_sensitivity;
|
|
46935
|
+
if (isFunction(sensitivity)) {
|
|
46936
|
+
sensitivity = sensitivity.call($$.api, d);
|
|
46937
|
+
} else if (sensitivity === "radius") {
|
|
46938
|
+
sensitivity = d.r;
|
|
46939
|
+
}
|
|
46940
|
+
return sensitivity;
|
|
46941
|
+
},
|
|
46794
46942
|
insertPointInfoDefs: function insertPointInfoDefs(point, id) {
|
|
46795
46943
|
var _this7 = this,
|
|
46796
46944
|
$$ = this,
|
|
@@ -51611,9 +51759,9 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
51611
51759
|
e = event == null ? void 0 : event.sourceEvent,
|
|
51612
51760
|
isUnZoom = (event == null ? void 0 : event.transform) === transform_identity;
|
|
51613
51761
|
if (((_startEvent = startEvent) == null ? void 0 : _startEvent.type.indexOf("touch")) > -1) {
|
|
51614
|
-
var _e
|
|
51762
|
+
var _e;
|
|
51615
51763
|
startEvent = startEvent.changedTouches[0];
|
|
51616
|
-
e = (_e = e) == null
|
|
51764
|
+
e = (_e = e) == null || (_e = _e.changedTouches) == null ? void 0 : _e[0];
|
|
51617
51765
|
}
|
|
51618
51766
|
|
|
51619
51767
|
// if click, do nothing. otherwise, click interaction will be canceled.
|
|
@@ -52119,7 +52267,7 @@ var _defaults = {};
|
|
|
52119
52267
|
|
|
52120
52268
|
/**
|
|
52121
52269
|
* @namespace bb
|
|
52122
|
-
* @version 3.9.
|
|
52270
|
+
* @version 3.9.1
|
|
52123
52271
|
*/
|
|
52124
52272
|
var bb = {
|
|
52125
52273
|
/**
|
|
@@ -52129,7 +52277,7 @@ var bb = {
|
|
|
52129
52277
|
* bb.version; // "1.0.0"
|
|
52130
52278
|
* @memberof bb
|
|
52131
52279
|
*/
|
|
52132
|
-
version: "3.9.
|
|
52280
|
+
version: "3.9.1",
|
|
52133
52281
|
/**
|
|
52134
52282
|
* Generate chart
|
|
52135
52283
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|