billboard.js 3.9.0-next.2 → 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 +156 -98
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +396 -207
- 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 +157 -93
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -3
- 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/legend.ts +50 -34
- package/src/ChartInternal/internals/tooltip.ts +55 -41
- package/src/ChartInternal/shape/point.ts +20 -2
- package/src/config/Options/common/legend.ts +37 -6
- package/types/options.d.ts +25 -0
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);
|
|
16149
16270
|
}
|
|
16150
16271
|
|
|
16151
|
-
|
|
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);
|
|
16280
|
+
}
|
|
16281
|
+
|
|
16282
|
+
return clone;
|
|
16152
16283
|
}
|
|
16153
16284
|
});
|
|
16154
16285
|
|
|
@@ -25425,17 +25556,34 @@ var data_this = undefined;
|
|
|
25425
25556
|
* - defines the max step the legend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns).
|
|
25426
25557
|
* @property {boolean} [legend.equally=false] Set to all items have same width size.
|
|
25427
25558
|
* @property {number} [legend.padding=0] Set padding value
|
|
25559
|
+
* @property {boolean} [legend.item.interaction=true] Set legend item interaction.
|
|
25560
|
+
* - **NOTE:**
|
|
25561
|
+
* - This setting will not have effect on `.toggle()` method.
|
|
25562
|
+
* - `legend.item.onXXX` listener options will work if set, regardless of this option value.
|
|
25563
|
+
* @property {boolean} [legend.item.interaction.dblclick=false] Set legend item to interact on double click.
|
|
25564
|
+
* - **NOTE:**
|
|
25565
|
+
* - Double clicking will make focused clicked dataseries only, hiding all others.
|
|
25566
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
25567
|
+
* - To return initial state(which all dataseries are showing), double click current focused legend item again.
|
|
25568
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
25569
|
+
* - In this case, default `click` interaction will be disabled.
|
|
25428
25570
|
* @property {Function} [legend.item.onclick=undefined] Set click event handler to the legend item.
|
|
25571
|
+
* - **NOTE:**
|
|
25572
|
+
* - When set, default `click` interaction will be disabled.
|
|
25573
|
+
* - When `interaction.dblclick=true` is set, will be called on double click.
|
|
25429
25574
|
* @property {Function} [legend.item.onover=undefined] Set mouse/touch over event handler to the legend item.
|
|
25575
|
+
* - **NOTE:** When set, default `mouseover` interaction will be disabled.
|
|
25430
25576
|
* @property {Function} [legend.item.onout=undefined] Set mouse/touch out event handler to the legend item.
|
|
25577
|
+
* - **NOTE:** When set, default `mouseout` interaction will be disabled.
|
|
25431
25578
|
* @property {number} [legend.item.tile.width=10] Set width for 'rectangle' legend item tile element.
|
|
25432
|
-
* @property {number} [legend.item.tile.height=10]
|
|
25579
|
+
* @property {number} [legend.item.tile.height=10] Set height for 'rectangle' legend item tile element.
|
|
25433
25580
|
* @property {number} [legend.item.tile.r=5] Set the radius for 'circle' legend item tile type.
|
|
25434
25581
|
* @property {string} [legend.item.tile.type="rectangle"] Set legend item shape type.<br>
|
|
25435
25582
|
* - **Available Values:**
|
|
25436
25583
|
* - circle
|
|
25437
25584
|
* - rectangle
|
|
25438
25585
|
* @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
|
|
25586
|
+
* @see [Demo: item.interaction](https://naver.github.io/billboard.js/demo/#Legend.LegendItemInteraction)
|
|
25439
25587
|
* @see [Demo: item.tile.type](https://naver.github.io/billboard.js/demo/#Legend.LegendItemTileType)
|
|
25440
25588
|
* @see [Demo: position](https://naver.github.io/billboard.js/demo/#Legend.LegendPosition)
|
|
25441
25589
|
* @see [Demo: contents.template](https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate1)
|
|
@@ -25470,6 +25618,16 @@ var data_this = undefined;
|
|
|
25470
25618
|
* equally: false,
|
|
25471
25619
|
* padding: 10,
|
|
25472
25620
|
* item: {
|
|
25621
|
+
* // will disable default interaction
|
|
25622
|
+
* interaction: false,
|
|
25623
|
+
*
|
|
25624
|
+
* // set legend interact on double click
|
|
25625
|
+
* // by double clicking, will make focused clicked dataseries only, hiding all others.
|
|
25626
|
+
* interaction: {
|
|
25627
|
+
* dblclick: true
|
|
25628
|
+
* }
|
|
25629
|
+
*
|
|
25630
|
+
* // when set below callback, will disable corresponding default interactions
|
|
25473
25631
|
* onclick: function(id) { ... },
|
|
25474
25632
|
* onover: function(id) { ... },
|
|
25475
25633
|
* onout: function(id) { ... },
|
|
@@ -25490,24 +25648,26 @@ var data_this = undefined;
|
|
|
25490
25648
|
* usePoint: true
|
|
25491
25649
|
* }
|
|
25492
25650
|
*/
|
|
25493
|
-
legend_show: !0,
|
|
25494
|
-
legend_hide: !1,
|
|
25495
25651
|
legend_contents_bindto: undefined,
|
|
25496
25652
|
legend_contents_template: "<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",
|
|
25497
|
-
|
|
25653
|
+
legend_equally: !1,
|
|
25654
|
+
legend_hide: !1,
|
|
25498
25655
|
legend_inset_anchor: "top-left",
|
|
25499
25656
|
legend_inset_x: 10,
|
|
25500
25657
|
legend_inset_y: 0,
|
|
25501
25658
|
legend_inset_step: undefined,
|
|
25659
|
+
legend_item_interaction: !0,
|
|
25660
|
+
legend_item_dblclick: !1,
|
|
25502
25661
|
legend_item_onclick: undefined,
|
|
25503
25662
|
legend_item_onover: undefined,
|
|
25504
25663
|
legend_item_onout: undefined,
|
|
25505
|
-
legend_equally: !1,
|
|
25506
|
-
legend_padding: 0,
|
|
25507
25664
|
legend_item_tile_width: 10,
|
|
25508
25665
|
legend_item_tile_height: 10,
|
|
25509
25666
|
legend_item_tile_r: 5,
|
|
25510
25667
|
legend_item_tile_type: "rectangle",
|
|
25668
|
+
legend_padding: 0,
|
|
25669
|
+
legend_position: "bottom",
|
|
25670
|
+
legend_show: !0,
|
|
25511
25671
|
legend_usePoint: !1
|
|
25512
25672
|
});
|
|
25513
25673
|
;// CONCATENATED MODULE: ./src/config/Options/common/title.ts
|
|
@@ -27478,22 +27638,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27478
27638
|
findClosest: function findClosest(values, pos) {
|
|
27479
27639
|
var _this36 = this,
|
|
27480
27640
|
$$ = this,
|
|
27481
|
-
config = $$.config,
|
|
27482
27641
|
main = $$.$el.main,
|
|
27483
27642
|
data = values.filter(function (v) {
|
|
27484
27643
|
_newArrowCheck(this, _this36);
|
|
27485
27644
|
return v && isValue(v.value);
|
|
27486
27645
|
}.bind(this)),
|
|
27487
|
-
getSensitivity = function (d) {
|
|
27488
|
-
_newArrowCheck(this, _this36);
|
|
27489
|
-
var sensitivity = config.point_sensitivity;
|
|
27490
|
-
if (isFunction(sensitivity)) {
|
|
27491
|
-
sensitivity = sensitivity.call($$.api, d);
|
|
27492
|
-
} else if (sensitivity === "radius") {
|
|
27493
|
-
sensitivity = d.r;
|
|
27494
|
-
}
|
|
27495
|
-
return sensitivity;
|
|
27496
|
-
}.bind(this),
|
|
27497
27646
|
minDist,
|
|
27498
27647
|
closest;
|
|
27499
27648
|
// find mouseovering bar/candlestick
|
|
@@ -27516,7 +27665,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27516
27665
|
}.bind(this)).forEach(function (v) {
|
|
27517
27666
|
_newArrowCheck(this, _this36);
|
|
27518
27667
|
var d = $$.dist(v, pos);
|
|
27519
|
-
minDist =
|
|
27668
|
+
minDist = $$.getPointSensitivity(v);
|
|
27520
27669
|
if (d < minDist) {
|
|
27521
27670
|
minDist = d;
|
|
27522
27671
|
closest = v;
|
|
@@ -29959,7 +30108,8 @@ function getLegendColor(id) {
|
|
|
29959
30108
|
state = $$.state,
|
|
29960
30109
|
isTouch = state.inputType === "touch",
|
|
29961
30110
|
hasGauge = $$.hasType("gauge"),
|
|
29962
|
-
useCssRule = config.boost_useCssRule
|
|
30111
|
+
useCssRule = config.boost_useCssRule,
|
|
30112
|
+
interaction = config.legend_item_interaction;
|
|
29963
30113
|
item.attr("class", function (id) {
|
|
29964
30114
|
var node = src_select(this),
|
|
29965
30115
|
itemClass = !node.empty() && node.attr("class") || "";
|
|
@@ -29977,19 +30127,27 @@ function getLegendColor(id) {
|
|
|
29977
30127
|
$$.setCssRule(!1, selector, [props])($el.legend);
|
|
29978
30128
|
}.bind(this));
|
|
29979
30129
|
}
|
|
29980
|
-
item.
|
|
30130
|
+
item.on(interaction.dblclick ? "dblclick" : "click", interaction || isFunction(config.legend_item_onclick) ? function (event, id) {
|
|
29981
30131
|
if (!callFn(config.legend_item_onclick, api, id)) {
|
|
29982
|
-
|
|
29983
|
-
|
|
29984
|
-
|
|
30132
|
+
var altKey = event.altKey,
|
|
30133
|
+
target = event.target,
|
|
30134
|
+
type = event.type;
|
|
30135
|
+
if (type === "dblclick" || altKey) {
|
|
30136
|
+
// when focused legend is clicked(with altKey or double clicked), reset all hiding.
|
|
30137
|
+
if (state.hiddenTargetIds.length && target.parentNode.getAttribute("class").indexOf($LEGEND.legendItemHidden) === -1) {
|
|
30138
|
+
api.show();
|
|
30139
|
+
} else {
|
|
30140
|
+
api.hide();
|
|
30141
|
+
api.show(id);
|
|
30142
|
+
}
|
|
29985
30143
|
} else {
|
|
29986
30144
|
api.toggle(id);
|
|
29987
30145
|
src_select(this).classed($FOCUS.legendItemFocused, !1);
|
|
29988
30146
|
}
|
|
29989
30147
|
}
|
|
29990
30148
|
isTouch && $$.hideTooltip();
|
|
29991
|
-
});
|
|
29992
|
-
isTouch || item.on("mouseout", function (event, id) {
|
|
30149
|
+
} : null);
|
|
30150
|
+
isTouch || item.on("mouseout", interaction || isFunction(config.legend_item_onout) ? function (event, id) {
|
|
29993
30151
|
if (!callFn(config.legend_item_onout, api, id)) {
|
|
29994
30152
|
src_select(this).classed($FOCUS.legendItemFocused, !1);
|
|
29995
30153
|
if (hasGauge) {
|
|
@@ -29997,7 +30155,7 @@ function getLegendColor(id) {
|
|
|
29997
30155
|
}
|
|
29998
30156
|
$$.api.revert();
|
|
29999
30157
|
}
|
|
30000
|
-
}).on("mouseover", function (event, id) {
|
|
30158
|
+
} : null).on("mouseover", interaction || isFunction(config.legend_item_onover) ? function (event, id) {
|
|
30001
30159
|
if (!callFn(config.legend_item_onover, api, id)) {
|
|
30002
30160
|
src_select(this).classed($FOCUS.legendItemFocused, !0);
|
|
30003
30161
|
if (hasGauge) {
|
|
@@ -30007,7 +30165,10 @@ function getLegendColor(id) {
|
|
|
30007
30165
|
api.focus(id);
|
|
30008
30166
|
}
|
|
30009
30167
|
}
|
|
30010
|
-
});
|
|
30168
|
+
} : null);
|
|
30169
|
+
|
|
30170
|
+
// set cursor when has some interaction
|
|
30171
|
+
!item.empty() && item.on("click mouseout mouseover") && item.style("cursor", $$.getStylePropValue("pointer"));
|
|
30011
30172
|
}
|
|
30012
30173
|
},
|
|
30013
30174
|
/**
|
|
@@ -34788,17 +34949,65 @@ function title_getTextPos(pos, width) {
|
|
|
34788
34949
|
getTooltipContentTemplate: function getTooltipContentTemplate(tplStr) {
|
|
34789
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(/{{(.*)}}/);
|
|
34790
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
|
+
},
|
|
34791
35001
|
/**
|
|
34792
35002
|
* Returns the position of the tooltip
|
|
34793
|
-
* @param {object} dataToShow data
|
|
34794
35003
|
* @param {string} tWidth Width value of tooltip element
|
|
34795
35004
|
* @param {string} tHeight Height value of tooltip element
|
|
34796
|
-
* @param {
|
|
35005
|
+
* @param {object} currPos Current mouse position
|
|
34797
35006
|
* @returns {object} top, left value
|
|
34798
35007
|
* @private
|
|
34799
35008
|
*/
|
|
34800
|
-
|
|
34801
|
-
var
|
|
35009
|
+
getTooltipPosition: function getTooltipPosition(tWidth, tHeight, currPos) {
|
|
35010
|
+
var _this5 = this,
|
|
34802
35011
|
$$ = this,
|
|
34803
35012
|
config = $$.config,
|
|
34804
35013
|
scale = $$.scale,
|
|
@@ -34809,16 +35018,14 @@ function title_getTextPos(pos, width) {
|
|
|
34809
35018
|
current = _state.current,
|
|
34810
35019
|
isLegendRight = _state.isLegendRight,
|
|
34811
35020
|
inputType = _state.inputType,
|
|
34812
|
-
event = _state.event,
|
|
34813
35021
|
hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
|
34814
35022
|
hasTreemap = state.hasTreemap,
|
|
34815
35023
|
isRotated = config.axis_rotated,
|
|
34816
35024
|
svgLeft = $$.getSvgLeft(!0),
|
|
34817
35025
|
chartRight = svgLeft + current.width - $$.getCurrentPaddingRight(),
|
|
34818
35026
|
chartLeft = $$.getCurrentPaddingLeft(!0),
|
|
34819
|
-
|
|
34820
|
-
|
|
34821
|
-
y = _getPointer[1];
|
|
35027
|
+
x = currPos.x,
|
|
35028
|
+
y = currPos.y;
|
|
34822
35029
|
// Determine tooltip position
|
|
34823
35030
|
if ($$.hasArcType()) {
|
|
34824
35031
|
var raw = inputType === "touch" || $$.hasType("radar");
|
|
@@ -34827,14 +35034,13 @@ function title_getTextPos(pos, width) {
|
|
|
34827
35034
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
34828
35035
|
}
|
|
34829
35036
|
} else if (!hasTreemap) {
|
|
34830
|
-
var dataScale = scale.x(dataToShow[0].x);
|
|
34831
35037
|
if (isRotated) {
|
|
34832
|
-
y =
|
|
35038
|
+
y = currPos.xAxis + 20;
|
|
34833
35039
|
x += svgLeft;
|
|
34834
35040
|
chartRight -= svgLeft;
|
|
34835
35041
|
} else {
|
|
34836
35042
|
y -= 5;
|
|
34837
|
-
x = svgLeft + chartLeft + 20 + (scale.zoom ? x :
|
|
35043
|
+
x = svgLeft + chartLeft + 20 + (scale.zoom ? x : currPos.xAxis);
|
|
34838
35044
|
}
|
|
34839
35045
|
}
|
|
34840
35046
|
|
|
@@ -34853,7 +35059,7 @@ function title_getTextPos(pos, width) {
|
|
|
34853
35059
|
|
|
34854
35060
|
// make sure to not be positioned out of viewport
|
|
34855
35061
|
Object.keys(pos).forEach(function (v) {
|
|
34856
|
-
_newArrowCheck(this,
|
|
35062
|
+
_newArrowCheck(this, _this5);
|
|
34857
35063
|
if (pos[v] < 0) {
|
|
34858
35064
|
pos[v] = 0;
|
|
34859
35065
|
}
|
|
@@ -34863,33 +35069,27 @@ function title_getTextPos(pos, width) {
|
|
|
34863
35069
|
/**
|
|
34864
35070
|
* Show the tooltip
|
|
34865
35071
|
* @param {object} selectedData Data object
|
|
34866
|
-
* @param {SVGElement}
|
|
35072
|
+
* @param {SVGElement} eventTarget Event element
|
|
34867
35073
|
* @private
|
|
34868
35074
|
*/
|
|
34869
|
-
showTooltip: function showTooltip(selectedData,
|
|
34870
|
-
var
|
|
35075
|
+
showTooltip: function showTooltip(selectedData, eventTarget) {
|
|
35076
|
+
var _this6 = this,
|
|
34871
35077
|
$$ = this,
|
|
34872
35078
|
config = $$.config,
|
|
34873
|
-
scale = $$.scale,
|
|
34874
|
-
state = $$.state,
|
|
34875
35079
|
tooltip = $$.$el.tooltip,
|
|
34876
|
-
bindto = config.tooltip_contents.bindto,
|
|
34877
35080
|
dataToShow = selectedData.filter(function (d) {
|
|
34878
|
-
_newArrowCheck(this,
|
|
35081
|
+
_newArrowCheck(this, _this6);
|
|
34879
35082
|
return d && isValue($$.getBaseValue(d));
|
|
34880
35083
|
}.bind(this));
|
|
34881
35084
|
if (!tooltip || dataToShow.length === 0 || !config.tooltip_show) {
|
|
34882
35085
|
return;
|
|
34883
35086
|
}
|
|
34884
|
-
var datum = tooltip.datum()
|
|
34885
|
-
_ref = datum || {},
|
|
34886
|
-
_ref$width = _ref.width,
|
|
34887
|
-
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
34888
|
-
_ref$height = _ref.height,
|
|
34889
|
-
height = _ref$height === void 0 ? 0 : _ref$height;
|
|
35087
|
+
var datum = tooltip.datum();
|
|
34890
35088
|
var dataStr = JSON.stringify(selectedData);
|
|
34891
35089
|
if (!datum || datum.current !== dataStr) {
|
|
34892
|
-
var
|
|
35090
|
+
var _selectedData$concat$ = selectedData.concat().sort()[0],
|
|
35091
|
+
index = _selectedData$concat$.index,
|
|
35092
|
+
x = _selectedData$concat$.x;
|
|
34893
35093
|
callFn(config.tooltip_onshow, $$.api, selectedData);
|
|
34894
35094
|
|
|
34895
35095
|
// set tooltip content
|
|
@@ -34903,57 +35103,28 @@ function title_getTextPos(pos, width) {
|
|
|
34903
35103
|
)).style("display", null).style("visibility", null) // for IE9
|
|
34904
35104
|
.datum(datum = {
|
|
34905
35105
|
index: index,
|
|
35106
|
+
x: x,
|
|
34906
35107
|
current: dataStr,
|
|
34907
|
-
width:
|
|
34908
|
-
height:
|
|
35108
|
+
width: tooltip.property("offsetWidth"),
|
|
35109
|
+
height: tooltip.property("offsetHeight")
|
|
34909
35110
|
});
|
|
34910
35111
|
callFn(config.tooltip_onshown, $$.api, selectedData);
|
|
34911
35112
|
$$._handleLinkedCharts(!0, index);
|
|
34912
35113
|
}
|
|
34913
|
-
|
|
34914
|
-
var _config$tooltip_posit,
|
|
34915
|
-
_selectedData$filter,
|
|
34916
|
-
fnPos = ((_config$tooltip_posit = config.tooltip_position) == null ? void 0 : _config$tooltip_posit.bind($$.api)) || $$.tooltipPosition.bind($$),
|
|
34917
|
-
_getPointer2 = getPointer(state.event, eventRect),
|
|
34918
|
-
x = _getPointer2[0],
|
|
34919
|
-
y = _getPointer2[1],
|
|
34920
|
-
currPos = {
|
|
34921
|
-
x: x,
|
|
34922
|
-
y: y
|
|
34923
|
-
},
|
|
34924
|
-
data = (_selectedData$filter = selectedData.filter(Boolean)) == null ? void 0 : _selectedData$filter.shift();
|
|
34925
|
-
// get mouse event position
|
|
34926
|
-
|
|
34927
|
-
if (scale.x && data && "x" in data) {
|
|
34928
|
-
currPos.xAxis = scale.x(data.x);
|
|
34929
|
-
}
|
|
34930
|
-
|
|
34931
|
-
// Get tooltip dimensions
|
|
34932
|
-
var pos = fnPos(dataToShow, width, height, eventRect, currPos);
|
|
34933
|
-
["top", "left"].forEach(function (v) {
|
|
34934
|
-
_newArrowCheck(this, _this5);
|
|
34935
|
-
var value = pos[v];
|
|
34936
|
-
tooltip.style(v, value + "px");
|
|
34937
|
-
|
|
34938
|
-
// Remember left pos in percentage to be used on resize call
|
|
34939
|
-
if (v === "left" && !datum.xPosInPercent) {
|
|
34940
|
-
datum.xPosInPercent = value / state.current.width * 100;
|
|
34941
|
-
}
|
|
34942
|
-
}.bind(this));
|
|
34943
|
-
}
|
|
35114
|
+
$$.setTooltipPosition(dataToShow, eventTarget);
|
|
34944
35115
|
},
|
|
34945
35116
|
/**
|
|
34946
35117
|
* Adjust tooltip position on resize event
|
|
34947
35118
|
* @private
|
|
34948
35119
|
*/
|
|
34949
35120
|
bindTooltipResizePos: function bindTooltipResizePos() {
|
|
34950
|
-
var
|
|
35121
|
+
var _this7 = this,
|
|
34951
35122
|
$$ = this,
|
|
34952
35123
|
resizeFunction = $$.resizeFunction,
|
|
34953
35124
|
state = $$.state,
|
|
34954
35125
|
tooltip = $$.$el.tooltip;
|
|
34955
35126
|
resizeFunction.add(function () {
|
|
34956
|
-
_newArrowCheck(this,
|
|
35127
|
+
_newArrowCheck(this, _this7);
|
|
34957
35128
|
if (tooltip.style("display") === "block") {
|
|
34958
35129
|
var current = state.current,
|
|
34959
35130
|
_tooltip$datum = tooltip.datum(),
|
|
@@ -34997,7 +35168,7 @@ function title_getTextPos(pos, width) {
|
|
|
34997
35168
|
* @private
|
|
34998
35169
|
*/
|
|
34999
35170
|
_handleLinkedCharts: function _handleLinkedCharts(show, index) {
|
|
35000
|
-
var
|
|
35171
|
+
var _this8 = this,
|
|
35001
35172
|
$$ = this,
|
|
35002
35173
|
charts = $$.charts,
|
|
35003
35174
|
config = $$.config,
|
|
@@ -35007,10 +35178,10 @@ function title_getTextPos(pos, width) {
|
|
|
35007
35178
|
if (event != null && event.isTrusted && config.tooltip_linked && charts.length > 1) {
|
|
35008
35179
|
var linkedName = config.tooltip_linked_name;
|
|
35009
35180
|
charts.filter(function (c) {
|
|
35010
|
-
_newArrowCheck(this,
|
|
35181
|
+
_newArrowCheck(this, _this8);
|
|
35011
35182
|
return c !== $$.api;
|
|
35012
35183
|
}.bind(this)).forEach(function (c) {
|
|
35013
|
-
_newArrowCheck(this,
|
|
35184
|
+
_newArrowCheck(this, _this8);
|
|
35014
35185
|
var _c$internal = c.internal,
|
|
35015
35186
|
config = _c$internal.config,
|
|
35016
35187
|
$el = _c$internal.$el,
|
|
@@ -40601,9 +40772,10 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
40601
40772
|
|
|
40602
40773
|
// Show xgrid focus line
|
|
40603
40774
|
$$.showGridFocus(selectedData);
|
|
40775
|
+
var dist = $$.dist(closest, mouse);
|
|
40604
40776
|
|
|
40605
40777
|
// Show cursor as pointer if point is close to mouse position
|
|
40606
|
-
if ($$.isBarType(closest.id) ||
|
|
40778
|
+
if ($$.isBarType(closest.id) || dist < $$.getPointSensitivity(closest)) {
|
|
40607
40779
|
$$.$el.svg.select("." + $EVENT.eventRect).style("cursor", "pointer");
|
|
40608
40780
|
if (!state.mouseover) {
|
|
40609
40781
|
config.data_onover.call($$.api, closest);
|
|
@@ -40680,9 +40852,11 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
40680
40852
|
index += 1;
|
|
40681
40853
|
}
|
|
40682
40854
|
}
|
|
40855
|
+
var eventOnSameIdx = config.tooltip_grouped && index === eventReceiver.currentIdx;
|
|
40683
40856
|
|
|
40684
40857
|
// do nothing while dragging/flowing
|
|
40685
|
-
if (state.dragging || state.flowing || $$.hasArcType() ||
|
|
40858
|
+
if (state.dragging || state.flowing || $$.hasArcType() || eventOnSameIdx) {
|
|
40859
|
+
eventOnSameIdx && $$.setTooltipPosition();
|
|
40686
40860
|
return;
|
|
40687
40861
|
}
|
|
40688
40862
|
if (index !== eventReceiver.currentIdx) {
|
|
@@ -46750,6 +46924,21 @@ var getTransitionName = function () {
|
|
|
46750
46924
|
}
|
|
46751
46925
|
return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r || this.config.point_sensitivity);
|
|
46752
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
|
+
},
|
|
46753
46942
|
insertPointInfoDefs: function insertPointInfoDefs(point, id) {
|
|
46754
46943
|
var _this7 = this,
|
|
46755
46944
|
$$ = this,
|
|
@@ -51570,9 +51759,9 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
51570
51759
|
e = event == null ? void 0 : event.sourceEvent,
|
|
51571
51760
|
isUnZoom = (event == null ? void 0 : event.transform) === transform_identity;
|
|
51572
51761
|
if (((_startEvent = startEvent) == null ? void 0 : _startEvent.type.indexOf("touch")) > -1) {
|
|
51573
|
-
var _e
|
|
51762
|
+
var _e;
|
|
51574
51763
|
startEvent = startEvent.changedTouches[0];
|
|
51575
|
-
e = (_e = e) == null
|
|
51764
|
+
e = (_e = e) == null || (_e = _e.changedTouches) == null ? void 0 : _e[0];
|
|
51576
51765
|
}
|
|
51577
51766
|
|
|
51578
51767
|
// if click, do nothing. otherwise, click interaction will be canceled.
|
|
@@ -52078,7 +52267,7 @@ var _defaults = {};
|
|
|
52078
52267
|
|
|
52079
52268
|
/**
|
|
52080
52269
|
* @namespace bb
|
|
52081
|
-
* @version 3.9.
|
|
52270
|
+
* @version 3.9.1
|
|
52082
52271
|
*/
|
|
52083
52272
|
var bb = {
|
|
52084
52273
|
/**
|
|
@@ -52088,7 +52277,7 @@ var bb = {
|
|
|
52088
52277
|
* bb.version; // "1.0.0"
|
|
52089
52278
|
* @memberof bb
|
|
52090
52279
|
*/
|
|
52091
|
-
version: "3.9.
|
|
52280
|
+
version: "3.9.1",
|
|
52092
52281
|
/**
|
|
52093
52282
|
* Generate chart
|
|
52094
52283
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|