billboard.js 3.9.4 → 3.10.0-next.2
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 +2 -2
- package/dist/billboard.css +2 -2
- package/dist/billboard.js +2742 -2516
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2936 -2704
- package/dist/billboard.pkgd.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +15 -15
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +205 -186
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +231 -226
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +172 -152
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +161 -142
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/{billboardjs-plugin-bubblecompare.js → billboardjs-plugin-bubblecompare.pkgd.js} +52 -32
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +12 -0
- package/dist/plugin/pkgd/{billboardjs-plugin-sparkline.js → billboardjs-plugin-sparkline.pkgd.js} +239 -200
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +12 -0
- package/dist/plugin/pkgd/{billboardjs-plugin-stanford.js → billboardjs-plugin-stanford.pkgd.js} +301 -277
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -0
- package/dist/plugin/pkgd/{billboardjs-plugin-tableview.js → billboardjs-plugin-tableview.pkgd.js} +206 -166
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +12 -0
- package/dist/plugin/pkgd/{billboardjs-plugin-textoverlap.js → billboardjs-plugin-textoverlap.pkgd.js} +308 -278
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +12 -0
- package/dist/theme/dark.css +5 -4
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +5 -4
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +5 -4
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +5 -4
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +718 -509
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +15 -9
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +21 -28
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +17 -11
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +13 -7
- package/package.json +32 -32
- package/src/Chart/api/axis.ts +4 -0
- package/src/Chart/api/category.ts +8 -4
- package/src/Chart/api/export.ts +1 -2
- package/src/Chart/api/subchart.ts +162 -89
- package/src/Chart/api/zoom.ts +69 -79
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +0 -8
- package/src/ChartInternal/data/IData.ts +4 -1
- package/src/ChartInternal/data/convert.helper.ts +1 -15
- package/src/ChartInternal/data/data.ts +8 -2
- package/src/ChartInternal/interactions/eventrect.ts +3 -4
- package/src/ChartInternal/interactions/flow.ts +1 -7
- package/src/ChartInternal/interactions/interaction.ts +11 -5
- package/src/ChartInternal/interactions/subchart.ts +36 -30
- package/src/ChartInternal/interactions/zoom.ts +13 -3
- package/src/ChartInternal/internals/category.ts +2 -2
- package/src/ChartInternal/internals/clip.ts +4 -5
- package/src/ChartInternal/internals/color.ts +49 -23
- package/src/ChartInternal/internals/domain.ts +46 -10
- package/src/ChartInternal/internals/grid.ts +57 -86
- package/src/ChartInternal/internals/redraw.ts +1 -6
- package/src/ChartInternal/internals/region.ts +35 -12
- package/src/ChartInternal/internals/selection.ts +1 -1
- package/src/ChartInternal/internals/text.ts +1 -26
- package/src/ChartInternal/internals/title.ts +10 -48
- package/src/ChartInternal/internals/tooltip.ts +50 -54
- package/src/ChartInternal/shape/arc.ts +2 -2
- package/src/ChartInternal/shape/candlestick.ts +2 -17
- package/src/ChartInternal/shape/point.ts +36 -8
- package/src/ChartInternal/shape/radar.ts +1 -1
- package/src/ChartInternal/shape/shape.ts +50 -4
- package/src/ChartInternal/shape/treemap.ts +2 -2
- package/src/Plugin/bubblecompare/index.ts +1 -1
- package/src/Plugin/sparkline/index.ts +2 -2
- package/src/Plugin/stanford/Elements.ts +10 -2
- package/src/Plugin/stanford/index.ts +1 -24
- package/src/Plugin/tableview/index.ts +2 -2
- package/src/config/Options/axis/x.ts +1 -0
- package/src/config/Options/common/main.ts +12 -2
- package/src/config/Options/common/point.ts +41 -0
- package/src/config/Options/common/tooltip.ts +10 -10
- package/src/config/Options/data/axis.ts +3 -1
- package/src/config/Options/data/data.ts +10 -2
- package/src/config/Options/shape/area.ts +10 -4
- package/src/config/Options/shape/bar.ts +10 -4
- package/src/config/Store/State.ts +3 -0
- package/src/module/Cache.ts +7 -5
- package/src/module/browser.ts +34 -14
- package/src/module/util.ts +8 -4
- package/src/module/worker.ts +24 -13
- package/src/scss/billboard.scss +4 -2
- package/src/scss/theme/dark.scss +4 -2
- package/src/scss/theme/datalab.scss +4 -2
- package/src/scss/theme/graph.scss +4 -2
- package/src/scss/theme/insight.scss +4 -2
- package/types/chart.d.ts +11 -0
- package/types/options.d.ts +9 -3
- package/types/options.shape.d.ts +26 -0
- package/types/types.d.ts +15 -1
package/dist/plugin/pkgd/{billboardjs-plugin-stanford.js → billboardjs-plugin-stanford.pkgd.js}
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.10.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
else if(typeof exports === 'object')
|
|
18
18
|
exports["bb"] = factory();
|
|
19
19
|
else
|
|
20
|
-
root["bb"] = root["bb"] || {}, root["bb"]["plugin"] = root["bb"]["plugin"] || {}, root["bb"]["plugin"]["stanford"] = factory();
|
|
20
|
+
root["bb"] = root["bb"] || {}, root["bb"]["plugin"] = root["bb"]["plugin"] || {}, root["bb"]["plugin"]["stanford.pkgd"] = factory();
|
|
21
21
|
})(this, function() {
|
|
22
22
|
return /******/ (function() { // webpackBootstrap
|
|
23
23
|
/******/ var __webpack_modules__ = ([
|
|
@@ -1233,10 +1233,10 @@ var store = __webpack_require__(37);
|
|
|
1233
1233
|
(module.exports = function (key, value) {
|
|
1234
1234
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1235
1235
|
})('versions', []).push({
|
|
1236
|
-
version: '3.32.
|
|
1236
|
+
version: '3.32.2',
|
|
1237
1237
|
mode: IS_PURE ? 'pure' : 'global',
|
|
1238
1238
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
1239
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.32.
|
|
1239
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE',
|
|
1240
1240
|
source: 'https://github.com/zloirock/core-js'
|
|
1241
1241
|
});
|
|
1242
1242
|
|
|
@@ -4590,7 +4590,9 @@ try {
|
|
|
4590
4590
|
} catch (error) { /* empty */ }
|
|
4591
4591
|
|
|
4592
4592
|
module.exports = function (exec, SKIP_CLOSING) {
|
|
4593
|
-
|
|
4593
|
+
try {
|
|
4594
|
+
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
4595
|
+
} catch (error) { return false; } // workaround of old WebKit + `eval` bug
|
|
4594
4596
|
var ITERATION_SUPPORT = false;
|
|
4595
4597
|
try {
|
|
4596
4598
|
var object = {};
|
|
@@ -4789,12 +4791,15 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
4789
4791
|
|
|
4790
4792
|
var getIterationMethod = function (KIND) {
|
|
4791
4793
|
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
4792
|
-
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
4794
|
+
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
4795
|
+
|
|
4793
4796
|
switch (KIND) {
|
|
4794
4797
|
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
4795
4798
|
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
4796
4799
|
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
4797
|
-
}
|
|
4800
|
+
}
|
|
4801
|
+
|
|
4802
|
+
return function () { return new IteratorConstructor(this); };
|
|
4798
4803
|
};
|
|
4799
4804
|
|
|
4800
4805
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
@@ -6395,7 +6400,7 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
6395
6400
|
exponent = eMax;
|
|
6396
6401
|
} else if (exponent + eBias >= 1) {
|
|
6397
6402
|
mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));
|
|
6398
|
-
exponent
|
|
6403
|
+
exponent += eBias;
|
|
6399
6404
|
} else {
|
|
6400
6405
|
mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));
|
|
6401
6406
|
exponent = 0;
|
|
@@ -6444,8 +6449,8 @@ var unpack = function (buffer, mantissaLength) {
|
|
|
6444
6449
|
} else if (exponent === eMax) {
|
|
6445
6450
|
return mantissa ? NaN : s ? -Infinity : Infinity;
|
|
6446
6451
|
} else {
|
|
6447
|
-
mantissa
|
|
6448
|
-
exponent
|
|
6452
|
+
mantissa += pow(2, mantissaLength);
|
|
6453
|
+
exponent -= eBias;
|
|
6449
6454
|
} return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
|
|
6450
6455
|
};
|
|
6451
6456
|
|
|
@@ -8020,6 +8025,7 @@ var exp = Math.exp;
|
|
|
8020
8025
|
// https://tc39.es/ecma262/#sec-math.expm1
|
|
8021
8026
|
module.exports = (!$expm1
|
|
8022
8027
|
// Old FF bug
|
|
8028
|
+
// eslint-disable-next-line no-loss-of-precision -- required for old engines
|
|
8023
8029
|
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
|
|
8024
8030
|
// Tor Browser bug
|
|
8025
8031
|
|| $expm1(-2e-17) !== -2e-17
|
|
@@ -8385,9 +8391,20 @@ var toNumber = function (argument) {
|
|
|
8385
8391
|
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
|
|
8386
8392
|
} else if (first === 48) {
|
|
8387
8393
|
switch (charCodeAt(it, 1)) {
|
|
8388
|
-
|
|
8389
|
-
case
|
|
8390
|
-
|
|
8394
|
+
// fast equal of /^0b[01]+$/i
|
|
8395
|
+
case 66:
|
|
8396
|
+
case 98:
|
|
8397
|
+
radix = 2;
|
|
8398
|
+
maxCode = 49;
|
|
8399
|
+
break;
|
|
8400
|
+
// fast equal of /^0o[0-7]+$/i
|
|
8401
|
+
case 79:
|
|
8402
|
+
case 111:
|
|
8403
|
+
radix = 8;
|
|
8404
|
+
maxCode = 55;
|
|
8405
|
+
break;
|
|
8406
|
+
default:
|
|
8407
|
+
return +it;
|
|
8391
8408
|
}
|
|
8392
8409
|
digits = stringSlice(it, 2);
|
|
8393
8410
|
length = digits.length;
|
|
@@ -11446,7 +11463,7 @@ var handleNCG = function (string) {
|
|
|
11446
11463
|
for (; index <= length; index++) {
|
|
11447
11464
|
chr = charAt(string, index);
|
|
11448
11465
|
if (chr === '\\') {
|
|
11449
|
-
chr
|
|
11466
|
+
chr += charAt(string, ++index);
|
|
11450
11467
|
} else if (chr === ']') {
|
|
11451
11468
|
brackets = false;
|
|
11452
11469
|
} else if (!brackets) switch (true) {
|
|
@@ -12477,7 +12494,10 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
|
|
|
12477
12494
|
re[SYMBOL] = /./[SYMBOL];
|
|
12478
12495
|
}
|
|
12479
12496
|
|
|
12480
|
-
re.exec = function () {
|
|
12497
|
+
re.exec = function () {
|
|
12498
|
+
execCalled = true;
|
|
12499
|
+
return null;
|
|
12500
|
+
};
|
|
12481
12501
|
|
|
12482
12502
|
re[SYMBOL]('');
|
|
12483
12503
|
return !execCalled;
|
|
@@ -16406,7 +16426,7 @@ var checkBasicSemantic = function (structuredCloneImplementation) {
|
|
|
16406
16426
|
var set1 = new global.Set([7]);
|
|
16407
16427
|
var set2 = structuredCloneImplementation(set1);
|
|
16408
16428
|
var number = structuredCloneImplementation(Object(7));
|
|
16409
|
-
return set2 === set1 || !set2.has(7) || typeof number != 'object' || number !== 7;
|
|
16429
|
+
return set2 === set1 || !set2.has(7) || typeof number != 'object' || +number !== 7;
|
|
16410
16430
|
}) && structuredCloneImplementation;
|
|
16411
16431
|
};
|
|
16412
16432
|
|
|
@@ -18366,7 +18386,7 @@ var encode = function (input) {
|
|
|
18366
18386
|
var q = delta;
|
|
18367
18387
|
var k = base;
|
|
18368
18388
|
while (true) {
|
|
18369
|
-
var t = k <= bias ? tMin :
|
|
18389
|
+
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
18370
18390
|
if (q < t) break;
|
|
18371
18391
|
var qMinusT = q - t;
|
|
18372
18392
|
var baseMinusT = base - t;
|
|
@@ -19667,7 +19687,7 @@ function rgb_formatHex8() {
|
|
|
19667
19687
|
return "#" + hex(this.r) + hex(this.g) + hex(this.b) + hex((isNaN(this.opacity) ? 1 : this.opacity) * 255);
|
|
19668
19688
|
}
|
|
19669
19689
|
function rgb_formatRgb() {
|
|
19670
|
-
|
|
19690
|
+
const a = clampa(this.opacity);
|
|
19671
19691
|
return "" + (a === 1 ? "rgb(" : "rgba(") + clampi(this.r) + ", " + clampi(this.g) + ", " + clampi(this.b) + (a === 1 ? ")" : ", " + a + ")");
|
|
19672
19692
|
}
|
|
19673
19693
|
function clampa(opacity) {
|
|
@@ -19740,7 +19760,7 @@ src_define(Hsl, hsl, extend(Color, {
|
|
|
19740
19760
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
19741
19761
|
},
|
|
19742
19762
|
formatHsl: function formatHsl() {
|
|
19743
|
-
|
|
19763
|
+
const a = clampa(this.opacity);
|
|
19744
19764
|
return "" + (a === 1 ? "hsl(" : "hsla(") + clamph(this.h) + ", " + clampt(this.s) * 100 + "%, " + clampt(this.l) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
|
19745
19765
|
}
|
|
19746
19766
|
}));
|
|
@@ -20062,10 +20082,9 @@ function descending(a, b) {
|
|
|
20062
20082
|
|
|
20063
20083
|
|
|
20064
20084
|
function bisector(f) {
|
|
20065
|
-
var _this = this
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
delta;
|
|
20085
|
+
var _this = this;
|
|
20086
|
+
let compare1, compare2, delta;
|
|
20087
|
+
|
|
20069
20088
|
// If an accessor is specified, promote it to a comparator. In this case we
|
|
20070
20089
|
// can test whether the search value is (self-) comparable. We can’t do this
|
|
20071
20090
|
// for a comparator (except for specific, known comparators) because we can’t
|
|
@@ -20096,7 +20115,7 @@ function bisector(f) {
|
|
|
20096
20115
|
if (lo < hi) {
|
|
20097
20116
|
if (compare1(x, x) !== 0) return hi;
|
|
20098
20117
|
do {
|
|
20099
|
-
|
|
20118
|
+
const mid = lo + hi >>> 1;
|
|
20100
20119
|
if (compare2(a[mid], x) < 0) lo = mid + 1;else hi = mid;
|
|
20101
20120
|
} while (lo < hi);
|
|
20102
20121
|
}
|
|
@@ -20112,7 +20131,7 @@ function bisector(f) {
|
|
|
20112
20131
|
if (lo < hi) {
|
|
20113
20132
|
if (compare1(x, x) !== 0) return hi;
|
|
20114
20133
|
do {
|
|
20115
|
-
|
|
20134
|
+
const mid = lo + hi >>> 1;
|
|
20116
20135
|
if (compare2(a[mid], x) <= 0) lo = mid + 1;else hi = mid;
|
|
20117
20136
|
} while (lo < hi);
|
|
20118
20137
|
}
|
|
@@ -20125,7 +20144,7 @@ function bisector(f) {
|
|
|
20125
20144
|
if (hi === void 0) {
|
|
20126
20145
|
hi = a.length;
|
|
20127
20146
|
}
|
|
20128
|
-
|
|
20147
|
+
const i = left(a, x, lo, hi - 1);
|
|
20129
20148
|
return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
|
20130
20149
|
}
|
|
20131
20150
|
return {
|
|
@@ -20149,7 +20168,7 @@ function number_number(x) {
|
|
|
20149
20168
|
return x === null ? NaN : +x;
|
|
20150
20169
|
}
|
|
20151
20170
|
function numbers(values, valueof) {
|
|
20152
|
-
var _iterator, _step, value, index, _iterator2, _step2
|
|
20171
|
+
var _iterator, _step, value, index, _iterator2, _step2;
|
|
20153
20172
|
return regenerator.wrap(function (_context) {
|
|
20154
20173
|
while (1) switch (_context.prev = _context.next) {
|
|
20155
20174
|
case 0:
|
|
@@ -20184,13 +20203,13 @@ function numbers(values, valueof) {
|
|
|
20184
20203
|
_context.next = 20;
|
|
20185
20204
|
break;
|
|
20186
20205
|
}
|
|
20187
|
-
|
|
20188
|
-
if (!((
|
|
20206
|
+
value = _step2.value;
|
|
20207
|
+
if (!((value = valueof(value, ++index, values)) != null && (value = +value) >= value)) {
|
|
20189
20208
|
_context.next = 18;
|
|
20190
20209
|
break;
|
|
20191
20210
|
}
|
|
20192
20211
|
_context.next = 18;
|
|
20193
|
-
return
|
|
20212
|
+
return value;
|
|
20194
20213
|
case 18:
|
|
20195
20214
|
_context.next = 13;
|
|
20196
20215
|
break;
|
|
@@ -20204,10 +20223,10 @@ function numbers(values, valueof) {
|
|
|
20204
20223
|
|
|
20205
20224
|
|
|
20206
20225
|
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20226
|
+
const ascendingBisect = bisector(ascending);
|
|
20227
|
+
const bisectRight = ascendingBisect.right;
|
|
20228
|
+
const bisectLeft = ascendingBisect.left;
|
|
20229
|
+
const bisectCenter = bisector(number_number).center;
|
|
20211
20230
|
/* harmony default export */ var bisect = (bisectRight);
|
|
20212
20231
|
;// CONCATENATED MODULE: ./node_modules/d3-scale/src/constant.js
|
|
20213
20232
|
function constants(x) {
|
|
@@ -20359,15 +20378,15 @@ function initInterpolator(domain, interpolator) {
|
|
|
20359
20378
|
return this;
|
|
20360
20379
|
}
|
|
20361
20380
|
;// CONCATENATED MODULE: ./node_modules/d3-array/src/ticks.js
|
|
20362
|
-
|
|
20381
|
+
const e10 = Math.sqrt(50),
|
|
20363
20382
|
e5 = Math.sqrt(10),
|
|
20364
20383
|
e2 = Math.sqrt(2);
|
|
20365
20384
|
function tickSpec(start, stop, count) {
|
|
20366
|
-
|
|
20385
|
+
const step = (stop - start) / Math.max(0, count),
|
|
20367
20386
|
power = Math.floor(Math.log10(step)),
|
|
20368
20387
|
error = step / Math.pow(10, power),
|
|
20369
20388
|
factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
|
|
20370
|
-
|
|
20389
|
+
let i1, i2, inc;
|
|
20371
20390
|
if (power < 0) {
|
|
20372
20391
|
inc = Math.pow(10, -power) / factor;
|
|
20373
20392
|
i1 = Math.round(start * inc);
|
|
@@ -20389,18 +20408,18 @@ function ticks(start, stop, count) {
|
|
|
20389
20408
|
stop = +stop, start = +start, count = +count;
|
|
20390
20409
|
if (!(count > 0)) return [];
|
|
20391
20410
|
if (start === stop) return [start];
|
|
20392
|
-
|
|
20411
|
+
const reverse = stop < start,
|
|
20393
20412
|
_ref = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count),
|
|
20394
20413
|
i1 = _ref[0],
|
|
20395
20414
|
i2 = _ref[1],
|
|
20396
20415
|
inc = _ref[2];
|
|
20397
20416
|
if (!(i2 >= i1)) return [];
|
|
20398
|
-
|
|
20417
|
+
const n = i2 - i1 + 1,
|
|
20399
20418
|
ticks = Array(n);
|
|
20400
20419
|
if (reverse) {
|
|
20401
|
-
if (inc < 0) for (
|
|
20420
|
+
if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
|
|
20402
20421
|
} else {
|
|
20403
|
-
if (inc < 0) for (
|
|
20422
|
+
if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
|
|
20404
20423
|
}
|
|
20405
20424
|
return ticks;
|
|
20406
20425
|
}
|
|
@@ -20410,7 +20429,7 @@ function tickIncrement(start, stop, count) {
|
|
|
20410
20429
|
}
|
|
20411
20430
|
function tickStep(start, stop, count) {
|
|
20412
20431
|
stop = +stop, start = +start, count = +count;
|
|
20413
|
-
|
|
20432
|
+
const reverse = stop < start,
|
|
20414
20433
|
inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
|
|
20415
20434
|
return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
20416
20435
|
}
|
|
@@ -20917,10 +20936,10 @@ function reflect(f) {
|
|
|
20917
20936
|
}.bind(this);
|
|
20918
20937
|
}
|
|
20919
20938
|
function loggish(transform) {
|
|
20920
|
-
var _this4 = this
|
|
20921
|
-
|
|
20922
|
-
domain = scale.domain
|
|
20923
|
-
|
|
20939
|
+
var _this4 = this;
|
|
20940
|
+
const scale = transform(transformLog, transformExp),
|
|
20941
|
+
domain = scale.domain;
|
|
20942
|
+
let base = 10,
|
|
20924
20943
|
logs,
|
|
20925
20944
|
pows;
|
|
20926
20945
|
function rescale() {
|
|
@@ -20941,21 +20960,21 @@ function loggish(transform) {
|
|
|
20941
20960
|
};
|
|
20942
20961
|
scale.ticks = function (count) {
|
|
20943
20962
|
_newArrowCheck(this, _this4);
|
|
20944
|
-
|
|
20945
|
-
|
|
20963
|
+
const d = domain();
|
|
20964
|
+
let u = d[0],
|
|
20946
20965
|
v = d[d.length - 1];
|
|
20947
|
-
|
|
20966
|
+
const r = v < u;
|
|
20948
20967
|
if (r) {
|
|
20949
20968
|
var _ref = [v, u];
|
|
20950
20969
|
u = _ref[0];
|
|
20951
20970
|
v = _ref[1];
|
|
20952
20971
|
}
|
|
20953
|
-
|
|
20972
|
+
let i = logs(u),
|
|
20954
20973
|
j = logs(v),
|
|
20955
20974
|
k,
|
|
20956
20975
|
t;
|
|
20957
|
-
|
|
20958
|
-
|
|
20976
|
+
const n = count == null ? 10 : +count;
|
|
20977
|
+
let z = [];
|
|
20959
20978
|
if (!(base % 1) && j - i < n) {
|
|
20960
20979
|
i = Math.floor(i), j = Math.ceil(j);
|
|
20961
20980
|
if (u > 0) for (; i <= j; ++i) {
|
|
@@ -20989,10 +21008,10 @@ function loggish(transform) {
|
|
|
20989
21008
|
specifier = format(specifier);
|
|
20990
21009
|
}
|
|
20991
21010
|
if (count === Infinity) return specifier;
|
|
20992
|
-
|
|
21011
|
+
const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
|
|
20993
21012
|
return function (d) {
|
|
20994
21013
|
_newArrowCheck(this, _this5);
|
|
20995
|
-
|
|
21014
|
+
let i = d / pows(Math.round(logs(d)));
|
|
20996
21015
|
if (i * base < base - .5) i *= base;
|
|
20997
21016
|
return i <= k ? specifier(d) : "";
|
|
20998
21017
|
}.bind(this);
|
|
@@ -21014,8 +21033,8 @@ function loggish(transform) {
|
|
|
21014
21033
|
return scale;
|
|
21015
21034
|
}
|
|
21016
21035
|
function log() {
|
|
21017
|
-
var _this7 = this
|
|
21018
|
-
|
|
21036
|
+
var _this7 = this;
|
|
21037
|
+
const scale = loggish(transformer()).domain([1, 10]);
|
|
21019
21038
|
scale.copy = function () {
|
|
21020
21039
|
_newArrowCheck(this, _this7);
|
|
21021
21040
|
return copy(scale, log()).base(scale.base());
|
|
@@ -21226,7 +21245,7 @@ function _objectSpread(e) { for (var r = 1, t; r < arguments.length; r++) { t =
|
|
|
21226
21245
|
* CSS class names definition
|
|
21227
21246
|
* @private
|
|
21228
21247
|
*/
|
|
21229
|
-
|
|
21248
|
+
const $COMMON = {
|
|
21230
21249
|
button: "bb-button",
|
|
21231
21250
|
chart: "bb-chart",
|
|
21232
21251
|
empty: "bb-empty",
|
|
@@ -21234,7 +21253,7 @@ var $COMMON = {
|
|
|
21234
21253
|
target: "bb-target",
|
|
21235
21254
|
EXPANDED: "_expanded_"
|
|
21236
21255
|
};
|
|
21237
|
-
|
|
21256
|
+
const $ARC = {
|
|
21238
21257
|
arc: "bb-arc",
|
|
21239
21258
|
arcLabelLine: "bb-arc-label-line",
|
|
21240
21259
|
arcs: "bb-arcs",
|
|
@@ -21244,11 +21263,11 @@ var $ARC = {
|
|
|
21244
21263
|
chartArcsTitle: "bb-chart-arcs-title",
|
|
21245
21264
|
needle: "bb-needle"
|
|
21246
21265
|
};
|
|
21247
|
-
|
|
21266
|
+
const $AREA = {
|
|
21248
21267
|
area: "bb-area",
|
|
21249
21268
|
areas: "bb-areas"
|
|
21250
21269
|
};
|
|
21251
|
-
|
|
21270
|
+
const $AXIS = {
|
|
21252
21271
|
axis: "bb-axis",
|
|
21253
21272
|
axisX: "bb-axis-x",
|
|
21254
21273
|
axisXLabel: "bb-axis-x-label",
|
|
@@ -21257,13 +21276,13 @@ var $AXIS = {
|
|
|
21257
21276
|
axisY2Label: "bb-axis-y2-label",
|
|
21258
21277
|
axisYLabel: "bb-axis-y-label"
|
|
21259
21278
|
};
|
|
21260
|
-
|
|
21279
|
+
const $BAR = {
|
|
21261
21280
|
bar: "bb-bar",
|
|
21262
21281
|
bars: "bb-bars",
|
|
21263
21282
|
chartBar: "bb-chart-bar",
|
|
21264
21283
|
chartBars: "bb-chart-bars"
|
|
21265
21284
|
};
|
|
21266
|
-
|
|
21285
|
+
const $CANDLESTICK = {
|
|
21267
21286
|
candlestick: "bb-candlestick",
|
|
21268
21287
|
candlesticks: "bb-candlesticks",
|
|
21269
21288
|
chartCandlestick: "bb-chart-candlestick",
|
|
@@ -21271,27 +21290,27 @@ var $CANDLESTICK = {
|
|
|
21271
21290
|
valueDown: "bb-value-down",
|
|
21272
21291
|
valueUp: "bb-value-up"
|
|
21273
21292
|
};
|
|
21274
|
-
|
|
21293
|
+
const $CIRCLE = {
|
|
21275
21294
|
chartCircles: "bb-chart-circles",
|
|
21276
21295
|
circle: "bb-circle",
|
|
21277
21296
|
circles: "bb-circles"
|
|
21278
21297
|
};
|
|
21279
|
-
|
|
21298
|
+
const $COLOR = {
|
|
21280
21299
|
colorPattern: "bb-color-pattern",
|
|
21281
21300
|
colorScale: "bb-colorscale"
|
|
21282
21301
|
};
|
|
21283
|
-
|
|
21302
|
+
const $DRAG = {
|
|
21284
21303
|
dragarea: "bb-dragarea",
|
|
21285
21304
|
INCLUDED: "_included_"
|
|
21286
21305
|
};
|
|
21287
|
-
|
|
21306
|
+
const $GAUGE = {
|
|
21288
21307
|
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
21289
21308
|
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
21290
21309
|
chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
|
21291
21310
|
chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
|
21292
21311
|
gaugeValue: "bb-gauge-value"
|
|
21293
21312
|
};
|
|
21294
|
-
|
|
21313
|
+
const $LEGEND = {
|
|
21295
21314
|
legend: "bb-legend",
|
|
21296
21315
|
legendBackground: "bb-legend-background",
|
|
21297
21316
|
legendItem: "bb-legend-item",
|
|
@@ -21300,26 +21319,26 @@ var $LEGEND = {
|
|
|
21300
21319
|
legendItemPoint: "bb-legend-item-point",
|
|
21301
21320
|
legendItemTile: "bb-legend-item-tile"
|
|
21302
21321
|
};
|
|
21303
|
-
|
|
21322
|
+
const $LINE = {
|
|
21304
21323
|
chartLine: "bb-chart-line",
|
|
21305
21324
|
chartLines: "bb-chart-lines",
|
|
21306
21325
|
line: "bb-line",
|
|
21307
21326
|
lines: "bb-lines"
|
|
21308
21327
|
};
|
|
21309
|
-
|
|
21328
|
+
const $EVENT = {
|
|
21310
21329
|
eventRect: "bb-event-rect",
|
|
21311
21330
|
eventRects: "bb-event-rects",
|
|
21312
21331
|
eventRectsMultiple: "bb-event-rects-multiple",
|
|
21313
21332
|
eventRectsSingle: "bb-event-rects-single"
|
|
21314
21333
|
};
|
|
21315
|
-
|
|
21334
|
+
const $FOCUS = {
|
|
21316
21335
|
focused: "bb-focused",
|
|
21317
21336
|
defocused: "bb-defocused",
|
|
21318
21337
|
legendItemFocused: "bb-legend-item-focused",
|
|
21319
21338
|
xgridFocus: "bb-xgrid-focus",
|
|
21320
21339
|
ygridFocus: "bb-ygrid-focus"
|
|
21321
21340
|
};
|
|
21322
|
-
|
|
21341
|
+
const $GRID = {
|
|
21323
21342
|
grid: "bb-grid",
|
|
21324
21343
|
gridLines: "bb-grid-lines",
|
|
21325
21344
|
xgrid: "bb-xgrid",
|
|
@@ -21331,32 +21350,32 @@ var $GRID = {
|
|
|
21331
21350
|
ygridLines: "bb-ygrid-lines",
|
|
21332
21351
|
ygrids: "bb-ygrids"
|
|
21333
21352
|
};
|
|
21334
|
-
|
|
21353
|
+
const $LEVEL = {
|
|
21335
21354
|
level: "bb-level",
|
|
21336
21355
|
levels: "bb-levels"
|
|
21337
21356
|
};
|
|
21338
|
-
|
|
21357
|
+
const $RADAR = {
|
|
21339
21358
|
chartRadar: "bb-chart-radar",
|
|
21340
21359
|
chartRadars: "bb-chart-radars"
|
|
21341
21360
|
};
|
|
21342
|
-
|
|
21361
|
+
const $REGION = {
|
|
21343
21362
|
region: "bb-region",
|
|
21344
21363
|
regions: "bb-regions"
|
|
21345
21364
|
};
|
|
21346
|
-
|
|
21365
|
+
const $SELECT = {
|
|
21347
21366
|
selectedCircle: "bb-selected-circle",
|
|
21348
21367
|
selectedCircles: "bb-selected-circles",
|
|
21349
21368
|
SELECTED: "_selected_"
|
|
21350
21369
|
};
|
|
21351
|
-
|
|
21370
|
+
const $SHAPE = {
|
|
21352
21371
|
shape: "bb-shape",
|
|
21353
21372
|
shapes: "bb-shapes"
|
|
21354
21373
|
};
|
|
21355
|
-
|
|
21374
|
+
const $SUBCHART = {
|
|
21356
21375
|
brush: "bb-brush",
|
|
21357
21376
|
subchart: "bb-subchart"
|
|
21358
21377
|
};
|
|
21359
|
-
|
|
21378
|
+
const $TEXT = {
|
|
21360
21379
|
chartText: "bb-chart-text",
|
|
21361
21380
|
chartTexts: "bb-chart-texts",
|
|
21362
21381
|
text: "bb-text",
|
|
@@ -21364,24 +21383,24 @@ var $TEXT = {
|
|
|
21364
21383
|
title: "bb-title",
|
|
21365
21384
|
TextOverlapping: "text-overlapping"
|
|
21366
21385
|
};
|
|
21367
|
-
|
|
21386
|
+
const $TOOLTIP = {
|
|
21368
21387
|
tooltip: "bb-tooltip",
|
|
21369
21388
|
tooltipContainer: "bb-tooltip-container",
|
|
21370
21389
|
tooltipName: "bb-tooltip-name"
|
|
21371
21390
|
};
|
|
21372
|
-
|
|
21391
|
+
const $TREEMAP = {
|
|
21373
21392
|
treemap: "bb-treemap",
|
|
21374
21393
|
chartTreemap: "bb-chart-treemap",
|
|
21375
21394
|
chartTreemaps: "bb-chart-treemaps"
|
|
21376
21395
|
};
|
|
21377
|
-
|
|
21396
|
+
const $ZOOM = {
|
|
21378
21397
|
buttonZoomReset: "bb-zoom-reset",
|
|
21379
21398
|
zoomBrush: "bb-zoom-brush"
|
|
21380
21399
|
};
|
|
21381
21400
|
/* harmony default export */ var classes = (_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $TREEMAP), $ZOOM));
|
|
21382
21401
|
;// CONCATENATED MODULE: ./node_modules/d3-selection/src/sourceEvent.js
|
|
21383
21402
|
/* harmony default export */ function sourceEvent(event) {
|
|
21384
|
-
|
|
21403
|
+
let sourceEvent;
|
|
21385
21404
|
while (sourceEvent = event.sourceEvent) event = sourceEvent;
|
|
21386
21405
|
return event;
|
|
21387
21406
|
}
|
|
@@ -21864,7 +21883,7 @@ function size_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeo
|
|
|
21864
21883
|
function size_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return size_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return size_arrayLikeToArray(o, minLen); }
|
|
21865
21884
|
function size_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21866
21885
|
/* harmony default export */ function size() {
|
|
21867
|
-
|
|
21886
|
+
let size = 0;
|
|
21868
21887
|
for (var _iterator = size_createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {
|
|
21869
21888
|
_step.value;
|
|
21870
21889
|
++size;
|
|
@@ -22414,10 +22433,10 @@ Selection.prototype = selection.prototype = (_selection$prototype = {
|
|
|
22414
22433
|
;// CONCATENATED MODULE: ./node_modules/d3-drag/src/noevent.js
|
|
22415
22434
|
// These are typically used in conjunction with noevent to ensure that we can
|
|
22416
22435
|
// preventDefault on the event.
|
|
22417
|
-
|
|
22436
|
+
const nonpassive = {
|
|
22418
22437
|
passive: !1
|
|
22419
22438
|
};
|
|
22420
|
-
|
|
22439
|
+
const nonpassivecapture = {
|
|
22421
22440
|
capture: !0,
|
|
22422
22441
|
passive: !1
|
|
22423
22442
|
};
|
|
@@ -22782,7 +22801,7 @@ var svgNode;
|
|
|
22782
22801
|
|
|
22783
22802
|
/* eslint-disable no-undef */
|
|
22784
22803
|
function parseCss(value) {
|
|
22785
|
-
|
|
22804
|
+
const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
22786
22805
|
return m.isIdentity ? decompose_identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
22787
22806
|
}
|
|
22788
22807
|
function parseSvg(value) {
|
|
@@ -23537,7 +23556,7 @@ var constant_this = undefined;
|
|
|
23537
23556
|
}).bind(undefined));
|
|
23538
23557
|
;// CONCATENATED MODULE: ./node_modules/d3-brush/src/event.js
|
|
23539
23558
|
function BrushEvent(type, _ref) {
|
|
23540
|
-
|
|
23559
|
+
let sourceEvent = _ref.sourceEvent,
|
|
23541
23560
|
target = _ref.target,
|
|
23542
23561
|
selection = _ref.selection,
|
|
23543
23562
|
mode = _ref.mode,
|
|
@@ -23606,7 +23625,7 @@ var MODE_DRAG = {
|
|
|
23606
23625
|
MODE_CENTER = {
|
|
23607
23626
|
name: "center"
|
|
23608
23627
|
};
|
|
23609
|
-
|
|
23628
|
+
const abs = Math.abs,
|
|
23610
23629
|
max = Math.max,
|
|
23611
23630
|
min = Math.min;
|
|
23612
23631
|
function number1(e) {
|
|
@@ -23892,7 +23911,7 @@ function brush_brush(dim) {
|
|
|
23892
23911
|
lockY,
|
|
23893
23912
|
points = Array.from(event.touches || [event], function (t) {
|
|
23894
23913
|
_newArrowCheck(this, _this);
|
|
23895
|
-
|
|
23914
|
+
const i = t.identifier;
|
|
23896
23915
|
t = src_pointer(t, that);
|
|
23897
23916
|
t.point0 = t.slice();
|
|
23898
23917
|
t.identifier = i;
|
|
@@ -23902,7 +23921,7 @@ function brush_brush(dim) {
|
|
|
23902
23921
|
var emit = emitter(that, arguments, !0).beforestart();
|
|
23903
23922
|
if (type === "overlay") {
|
|
23904
23923
|
if (selection) moving = !0;
|
|
23905
|
-
|
|
23924
|
+
const pts = [points[0], points[1] || points[0]];
|
|
23906
23925
|
state.selection = selection = [[w0 = dim === Y ? W : min(pts[0][0], pts[1][0]), n0 = dim === X ? N : min(pts[0][1], pts[1][1])], [e0 = dim === Y ? E : max(pts[0][0], pts[1][0]), s0 = dim === X ? S : max(pts[0][1], pts[1][1])]];
|
|
23907
23926
|
if (points.length > 1) move(event);
|
|
23908
23927
|
} else {
|
|
@@ -23929,26 +23948,26 @@ function brush_brush(dim) {
|
|
|
23929
23948
|
emit.start(event, mode.name);
|
|
23930
23949
|
function moved(event) {
|
|
23931
23950
|
for (var _iterator = brush_createForOfIteratorHelperLoose(event.changedTouches || [event]), _step; !(_step = _iterator()).done;) {
|
|
23932
|
-
|
|
23951
|
+
const p = _step.value;
|
|
23933
23952
|
for (var _iterator3 = brush_createForOfIteratorHelperLoose(points), _step3; !(_step3 = _iterator3()).done;) {
|
|
23934
|
-
|
|
23953
|
+
const d = _step3.value;
|
|
23935
23954
|
if (d.identifier === p.identifier) d.cur = src_pointer(p, that);
|
|
23936
23955
|
}
|
|
23937
23956
|
}
|
|
23938
23957
|
if (shifting && !lockX && !lockY && points.length === 1) {
|
|
23939
|
-
|
|
23958
|
+
const point = points[0];
|
|
23940
23959
|
if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1])) lockY = !0;else lockX = !0;
|
|
23941
23960
|
}
|
|
23942
23961
|
for (var _iterator2 = brush_createForOfIteratorHelperLoose(points), _step2; !(_step2 = _iterator2()).done;) {
|
|
23943
|
-
|
|
23944
|
-
if (
|
|
23962
|
+
const point = _step2.value;
|
|
23963
|
+
if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];
|
|
23945
23964
|
}
|
|
23946
23965
|
moving = !0;
|
|
23947
23966
|
src_noevent(event);
|
|
23948
23967
|
move(event);
|
|
23949
23968
|
}
|
|
23950
23969
|
function move(event) {
|
|
23951
|
-
|
|
23970
|
+
const point = points[0],
|
|
23952
23971
|
point0 = point.point0;
|
|
23953
23972
|
var t;
|
|
23954
23973
|
dx = point[0] - point0[0];
|
|
@@ -24139,7 +24158,6 @@ function brush_brush(dim) {
|
|
|
24139
24158
|
|
|
24140
24159
|
;// CONCATENATED MODULE: ./src/module/browser.ts
|
|
24141
24160
|
|
|
24142
|
-
var browser_this = undefined;
|
|
24143
24161
|
/**
|
|
24144
24162
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
24145
24163
|
* billboard.js project is licensed under the MIT license
|
|
@@ -24150,26 +24168,41 @@ var browser_this = undefined;
|
|
|
24150
24168
|
*/
|
|
24151
24169
|
/* eslint-disable no-new-func, no-undef */
|
|
24152
24170
|
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
|
|
24156
|
-
|
|
24157
|
-
|
|
24158
|
-
|
|
24159
|
-
|
|
24160
|
-
|
|
24161
|
-
|
|
24171
|
+
|
|
24172
|
+
/**
|
|
24173
|
+
* Get global object
|
|
24174
|
+
* @returns {object} window object
|
|
24175
|
+
* @private
|
|
24176
|
+
*/
|
|
24177
|
+
function getGlobal() {
|
|
24178
|
+
return typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self || Function("return this")();
|
|
24179
|
+
}
|
|
24180
|
+
|
|
24181
|
+
/**
|
|
24182
|
+
* Get fallback object
|
|
24183
|
+
* @param {object} w global object
|
|
24184
|
+
* @returns {Array} fallback object array
|
|
24185
|
+
* @private
|
|
24186
|
+
*/
|
|
24187
|
+
function getFallback(w) {
|
|
24188
|
+
var _this = this;
|
|
24189
|
+
const hasRAF = typeof (w == null ? void 0 : w.requestAnimationFrame) === "function",
|
|
24190
|
+
hasRIC = typeof (w == null ? void 0 : w.requestIdleCallback) === "function";
|
|
24191
|
+
return [hasRAF ? w.requestAnimationFrame : function (cb) {
|
|
24192
|
+
_newArrowCheck(this, _this);
|
|
24162
24193
|
return setTimeout(cb, 1);
|
|
24163
|
-
}.bind(
|
|
24164
|
-
|
|
24165
|
-
_newArrowCheck(this, browser_this);
|
|
24194
|
+
}.bind(this), hasRAF ? w.cancelAnimationFrame : function (id) {
|
|
24195
|
+
_newArrowCheck(this, _this);
|
|
24166
24196
|
return clearTimeout(id);
|
|
24167
|
-
}.bind(
|
|
24168
|
-
|
|
24169
|
-
|
|
24170
|
-
doc = win == null ? void 0 : win.document
|
|
24171
|
-
|
|
24172
|
-
|
|
24197
|
+
}.bind(this), hasRIC ? w.requestIdleCallback : requestAnimationFrame, hasRIC ? w.cancelIdleCallback : cancelAnimationFrame];
|
|
24198
|
+
}
|
|
24199
|
+
const win = getGlobal(),
|
|
24200
|
+
doc = win == null ? void 0 : win.document,
|
|
24201
|
+
_getFallback = getFallback(win),
|
|
24202
|
+
requestAnimationFrame = _getFallback[0],
|
|
24203
|
+
cancelAnimationFrame = _getFallback[1],
|
|
24204
|
+
requestIdleCallback = _getFallback[2],
|
|
24205
|
+
cancelIdleCallback = _getFallback[3];
|
|
24173
24206
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
24174
24207
|
|
|
24175
24208
|
|
|
@@ -24185,7 +24218,7 @@ function util_objectSpread(e) { for (var r = 1, t; r < arguments.length; r++) {
|
|
|
24185
24218
|
|
|
24186
24219
|
|
|
24187
24220
|
|
|
24188
|
-
|
|
24221
|
+
const isValue = function (v) {
|
|
24189
24222
|
_newArrowCheck(this, util_this);
|
|
24190
24223
|
return v || v === 0;
|
|
24191
24224
|
}.bind(undefined),
|
|
@@ -24278,8 +24311,8 @@ function getOption(options, key, defaultValue) {
|
|
|
24278
24311
|
* @private
|
|
24279
24312
|
*/
|
|
24280
24313
|
function hasValue(dict, value) {
|
|
24281
|
-
var _this2 = this
|
|
24282
|
-
|
|
24314
|
+
var _this2 = this;
|
|
24315
|
+
let found = !1;
|
|
24283
24316
|
Object.keys(dict).forEach(function (key) {
|
|
24284
24317
|
_newArrowCheck(this, _this2);
|
|
24285
24318
|
return dict[key] === value && (found = !0);
|
|
@@ -24296,7 +24329,7 @@ function hasValue(dict, value) {
|
|
|
24296
24329
|
* @private
|
|
24297
24330
|
*/
|
|
24298
24331
|
function callFn(fn, thisArg) {
|
|
24299
|
-
|
|
24332
|
+
const isFn = isFunction(fn);
|
|
24300
24333
|
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
24301
24334
|
args[_key - 2] = arguments[_key];
|
|
24302
24335
|
}
|
|
@@ -24311,14 +24344,15 @@ function callFn(fn, thisArg) {
|
|
|
24311
24344
|
* @private
|
|
24312
24345
|
*/
|
|
24313
24346
|
function endall(transition, cb) {
|
|
24314
|
-
var _this3 = this
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24347
|
+
var _this3 = this;
|
|
24348
|
+
let n = 0;
|
|
24349
|
+
const end = function () {
|
|
24350
|
+
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
24351
|
+
args[_key2] = arguments[_key2];
|
|
24352
|
+
}
|
|
24353
|
+
--n || cb.apply.apply(cb, [this].concat(args));
|
|
24354
|
+
};
|
|
24355
|
+
|
|
24322
24356
|
// if is transition selection
|
|
24323
24357
|
if ("duration" in transition) {
|
|
24324
24358
|
transition.each(function () {
|
|
@@ -24337,8 +24371,8 @@ function endall(transition, cb) {
|
|
|
24337
24371
|
* @returns {string}
|
|
24338
24372
|
* @private
|
|
24339
24373
|
*/
|
|
24340
|
-
function
|
|
24341
|
-
return isString(str) ? str.replace(
|
|
24374
|
+
function sanitize(str) {
|
|
24375
|
+
return isString(str) ? str.replace(/<(script|img)?/ig, "<").replace(/(script)?>/ig, ">") : str;
|
|
24342
24376
|
}
|
|
24343
24377
|
|
|
24344
24378
|
/**
|
|
@@ -24363,12 +24397,12 @@ function setTextValue(node, text, dy, toMiddle) {
|
|
|
24363
24397
|
if (text.indexOf("\n") === -1) {
|
|
24364
24398
|
node.text(text);
|
|
24365
24399
|
} else {
|
|
24366
|
-
|
|
24400
|
+
const diff = [node.text(), text].map(function (v) {
|
|
24367
24401
|
_newArrowCheck(this, _this4);
|
|
24368
24402
|
return v.replace(/[\s\n]/g, "");
|
|
24369
24403
|
}.bind(this));
|
|
24370
24404
|
if (diff[0] !== diff[1]) {
|
|
24371
|
-
|
|
24405
|
+
const multiline = text.split("\n"),
|
|
24372
24406
|
len = toMiddle ? multiline.length - 1 : 1;
|
|
24373
24407
|
// reset possible text
|
|
24374
24408
|
node.html("");
|
|
@@ -24394,7 +24428,7 @@ function getRectSegList(path) {
|
|
|
24394
24428
|
* | |
|
|
24395
24429
|
* seg0 ---------- seg3
|
|
24396
24430
|
* */
|
|
24397
|
-
|
|
24431
|
+
const _path$getBBox = path.getBBox(),
|
|
24398
24432
|
x = _path$getBBox.x,
|
|
24399
24433
|
y = _path$getBBox.y,
|
|
24400
24434
|
width = _path$getBBox.width,
|
|
@@ -24428,7 +24462,7 @@ function getRectSegList(path) {
|
|
|
24428
24462
|
* @private
|
|
24429
24463
|
*/
|
|
24430
24464
|
function getPathBox(path) {
|
|
24431
|
-
|
|
24465
|
+
const _path$getBoundingClie = path.getBoundingClientRect(),
|
|
24432
24466
|
width = _path$getBoundingClie.width,
|
|
24433
24467
|
height = _path$getBoundingClie.height,
|
|
24434
24468
|
items = getRectSegList(path),
|
|
@@ -24451,9 +24485,12 @@ function getPathBox(path) {
|
|
|
24451
24485
|
*/
|
|
24452
24486
|
function getPointer(event, element) {
|
|
24453
24487
|
var _ref,
|
|
24454
|
-
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
24455
|
-
pointer = src_pointer(touches || event, element),
|
|
24456
24488
|
_this5 = this;
|
|
24489
|
+
const touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]);
|
|
24490
|
+
let pointer = [0, 0];
|
|
24491
|
+
try {
|
|
24492
|
+
pointer = src_pointer(touches || event, element);
|
|
24493
|
+
} catch (e) {}
|
|
24457
24494
|
return pointer.map(function (v) {
|
|
24458
24495
|
_newArrowCheck(this, _this5);
|
|
24459
24496
|
return isNaN(v) ? 0 : v;
|
|
@@ -24467,10 +24504,10 @@ function getPointer(event, element) {
|
|
|
24467
24504
|
* @private
|
|
24468
24505
|
*/
|
|
24469
24506
|
function getBrushSelection(ctx) {
|
|
24470
|
-
|
|
24507
|
+
const event = ctx.event,
|
|
24471
24508
|
$el = ctx.$el,
|
|
24472
24509
|
main = $el.subchart.main || $el.main;
|
|
24473
|
-
|
|
24510
|
+
let selection;
|
|
24474
24511
|
|
|
24475
24512
|
// check from event
|
|
24476
24513
|
if (event && event.type === "brush") {
|
|
@@ -24490,7 +24527,7 @@ function getBrushSelection(ctx) {
|
|
|
24490
24527
|
* @private
|
|
24491
24528
|
*/
|
|
24492
24529
|
function getBoundingRect(node) {
|
|
24493
|
-
|
|
24530
|
+
const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
|
|
24494
24531
|
return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
|
|
24495
24532
|
}
|
|
24496
24533
|
|
|
@@ -24512,7 +24549,7 @@ function getRandom(asStr, min, max) {
|
|
|
24512
24549
|
if (max === void 0) {
|
|
24513
24550
|
max = 1e4;
|
|
24514
24551
|
}
|
|
24515
|
-
|
|
24552
|
+
const crpt = win.crypto || win.msCrypto,
|
|
24516
24553
|
rand = crpt ? min + crpt.getRandomValues(new Uint32Array(1))[0] % (max - min + 1) : Math.floor(Math.random() * (max - min) + min);
|
|
24517
24554
|
return asStr ? rand + "" : rand;
|
|
24518
24555
|
}
|
|
@@ -24531,8 +24568,8 @@ function findIndex(arr, v, start, end, isRotated) {
|
|
|
24531
24568
|
if (start > end) {
|
|
24532
24569
|
return -1;
|
|
24533
24570
|
}
|
|
24534
|
-
|
|
24535
|
-
|
|
24571
|
+
const mid = Math.floor((start + end) / 2);
|
|
24572
|
+
let _arr$mid = arr[mid],
|
|
24536
24573
|
x = _arr$mid.x,
|
|
24537
24574
|
_arr$mid$w = _arr$mid.w,
|
|
24538
24575
|
w = _arr$mid$w === void 0 ? 0 : _arr$mid$w;
|
|
@@ -24553,7 +24590,7 @@ function findIndex(arr, v, start, end, isRotated) {
|
|
|
24553
24590
|
* @private
|
|
24554
24591
|
*/
|
|
24555
24592
|
function brushEmpty(ctx) {
|
|
24556
|
-
|
|
24593
|
+
const selection = getBrushSelection(ctx);
|
|
24557
24594
|
if (selection) {
|
|
24558
24595
|
// brush selected area
|
|
24559
24596
|
// two-dimensional: [[x0, y0], [x1, y1]]
|
|
@@ -24570,17 +24607,19 @@ function brushEmpty(ctx) {
|
|
|
24570
24607
|
* @private
|
|
24571
24608
|
*/
|
|
24572
24609
|
function deepClone() {
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
return r;
|
|
24610
|
+
var _this6 = this;
|
|
24611
|
+
const _clone = function clone(v) {
|
|
24612
|
+
_newArrowCheck(this, _this6);
|
|
24613
|
+
if (isObject(v) && v.constructor) {
|
|
24614
|
+
const r = new v.constructor();
|
|
24615
|
+
for (const k in v) {
|
|
24616
|
+
r[k] = _clone(v[k]);
|
|
24581
24617
|
}
|
|
24582
|
-
return
|
|
24583
|
-
}
|
|
24618
|
+
return r;
|
|
24619
|
+
}
|
|
24620
|
+
return v;
|
|
24621
|
+
}.bind(this);
|
|
24622
|
+
for (var _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
24584
24623
|
objectN[_key3] = arguments[_key3];
|
|
24585
24624
|
}
|
|
24586
24625
|
return objectN.map(function (v) {
|
|
@@ -24612,7 +24651,7 @@ function util_extend(target, source) {
|
|
|
24612
24651
|
}
|
|
24613
24652
|
|
|
24614
24653
|
// exclude name with only numbers
|
|
24615
|
-
for (
|
|
24654
|
+
for (const p in source) {
|
|
24616
24655
|
if (/^\d+$/.test(p) || p in target) {
|
|
24617
24656
|
continue;
|
|
24618
24657
|
}
|
|
@@ -24627,7 +24666,7 @@ function util_extend(target, source) {
|
|
|
24627
24666
|
* @returns {string} capitalized string
|
|
24628
24667
|
* @private
|
|
24629
24668
|
*/
|
|
24630
|
-
|
|
24669
|
+
const capitalize = function (str) {
|
|
24631
24670
|
_newArrowCheck(this, util_this);
|
|
24632
24671
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
24633
24672
|
}.bind(undefined);
|
|
@@ -24656,7 +24695,7 @@ function camelize(str, separator) {
|
|
|
24656
24695
|
* @returns {Array}
|
|
24657
24696
|
* @private
|
|
24658
24697
|
*/
|
|
24659
|
-
|
|
24698
|
+
const toArray = function (v) {
|
|
24660
24699
|
_newArrowCheck(this, util_this);
|
|
24661
24700
|
return [].slice.call(v);
|
|
24662
24701
|
}.bind(undefined);
|
|
@@ -24670,8 +24709,8 @@ var toArray = function (v) {
|
|
|
24670
24709
|
* @private
|
|
24671
24710
|
*/
|
|
24672
24711
|
function addCssRules(style, selector, prop) {
|
|
24673
|
-
var _this9 = this
|
|
24674
|
-
|
|
24712
|
+
var _this9 = this;
|
|
24713
|
+
const rootSelctor = style.rootSelctor,
|
|
24675
24714
|
sheet = style.sheet,
|
|
24676
24715
|
getSelector = function (s) {
|
|
24677
24716
|
_newArrowCheck(this, _this9);
|
|
@@ -24688,8 +24727,8 @@ function addCssRules(style, selector, prop) {
|
|
|
24688
24727
|
* @private
|
|
24689
24728
|
*/
|
|
24690
24729
|
function getCssRules(styleSheets) {
|
|
24691
|
-
var _this10 = this
|
|
24692
|
-
|
|
24730
|
+
var _this10 = this;
|
|
24731
|
+
let rules = [];
|
|
24693
24732
|
styleSheets.forEach(function (sheet) {
|
|
24694
24733
|
_newArrowCheck(this, _this10);
|
|
24695
24734
|
try {
|
|
@@ -24711,7 +24750,7 @@ function getCssRules(styleSheets) {
|
|
|
24711
24750
|
* @private
|
|
24712
24751
|
*/
|
|
24713
24752
|
function getTranslation(node) {
|
|
24714
|
-
|
|
24753
|
+
const transform = node ? node.transform : null,
|
|
24715
24754
|
baseVal = transform && transform.baseVal;
|
|
24716
24755
|
return baseVal && baseVal.numberOfItems ? baseVal.getItem(0).matrix : {
|
|
24717
24756
|
a: 0,
|
|
@@ -24730,8 +24769,8 @@ function getTranslation(node) {
|
|
|
24730
24769
|
* @private
|
|
24731
24770
|
*/
|
|
24732
24771
|
function getUnique(data) {
|
|
24733
|
-
var _this11 = this
|
|
24734
|
-
|
|
24772
|
+
var _this11 = this;
|
|
24773
|
+
const isDate = data[0] instanceof Date,
|
|
24735
24774
|
d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
|
|
24736
24775
|
_newArrowCheck(this, _this11);
|
|
24737
24776
|
return self.indexOf(v) === i;
|
|
@@ -24770,11 +24809,11 @@ function mergeObj(target) {
|
|
|
24770
24809
|
if (!objectN.length || objectN.length === 1 && !objectN[0]) {
|
|
24771
24810
|
return target;
|
|
24772
24811
|
}
|
|
24773
|
-
|
|
24812
|
+
const source = objectN.shift();
|
|
24774
24813
|
if (isObject(target) && isObject(source)) {
|
|
24775
24814
|
Object.keys(source).forEach(function (key) {
|
|
24776
24815
|
_newArrowCheck(this, _this13);
|
|
24777
|
-
|
|
24816
|
+
const value = source[key];
|
|
24778
24817
|
if (isObject(value)) {
|
|
24779
24818
|
target[key] || (target[key] = {});
|
|
24780
24819
|
target[key] = mergeObj(target[key], value);
|
|
@@ -24798,7 +24837,7 @@ function sortValue(data, isAsc) {
|
|
|
24798
24837
|
if (isAsc === void 0) {
|
|
24799
24838
|
isAsc = !0;
|
|
24800
24839
|
}
|
|
24801
|
-
|
|
24840
|
+
let fn;
|
|
24802
24841
|
if (data[0] instanceof Date) {
|
|
24803
24842
|
fn = isAsc ? function (a, b) {
|
|
24804
24843
|
_newArrowCheck(this, _this14);
|
|
@@ -24831,11 +24870,11 @@ function sortValue(data, isAsc) {
|
|
|
24831
24870
|
* @private
|
|
24832
24871
|
*/
|
|
24833
24872
|
function getMinMax(type, data) {
|
|
24834
|
-
var _this15 = this
|
|
24835
|
-
|
|
24836
|
-
|
|
24837
|
-
|
|
24838
|
-
|
|
24873
|
+
var _this15 = this;
|
|
24874
|
+
let res = data.filter(function (v) {
|
|
24875
|
+
_newArrowCheck(this, _this15);
|
|
24876
|
+
return notEmpty(v);
|
|
24877
|
+
}.bind(this));
|
|
24839
24878
|
if (res.length) {
|
|
24840
24879
|
if (isNumber(res[0])) {
|
|
24841
24880
|
res = Math[type].apply(Math, res);
|
|
@@ -24856,14 +24895,14 @@ function getMinMax(type, data) {
|
|
|
24856
24895
|
* @returns {Array}
|
|
24857
24896
|
* @private
|
|
24858
24897
|
*/
|
|
24859
|
-
|
|
24898
|
+
const getRange = function (start, end, step) {
|
|
24860
24899
|
if (step === void 0) {
|
|
24861
24900
|
step = 1;
|
|
24862
24901
|
}
|
|
24863
24902
|
_newArrowCheck(this, util_this);
|
|
24864
|
-
|
|
24903
|
+
const res = [],
|
|
24865
24904
|
n = Math.max(0, Math.ceil((end - start) / step)) | 0;
|
|
24866
|
-
for (
|
|
24905
|
+
for (let i = start; i < n; i++) {
|
|
24867
24906
|
res.push(start + i * step);
|
|
24868
24907
|
}
|
|
24869
24908
|
return res;
|
|
@@ -24872,7 +24911,7 @@ var getRange = function (start, end, step) {
|
|
|
24872
24911
|
mouse: function () {
|
|
24873
24912
|
var _this16 = this;
|
|
24874
24913
|
_newArrowCheck(this, util_this);
|
|
24875
|
-
|
|
24914
|
+
const getParams = function () {
|
|
24876
24915
|
_newArrowCheck(this, _this16);
|
|
24877
24916
|
return {
|
|
24878
24917
|
bubbles: !1,
|
|
@@ -24900,7 +24939,7 @@ var getRange = function (start, end, step) {
|
|
|
24900
24939
|
params = getParams();
|
|
24901
24940
|
}
|
|
24902
24941
|
_newArrowCheck(this, _this16);
|
|
24903
|
-
|
|
24942
|
+
const mouseEvent = doc.createEvent("MouseEvent");
|
|
24904
24943
|
|
|
24905
24944
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
|
|
24906
24945
|
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0,
|
|
@@ -24912,7 +24951,7 @@ var getRange = function (start, end, step) {
|
|
|
24912
24951
|
}.bind(undefined)(),
|
|
24913
24952
|
touch: function touch(el, eventType, params) {
|
|
24914
24953
|
_newArrowCheck(this, util_this);
|
|
24915
|
-
|
|
24954
|
+
const touchObj = new Touch(mergeObj({
|
|
24916
24955
|
identifier: Date.now(),
|
|
24917
24956
|
target: el,
|
|
24918
24957
|
radiusX: 2.5,
|
|
@@ -24938,8 +24977,8 @@ var getRange = function (start, end, step) {
|
|
|
24938
24977
|
* @private
|
|
24939
24978
|
*/
|
|
24940
24979
|
function tplProcess(tpl, data) {
|
|
24941
|
-
|
|
24942
|
-
for (
|
|
24980
|
+
let res = tpl;
|
|
24981
|
+
for (const x in data) {
|
|
24943
24982
|
res = res.replace(new RegExp("{=" + x + "}", "g"), data[x]);
|
|
24944
24983
|
}
|
|
24945
24984
|
return res;
|
|
@@ -24953,13 +24992,14 @@ function tplProcess(tpl, data) {
|
|
|
24953
24992
|
* @private
|
|
24954
24993
|
*/
|
|
24955
24994
|
function parseDate(date) {
|
|
24956
|
-
|
|
24995
|
+
let parsedDate;
|
|
24957
24996
|
if (date instanceof Date) {
|
|
24958
24997
|
parsedDate = date;
|
|
24959
24998
|
} else if (isString(date)) {
|
|
24960
|
-
var _format$dataTime
|
|
24961
|
-
|
|
24999
|
+
var _format$dataTime;
|
|
25000
|
+
const config = this.config,
|
|
24962
25001
|
format = this.format;
|
|
25002
|
+
|
|
24963
25003
|
// if fails to parse, try by new Date()
|
|
24964
25004
|
// https://github.com/naver/billboard.js/issues/1714
|
|
24965
25005
|
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
@@ -24989,11 +25029,11 @@ function isTabVisible() {
|
|
|
24989
25029
|
* @private
|
|
24990
25030
|
*/
|
|
24991
25031
|
function convertInputType(mouse, touch) {
|
|
24992
|
-
var _this17 = this
|
|
24993
|
-
|
|
25032
|
+
var _this17 = this;
|
|
25033
|
+
const DocumentTouch = win.DocumentTouch,
|
|
24994
25034
|
matchMedia = win.matchMedia,
|
|
24995
|
-
navigator = win.navigator
|
|
24996
|
-
|
|
25035
|
+
navigator = win.navigator;
|
|
25036
|
+
let hasTouch = !1;
|
|
24997
25037
|
if (touch) {
|
|
24998
25038
|
// Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
|
|
24999
25039
|
if (navigator && "maxTouchPoints" in navigator) {
|
|
@@ -25009,7 +25049,7 @@ function convertInputType(mouse, touch) {
|
|
|
25009
25049
|
hasTouch = !0;
|
|
25010
25050
|
} else {
|
|
25011
25051
|
// Only as a last resort, fall back to user agent sniffing
|
|
25012
|
-
|
|
25052
|
+
const UA = navigator.userAgent;
|
|
25013
25053
|
hasTouch = /\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA) || /\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA);
|
|
25014
25054
|
}
|
|
25015
25055
|
}
|
|
@@ -25018,7 +25058,7 @@ function convertInputType(mouse, touch) {
|
|
|
25018
25058
|
// Check if agent has mouse using any-hover, touch devices (e.g iPad) with external mouse will return true as long as mouse is connected
|
|
25019
25059
|
// https://css-tricks.com/interaction-media-features-and-their-potential-for-incorrect-assumptions/#aa-testing-the-capabilities-of-all-inputs
|
|
25020
25060
|
// Demo: https://patrickhlauke.github.io/touch/pointer-hover-any-pointer-any-hover/
|
|
25021
|
-
|
|
25061
|
+
const hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
|
|
25022
25062
|
_newArrowCheck(this, _this17);
|
|
25023
25063
|
return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
|
|
25024
25064
|
}.bind(this));
|
|
@@ -25057,22 +25097,20 @@ function runUntil(fn, conditionFn) {
|
|
|
25057
25097
|
* @private
|
|
25058
25098
|
*/
|
|
25059
25099
|
function loadConfig(config) {
|
|
25060
|
-
var _this = this
|
|
25061
|
-
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25065
|
-
|
|
25066
|
-
|
|
25067
|
-
|
|
25068
|
-
|
|
25069
|
-
|
|
25070
|
-
|
|
25071
|
-
|
|
25072
|
-
|
|
25073
|
-
|
|
25074
|
-
return undefined;
|
|
25075
|
-
}.bind(this);
|
|
25100
|
+
var _this = this;
|
|
25101
|
+
const thisConfig = this.config;
|
|
25102
|
+
let target, keys, read;
|
|
25103
|
+
const _find = function find() {
|
|
25104
|
+
_newArrowCheck(this, _this);
|
|
25105
|
+
const key = keys.shift();
|
|
25106
|
+
if (key && target && isObjectType(target) && key in target) {
|
|
25107
|
+
target = target[key];
|
|
25108
|
+
return _find();
|
|
25109
|
+
} else if (!key) {
|
|
25110
|
+
return target;
|
|
25111
|
+
}
|
|
25112
|
+
return undefined;
|
|
25113
|
+
}.bind(this);
|
|
25076
25114
|
Object.keys(thisConfig).forEach(function (key) {
|
|
25077
25115
|
_newArrowCheck(this, _this);
|
|
25078
25116
|
target = config;
|
|
@@ -25107,7 +25145,7 @@ function loadConfig(config) {
|
|
|
25107
25145
|
* @example
|
|
25108
25146
|
* bb.plugin.stanford.version; // ex) 1.9.0
|
|
25109
25147
|
*/
|
|
25110
|
-
|
|
25148
|
+
let Plugin = /*#__PURE__*/function () {
|
|
25111
25149
|
/**
|
|
25112
25150
|
* Constructor
|
|
25113
25151
|
* @param {Any} options config option object
|
|
@@ -25161,7 +25199,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
25161
25199
|
};
|
|
25162
25200
|
return Plugin;
|
|
25163
25201
|
}();
|
|
25164
|
-
Plugin.version = "3.
|
|
25202
|
+
Plugin.version = "3.10.0-next.2";
|
|
25165
25203
|
|
|
25166
25204
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
|
|
25167
25205
|
/**
|
|
@@ -25176,7 +25214,7 @@ Plugin.version = "3.9.4";
|
|
|
25176
25214
|
* @returns {StanfordOptions}
|
|
25177
25215
|
* @private
|
|
25178
25216
|
*/
|
|
25179
|
-
|
|
25217
|
+
let Options = function () {
|
|
25180
25218
|
return {
|
|
25181
25219
|
/**
|
|
25182
25220
|
* Set the color of the color scale. This function receives a value between 0 and 1, and should return a color.
|
|
@@ -25343,16 +25381,15 @@ function pointInRegion(point, region) {
|
|
|
25343
25381
|
// thanks to: http://bl.ocks.org/bycoffe/5575904
|
|
25344
25382
|
// ray-casting algorithm based on
|
|
25345
25383
|
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
|
25346
|
-
|
|
25384
|
+
const x = point.x,
|
|
25347
25385
|
y = point.value;
|
|
25348
|
-
|
|
25349
|
-
for (
|
|
25350
|
-
|
|
25386
|
+
let inside = !1;
|
|
25387
|
+
for (let i = 0, j = region.length - 1; i < region.length; j = i++) {
|
|
25388
|
+
const xi = region[i].x,
|
|
25351
25389
|
yi = region[i].y,
|
|
25352
25390
|
xj = region[j].x,
|
|
25353
|
-
yj = region[j].y
|
|
25354
|
-
|
|
25355
|
-
if (intersect) {
|
|
25391
|
+
yj = region[j].y;
|
|
25392
|
+
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) {
|
|
25356
25393
|
inside = !inside;
|
|
25357
25394
|
}
|
|
25358
25395
|
}
|
|
@@ -25384,10 +25421,10 @@ function compareEpochs(a, b) {
|
|
|
25384
25421
|
*/
|
|
25385
25422
|
function getRegionArea(points) {
|
|
25386
25423
|
// thanks to: https://stackoverflow.com/questions/16282330/find-centerpoint-of-polygon-in-javascript
|
|
25387
|
-
|
|
25424
|
+
let area = 0,
|
|
25388
25425
|
point1,
|
|
25389
25426
|
point2;
|
|
25390
|
-
for (
|
|
25427
|
+
for (let i = 0, l = points.length, j = l - 1; i < l; j = i, i++) {
|
|
25391
25428
|
point1 = points[i];
|
|
25392
25429
|
point2 = points[j];
|
|
25393
25430
|
area += point1.x * point2.y;
|
|
@@ -25404,12 +25441,12 @@ function getRegionArea(points) {
|
|
|
25404
25441
|
* @private
|
|
25405
25442
|
*/
|
|
25406
25443
|
function getCentroid(points) {
|
|
25407
|
-
|
|
25408
|
-
|
|
25444
|
+
const area = getRegionArea(points);
|
|
25445
|
+
let x = 0,
|
|
25409
25446
|
y = 0,
|
|
25410
25447
|
f;
|
|
25411
|
-
for (
|
|
25412
|
-
|
|
25448
|
+
for (let i = 0, l = points.length, j = l - 1; i < l; j = i, i++) {
|
|
25449
|
+
const point1 = points[i],
|
|
25413
25450
|
point2 = points[j];
|
|
25414
25451
|
f = point1.x * point2.y - point2.x * point1.y;
|
|
25415
25452
|
x += (point1.x + point2.x) * f;
|
|
@@ -25438,66 +25475,71 @@ function getCentroid(points) {
|
|
|
25438
25475
|
* @param {Stanford} owner Stanford instance
|
|
25439
25476
|
* @private
|
|
25440
25477
|
*/
|
|
25441
|
-
|
|
25478
|
+
let Elements = /*#__PURE__*/function () {
|
|
25442
25479
|
function Elements(owner) {
|
|
25443
25480
|
this.owner = void 0;
|
|
25444
25481
|
this.owner = owner;
|
|
25445
25482
|
|
|
25446
25483
|
// MEMO: Avoid blocking eventRect
|
|
25447
|
-
|
|
25484
|
+
const elements = owner.$$.$el.main.select(".bb-chart").append("g").attr("class", stanford_classes.stanfordElements);
|
|
25448
25485
|
elements.append("g").attr("class", stanford_classes.stanfordLines);
|
|
25449
25486
|
elements.append("g").attr("class", stanford_classes.stanfordRegions);
|
|
25450
25487
|
}
|
|
25451
25488
|
var _proto = Elements.prototype;
|
|
25452
25489
|
_proto.updateStanfordLines = function updateStanfordLines(duration) {
|
|
25453
|
-
var _this = this
|
|
25454
|
-
|
|
25490
|
+
var _this = this;
|
|
25491
|
+
const $$ = this.owner.$$,
|
|
25455
25492
|
config = $$.config,
|
|
25456
25493
|
main = $$.$el.main,
|
|
25457
25494
|
isRotated = config.axis_rotated,
|
|
25458
25495
|
xvCustom = this.xvCustom.bind($$),
|
|
25459
25496
|
yvCustom = this.yvCustom.bind($$),
|
|
25460
25497
|
stanfordLine = main.select("." + stanford_classes.stanfordLines).style("shape-rendering", "geometricprecision").selectAll("." + stanford_classes.stanfordLine).data(this.owner.config.lines);
|
|
25498
|
+
|
|
25461
25499
|
// Stanford-Lines
|
|
25462
25500
|
|
|
25463
25501
|
// exit
|
|
25464
25502
|
stanfordLine.exit().transition().duration(duration).style("opacity", "0").remove();
|
|
25465
25503
|
|
|
25466
25504
|
// enter
|
|
25467
|
-
|
|
25505
|
+
const stanfordLineEnter = stanfordLine.enter().append("g");
|
|
25468
25506
|
stanfordLineEnter.append("line").style("opacity", "0");
|
|
25469
25507
|
stanfordLineEnter.merge(stanfordLine).attr("class", function (d) {
|
|
25470
25508
|
_newArrowCheck(this, _this);
|
|
25471
25509
|
return stanford_classes.stanfordLine + (d.class ? " " + d.class : "");
|
|
25472
25510
|
}.bind(this)).select("line").transition().duration(duration).attr("x1", function (d) {
|
|
25473
25511
|
_newArrowCheck(this, _this);
|
|
25474
|
-
|
|
25512
|
+
const v = isRotated ? yvCustom(d, "y1") : xvCustom(d, "x1");
|
|
25513
|
+
return v;
|
|
25475
25514
|
}.bind(this)).attr("x2", function (d) {
|
|
25476
25515
|
_newArrowCheck(this, _this);
|
|
25477
25516
|
return isRotated ? yvCustom(d, "y2") : xvCustom(d, "x2");
|
|
25478
25517
|
}.bind(this)).attr("y1", function (d) {
|
|
25479
25518
|
_newArrowCheck(this, _this);
|
|
25480
|
-
|
|
25519
|
+
const v = isRotated ? xvCustom(d, "x1") : yvCustom(d, "y1");
|
|
25520
|
+
return v;
|
|
25481
25521
|
}.bind(this)).attr("y2", function (d) {
|
|
25482
25522
|
_newArrowCheck(this, _this);
|
|
25483
25523
|
return isRotated ? xvCustom(d, "x2") : yvCustom(d, "y2");
|
|
25484
25524
|
}.bind(this)).transition().style("opacity", null);
|
|
25485
25525
|
};
|
|
25486
25526
|
_proto.updateStanfordRegions = function updateStanfordRegions(duration) {
|
|
25487
|
-
var _this2 = this
|
|
25488
|
-
|
|
25527
|
+
var _this2 = this;
|
|
25528
|
+
const $$ = this.owner.$$,
|
|
25489
25529
|
config = $$.config,
|
|
25490
25530
|
main = $$.$el.main,
|
|
25491
25531
|
isRotated = config.axis_rotated,
|
|
25492
25532
|
xvCustom = this.xvCustom.bind($$),
|
|
25493
25533
|
yvCustom = this.yvCustom.bind($$),
|
|
25494
|
-
countPointsInRegion = this.owner.countEpochsInRegion.bind($$)
|
|
25495
|
-
|
|
25534
|
+
countPointsInRegion = this.owner.countEpochsInRegion.bind($$);
|
|
25535
|
+
// Stanford-Regions
|
|
25536
|
+
let stanfordRegion = main.select("." + stanford_classes.stanfordRegions).selectAll("." + stanford_classes.stanfordRegion).data(this.owner.config.regions);
|
|
25537
|
+
|
|
25496
25538
|
// exit
|
|
25497
25539
|
stanfordRegion.exit().transition().duration(duration).style("opacity", "0").remove();
|
|
25498
25540
|
|
|
25499
25541
|
// enter
|
|
25500
|
-
|
|
25542
|
+
const stanfordRegionEnter = stanfordRegion.enter().append("g");
|
|
25501
25543
|
stanfordRegionEnter.append("polygon").style("opacity", "0");
|
|
25502
25544
|
stanfordRegionEnter.append("text").attr("transform", isRotated ? "rotate(-90)" : "").style("opacity", "0");
|
|
25503
25545
|
stanfordRegion = stanfordRegionEnter.merge(stanfordRegion);
|
|
@@ -25526,7 +25568,7 @@ var Elements = /*#__PURE__*/function () {
|
|
|
25526
25568
|
}.bind(this)).text(function (d) {
|
|
25527
25569
|
_newArrowCheck(this, _this2);
|
|
25528
25570
|
if (d.text) {
|
|
25529
|
-
|
|
25571
|
+
const _countPointsInRegion = countPointsInRegion(d.points),
|
|
25530
25572
|
value = _countPointsInRegion.value,
|
|
25531
25573
|
percentage = _countPointsInRegion.percentage;
|
|
25532
25574
|
return d.text(value, percentage);
|
|
@@ -25542,10 +25584,10 @@ var Elements = /*#__PURE__*/function () {
|
|
|
25542
25584
|
this.updateStanfordRegions(duration);
|
|
25543
25585
|
};
|
|
25544
25586
|
_proto.xvCustom = function xvCustom(d, xyValue) {
|
|
25545
|
-
|
|
25587
|
+
const $$ = this,
|
|
25546
25588
|
axis = $$.axis,
|
|
25547
25589
|
config = $$.config;
|
|
25548
|
-
|
|
25590
|
+
let value = xyValue ? d[xyValue] : $$.getBaseValue(d);
|
|
25549
25591
|
if (axis.isTimeSeries()) {
|
|
25550
25592
|
value = parseDate.call($$, value);
|
|
25551
25593
|
} else if (axis.isCategorized() && isString(value)) {
|
|
@@ -25554,7 +25596,7 @@ var Elements = /*#__PURE__*/function () {
|
|
|
25554
25596
|
return Math.ceil($$.scale.x(value));
|
|
25555
25597
|
};
|
|
25556
25598
|
_proto.yvCustom = function yvCustom(d, xyValue) {
|
|
25557
|
-
|
|
25599
|
+
const $$ = this,
|
|
25558
25600
|
yScale = d.axis && d.axis === "y2" ? $$.scale.y2 : $$.scale.y,
|
|
25559
25601
|
value = xyValue ? d[xyValue] : $$.getBaseValue(d);
|
|
25560
25602
|
return Math.ceil(yScale(value));
|
|
@@ -25716,7 +25758,7 @@ function axisLeft(scale) {
|
|
|
25716
25758
|
* @param {Stanford} owner Stanford instance
|
|
25717
25759
|
* @private
|
|
25718
25760
|
*/
|
|
25719
|
-
|
|
25761
|
+
let ColorScale = /*#__PURE__*/function () {
|
|
25720
25762
|
function ColorScale(owner) {
|
|
25721
25763
|
this.owner = void 0;
|
|
25722
25764
|
this.colorScale = void 0;
|
|
@@ -25724,8 +25766,8 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
25724
25766
|
}
|
|
25725
25767
|
var _proto = ColorScale.prototype;
|
|
25726
25768
|
_proto.drawColorScale = function drawColorScale() {
|
|
25727
|
-
var _this = this
|
|
25728
|
-
|
|
25769
|
+
var _this = this;
|
|
25770
|
+
const _this$owner = this.owner,
|
|
25729
25771
|
$$ = _this$owner.$$,
|
|
25730
25772
|
config = _this$owner.config,
|
|
25731
25773
|
target = $$.data.targets[0],
|
|
@@ -25746,7 +25788,7 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
25746
25788
|
}.bind(this));
|
|
25747
25789
|
|
|
25748
25790
|
// Legend Axis
|
|
25749
|
-
|
|
25791
|
+
const axisScale = symlog().domain([target.minEpochs, target.maxEpochs]).range([points[0] + config.padding_top + points[points.length - 1] + 5 - 1, points[0] + config.padding_top]),
|
|
25750
25792
|
legendAxis = axisRight(axisScale),
|
|
25751
25793
|
scaleFormat = config.scale_format;
|
|
25752
25794
|
if (scaleFormat === "pow10") {
|
|
@@ -25758,7 +25800,7 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
25758
25800
|
}
|
|
25759
25801
|
|
|
25760
25802
|
// Draw Axis
|
|
25761
|
-
|
|
25803
|
+
const axis = this.colorScale.append("g").attr("class", "legend axis").attr("transform", "translate(" + barWidth + ",0)").call(legendAxis);
|
|
25762
25804
|
if (scaleFormat === "pow10") {
|
|
25763
25805
|
axis.selectAll(".tick text").text(null).filter(function (d) {
|
|
25764
25806
|
_newArrowCheck(this, _this);
|
|
@@ -25886,7 +25928,7 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
25886
25928
|
* ]
|
|
25887
25929
|
* })
|
|
25888
25930
|
*/
|
|
25889
|
-
|
|
25931
|
+
let Stanford = /*#__PURE__*/function (_Plugin) {
|
|
25890
25932
|
_inheritsLoose(Stanford, _Plugin);
|
|
25891
25933
|
function Stanford(options) {
|
|
25892
25934
|
var _this = _Plugin.call(this, options) || this;
|
|
@@ -25898,8 +25940,9 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
25898
25940
|
}
|
|
25899
25941
|
var _proto = Stanford.prototype;
|
|
25900
25942
|
_proto.$beforeInit = function $beforeInit() {
|
|
25901
|
-
var _this2 = this
|
|
25902
|
-
|
|
25943
|
+
var _this2 = this;
|
|
25944
|
+
const $$ = this.$$;
|
|
25945
|
+
|
|
25903
25946
|
// override on config values & methods
|
|
25904
25947
|
$$.config.data_xSort = !1;
|
|
25905
25948
|
$$.isMultipleX = function () {
|
|
@@ -25917,14 +25960,14 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
25917
25960
|
_newArrowCheck(this, _this2);
|
|
25918
25961
|
return 1;
|
|
25919
25962
|
}.bind(this);
|
|
25920
|
-
|
|
25963
|
+
const getCurrentPaddingRight = $$.getCurrentPaddingRight.bind($$);
|
|
25921
25964
|
$$.getCurrentPaddingRight = function () {
|
|
25922
25965
|
_newArrowCheck(this, _this2);
|
|
25923
25966
|
return getCurrentPaddingRight() + (this.colorScale ? this.colorScale.getColorScalePadding() : 0);
|
|
25924
25967
|
}.bind(this);
|
|
25925
25968
|
};
|
|
25926
25969
|
_proto.$init = function $init() {
|
|
25927
|
-
|
|
25970
|
+
const $$ = this.$$;
|
|
25928
25971
|
loadConfig.call(this, this.options);
|
|
25929
25972
|
$$.color = this.getStanfordPointColor.bind($$);
|
|
25930
25973
|
this.colorScale = new ColorScale(this);
|
|
@@ -25944,8 +25987,8 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
25944
25987
|
return new Options();
|
|
25945
25988
|
};
|
|
25946
25989
|
_proto.convertData = function convertData() {
|
|
25947
|
-
var _this3 = this
|
|
25948
|
-
|
|
25990
|
+
var _this3 = this;
|
|
25991
|
+
const data = this.$$.data.targets,
|
|
25949
25992
|
epochs = this.options.epochs;
|
|
25950
25993
|
data.forEach(function (d) {
|
|
25951
25994
|
var _this4 = this;
|
|
@@ -25960,35 +26003,16 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
25960
26003
|
d.colorscale = undefined;
|
|
25961
26004
|
}.bind(this));
|
|
25962
26005
|
};
|
|
25963
|
-
_proto.xvCustom = function xvCustom(d, xyValue) {
|
|
25964
|
-
var $$ = this,
|
|
25965
|
-
axis = $$.axis,
|
|
25966
|
-
config = $$.config;
|
|
25967
|
-
var value = xyValue ? d[xyValue] : $$.getBaseValue(d);
|
|
25968
|
-
if (axis.isTimeSeries()) {
|
|
25969
|
-
value = parseDate.call($$, value);
|
|
25970
|
-
} else if (axis.isCategorized() && isString(value)) {
|
|
25971
|
-
value = config.axis_x_categories.indexOf(d.value);
|
|
25972
|
-
}
|
|
25973
|
-
return Math.ceil($$.scale.x(value));
|
|
25974
|
-
};
|
|
25975
|
-
_proto.yvCustom = function yvCustom(d, xyValue) {
|
|
25976
|
-
var $$ = this,
|
|
25977
|
-
scale = $$.scale,
|
|
25978
|
-
yScale = d.axis && d.axis === "y2" ? scale.y2 : scale.y,
|
|
25979
|
-
value = xyValue ? d[xyValue] : $$.getBaseValue(d);
|
|
25980
|
-
return Math.ceil(yScale(value));
|
|
25981
|
-
};
|
|
25982
26006
|
_proto.initStanfordData = function initStanfordData() {
|
|
25983
|
-
var _this5 = this
|
|
25984
|
-
|
|
26007
|
+
var _this5 = this;
|
|
26008
|
+
const config = this.config,
|
|
25985
26009
|
target = this.$$.data.targets[0];
|
|
25986
26010
|
// TODO STANFORD see if (data.js -> orderTargets)+ can be used instead
|
|
25987
26011
|
// Make larger values appear on top
|
|
25988
26012
|
target.values.sort(compareEpochs);
|
|
25989
26013
|
|
|
25990
26014
|
// Get array of epochs
|
|
25991
|
-
|
|
26015
|
+
const epochs = target.values.map(function (a) {
|
|
25992
26016
|
_newArrowCheck(this, _this5);
|
|
25993
26017
|
return a.epochs;
|
|
25994
26018
|
}.bind(this));
|
|
@@ -25998,19 +26022,19 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
25998
26022
|
target.colorscale = sequentialLog(target.colors).domain([target.minEpochs, target.maxEpochs]);
|
|
25999
26023
|
};
|
|
26000
26024
|
_proto.getStanfordPointColor = function getStanfordPointColor(d) {
|
|
26001
|
-
|
|
26025
|
+
const target = this.data.targets[0];
|
|
26002
26026
|
return target.colorscale(d.epochs);
|
|
26003
26027
|
};
|
|
26004
26028
|
_proto.setStanfordTooltip = function setStanfordTooltip() {
|
|
26005
|
-
|
|
26029
|
+
const config = this.$$.config;
|
|
26006
26030
|
if (isEmpty(config.tooltip_contents)) {
|
|
26007
26031
|
config.tooltip_contents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
26008
|
-
var _this6 = this
|
|
26009
|
-
|
|
26010
|
-
|
|
26032
|
+
var _this6 = this;
|
|
26033
|
+
const data_x = config.data_x;
|
|
26034
|
+
let html = "<table class=\"" + $TOOLTIP.tooltip + "\"><tbody>";
|
|
26011
26035
|
d.forEach(function (v) {
|
|
26012
26036
|
_newArrowCheck(this, _this6);
|
|
26013
|
-
|
|
26037
|
+
const _v$id = v.id,
|
|
26014
26038
|
id = _v$id === void 0 ? "" : _v$id,
|
|
26015
26039
|
_v$value = v.value,
|
|
26016
26040
|
value = _v$value === void 0 ? 0 : _v$value,
|
|
@@ -26025,8 +26049,8 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
26025
26049
|
}
|
|
26026
26050
|
};
|
|
26027
26051
|
_proto.countEpochsInRegion = function countEpochsInRegion(region) {
|
|
26028
|
-
var _this7 = this
|
|
26029
|
-
|
|
26052
|
+
var _this7 = this;
|
|
26053
|
+
const $$ = this,
|
|
26030
26054
|
target = $$.data.targets[0],
|
|
26031
26055
|
total = target.values.reduce(function (accumulator, currentValue) {
|
|
26032
26056
|
_newArrowCheck(this, _this7);
|