billboard.js 3.14.2 → 3.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +7 -6
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +3 -3
- package/dist/billboard.pkgd.js +7 -6
- package/dist/billboard.pkgd.min.js +17 -17
- 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 +2 -2
- 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 +2 -2
- 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.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- 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/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +377 -376
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +4 -4
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +13 -13
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +10 -10
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +8 -8
- package/package.json +29 -29
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/interactions/interaction.ts +1 -1
- package/src/config/Options/shape/gauge.ts +3 -2
- package/types/options.shape.d.ts +3 -2
package/dist-esm/billboard.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.14.
|
|
8
|
+
* @version 3.14.3
|
|
9
9
|
*/
|
|
10
10
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
11
11
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
@@ -2174,10 +2174,10 @@ function getGlobal() {
|
|
|
2174
2174
|
* @private
|
|
2175
2175
|
*/
|
|
2176
2176
|
function getFallback(w) {
|
|
2177
|
-
var hasRAF = typeof (w === null || w ===
|
|
2178
|
-
typeof (w === null || w ===
|
|
2179
|
-
var hasRIC = typeof (w === null || w ===
|
|
2180
|
-
typeof (w === null || w ===
|
|
2177
|
+
var hasRAF = typeof (w === null || w === undefined ? undefined : w.requestAnimationFrame) === "function" &&
|
|
2178
|
+
typeof (w === null || w === undefined ? undefined : w.cancelAnimationFrame) === "function";
|
|
2179
|
+
var hasRIC = typeof (w === null || w === undefined ? undefined : w.requestIdleCallback) === "function" &&
|
|
2180
|
+
typeof (w === null || w === undefined ? undefined : w.cancelIdleCallback) === "function";
|
|
2181
2181
|
var request = function (cb) { return setTimeout(cb, 1); };
|
|
2182
2182
|
var cancel = function (id) { return clearTimeout(id); };
|
|
2183
2183
|
return [
|
|
@@ -2188,7 +2188,7 @@ function getFallback(w) {
|
|
|
2188
2188
|
];
|
|
2189
2189
|
}
|
|
2190
2190
|
var win = getGlobal();
|
|
2191
|
-
var doc = win === null || win ===
|
|
2191
|
+
var doc = win === null || win === undefined ? undefined : win.document;
|
|
2192
2192
|
var _a = getFallback(win), requestAnimationFrame = _a[0], requestIdleCallback = _a[2];
|
|
2193
2193
|
|
|
2194
2194
|
var isValue = function (v) { return v || v === 0; };
|
|
@@ -2220,7 +2220,7 @@ var isArray = function (arr) { return Array.isArray(arr); };
|
|
|
2220
2220
|
* @returns {boolean}
|
|
2221
2221
|
* @private
|
|
2222
2222
|
*/
|
|
2223
|
-
var isObject = function (obj) { return obj && !(obj === null || obj ===
|
|
2223
|
+
var isObject = function (obj) { return obj && !(obj === null || obj === undefined ? undefined : obj.nodeType) && isObjectType(obj) && !isArray(obj); };
|
|
2224
2224
|
/**
|
|
2225
2225
|
* Get specified key value from object
|
|
2226
2226
|
* If default value is given, will return if given key value not found
|
|
@@ -2308,8 +2308,8 @@ function sanitize(str) {
|
|
|
2308
2308
|
* @private
|
|
2309
2309
|
*/
|
|
2310
2310
|
function setTextValue(node, text, dy, toMiddle) {
|
|
2311
|
-
if (dy ===
|
|
2312
|
-
if (toMiddle ===
|
|
2311
|
+
if (dy === undefined) { dy = [-1, 1]; }
|
|
2312
|
+
if (toMiddle === undefined) { toMiddle = false; }
|
|
2313
2313
|
if (!node || !isString(text)) {
|
|
2314
2314
|
return;
|
|
2315
2315
|
}
|
|
@@ -2382,7 +2382,7 @@ function getPathBox(path) {
|
|
|
2382
2382
|
function getPointer(event, element) {
|
|
2383
2383
|
var _a;
|
|
2384
2384
|
var touches = event &&
|
|
2385
|
-
((_a = (event.touches || (event.sourceEvent && event.sourceEvent.touches))) === null || _a ===
|
|
2385
|
+
((_a = (event.touches || (event.sourceEvent && event.sourceEvent.touches))) === null || _a === undefined ? undefined : _a[0]);
|
|
2386
2386
|
var pointer$1 = [0, 0];
|
|
2387
2387
|
try {
|
|
2388
2388
|
pointer$1 = pointer(touches || event, element);
|
|
@@ -2431,9 +2431,9 @@ function getBoundingRect(node) {
|
|
|
2431
2431
|
* @private
|
|
2432
2432
|
*/
|
|
2433
2433
|
function getRandom(asStr, min, max) {
|
|
2434
|
-
if (asStr ===
|
|
2435
|
-
if (min ===
|
|
2436
|
-
if (max ===
|
|
2434
|
+
if (asStr === undefined) { asStr = true; }
|
|
2435
|
+
if (min === undefined) { min = 0; }
|
|
2436
|
+
if (max === undefined) { max = 10000; }
|
|
2437
2437
|
var crpt = win.crypto || win.msCrypto;
|
|
2438
2438
|
var rand = crpt ?
|
|
2439
2439
|
min + crpt.getRandomValues(new Uint32Array(1))[0] % (max - min + 1) :
|
|
@@ -2455,7 +2455,7 @@ function findIndex(arr, v, start, end, isRotated) {
|
|
|
2455
2455
|
return -1;
|
|
2456
2456
|
}
|
|
2457
2457
|
var mid = Math.floor((start + end) / 2);
|
|
2458
|
-
var _a = arr[mid], x = _a.x, _b = _a.w, w = _b ===
|
|
2458
|
+
var _a = arr[mid], x = _a.x, _b = _a.w, w = _b === undefined ? 0 : _b;
|
|
2459
2459
|
if (isRotated) {
|
|
2460
2460
|
x = arr[mid].y;
|
|
2461
2461
|
w = arr[mid].h;
|
|
@@ -2515,7 +2515,7 @@ function deepClone() {
|
|
|
2515
2515
|
* @private
|
|
2516
2516
|
*/
|
|
2517
2517
|
function extend(target, source) {
|
|
2518
|
-
if (target ===
|
|
2518
|
+
if (target === undefined) { target = {}; }
|
|
2519
2519
|
if (isArray(source)) {
|
|
2520
2520
|
source.forEach(function (v) { return extend(target, v); });
|
|
2521
2521
|
}
|
|
@@ -2543,7 +2543,7 @@ var capitalize = function (str) { return str.charAt(0).toUpperCase() + str.slice
|
|
|
2543
2543
|
* @private
|
|
2544
2544
|
*/
|
|
2545
2545
|
function camelize(str, separator) {
|
|
2546
|
-
if (separator ===
|
|
2546
|
+
if (separator === undefined) { separator = "-"; }
|
|
2547
2547
|
return str.split(separator)
|
|
2548
2548
|
.map(function (v, i) { return (i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase()); })
|
|
2549
2549
|
.join("");
|
|
@@ -2564,7 +2564,7 @@ var toArray = function (v) { return [].slice.call(v); };
|
|
|
2564
2564
|
* @private
|
|
2565
2565
|
*/
|
|
2566
2566
|
function addCssRules(style, selector, prop) {
|
|
2567
|
-
var _a = style.rootSelector, rootSelector = _a ===
|
|
2567
|
+
var _a = style.rootSelector, rootSelector = _a === undefined ? "" : _a, sheet = style.sheet;
|
|
2568
2568
|
var getSelector = function (s) {
|
|
2569
2569
|
return s
|
|
2570
2570
|
.replace(/\s?(bb-)/g, ".$1")
|
|
@@ -2589,7 +2589,7 @@ function getCssRules(styleSheets) {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
}
|
|
2591
2591
|
catch (e) {
|
|
2592
|
-
(_a = win.console) === null || _a ===
|
|
2592
|
+
(_a = win.console) === null || _a === undefined ? undefined : _a.warn("Error while reading rules from ".concat(sheet.href, ": ").concat(e.toString()));
|
|
2593
2593
|
}
|
|
2594
2594
|
});
|
|
2595
2595
|
return rules;
|
|
@@ -2603,8 +2603,8 @@ function getCssRules(styleSheets) {
|
|
|
2603
2603
|
function getScrollPosition(node) {
|
|
2604
2604
|
var _a, _b, _c, _d, _e, _f;
|
|
2605
2605
|
return {
|
|
2606
|
-
x: ((_b = (_a = win.pageXOffset) !== null && _a !==
|
|
2607
|
-
y: ((_e = (_d = win.pageYOffset) !== null && _d !==
|
|
2606
|
+
x: ((_b = (_a = win.pageXOffset) !== null && _a !== undefined ? _a : win.scrollX) !== null && _b !== undefined ? _b : 0) + ((_c = node.scrollLeft) !== null && _c !== undefined ? _c : 0),
|
|
2607
|
+
y: ((_e = (_d = win.pageYOffset) !== null && _d !== undefined ? _d : win.scrollY) !== null && _e !== undefined ? _e : 0) + ((_f = node.scrollTop) !== null && _f !== undefined ? _f : 0)
|
|
2608
2608
|
};
|
|
2609
2609
|
}
|
|
2610
2610
|
/**
|
|
@@ -2616,12 +2616,12 @@ function getScrollPosition(node) {
|
|
|
2616
2616
|
* @returns {object}
|
|
2617
2617
|
*/
|
|
2618
2618
|
function getTransformCTM(node, x, y, inverse) {
|
|
2619
|
-
if (x ===
|
|
2620
|
-
if (y ===
|
|
2621
|
-
if (inverse ===
|
|
2619
|
+
if (x === undefined) { x = 0; }
|
|
2620
|
+
if (y === undefined) { y = 0; }
|
|
2621
|
+
if (inverse === undefined) { inverse = true; }
|
|
2622
2622
|
var point = new DOMPoint(x, y);
|
|
2623
2623
|
var screen = node.getScreenCTM();
|
|
2624
|
-
var res = point.matrixTransform(inverse ? screen === null || screen ===
|
|
2624
|
+
var res = point.matrixTransform(inverse ? screen === null || screen === undefined ? undefined : screen.inverse() : screen);
|
|
2625
2625
|
if (inverse === false) {
|
|
2626
2626
|
var rect = node.getBoundingClientRect();
|
|
2627
2627
|
res.x -= rect.x;
|
|
@@ -2691,7 +2691,7 @@ function mergeObj(target) {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
});
|
|
2693
2693
|
}
|
|
2694
|
-
return mergeObj.apply(
|
|
2694
|
+
return mergeObj.apply(undefined, __spreadArray([target], objectN, false));
|
|
2695
2695
|
}
|
|
2696
2696
|
/**
|
|
2697
2697
|
* Sort value
|
|
@@ -2701,7 +2701,7 @@ function mergeObj(target) {
|
|
|
2701
2701
|
* @private
|
|
2702
2702
|
*/
|
|
2703
2703
|
function sortValue(data, isAsc) {
|
|
2704
|
-
if (isAsc ===
|
|
2704
|
+
if (isAsc === undefined) { isAsc = true; }
|
|
2705
2705
|
var fn;
|
|
2706
2706
|
if (data[0] instanceof Date) {
|
|
2707
2707
|
fn = isAsc ? function (a, b) { return a - b; } : function (a, b) { return b - a; };
|
|
@@ -2747,7 +2747,7 @@ function getMinMax$1(type, data) {
|
|
|
2747
2747
|
* @private
|
|
2748
2748
|
*/
|
|
2749
2749
|
var getRange = function (start, end, step) {
|
|
2750
|
-
if (step ===
|
|
2750
|
+
if (step === undefined) { step = 1; }
|
|
2751
2751
|
var res = [];
|
|
2752
2752
|
var n = Math.max(0, Math.ceil((end - start) / step)) | 0;
|
|
2753
2753
|
for (var i = start; i < n; i++) {
|
|
@@ -2777,7 +2777,7 @@ var emulateEvent = {
|
|
|
2777
2777
|
catch (_a) {
|
|
2778
2778
|
// Polyfills DOM4 MouseEvent
|
|
2779
2779
|
return function (el, eventType, params) {
|
|
2780
|
-
if (params ===
|
|
2780
|
+
if (params === undefined) { params = getParams(); }
|
|
2781
2781
|
var mouseEvent = doc.createEvent("MouseEvent");
|
|
2782
2782
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
|
|
2783
2783
|
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
|
|
@@ -2836,7 +2836,7 @@ function parseDate(date) {
|
|
|
2836
2836
|
var _b = this, config = _b.config, format = _b.format;
|
|
2837
2837
|
// if fails to parse, try by new Date()
|
|
2838
2838
|
// https://github.com/naver/billboard.js/issues/1714
|
|
2839
|
-
parsedDate = (_a = format.dataTime(config.data_xFormat)(date)) !== null && _a !==
|
|
2839
|
+
parsedDate = (_a = format.dataTime(config.data_xFormat)(date)) !== null && _a !== undefined ? _a : new Date(date);
|
|
2840
2840
|
}
|
|
2841
2841
|
else if (isNumber(date) && !isNaN(date)) {
|
|
2842
2842
|
parsedDate = new Date(+date);
|
|
@@ -2864,7 +2864,7 @@ function hasViewBox(svg) {
|
|
|
2864
2864
|
* @returns {boolean}
|
|
2865
2865
|
*/
|
|
2866
2866
|
function hasStyle(node, condition, all) {
|
|
2867
|
-
if (all ===
|
|
2867
|
+
if (all === undefined) { all = false; }
|
|
2868
2868
|
var isD3Node = !!node.node;
|
|
2869
2869
|
var has = false;
|
|
2870
2870
|
for (var _i = 0, _a = Object.entries(condition); _i < _a.length; _i++) {
|
|
@@ -2882,7 +2882,7 @@ function hasStyle(node, condition, all) {
|
|
|
2882
2882
|
* @private
|
|
2883
2883
|
*/
|
|
2884
2884
|
function isTabVisible() {
|
|
2885
|
-
return (doc === null || doc ===
|
|
2885
|
+
return (doc === null || doc === undefined ? undefined : doc.hidden) === false || (doc === null || doc === undefined ? undefined : doc.visibilityState) === "visible";
|
|
2886
2886
|
}
|
|
2887
2887
|
/**
|
|
2888
2888
|
* Get the current input type
|
|
@@ -2894,7 +2894,7 @@ function isTabVisible() {
|
|
|
2894
2894
|
function convertInputType(mouse, touch) {
|
|
2895
2895
|
var DocumentTouch = win.DocumentTouch, matchMedia = win.matchMedia, navigator = win.navigator;
|
|
2896
2896
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer#coarse
|
|
2897
|
-
var hasPointerCoarse = matchMedia === null || matchMedia ===
|
|
2897
|
+
var hasPointerCoarse = matchMedia === null || matchMedia === undefined ? undefined : matchMedia("(pointer:coarse)").matches;
|
|
2898
2898
|
var hasTouch = false;
|
|
2899
2899
|
if (touch) {
|
|
2900
2900
|
// Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
|
|
@@ -2921,7 +2921,7 @@ function convertInputType(mouse, touch) {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
// For non-touch device, media feature condition is: '(pointer:coarse) = false' and '(pointer:fine) = true'
|
|
2923
2923
|
// https://github.com/naver/billboard.js/issues/3854#issuecomment-2404183158
|
|
2924
|
-
var hasMouse = mouse && !hasPointerCoarse && (matchMedia === null || matchMedia ===
|
|
2924
|
+
var hasMouse = mouse && !hasPointerCoarse && (matchMedia === null || matchMedia === undefined ? undefined : matchMedia("(pointer:fine)").matches);
|
|
2925
2925
|
// fallback to 'mouse' if no input type is detected.
|
|
2926
2926
|
return (hasMouse && "mouse") || (hasTouch && "touch") || "mouse";
|
|
2927
2927
|
}
|
|
@@ -3231,7 +3231,7 @@ var Cache = /** @class */ (function () {
|
|
|
3231
3231
|
* @private
|
|
3232
3232
|
*/
|
|
3233
3233
|
Cache.prototype.add = function (key, value, isDataType) {
|
|
3234
|
-
if (isDataType ===
|
|
3234
|
+
if (isDataType === undefined) { isDataType = false; }
|
|
3235
3235
|
this.cache[key] = isDataType ? this.cloneTarget(value) : value;
|
|
3236
3236
|
return this.cache[key];
|
|
3237
3237
|
};
|
|
@@ -3253,11 +3253,11 @@ var Cache = /** @class */ (function () {
|
|
|
3253
3253
|
* @private
|
|
3254
3254
|
*/
|
|
3255
3255
|
Cache.prototype.get = function (key, isDataType) {
|
|
3256
|
-
if (isDataType ===
|
|
3256
|
+
if (isDataType === undefined) { isDataType = false; }
|
|
3257
3257
|
// when is isDataType, key should be string array
|
|
3258
3258
|
if (isDataType && Array.isArray(key)) {
|
|
3259
3259
|
var targets = [];
|
|
3260
|
-
for (var i = 0, id =
|
|
3260
|
+
for (var i = 0, id = undefined; (id = key[i]); i++) {
|
|
3261
3261
|
if (id in this.cache) {
|
|
3262
3262
|
targets.push(this.cloneTarget(this.cache[id]));
|
|
3263
3263
|
}
|
|
@@ -3437,7 +3437,7 @@ function checkModuleImport(ctx) {
|
|
|
3437
3437
|
function logError(head, tail, info) {
|
|
3438
3438
|
var _a;
|
|
3439
3439
|
var prefix = "[billboard.js]";
|
|
3440
|
-
var hasConsole = (_a = win.console) === null || _a ===
|
|
3440
|
+
var hasConsole = (_a = win.console) === null || _a === undefined ? undefined : _a.error;
|
|
3441
3441
|
if (hasConsole) {
|
|
3442
3442
|
var tailMsg = ["background:red;color:white;display:block;font-size:15px", tail] ;
|
|
3443
3443
|
console.error.apply(console, __spreadArray(["\u274C ".concat(prefix, " ").concat(head), "background:red;color:white;display:block;font-size:15px"], tailMsg, false));
|
|
@@ -3497,8 +3497,8 @@ function generateWait() {
|
|
|
3497
3497
|
function loop() {
|
|
3498
3498
|
var _a;
|
|
3499
3499
|
var done = 0;
|
|
3500
|
-
for (var i = 0, t =
|
|
3501
|
-
if (t === true || ((_a = t.empty) === null || _a ===
|
|
3500
|
+
for (var i = 0, t = undefined; (t = transitionsToWait[i]); i++) {
|
|
3501
|
+
if (t === true || ((_a = t.empty) === null || _a === undefined ? undefined : _a.call(t))) {
|
|
3502
3502
|
done++;
|
|
3503
3503
|
continue;
|
|
3504
3504
|
}
|
|
@@ -3517,7 +3517,7 @@ function generateWait() {
|
|
|
3517
3517
|
return done === transitionsToWait.length;
|
|
3518
3518
|
}
|
|
3519
3519
|
runUntil(function () {
|
|
3520
|
-
callback === null || callback ===
|
|
3520
|
+
callback === null || callback === undefined ? undefined : callback();
|
|
3521
3521
|
}, loop);
|
|
3522
3522
|
};
|
|
3523
3523
|
f.add = function (t) {
|
|
@@ -3546,7 +3546,7 @@ function getObjectURL(fn, depsFn) {
|
|
|
3546
3546
|
if (!(key in blob)) {
|
|
3547
3547
|
// Web Worker body
|
|
3548
3548
|
blob[key] = new win.Blob([
|
|
3549
|
-
"".concat((_a = depsFn === null || depsFn ===
|
|
3549
|
+
"".concat((_a = depsFn === null || depsFn === undefined ? undefined : depsFn.map(String).join(";")) !== null && _a !== undefined ? _a : "", "\n\n\t\t\tself.onmessage=function({data}) {\n\t\t\t\tconst result = (").concat(fnString, ").apply(null, data);\n\t\t\t\tself.postMessage(result);\n\t\t\t};")
|
|
3550
3550
|
], {
|
|
3551
3551
|
type: "text/javascript"
|
|
3552
3552
|
});
|
|
@@ -3592,13 +3592,13 @@ function getWorker(src) {
|
|
|
3592
3592
|
* @private
|
|
3593
3593
|
*/
|
|
3594
3594
|
function runWorker(useWorker, fn, callback, depsFn) {
|
|
3595
|
-
if (useWorker ===
|
|
3595
|
+
if (useWorker === undefined) { useWorker = true; }
|
|
3596
3596
|
var runFn = function () {
|
|
3597
3597
|
var args = [];
|
|
3598
3598
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3599
3599
|
args[_i] = arguments[_i];
|
|
3600
3600
|
}
|
|
3601
|
-
var res = fn.apply(
|
|
3601
|
+
var res = fn.apply(undefined, args);
|
|
3602
3602
|
callback(res);
|
|
3603
3603
|
};
|
|
3604
3604
|
if (win.Worker && useWorker) {
|
|
@@ -3730,7 +3730,7 @@ function json(json, keysParam) {
|
|
|
3730
3730
|
Object.keys(json).forEach(function (key) {
|
|
3731
3731
|
var _a;
|
|
3732
3732
|
var tmp = json[key].concat();
|
|
3733
|
-
(_a = tmp.unshift) === null || _a ===
|
|
3733
|
+
(_a = tmp.unshift) === null || _a === undefined ? undefined : _a.call(tmp, key);
|
|
3734
3734
|
newRows.push(tmp);
|
|
3735
3735
|
});
|
|
3736
3736
|
data = columns(newRows);
|
|
@@ -3748,7 +3748,7 @@ function json(json, keysParam) {
|
|
|
3748
3748
|
* @private
|
|
3749
3749
|
*/
|
|
3750
3750
|
function url(url, mimeType, headers, keys, done) {
|
|
3751
|
-
if (mimeType ===
|
|
3751
|
+
if (mimeType === undefined) { mimeType = "csv"; }
|
|
3752
3752
|
var req = new XMLHttpRequest();
|
|
3753
3753
|
var converter = { csv: csv, tsv: tsv, json: json };
|
|
3754
3754
|
req.open("GET", url);
|
|
@@ -3816,8 +3816,8 @@ function tsv(tsv) {
|
|
|
3816
3816
|
* @private
|
|
3817
3817
|
*/
|
|
3818
3818
|
function getDataKeyForJson(keysParam, config) {
|
|
3819
|
-
var keys = keysParam || (config === null || config ===
|
|
3820
|
-
if (keys === null || keys ===
|
|
3819
|
+
var keys = keysParam || (config === null || config === undefined ? undefined : config.data_keys);
|
|
3820
|
+
if (keys === null || keys === undefined ? undefined : keys.x) {
|
|
3821
3821
|
config.data_x = keys.x;
|
|
3822
3822
|
}
|
|
3823
3823
|
return keys;
|
|
@@ -3975,7 +3975,7 @@ var dataConvert = {
|
|
|
3975
3975
|
// indexing each value
|
|
3976
3976
|
t.values.forEach(function (v, i) { return (v.index = i); });
|
|
3977
3977
|
// this needs to be sorted because its index and value.index is identical
|
|
3978
|
-
(_a = $$.data.xs[t.id]) === null || _a ===
|
|
3978
|
+
(_a = $$.data.xs[t.id]) === null || _a === undefined ? undefined : _a.sort(function (v1, v2) { return v1 - v2; });
|
|
3979
3979
|
});
|
|
3980
3980
|
// cache information about values
|
|
3981
3981
|
state.hasNegativeValue = $$.hasNegativeValueInTargets(targets);
|
|
@@ -4102,7 +4102,7 @@ var data$1 = {
|
|
|
4102
4102
|
* @private
|
|
4103
4103
|
*/
|
|
4104
4104
|
getAllValuesOnIndex: function (index, filterNull) {
|
|
4105
|
-
if (filterNull ===
|
|
4105
|
+
if (filterNull === undefined) { filterNull = false; }
|
|
4106
4106
|
var $$ = this;
|
|
4107
4107
|
var value = $$.filterTargetsToShow($$.data.targets)
|
|
4108
4108
|
.map(function (t) { return $$.addName($$.getValueOnIndex(t.values, index)); });
|
|
@@ -4133,12 +4133,12 @@ var data$1 = {
|
|
|
4133
4133
|
generateTargetX: function (rawX, id, index) {
|
|
4134
4134
|
var $$ = this;
|
|
4135
4135
|
var axis = $$.axis;
|
|
4136
|
-
var x = (axis === null || axis ===
|
|
4137
|
-
if (axis === null || axis ===
|
|
4136
|
+
var x = (axis === null || axis === undefined ? undefined : axis.isCategorized()) ? index : (rawX || index);
|
|
4137
|
+
if (axis === null || axis === undefined ? undefined : axis.isTimeSeries()) {
|
|
4138
4138
|
var fn = parseDate.bind($$);
|
|
4139
4139
|
x = rawX ? fn(rawX) : fn($$.getXValue(id, index));
|
|
4140
4140
|
}
|
|
4141
|
-
else if ((axis === null || axis ===
|
|
4141
|
+
else if ((axis === null || axis === undefined ? undefined : axis.isCustomX()) && !(axis === null || axis === undefined ? undefined : axis.isCategorized())) {
|
|
4142
4142
|
x = isValue(rawX) ? +rawX : $$.getXValue(id, index);
|
|
4143
4143
|
}
|
|
4144
4144
|
return x;
|
|
@@ -4330,7 +4330,7 @@ var data$1 = {
|
|
|
4330
4330
|
},
|
|
4331
4331
|
hasTarget: function (targets, id) {
|
|
4332
4332
|
var ids = this.mapToIds(targets);
|
|
4333
|
-
for (var i = 0, val =
|
|
4333
|
+
for (var i = 0, val = undefined; (val = ids[i]); i++) {
|
|
4334
4334
|
if (val === id) {
|
|
4335
4335
|
return true;
|
|
4336
4336
|
}
|
|
@@ -4351,9 +4351,9 @@ var data$1 = {
|
|
|
4351
4351
|
var $$ = this;
|
|
4352
4352
|
var axis = $$.axis;
|
|
4353
4353
|
var xs = [];
|
|
4354
|
-
if (targets === null || targets ===
|
|
4354
|
+
if (targets === null || targets === undefined ? undefined : targets.length) {
|
|
4355
4355
|
xs = getUnique(mergeArray(targets.map(function (t) { return t.values.map(function (v) { return +v.x; }); })));
|
|
4356
|
-
xs = (axis === null || axis ===
|
|
4356
|
+
xs = (axis === null || axis === undefined ? undefined : axis.isTimeSeries()) ? xs.map(function (x) { return new Date(+x); }) : xs.map(Number);
|
|
4357
4357
|
}
|
|
4358
4358
|
return sortValue(xs);
|
|
4359
4359
|
},
|
|
@@ -4486,7 +4486,7 @@ var data$1 = {
|
|
|
4486
4486
|
* @private
|
|
4487
4487
|
*/
|
|
4488
4488
|
getSortCompareFn: function (isReversed) {
|
|
4489
|
-
if (isReversed ===
|
|
4489
|
+
if (isReversed === undefined) { isReversed = false; }
|
|
4490
4490
|
var $$ = this;
|
|
4491
4491
|
var config = $$.config;
|
|
4492
4492
|
var order = config.data_order;
|
|
@@ -4570,7 +4570,7 @@ var data$1 = {
|
|
|
4570
4570
|
if (hasViewBox($el.svg)) {
|
|
4571
4571
|
var pos = [point, 0];
|
|
4572
4572
|
isRotated && pos.reverse();
|
|
4573
|
-
point = getTransformCTM.apply(
|
|
4573
|
+
point = getTransformCTM.apply(undefined, __spreadArray([$el.eventRect.node()], pos, false))[isRotated ? "y" : "x"];
|
|
4574
4574
|
}
|
|
4575
4575
|
else {
|
|
4576
4576
|
point -= isRotated ? rect.top : rect.left;
|
|
@@ -4731,9 +4731,9 @@ var data$1 = {
|
|
|
4731
4731
|
return current;
|
|
4732
4732
|
},
|
|
4733
4733
|
getRangedData: function (d, key, type) {
|
|
4734
|
-
if (key ===
|
|
4735
|
-
if (type ===
|
|
4736
|
-
var value = d === null || d ===
|
|
4734
|
+
if (key === undefined) { key = ""; }
|
|
4735
|
+
if (type === undefined) { type = "areaRange"; }
|
|
4736
|
+
var value = d === null || d === undefined ? undefined : d.value;
|
|
4737
4737
|
if (isArray(value)) {
|
|
4738
4738
|
if (type === "bar") {
|
|
4739
4739
|
return value.reduce(function (a, c) { return c - a; });
|
|
@@ -4777,7 +4777,7 @@ var data$1 = {
|
|
|
4777
4777
|
* @private
|
|
4778
4778
|
*/
|
|
4779
4779
|
getRatio: function (type, d, asPercent) {
|
|
4780
|
-
if (asPercent ===
|
|
4780
|
+
if (asPercent === undefined) { asPercent = false; }
|
|
4781
4781
|
var $$ = this;
|
|
4782
4782
|
var config = $$.config, state = $$.state;
|
|
4783
4783
|
var api = $$.api;
|
|
@@ -4883,7 +4883,7 @@ var data$1 = {
|
|
|
4883
4883
|
getDataById: function (id) {
|
|
4884
4884
|
var _a;
|
|
4885
4885
|
var d = this.cache.get(id) || this.api.data(id);
|
|
4886
|
-
return (_a = d === null || d ===
|
|
4886
|
+
return (_a = d === null || d === undefined ? undefined : d[0]) !== null && _a !== undefined ? _a : d;
|
|
4887
4887
|
}
|
|
4888
4888
|
};
|
|
4889
4889
|
|
|
@@ -4898,11 +4898,11 @@ var data$1 = {
|
|
|
4898
4898
|
* @private
|
|
4899
4899
|
*/
|
|
4900
4900
|
function callDone(fn, resizeAfter) {
|
|
4901
|
-
if (resizeAfter ===
|
|
4901
|
+
if (resizeAfter === undefined) { resizeAfter = false; }
|
|
4902
4902
|
var $$ = this;
|
|
4903
4903
|
var api = $$.api;
|
|
4904
4904
|
resizeAfter && $$.api.flush(true);
|
|
4905
|
-
fn === null || fn ===
|
|
4905
|
+
fn === null || fn === undefined ? undefined : fn.call(api);
|
|
4906
4906
|
}
|
|
4907
4907
|
var dataLoad = {
|
|
4908
4908
|
load: function (rawTargets, args) {
|
|
@@ -4924,7 +4924,7 @@ var dataLoad = {
|
|
|
4924
4924
|
if (args.type || args.types) {
|
|
4925
4925
|
targets.forEach(function (t) {
|
|
4926
4926
|
var _a;
|
|
4927
|
-
var type = ((_a = args.types) === null || _a ===
|
|
4927
|
+
var type = ((_a = args.types) === null || _a === undefined ? undefined : _a[t.id]) || args.type;
|
|
4928
4928
|
$$.setTargetType(t.id, type);
|
|
4929
4929
|
});
|
|
4930
4930
|
}
|
|
@@ -5000,7 +5000,7 @@ var dataLoad = {
|
|
|
5000
5000
|
var _a;
|
|
5001
5001
|
var $$ = this;
|
|
5002
5002
|
var state = $$.state, $el = $$.$el, $T = $$.$T;
|
|
5003
|
-
var hasLegendDefsPoint = !!((_a = $$.hasLegendDefsPoint) === null || _a ===
|
|
5003
|
+
var hasLegendDefsPoint = !!((_a = $$.hasLegendDefsPoint) === null || _a === undefined ? undefined : _a.call($$));
|
|
5004
5004
|
var done = customDoneCb;
|
|
5005
5005
|
var targetIds = rawTargetIds;
|
|
5006
5006
|
// reset internally cached data
|
|
@@ -5032,7 +5032,7 @@ var dataLoad = {
|
|
|
5032
5032
|
// Remove target
|
|
5033
5033
|
$$.data.targets = $$.data.targets.filter(function (t) { return t.id !== id; });
|
|
5034
5034
|
// Remove custom point def element
|
|
5035
|
-
hasLegendDefsPoint && ((_a = $el.defs) === null || _a ===
|
|
5035
|
+
hasLegendDefsPoint && ((_a = $el.defs) === null || _a === undefined ? undefined : _a.select("#".concat($$.getDefsPointId(suffixId))).remove());
|
|
5036
5036
|
});
|
|
5037
5037
|
// since treemap uses different data types, it needs to be transformed
|
|
5038
5038
|
state.hasFunnel && $$.updateFunnel($$.data.targets);
|
|
@@ -5072,7 +5072,7 @@ var interaction = {
|
|
|
5072
5072
|
* @private
|
|
5073
5073
|
*/
|
|
5074
5074
|
expandBarTypeShapes: function (expand, i, id, reset) {
|
|
5075
|
-
if (expand ===
|
|
5075
|
+
if (expand === undefined) { expand = true; }
|
|
5076
5076
|
var $$ = this;
|
|
5077
5077
|
["bar", "candlestick"]
|
|
5078
5078
|
.filter(function (v) { return $$.$el[v]; })
|
|
@@ -5193,7 +5193,7 @@ var interaction = {
|
|
|
5193
5193
|
var $$ = this;
|
|
5194
5194
|
var config = $$.config, _c = $$.state, eventReceiver = _c.eventReceiver, hasAxis = _c.hasAxis, hasFunnel = _c.hasFunnel, hasRadar = _c.hasRadar, hasTreemap = _c.hasTreemap, _d = $$.$el, eventRect = _d.eventRect, funnel = _d.funnel, radar = _d.radar, svg = _d.svg, treemap = _d.treemap;
|
|
5195
5195
|
var element = (_b = (((hasFunnel || hasTreemap) && eventReceiver.rect) ||
|
|
5196
|
-
(hasRadar && radar.axes.select(".".concat($AXIS.axis, "-").concat(index, " text"))) || (eventRect || ((_a = $$.getArcElementByIdOrIndex) === null || _a ===
|
|
5196
|
+
(hasRadar && radar.axes.select(".".concat($AXIS.axis, "-").concat(index, " text"))) || (eventRect || ((_a = $$.getArcElementByIdOrIndex) === null || _a === undefined ? undefined : _a.call($$, index))))) === null || _b === undefined ? undefined : _b.node();
|
|
5197
5197
|
if (element) {
|
|
5198
5198
|
var isMultipleX = $$.isMultipleX();
|
|
5199
5199
|
var isRotated = config.axis_rotated;
|
|
@@ -5215,7 +5215,7 @@ var interaction = {
|
|
|
5215
5215
|
// value 4, is to adjust coordinate value set from: scale.ts - updateScales(): $$.getResettedPadding(1)
|
|
5216
5216
|
var y = top_1 + (mouse ? mouse[1] : 0) + (isRotated ? 4 : 0);
|
|
5217
5217
|
if (hasViewBox(svg)) {
|
|
5218
|
-
var ctm = getTransformCTM($$.$el.
|
|
5218
|
+
var ctm = getTransformCTM($$.$el.eventRect.node(), x, y, false);
|
|
5219
5219
|
x = ctm.x;
|
|
5220
5220
|
y = ctm.y;
|
|
5221
5221
|
}
|
|
@@ -5228,7 +5228,7 @@ var interaction = {
|
|
|
5228
5228
|
};
|
|
5229
5229
|
// for funnel and treemap event bound to <g> node
|
|
5230
5230
|
if (hasFunnel || hasTreemap) {
|
|
5231
|
-
element = (funnel !== null && funnel !==
|
|
5231
|
+
element = (funnel !== null && funnel !== undefined ? funnel : treemap).node();
|
|
5232
5232
|
}
|
|
5233
5233
|
emulateEvent[/^(mouse|click)/.test(type) ? "mouse" : "touch"](element, type, params);
|
|
5234
5234
|
}
|
|
@@ -5243,8 +5243,8 @@ var interaction = {
|
|
|
5243
5243
|
unbindZoomEvent: function () {
|
|
5244
5244
|
var $$ = this;
|
|
5245
5245
|
var _a = $$.$el, eventRect = _a.eventRect, zoomResetBtn = _a.zoomResetBtn;
|
|
5246
|
-
eventRect === null || eventRect ===
|
|
5247
|
-
zoomResetBtn === null || zoomResetBtn ===
|
|
5246
|
+
eventRect === null || eventRect === undefined ? undefined : eventRect.on(".zoom wheel.zoom .drag", null);
|
|
5247
|
+
zoomResetBtn === null || zoomResetBtn === undefined ? undefined : zoomResetBtn.on("click", null).style("display", "none");
|
|
5248
5248
|
},
|
|
5249
5249
|
/**
|
|
5250
5250
|
* Unbind all attached events
|
|
@@ -5276,14 +5276,14 @@ var interaction = {
|
|
|
5276
5276
|
[
|
|
5277
5277
|
svg,
|
|
5278
5278
|
eventRect,
|
|
5279
|
-
region === null || region ===
|
|
5280
|
-
brush === null || brush ===
|
|
5281
|
-
arcs === null || arcs ===
|
|
5282
|
-
legend === null || legend ===
|
|
5279
|
+
region === null || region === undefined ? undefined : region.list,
|
|
5280
|
+
brush === null || brush === undefined ? undefined : brush.getSelection(),
|
|
5281
|
+
arcs === null || arcs === undefined ? undefined : arcs.selectAll("path"),
|
|
5282
|
+
legend === null || legend === undefined ? undefined : legend.selectAll("g"),
|
|
5283
5283
|
treemap
|
|
5284
5284
|
]
|
|
5285
|
-
.forEach(function (v) { return v === null || v ===
|
|
5286
|
-
(_a = $$.unbindZoomEvent) === null || _a ===
|
|
5285
|
+
.forEach(function (v) { return v === null || v === undefined ? undefined : v.on(list, null); });
|
|
5286
|
+
(_a = $$.unbindZoomEvent) === null || _a === undefined ? undefined : _a.call($$);
|
|
5287
5287
|
}
|
|
5288
5288
|
};
|
|
5289
5289
|
|
|
@@ -5301,7 +5301,7 @@ var category = {
|
|
|
5301
5301
|
categoryName: function (i) {
|
|
5302
5302
|
var _a;
|
|
5303
5303
|
var axis_x_categories = this.config.axis_x_categories;
|
|
5304
|
-
return (_a = axis_x_categories === null || axis_x_categories ===
|
|
5304
|
+
return (_a = axis_x_categories === null || axis_x_categories === undefined ? undefined : axis_x_categories[i]) !== null && _a !== undefined ? _a : i;
|
|
5305
5305
|
}
|
|
5306
5306
|
};
|
|
5307
5307
|
|
|
@@ -5347,7 +5347,7 @@ var classModule = {
|
|
|
5347
5347
|
var ids = [];
|
|
5348
5348
|
return function (d) {
|
|
5349
5349
|
var _a;
|
|
5350
|
-
var id = d.id || ((_a = d.data) === null || _a ===
|
|
5350
|
+
var id = d.id || ((_a = d.data) === null || _a === undefined ? undefined : _a.id) || d;
|
|
5351
5351
|
if (ids.indexOf(id) < 0) {
|
|
5352
5352
|
ids.push(id);
|
|
5353
5353
|
}
|
|
@@ -5381,8 +5381,8 @@ var classModule = {
|
|
|
5381
5381
|
.replace(/[\x00-\x20\x7F-\xA0\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g, "-"); // eslint-disable-line no-control-regex
|
|
5382
5382
|
},
|
|
5383
5383
|
selectorTarget: function (id, prefix, postfix) {
|
|
5384
|
-
if (prefix ===
|
|
5385
|
-
if (postfix ===
|
|
5384
|
+
if (prefix === undefined) { prefix = ""; }
|
|
5385
|
+
if (postfix === undefined) { postfix = ""; }
|
|
5386
5386
|
var target = this.getTargetSelectorSuffix(id);
|
|
5387
5387
|
// select target & circle
|
|
5388
5388
|
return "".concat(prefix, ".").concat(CLASS.target + target, " ").concat(postfix, ", ").concat(prefix, ".").concat(CLASS.circles + target, " ").concat(postfix);
|
|
@@ -5397,7 +5397,7 @@ var classModule = {
|
|
|
5397
5397
|
},
|
|
5398
5398
|
selectorLegends: function (ids) {
|
|
5399
5399
|
var _this = this;
|
|
5400
|
-
return (ids === null || ids ===
|
|
5400
|
+
return (ids === null || ids === undefined ? undefined : ids.length) ? ids.map(function (id) { return _this.selectorLegend(id); }) : null;
|
|
5401
5401
|
}
|
|
5402
5402
|
};
|
|
5403
5403
|
|
|
@@ -5494,7 +5494,7 @@ var color = {
|
|
|
5494
5494
|
return function (d) {
|
|
5495
5495
|
var _a;
|
|
5496
5496
|
var id = d.id ||
|
|
5497
|
-
((_a = d.data) === null || _a ===
|
|
5497
|
+
((_a = d.data) === null || _a === undefined ? undefined : _a.id) ||
|
|
5498
5498
|
d;
|
|
5499
5499
|
var isLine = $$.isTypeOf(id, ["line", "spline", "step"]) || !config.data_types[id];
|
|
5500
5500
|
var color;
|
|
@@ -5551,7 +5551,7 @@ var color = {
|
|
|
5551
5551
|
* @private
|
|
5552
5552
|
*/
|
|
5553
5553
|
generateTextBGColorFilter: function (color, attr) {
|
|
5554
|
-
if (attr ===
|
|
5554
|
+
if (attr === undefined) { attr = {
|
|
5555
5555
|
x: 0,
|
|
5556
5556
|
y: 0,
|
|
5557
5557
|
width: 1,
|
|
@@ -5608,7 +5608,7 @@ var color = {
|
|
|
5608
5608
|
stops: []
|
|
5609
5609
|
};
|
|
5610
5610
|
if (radialGradient) {
|
|
5611
|
-
var _a = radialGradient.cx, cx = _a ===
|
|
5611
|
+
var _a = radialGradient.cx, cx = _a === undefined ? 0.3 : _a, _b = radialGradient.cy, cy = _b === undefined ? 0.3 : _b, _c = radialGradient.r, r = _c === undefined ? 0.7 : _c, _d = radialGradient.stops, stops = _d === undefined ? [[0.1, color_1, 0], [0.9, color_1, 1]] : _d;
|
|
5612
5612
|
gradient_1.stops = stops;
|
|
5613
5613
|
gradient_1.defs = defs.append("radialGradient")
|
|
5614
5614
|
.attr("id", "".concat(id))
|
|
@@ -5618,7 +5618,7 @@ var color = {
|
|
|
5618
5618
|
}
|
|
5619
5619
|
else {
|
|
5620
5620
|
var isRotated = config.axis_rotated;
|
|
5621
|
-
var _e = config["".concat(supportedType, "_linearGradient")], _f = _e.x, x = _f ===
|
|
5621
|
+
var _e = config["".concat(supportedType, "_linearGradient")], _f = _e.x, x = _f === undefined ? isRotated ? [1, 0] : [0, 0] : _f, _g = _e.y, y = _g === undefined ? isRotated ? [0, 0] : [0, 1] : _g, _h = _e.stops, stops = _h === undefined ? [[0, color_1, 1], [1, color_1, 0]] : _h;
|
|
5622
5622
|
gradient_1.stops = stops;
|
|
5623
5623
|
gradient_1.defs = defs.append("linearGradient")
|
|
5624
5624
|
.attr("id", "".concat(id))
|
|
@@ -5730,7 +5730,7 @@ var domain = {
|
|
|
5730
5730
|
if ($$.isStackNormalized()) {
|
|
5731
5731
|
return [0, 100];
|
|
5732
5732
|
}
|
|
5733
|
-
var isLog = (scale === null || scale ===
|
|
5733
|
+
var isLog = (scale === null || scale === undefined ? undefined : scale[axisId]) && scale[axisId].type === "log";
|
|
5734
5734
|
var targetsByAxisId = targets.filter(function (t) { return axis.getId(t.id) === axisId; });
|
|
5735
5735
|
var yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId;
|
|
5736
5736
|
if (yTargets.length === 0) { // use domain of the other axis if target of axisId is none
|
|
@@ -5830,7 +5830,7 @@ var domain = {
|
|
|
5830
5830
|
var configValue = $$.config["axis_x_".concat(type)];
|
|
5831
5831
|
var dataValue = getMinMax$1(type, targets.map(function (t) { return getMinMax$1(type, t.values.map(function (v) { return v.x; })); }));
|
|
5832
5832
|
var value = isObject(configValue) ? configValue.value : configValue;
|
|
5833
|
-
value = isDefined(value) && ((_a = $$.axis) === null || _a ===
|
|
5833
|
+
value = isDefined(value) && ((_a = $$.axis) === null || _a === undefined ? undefined : _a.isTimeSeries()) ? parseDate.bind(this)(value) : value;
|
|
5834
5834
|
if (isObject(configValue) && configValue.fit && ((type === "min" && value < dataValue) || (type === "max" && value > dataValue))) {
|
|
5835
5835
|
value = undefined;
|
|
5836
5836
|
}
|
|
@@ -5863,7 +5863,7 @@ var domain = {
|
|
|
5863
5863
|
}
|
|
5864
5864
|
var _a = isNumber(padding) ?
|
|
5865
5865
|
{ left: padding, right: padding } :
|
|
5866
|
-
padding, _b = _a.left, left = _b ===
|
|
5866
|
+
padding, _b = _a.left, left = _b === undefined ? defaultValue : _b, _c = _a.right, right = _c === undefined ? defaultValue : _c;
|
|
5867
5867
|
// when the unit is pixel, convert pixels to axis scale value
|
|
5868
5868
|
if (padding.unit === "px") {
|
|
5869
5869
|
var domainLength = Math.abs(diff + (diff * 0.2));
|
|
@@ -5894,7 +5894,7 @@ var domain = {
|
|
|
5894
5894
|
$$.getXDomainMinMax(targets, "min"),
|
|
5895
5895
|
$$.getXDomainMinMax(targets, "max")
|
|
5896
5896
|
];
|
|
5897
|
-
var _a = domain[0], min = _a ===
|
|
5897
|
+
var _a = domain[0], min = _a === undefined ? 0 : _a, _b = domain[1], max = _b === undefined ? 0 : _b;
|
|
5898
5898
|
if (x.type !== "log") {
|
|
5899
5899
|
var isCategorized = axis.isCategorized();
|
|
5900
5900
|
var isTimeSeries = axis.isTimeSeries();
|
|
@@ -5934,7 +5934,7 @@ var domain = {
|
|
|
5934
5934
|
org.xDomain = x.domain();
|
|
5935
5935
|
// zoomEnabled && $$.zoom.updateScaleExtent();
|
|
5936
5936
|
subX.domain(x.domain());
|
|
5937
|
-
(_a = $$.brush) === null || _a ===
|
|
5937
|
+
(_a = $$.brush) === null || _a === undefined ? undefined : _a.scale(subX);
|
|
5938
5938
|
}
|
|
5939
5939
|
if (withUpdateXDomain) {
|
|
5940
5940
|
var domainValue = domain || (!$$.brush || brushEmpty($$)) ?
|
|
@@ -5979,8 +5979,8 @@ var domain = {
|
|
|
5979
5979
|
* @private
|
|
5980
5980
|
*/
|
|
5981
5981
|
getZoomDomain: function (type, getCurrent) {
|
|
5982
|
-
if (type ===
|
|
5983
|
-
if (getCurrent ===
|
|
5982
|
+
if (type === undefined) { type = "zoom"; }
|
|
5983
|
+
if (getCurrent === undefined) { getCurrent = false; }
|
|
5984
5984
|
var $$ = this;
|
|
5985
5985
|
var config = $$.config, scale = $$.scale, org = $$.org;
|
|
5986
5986
|
var _a = getCurrent && scale[type] ? scale[type].domain() : org.xDomain, min = _a[0], max = _a[1];
|
|
@@ -6044,7 +6044,7 @@ var domain = {
|
|
|
6044
6044
|
* @private
|
|
6045
6045
|
*/
|
|
6046
6046
|
withinRange: function (domain, current, range) {
|
|
6047
|
-
if (current ===
|
|
6047
|
+
if (current === undefined) { current = [0, 0]; }
|
|
6048
6048
|
var $$ = this;
|
|
6049
6049
|
var isInverted = $$.config.axis_x_inverted;
|
|
6050
6050
|
var _a = range, min = _a[0], max = _a[1];
|
|
@@ -6164,9 +6164,9 @@ function getLegendColor(id) {
|
|
|
6164
6164
|
*/
|
|
6165
6165
|
function getFormattedText(id, formatted) {
|
|
6166
6166
|
var _a;
|
|
6167
|
-
if (formatted ===
|
|
6167
|
+
if (formatted === undefined) { formatted = true; }
|
|
6168
6168
|
var config = this.config;
|
|
6169
|
-
var text = (_a = config.data_names[id]) !== null && _a !==
|
|
6169
|
+
var text = (_a = config.data_names[id]) !== null && _a !== undefined ? _a : id;
|
|
6170
6170
|
if (formatted && isFunction(config.legend_format)) {
|
|
6171
6171
|
text = config.legend_format(text, id !== text ? id : undefined);
|
|
6172
6172
|
}
|
|
@@ -6221,7 +6221,7 @@ var legend$1 = {
|
|
|
6221
6221
|
$$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions);
|
|
6222
6222
|
}
|
|
6223
6223
|
// toggle legend state
|
|
6224
|
-
(_a = $el.legend) === null || _a ===
|
|
6224
|
+
(_a = $el.legend) === null || _a === undefined ? undefined : _a.selectAll(".".concat($LEGEND.legendItem)).classed($LEGEND.legendItemHidden, function (id) {
|
|
6225
6225
|
var hide = !$$.isTargetToShow(id);
|
|
6226
6226
|
if (hide) {
|
|
6227
6227
|
this.style.opacity = null;
|
|
@@ -6372,7 +6372,7 @@ var legend$1 = {
|
|
|
6372
6372
|
var _a;
|
|
6373
6373
|
var $$ = this;
|
|
6374
6374
|
var _b = $$.state, current = _b.current, isLegendRight = _b.isLegendRight, legendItemHeight = _b.legendItemHeight, legendStep = _b.legendStep;
|
|
6375
|
-
var isFitPadding = ((_a = $$.config.padding) === null || _a ===
|
|
6375
|
+
var isFitPadding = ((_a = $$.config.padding) === null || _a === undefined ? undefined : _a.mode) === "fit";
|
|
6376
6376
|
var height = $$.config.legend_show ?
|
|
6377
6377
|
(isLegendRight ? current.height : (Math.max(isFitPadding ? 10 : 20, legendItemHeight)) * (legendStep + 1)) :
|
|
6378
6378
|
0;
|
|
@@ -6916,7 +6916,7 @@ var legend$1 = {
|
|
|
6916
6916
|
var redraw = {
|
|
6917
6917
|
redraw: function (options) {
|
|
6918
6918
|
var _a, _b, _c, _d;
|
|
6919
|
-
if (options ===
|
|
6919
|
+
if (options === undefined) { options = {}; }
|
|
6920
6920
|
var $$ = this;
|
|
6921
6921
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
6922
6922
|
var main = $el.main, treemap = $el.treemap;
|
|
@@ -6927,7 +6927,7 @@ var redraw = {
|
|
|
6927
6927
|
var duration = wth.Transition ? config.transition_duration : 0;
|
|
6928
6928
|
var durationForExit = wth.TransitionForExit ? duration : 0;
|
|
6929
6929
|
var durationForAxis = wth.TransitionForAxis ? duration : 0;
|
|
6930
|
-
var transitions = (_a = $$.axis) === null || _a ===
|
|
6930
|
+
var transitions = (_a = $$.axis) === null || _a === undefined ? undefined : _a.generateTransitions(durationForAxis);
|
|
6931
6931
|
$$.updateSizes(initializing);
|
|
6932
6932
|
// update legend and transform each g
|
|
6933
6933
|
if (wth.Legend && config.legend_show) {
|
|
@@ -6967,7 +6967,7 @@ var redraw = {
|
|
|
6967
6967
|
// event rects will redrawn when flow called
|
|
6968
6968
|
if (config.interaction_enabled && !flow && wth.EventRect) {
|
|
6969
6969
|
$$.redrawEventRect();
|
|
6970
|
-
(_b = $$.bindZoomEvent) === null || _b ===
|
|
6970
|
+
(_b = $$.bindZoomEvent) === null || _b === undefined ? undefined : _b.call($$);
|
|
6971
6971
|
}
|
|
6972
6972
|
}
|
|
6973
6973
|
else {
|
|
@@ -6985,13 +6985,13 @@ var redraw = {
|
|
|
6985
6985
|
if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
|
|
6986
6986
|
$$.updateCircle();
|
|
6987
6987
|
}
|
|
6988
|
-
else if ((_c = $$.hasLegendDefsPoint) === null || _c ===
|
|
6988
|
+
else if ((_c = $$.hasLegendDefsPoint) === null || _c === undefined ? undefined : _c.call($$)) {
|
|
6989
6989
|
$$.data.targets.forEach($$.point("create", this));
|
|
6990
6990
|
}
|
|
6991
6991
|
// text
|
|
6992
6992
|
$$.hasDataLabel() && !$$.hasArcType(null, ["radar"]) && $$.updateText();
|
|
6993
6993
|
// title
|
|
6994
|
-
(_d = $$.redrawTitle) === null || _d ===
|
|
6994
|
+
(_d = $$.redrawTitle) === null || _d === undefined ? undefined : _d.call($$);
|
|
6995
6995
|
initializing && $$.updateTypesElements();
|
|
6996
6996
|
$$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart);
|
|
6997
6997
|
$$.updateTooltipOnRedraw();
|
|
@@ -7030,7 +7030,7 @@ var redraw = {
|
|
|
7030
7030
|
state.redrawing = false;
|
|
7031
7031
|
callFn(config.onrendered, $$.api);
|
|
7032
7032
|
};
|
|
7033
|
-
|
|
7033
|
+
{
|
|
7034
7034
|
// Only use transition when current tab is visible.
|
|
7035
7035
|
if (withTransition && redrawList.length) {
|
|
7036
7036
|
// Wait for end of transitions for callback
|
|
@@ -7087,7 +7087,7 @@ var redraw = {
|
|
|
7087
7087
|
return list;
|
|
7088
7088
|
},
|
|
7089
7089
|
updateAndRedraw: function (options) {
|
|
7090
|
-
if (options ===
|
|
7090
|
+
if (options === undefined) { options = {}; }
|
|
7091
7091
|
var $$ = this;
|
|
7092
7092
|
var config = $$.config, state = $$.state;
|
|
7093
7093
|
var transitions;
|
|
@@ -7129,7 +7129,7 @@ var redraw = {
|
|
|
7129
7129
|
* @private
|
|
7130
7130
|
*/
|
|
7131
7131
|
function getScale(type, min, max) {
|
|
7132
|
-
if (type ===
|
|
7132
|
+
if (type === undefined) { type = "linear"; }
|
|
7133
7133
|
var scale = ({
|
|
7134
7134
|
linear: scaleLinear,
|
|
7135
7135
|
log: scaleSymlog,
|
|
@@ -7139,7 +7139,7 @@ function getScale(type, min, max) {
|
|
|
7139
7139
|
})[type]();
|
|
7140
7140
|
scale.type = type;
|
|
7141
7141
|
/_?log/.test(type) && scale.clamp(true);
|
|
7142
|
-
return scale.range([min !== null && min !==
|
|
7142
|
+
return scale.range([min !== null && min !== undefined ? min : 0, max !== null && max !== undefined ? max : 1]);
|
|
7143
7143
|
}
|
|
7144
7144
|
var scale = {
|
|
7145
7145
|
/**
|
|
@@ -7181,8 +7181,8 @@ var scale = {
|
|
|
7181
7181
|
*/
|
|
7182
7182
|
getYScaleById: function (id, isSub) {
|
|
7183
7183
|
var _a;
|
|
7184
|
-
if (isSub ===
|
|
7185
|
-
var isY2 = ((_a = this.axis) === null || _a ===
|
|
7184
|
+
if (isSub === undefined) { isSub = false; }
|
|
7185
|
+
var isY2 = ((_a = this.axis) === null || _a === undefined ? undefined : _a.getId(id)) === "y2";
|
|
7186
7186
|
var key = isSub ? (isY2 ? "subY2" : "subY") : (isY2 ? "y2" : "y");
|
|
7187
7187
|
return this.scale[key];
|
|
7188
7188
|
},
|
|
@@ -7234,7 +7234,7 @@ var scale = {
|
|
|
7234
7234
|
*/
|
|
7235
7235
|
updateScales: function (isInit, updateXDomain) {
|
|
7236
7236
|
var _a, _b;
|
|
7237
|
-
if (updateXDomain ===
|
|
7237
|
+
if (updateXDomain === undefined) { updateXDomain = true; }
|
|
7238
7238
|
var $$ = this;
|
|
7239
7239
|
var axis = $$.axis, config = $$.config, format = $$.format, org = $$.org, scale = $$.scale, _c = $$.state, current = _c.current, width = _c.width, height = _c.height, width2 = _c.width2, height2 = _c.height2, hasAxis = _c.hasAxis, hasTreemap = _c.hasTreemap;
|
|
7240
7240
|
if (hasAxis) {
|
|
@@ -7255,12 +7255,12 @@ var scale = {
|
|
|
7255
7255
|
};
|
|
7256
7256
|
// update scales
|
|
7257
7257
|
// x Axis
|
|
7258
|
-
var xDomain = updateXDomain && ((_a = scale.x) === null || _a ===
|
|
7258
|
+
var xDomain = updateXDomain && ((_a = scale.x) === null || _a === undefined ? undefined : _a.orgDomain());
|
|
7259
7259
|
var xSubDomain = updateXDomain && org.xDomain;
|
|
7260
7260
|
scale.x = $$.getXScale(min.x, max.x, xDomain, function () { return axis.x.tickOffset(); });
|
|
7261
7261
|
scale.subX = $$.getXScale(min.x, max.x, xSubDomain, function (d) {
|
|
7262
7262
|
var _a;
|
|
7263
|
-
return (d % 1 ? 0 : ((_a = axis.subX) !== null && _a !==
|
|
7263
|
+
return (d % 1 ? 0 : ((_a = axis.subX) !== null && _a !== undefined ? _a : axis.x).tickOffset());
|
|
7264
7264
|
});
|
|
7265
7265
|
format.xAxisTick = axis.getXAxisTickFormat();
|
|
7266
7266
|
format.subXAxisTick = axis.getXAxisTickFormat(true);
|
|
@@ -7286,7 +7286,7 @@ var scale = {
|
|
|
7286
7286
|
}
|
|
7287
7287
|
else {
|
|
7288
7288
|
// update for arc
|
|
7289
|
-
(_b = $$.updateArc) === null || _b ===
|
|
7289
|
+
(_b = $$.updateArc) === null || _b === undefined ? undefined : _b.call($$);
|
|
7290
7290
|
}
|
|
7291
7291
|
},
|
|
7292
7292
|
/**
|
|
@@ -7401,7 +7401,7 @@ var size = {
|
|
|
7401
7401
|
var labelWidth = 0;
|
|
7402
7402
|
// if axis label position set to inner, exclude from the value
|
|
7403
7403
|
if (hasAxis && (isString(leftLabel) || isString(leftLabel.text) ||
|
|
7404
|
-
/^inner-/.test(leftLabel === null || leftLabel ===
|
|
7404
|
+
/^inner-/.test(leftLabel === null || leftLabel === undefined ? undefined : leftLabel.position))) {
|
|
7405
7405
|
var label = $el.main.select(".".concat(leftAxisClass, "-label"));
|
|
7406
7406
|
if (!label.empty()) {
|
|
7407
7407
|
labelWidth = label.node().getBoundingClientRect().left;
|
|
@@ -7419,7 +7419,7 @@ var size = {
|
|
|
7419
7419
|
var $$ = this;
|
|
7420
7420
|
var config = $$.config, hasAxis = $$.state.hasAxis, $el = $$.$el;
|
|
7421
7421
|
if (hasAxis && !withoutAxis && $$.axis.x && config.axis_rotated) {
|
|
7422
|
-
(_a = $$.axis.subX) === null || _a ===
|
|
7422
|
+
(_a = $$.axis.subX) === null || _a === undefined ? undefined : _a.create($el.axis.subX);
|
|
7423
7423
|
}
|
|
7424
7424
|
// pass 'withoutAxis' param to not animate at the init rendering
|
|
7425
7425
|
$$.updateScales(withoutAxis);
|
|
@@ -7471,12 +7471,12 @@ var size = {
|
|
|
7471
7471
|
*/
|
|
7472
7472
|
getCurrentPaddingByDirection: function (type, withoutRecompute, withXAxisTickTextOverflow) {
|
|
7473
7473
|
var _a;
|
|
7474
|
-
if (withoutRecompute ===
|
|
7475
|
-
if (withXAxisTickTextOverflow ===
|
|
7474
|
+
if (withoutRecompute === undefined) { withoutRecompute = false; }
|
|
7475
|
+
if (withXAxisTickTextOverflow === undefined) { withXAxisTickTextOverflow = false; }
|
|
7476
7476
|
var $$ = this;
|
|
7477
7477
|
var config = $$.config, $el = $$.$el, hasAxis = $$.state.hasAxis;
|
|
7478
7478
|
var isRotated = config.axis_rotated;
|
|
7479
|
-
var isFitPadding = ((_a = config.padding) === null || _a ===
|
|
7479
|
+
var isFitPadding = ((_a = config.padding) === null || _a === undefined ? undefined : _a.mode) === "fit";
|
|
7480
7480
|
var paddingOption = isNumber(config["padding_".concat(type)]) ?
|
|
7481
7481
|
config["padding_".concat(type)] :
|
|
7482
7482
|
undefined;
|
|
@@ -7504,7 +7504,7 @@ var size = {
|
|
|
7504
7504
|
}
|
|
7505
7505
|
var padding = hasAxis && isLeftRight && (isAxisInner || (isUndefined(paddingOption) && !isAxisShow)) ?
|
|
7506
7506
|
0 :
|
|
7507
|
-
(isFitPadding ? (isAxisShow ? axisSize : 0) + (paddingOption !== null && paddingOption !==
|
|
7507
|
+
(isFitPadding ? (isAxisShow ? axisSize : 0) + (paddingOption !== null && paddingOption !== undefined ? paddingOption : 0) : (isUndefined(paddingOption) ? axisSize : paddingOption));
|
|
7508
7508
|
if (isLeftRight && hasAxis) {
|
|
7509
7509
|
if (axisId && (isFitPadding || isAxisInner) && config["axis_".concat(axisId, "_label")].text) {
|
|
7510
7510
|
padding += $$.axis.getAxisLabelPosition(axisId).isOuter ? defaultPadding : 0;
|
|
@@ -7540,7 +7540,7 @@ var size = {
|
|
|
7540
7540
|
return padding + (axisSize * axesLen) - gap;
|
|
7541
7541
|
},
|
|
7542
7542
|
getCurrentPadding: function (withXAxisTickTextOverflow) {
|
|
7543
|
-
if (withXAxisTickTextOverflow ===
|
|
7543
|
+
if (withXAxisTickTextOverflow === undefined) { withXAxisTickTextOverflow = false; }
|
|
7544
7544
|
var $$ = this;
|
|
7545
7545
|
var _a = ["top", "bottom", "left", "right"]
|
|
7546
7546
|
.map(function (v) { return $$.getCurrentPaddingByDirection(v, null, withXAxisTickTextOverflow); }), top = _a[0], bottom = _a[1], left = _a[2], right = _a[3];
|
|
@@ -7584,7 +7584,7 @@ var size = {
|
|
|
7584
7584
|
var config = $$.config, state = $$.state, legend = $$.$el.legend;
|
|
7585
7585
|
var isRotated = config.axis_rotated;
|
|
7586
7586
|
var isNonAxis = $$.hasArcType() || state.hasFunnel || state.hasTreemap;
|
|
7587
|
-
var isFitPadding = ((_a = config.padding) === null || _a ===
|
|
7587
|
+
var isFitPadding = ((_a = config.padding) === null || _a === undefined ? undefined : _a.mode) === "fit";
|
|
7588
7588
|
!isInit && $$.setContainerSize();
|
|
7589
7589
|
var currLegend = {
|
|
7590
7590
|
width: legend ? $$.getLegendWidth() : 0,
|
|
@@ -7648,7 +7648,7 @@ var size = {
|
|
|
7648
7648
|
bottom: 0,
|
|
7649
7649
|
left: 0
|
|
7650
7650
|
};
|
|
7651
|
-
(_b = $$.updateSizeForLegend) === null || _b ===
|
|
7651
|
+
(_b = $$.updateSizeForLegend) === null || _b === undefined ? undefined : _b.call($$, currLegend);
|
|
7652
7652
|
state.width = state.current.width - state.margin.left - state.margin.right;
|
|
7653
7653
|
state.height = state.current.height - state.margin.top - state.margin.bottom;
|
|
7654
7654
|
if (state.width < 0) {
|
|
@@ -7673,10 +7673,10 @@ var size = {
|
|
|
7673
7673
|
if ($$.hasArcType()) {
|
|
7674
7674
|
var hasGauge = $$.hasType("gauge");
|
|
7675
7675
|
var isLegendRight = config.legend_show && state.isLegendRight;
|
|
7676
|
-
var textWidth = (_c = (state.hasRadar && $$.cache.get(KEY.radarTextWidth))) !== null && _c !==
|
|
7676
|
+
var textWidth = (_c = (state.hasRadar && $$.cache.get(KEY.radarTextWidth))) !== null && _c !== undefined ? _c : 0;
|
|
7677
7677
|
state.arcWidth = state.width - (isLegendRight ? currLegend.width + 10 : 0) - textWidth;
|
|
7678
7678
|
state.arcHeight = state.height - (isLegendRight && !hasGauge ? 0 : 10);
|
|
7679
|
-
if ((_d = config.arc_rangeText_values) === null || _d ===
|
|
7679
|
+
if ((_d = config.arc_rangeText_values) === null || _d === undefined ? undefined : _d.length) {
|
|
7680
7680
|
if (hasGauge) {
|
|
7681
7681
|
state.arcWidth -= 25;
|
|
7682
7682
|
state.arcHeight -= 10;
|
|
@@ -7690,7 +7690,7 @@ var size = {
|
|
|
7690
7690
|
if (hasGauge && !config.gauge_fullCircle) {
|
|
7691
7691
|
state.arcHeight += state.height - $$.getPaddingBottomForGauge();
|
|
7692
7692
|
}
|
|
7693
|
-
(_e = $$.updateRadius) === null || _e ===
|
|
7693
|
+
(_e = $$.updateRadius) === null || _e === undefined ? undefined : _e.call($$);
|
|
7694
7694
|
}
|
|
7695
7695
|
if (state.isLegendRight && isNonAxis) {
|
|
7696
7696
|
state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;
|
|
@@ -7714,7 +7714,7 @@ var style = {
|
|
|
7714
7714
|
return config.boost_useCssRule ?
|
|
7715
7715
|
function (selection) {
|
|
7716
7716
|
selection.each(function (d) {
|
|
7717
|
-
var res = propsFn && (propsFn === null || propsFn ===
|
|
7717
|
+
var res = propsFn && (propsFn === null || propsFn === undefined ? undefined : propsFn.call($$, d));
|
|
7718
7718
|
var shapeSelector = "".concat(withShape ? ".".concat($SHAPE.shapes + $$.getTargetSelectorSuffix(d.id)) : "").concat(selector);
|
|
7719
7719
|
(selector in cssRule) && style.sheet.deleteRule(cssRule[shapeSelector]);
|
|
7720
7720
|
$$.state.cssRule[shapeSelector] = addCssRules(style, shapeSelector, props.filter(Boolean).map(function (v) { return (isString(res) && v.indexOf(":") === -1 ? "".concat(v, ": ").concat(res) : (v || "")); }));
|
|
@@ -7771,7 +7771,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
7771
7771
|
var $$ = this;
|
|
7772
7772
|
var value = d.value;
|
|
7773
7773
|
var isCandlestickType = $$.isCandlestickType(d);
|
|
7774
|
-
var isNegative = (isNumber(value) && value < 0) || (isCandlestickType && !((_a = $$.getCandlestickData(d)) === null || _a ===
|
|
7774
|
+
var isNegative = (isNumber(value) && value < 0) || (isCandlestickType && !((_a = $$.getCandlestickData(d)) === null || _a === undefined ? undefined : _a._isUp));
|
|
7775
7775
|
var x = pos.x, y = pos.y;
|
|
7776
7776
|
var gap = 4;
|
|
7777
7777
|
var doubleGap = gap * 2;
|
|
@@ -7820,7 +7820,7 @@ function getTextPos(d, type) {
|
|
|
7820
7820
|
var id = d.id, index = d.index, value = d.value;
|
|
7821
7821
|
return (_a = (isFunction(position) ?
|
|
7822
7822
|
position.bind(this.api)(type, value, id, index, this.$el.text) :
|
|
7823
|
-
(id in position ? position[id] : position)[type])) !== null && _a !==
|
|
7823
|
+
(id in position ? position[id] : position)[type])) !== null && _a !== undefined ? _a : 0;
|
|
7824
7824
|
}
|
|
7825
7825
|
var text = {
|
|
7826
7826
|
opacityForText: function (d) {
|
|
@@ -7880,12 +7880,12 @@ var text = {
|
|
|
7880
7880
|
.merge(text)
|
|
7881
7881
|
.attr("class", classText)
|
|
7882
7882
|
.attr("text-anchor", function (d) {
|
|
7883
|
-
var isInverted = config["axis_".concat(axis === null || axis ===
|
|
7883
|
+
var isInverted = config["axis_".concat(axis === null || axis === undefined ? undefined : axis.getId(d.id), "_inverted")];
|
|
7884
7884
|
// when value is negative or
|
|
7885
7885
|
var isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
|
|
7886
7886
|
if ($$.isCandlestickType(d)) {
|
|
7887
7887
|
var data = $$.getCandlestickData(d);
|
|
7888
|
-
isEndAnchor = !(data === null || data ===
|
|
7888
|
+
isEndAnchor = !(data === null || data === undefined ? undefined : data._isUp);
|
|
7889
7889
|
}
|
|
7890
7890
|
else if ($$.isTreemapType(d)) {
|
|
7891
7891
|
return labelsCentered ? "middle" : "start";
|
|
@@ -7937,7 +7937,7 @@ var text = {
|
|
|
7937
7937
|
}
|
|
7938
7938
|
if ($$.isCandlestickType(d) && !isFunction(labelColors)) {
|
|
7939
7939
|
var value = $$.getCandlestickData(d);
|
|
7940
|
-
if (!(value === null || value ===
|
|
7940
|
+
if (!(value === null || value === undefined ? undefined : value._isUp)) {
|
|
7941
7941
|
var downColor = config.candlestick_color_down;
|
|
7942
7942
|
color = isObject(downColor) ? downColor[d.id] : downColor;
|
|
7943
7943
|
}
|
|
@@ -7990,7 +7990,7 @@ var text = {
|
|
|
7990
7990
|
.each(function (d, i) {
|
|
7991
7991
|
// do not apply transition for newly added text elements
|
|
7992
7992
|
var node = $T(hasTreemap && this.childElementCount ? this.parentNode : this, !!(withTransition && this.getAttribute("x")), t);
|
|
7993
|
-
var isInverted = config["axis_".concat(axis === null || axis ===
|
|
7993
|
+
var isInverted = config["axis_".concat(axis === null || axis === undefined ? undefined : axis.getId(d.id), "_inverted")];
|
|
7994
7994
|
var pos = {
|
|
7995
7995
|
x: getX.bind(this)(d, i),
|
|
7996
7996
|
y: getY.bind(this)(d, i)
|
|
@@ -8128,7 +8128,7 @@ var text = {
|
|
|
8128
8128
|
var xPos = points ? points[0][0] : 0;
|
|
8129
8129
|
if ($$.isCandlestickType(d)) {
|
|
8130
8130
|
if (isRotated) {
|
|
8131
|
-
xPos = ((_a = $$.getCandlestickData(d)) === null || _a ===
|
|
8131
|
+
xPos = ((_a = $$.getCandlestickData(d)) === null || _a === undefined ? undefined : _a._isUp) ? points[2][2] + 4 : points[2][1] - 4;
|
|
8132
8132
|
}
|
|
8133
8133
|
else {
|
|
8134
8134
|
xPos += (points[1][0] - xPos) / 2;
|
|
@@ -8174,7 +8174,7 @@ var text = {
|
|
|
8174
8174
|
var $$ = this;
|
|
8175
8175
|
var axis = $$.axis, config = $$.config, state = $$.state;
|
|
8176
8176
|
var isRotated = config.axis_rotated;
|
|
8177
|
-
var isInverted = config["axis_".concat(axis === null || axis ===
|
|
8177
|
+
var isInverted = config["axis_".concat(axis === null || axis === undefined ? undefined : axis.getId(d.id), "_inverted")];
|
|
8178
8178
|
var isBarType = $$.isBarType(d);
|
|
8179
8179
|
var isFunnelType = $$.isFunnelType(d);
|
|
8180
8180
|
var isTreemapType = $$.isTreemapType(d);
|
|
@@ -8286,7 +8286,7 @@ var text = {
|
|
|
8286
8286
|
* @private
|
|
8287
8287
|
*/
|
|
8288
8288
|
meetsLabelThreshold: function (ratio, type) {
|
|
8289
|
-
if (ratio ===
|
|
8289
|
+
if (ratio === undefined) { ratio = 0; }
|
|
8290
8290
|
var $$ = this;
|
|
8291
8291
|
var config = $$.config;
|
|
8292
8292
|
var threshold = config["".concat(type, "_label_threshold")] || 0;
|
|
@@ -8306,7 +8306,7 @@ var text = {
|
|
|
8306
8306
|
* @private
|
|
8307
8307
|
*/
|
|
8308
8308
|
function getTextXPos(pos, width) {
|
|
8309
|
-
if (pos ===
|
|
8309
|
+
if (pos === undefined) { pos = "left"; }
|
|
8310
8310
|
var isNum = isNumber(width);
|
|
8311
8311
|
var position;
|
|
8312
8312
|
if (pos.indexOf("center") > -1) {
|
|
@@ -8397,7 +8397,7 @@ var tooltip$1 = {
|
|
|
8397
8397
|
// Show tooltip if needed
|
|
8398
8398
|
if (config.tooltip_init_show) {
|
|
8399
8399
|
var isArc = !(hasAxis || hasRadar);
|
|
8400
|
-
if (((_b = $$.axis) === null || _b ===
|
|
8400
|
+
if (((_b = $$.axis) === null || _b === undefined ? undefined : _b.isTimeSeries()) && isString(config.tooltip_init_x)) {
|
|
8401
8401
|
config.tooltip_init_x = parseDate.call($$, config.tooltip_init_x);
|
|
8402
8402
|
}
|
|
8403
8403
|
$$.api.tooltip.show({
|
|
@@ -8407,7 +8407,7 @@ var tooltip$1 = {
|
|
|
8407
8407
|
});
|
|
8408
8408
|
var position = config.tooltip_init_position;
|
|
8409
8409
|
if (!config.tooltip_contents.bindto && !isEmpty(position)) {
|
|
8410
|
-
var _d = position.top, top_1 = _d ===
|
|
8410
|
+
var _d = position.top, top_1 = _d === undefined ? 0 : _d, _e = position.left, left = _e === undefined ? 50 : _e;
|
|
8411
8411
|
$el.tooltip.style("top", isString(top_1) ? top_1 : "".concat(top_1, "px"))
|
|
8412
8412
|
.style("left", isString(left) ? left : "".concat(left, "px"))
|
|
8413
8413
|
.style("display", null);
|
|
@@ -8427,7 +8427,7 @@ var tooltip$1 = {
|
|
|
8427
8427
|
}
|
|
8428
8428
|
var $$ = this;
|
|
8429
8429
|
var api = $$.api, config = $$.config;
|
|
8430
|
-
return isFunction(config.tooltip_contents) ? config.tooltip_contents.bind(api).apply(
|
|
8430
|
+
return isFunction(config.tooltip_contents) ? config.tooltip_contents.bind(api).apply(undefined, args) : $$.getTooltipContent.apply($$, args);
|
|
8431
8431
|
},
|
|
8432
8432
|
/**
|
|
8433
8433
|
* Returns the tooltip content(HTML string)
|
|
@@ -8453,14 +8453,14 @@ var tooltip$1 = {
|
|
|
8453
8453
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8454
8454
|
arg[_i] = arguments[_i];
|
|
8455
8455
|
}
|
|
8456
|
-
return sanitize((titleFn || defaultTitleFormat).apply(
|
|
8456
|
+
return sanitize((titleFn || defaultTitleFormat).apply(undefined, arg));
|
|
8457
8457
|
};
|
|
8458
8458
|
var nameFormat = function () {
|
|
8459
8459
|
var arg = [];
|
|
8460
8460
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8461
8461
|
arg[_i] = arguments[_i];
|
|
8462
8462
|
}
|
|
8463
|
-
return sanitize((nameFn || (function (name) { return name; })).apply(
|
|
8463
|
+
return sanitize((nameFn || (function (name) { return name; })).apply(undefined, arg));
|
|
8464
8464
|
};
|
|
8465
8465
|
var valueFormat = function () {
|
|
8466
8466
|
var arg = [];
|
|
@@ -8470,7 +8470,7 @@ var tooltip$1 = {
|
|
|
8470
8470
|
var fn = valueFn || (state.hasTreemap || $$.isStackNormalized() ?
|
|
8471
8471
|
function (v, ratio) { return "".concat((ratio * 100).toFixed(2), "%"); } :
|
|
8472
8472
|
defaultValueFormat);
|
|
8473
|
-
return sanitize(fn.apply(
|
|
8473
|
+
return sanitize(fn.apply(undefined, arg));
|
|
8474
8474
|
};
|
|
8475
8475
|
var order = config.tooltip_order;
|
|
8476
8476
|
var getRowValue = function (row) { return ($$.axis && $$.isBubbleZType(row) ?
|
|
@@ -8535,16 +8535,16 @@ var tooltip$1 = {
|
|
|
8535
8535
|
param = [row.ratio, row.id, row.index];
|
|
8536
8536
|
if ($$.isAreaRangeType(row)) {
|
|
8537
8537
|
var _c = ["high", "low"].map(function (v) {
|
|
8538
|
-
return valueFormat.apply(
|
|
8538
|
+
return valueFormat.apply(undefined, __spreadArray([$$.getRangedData(row, v)], param, false));
|
|
8539
8539
|
}), high = _c[0], low = _c[1];
|
|
8540
|
-
var mid = valueFormat.apply(
|
|
8540
|
+
var mid = valueFormat.apply(undefined, __spreadArray([getRowValue(row)], param, false));
|
|
8541
8541
|
value = "<b>Mid:</b> ".concat(mid, " <b>High:</b> ").concat(high, " <b>Low:</b> ").concat(low);
|
|
8542
8542
|
}
|
|
8543
8543
|
else if ($$.isCandlestickType(row)) {
|
|
8544
8544
|
var _d = ["open", "high", "low", "close", "volume"]
|
|
8545
8545
|
.map(function (v) {
|
|
8546
8546
|
var value = $$.getRangedData(row, v, "candlestick");
|
|
8547
|
-
return value ? valueFormat.apply(
|
|
8547
|
+
return value ? valueFormat.apply(undefined, __spreadArray([$$.getRangedData(row, v, "candlestick")], param, false)) :
|
|
8548
8548
|
undefined;
|
|
8549
8549
|
}), open_1 = _d[0], high = _d[1], low = _d[2], close_1 = _d[3], volume = _d[4];
|
|
8550
8550
|
value =
|
|
@@ -8555,14 +8555,14 @@ var tooltip$1 = {
|
|
|
8555
8555
|
value = "".concat(valueFormat(rangeValue, undefined, id, index));
|
|
8556
8556
|
}
|
|
8557
8557
|
else {
|
|
8558
|
-
value = valueFormat.apply(
|
|
8558
|
+
value = valueFormat.apply(undefined, __spreadArray([getRowValue(row)], param, false));
|
|
8559
8559
|
}
|
|
8560
8560
|
if (value !== undefined) {
|
|
8561
8561
|
// Skip elements when their name is set to null
|
|
8562
8562
|
if (row.name === null) {
|
|
8563
8563
|
return "continue";
|
|
8564
8564
|
}
|
|
8565
|
-
var name_1 = nameFormat.apply(
|
|
8565
|
+
var name_1 = nameFormat.apply(undefined, __spreadArray([(_a = row.name) !== null && _a !== undefined ? _a : row.id], param, false));
|
|
8566
8566
|
var color_1 = getBgColor(row);
|
|
8567
8567
|
var contentValue_1 = {
|
|
8568
8568
|
CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
|
@@ -8609,17 +8609,17 @@ var tooltip$1 = {
|
|
|
8609
8609
|
var config = $$.config, scale = $$.scale, state = $$.state, _c = $$.$el, eventRect = _c.eventRect, tooltip = _c.tooltip, svg = _c.svg;
|
|
8610
8610
|
var bindto = config.tooltip_contents.bindto;
|
|
8611
8611
|
var isRotated = config.axis_rotated;
|
|
8612
|
-
var datum = tooltip === null || tooltip ===
|
|
8612
|
+
var datum = tooltip === null || tooltip === undefined ? undefined : tooltip.datum();
|
|
8613
8613
|
if (!bindto && datum) {
|
|
8614
|
-
var data = dataToShow !== null && dataToShow !==
|
|
8615
|
-
var _d = getPointer(state.event, eventTarget !== null && eventTarget !==
|
|
8614
|
+
var data = dataToShow !== null && dataToShow !== undefined ? dataToShow : JSON.parse(datum.current);
|
|
8615
|
+
var _d = getPointer(state.event, eventTarget !== null && eventTarget !== undefined ? eventTarget : eventRect === null || eventRect === undefined ? undefined : eventRect.node()), x = _d[0], y = _d[1]; // get mouse event position
|
|
8616
8616
|
var currPos = { x: x, y: y };
|
|
8617
8617
|
if (state.hasAxis && scale.x && datum && "x" in datum) {
|
|
8618
8618
|
var getYPos = function (value, id, axisId) {
|
|
8619
8619
|
var _a;
|
|
8620
|
-
if (value ===
|
|
8621
|
-
if (axisId ===
|
|
8622
|
-
var scaleFn = scale[id ? (_a = $$.axis) === null || _a ===
|
|
8620
|
+
if (value === undefined) { value = 0; }
|
|
8621
|
+
if (axisId === undefined) { axisId = "y"; }
|
|
8622
|
+
var scaleFn = scale[id ? (_a = $$.axis) === null || _a === undefined ? undefined : _a.getId(id) : axisId];
|
|
8623
8623
|
return scaleFn ?
|
|
8624
8624
|
scaleFn(value) + (isRotated ? state.margin.left : state.margin.top) :
|
|
8625
8625
|
0;
|
|
@@ -8634,9 +8634,9 @@ var tooltip$1 = {
|
|
|
8634
8634
|
currPos.yAxis = getYPos;
|
|
8635
8635
|
}
|
|
8636
8636
|
}
|
|
8637
|
-
var _e = datum.width, width = _e ===
|
|
8637
|
+
var _e = datum.width, width = _e === undefined ? 0 : _e, _f = datum.height, height = _f === undefined ? 0 : _f;
|
|
8638
8638
|
// Get tooltip position
|
|
8639
|
-
var pos_1 = (_b = (_a = config.tooltip_position) === null || _a ===
|
|
8639
|
+
var pos_1 = (_b = (_a = config.tooltip_position) === null || _a === undefined ? undefined : _a.bind($$.api)(data, width, height, eventRect === null || eventRect === undefined ? undefined : eventRect.node(), currPos)) !== null && _b !== undefined ? _b : (hasViewBox(svg) ?
|
|
8640
8640
|
$$.getTooltipPositionViewBox.bind($$)(width, height, currPos) :
|
|
8641
8641
|
$$.getTooltipPosition.bind($$)(width, height, currPos));
|
|
8642
8642
|
["top", "left"].forEach(function (v) {
|
|
@@ -8662,7 +8662,7 @@ var tooltip$1 = {
|
|
|
8662
8662
|
var _c = $$.$el, eventRect = _c.eventRect, svg = _c.svg, config = $$.config, state = $$.state;
|
|
8663
8663
|
var isRotated = config.axis_rotated;
|
|
8664
8664
|
var hasArcType = $$.hasArcType() || state.hasFunnel || state.hasTreemap;
|
|
8665
|
-
var target = (_b = (_a = (hasArcType ? svg : eventRect)) === null || _a ===
|
|
8665
|
+
var target = (_b = (_a = (hasArcType ? svg : eventRect)) === null || _a === undefined ? undefined : _a.node()) !== null && _b !== undefined ? _b : state.event.target;
|
|
8666
8666
|
var x = currPos.x, y = currPos.y;
|
|
8667
8667
|
if (state.hasAxis) {
|
|
8668
8668
|
x = isRotated ? x : currPos.xAxis;
|
|
@@ -8723,8 +8723,8 @@ var tooltip$1 = {
|
|
|
8723
8723
|
else if (hasArcType) {
|
|
8724
8724
|
var notTouch = inputType !== "touch";
|
|
8725
8725
|
if (notTouch) {
|
|
8726
|
-
var titlePadding = (_b = (_a = $$.getTitlePadding) === null || _a ===
|
|
8727
|
-
if (titlePadding && hasGauge && ((_c = config.arc_rangeText_values) === null || _c ===
|
|
8726
|
+
var titlePadding = (_b = (_a = $$.getTitlePadding) === null || _a === undefined ? undefined : _a.call($$)) !== null && _b !== undefined ? _b : 0;
|
|
8727
|
+
if (titlePadding && hasGauge && ((_c = config.arc_rangeText_values) === null || _c === undefined ? undefined : _c.length)) {
|
|
8728
8728
|
titlePadding += 10;
|
|
8729
8729
|
}
|
|
8730
8730
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
@@ -8836,7 +8836,7 @@ var tooltip$1 = {
|
|
|
8836
8836
|
var $$ = this;
|
|
8837
8837
|
var api = $$.api, config = $$.config, tooltip = $$.$el.tooltip;
|
|
8838
8838
|
if (tooltip && tooltip.style("display") !== "none" && (!config.tooltip_doNotHide || force)) {
|
|
8839
|
-
var selectedData = JSON.parse((_a = tooltip.datum().current) !== null && _a !==
|
|
8839
|
+
var selectedData = JSON.parse((_a = tooltip.datum().current) !== null && _a !== undefined ? _a : {});
|
|
8840
8840
|
callFn(config.tooltip_onhide, api, selectedData);
|
|
8841
8841
|
// hide tooltip
|
|
8842
8842
|
tooltip
|
|
@@ -8857,7 +8857,7 @@ var tooltip$1 = {
|
|
|
8857
8857
|
var charts = $$.charts, config = $$.config, event = $$.state.event;
|
|
8858
8858
|
// Prevent propagation among instances if isn't instantiated from the user's event
|
|
8859
8859
|
// https://github.com/naver/billboard.js/issues/1979
|
|
8860
|
-
if ((event === null || event ===
|
|
8860
|
+
if ((event === null || event === undefined ? undefined : event.isTrusted) && config.tooltip_linked && charts.length > 1) {
|
|
8861
8861
|
var linkedName_1 = config.tooltip_linked_name;
|
|
8862
8862
|
charts
|
|
8863
8863
|
.filter(function (c) { return c !== $$.api; })
|
|
@@ -8868,7 +8868,7 @@ var tooltip$1 = {
|
|
|
8868
8868
|
var isInDom = doc.body.contains($el.chart.node());
|
|
8869
8869
|
if (isLinked && linkedName_1 === name && isInDom) {
|
|
8870
8870
|
var data = $el.tooltip.data()[0];
|
|
8871
|
-
var isNotSameIndex = index !== (data === null || data ===
|
|
8871
|
+
var isNotSameIndex = index !== (data === null || data === undefined ? undefined : data.index);
|
|
8872
8872
|
try {
|
|
8873
8873
|
c.tooltip[show && isNotSameIndex ? "show" : "hide"]({ index: index });
|
|
8874
8874
|
}
|
|
@@ -8889,15 +8889,15 @@ var tooltip$1 = {
|
|
|
8889
8889
|
var $$ = this;
|
|
8890
8890
|
var config = $$.config, _b = $$.$el, eventRect = _b.eventRect, svg = _b.svg, tooltip = _b.tooltip, _c = $$.state, event = _c.event, hasAxis = _c.hasAxis, hasRadar = _c.hasRadar, hasTreemap = _c.hasTreemap;
|
|
8891
8891
|
// Update tooltip, when tooltip is in shown state
|
|
8892
|
-
if ((tooltip === null || tooltip ===
|
|
8893
|
-
var rect = context !== null && context !==
|
|
8892
|
+
if ((tooltip === null || tooltip === undefined ? undefined : tooltip.style("display")) === "block" && event) {
|
|
8893
|
+
var rect = context !== null && context !== undefined ? context : (_a = (hasRadar ? svg : eventRect)) === null || _a === undefined ? undefined : _a.node();
|
|
8894
8894
|
// for Axis based & Radar
|
|
8895
8895
|
if (hasAxis || hasRadar) {
|
|
8896
8896
|
if ($$.isMultipleX()) {
|
|
8897
8897
|
$$.selectRectForMultipleXs(rect, false);
|
|
8898
8898
|
}
|
|
8899
8899
|
else {
|
|
8900
|
-
var idx = index !== null && index !==
|
|
8900
|
+
var idx = index !== null && index !== undefined ? index : $$.getDataIndexFromEvent(event);
|
|
8901
8901
|
if (index === -1) {
|
|
8902
8902
|
$$.api.tooltip.hide();
|
|
8903
8903
|
}
|
|
@@ -8916,7 +8916,7 @@ var tooltip$1 = {
|
|
|
8916
8916
|
if (data) {
|
|
8917
8917
|
var d = $$.hasArcType() ?
|
|
8918
8918
|
$$.convertToArcData($$.updateAngle(data)) :
|
|
8919
|
-
data === null || data ===
|
|
8919
|
+
data === null || data === undefined ? undefined : data.data;
|
|
8920
8920
|
hasTreemap && (target = svg.node());
|
|
8921
8921
|
d && $$.showTooltip([d], target);
|
|
8922
8922
|
}
|
|
@@ -8936,7 +8936,7 @@ var tooltip$1 = {
|
|
|
8936
8936
|
var transform = {
|
|
8937
8937
|
getTranslate: function (target, index) {
|
|
8938
8938
|
var _a;
|
|
8939
|
-
if (index ===
|
|
8939
|
+
if (index === undefined) { index = 0; }
|
|
8940
8940
|
var $$ = this;
|
|
8941
8941
|
var config = $$.config, state = $$.state;
|
|
8942
8942
|
var isRotated = config.axis_rotated;
|
|
@@ -8977,7 +8977,7 @@ var transform = {
|
|
|
8977
8977
|
else if (target === "arc") {
|
|
8978
8978
|
x = state.arcWidth / 2;
|
|
8979
8979
|
y = state.arcHeight / 2;
|
|
8980
|
-
if ((_a = config.arc_rangeText_values) === null || _a ===
|
|
8980
|
+
if ((_a = config.arc_rangeText_values) === null || _a === undefined ? undefined : _a.length) {
|
|
8981
8981
|
y += 5 + ($$.hasType("gauge") && config.title_text ? 10 : 0);
|
|
8982
8982
|
}
|
|
8983
8983
|
}
|
|
@@ -8995,13 +8995,13 @@ var transform = {
|
|
|
8995
8995
|
transformMain: function (withTransition, transitions) {
|
|
8996
8996
|
var $$ = this;
|
|
8997
8997
|
var main = $$.$el.main, $T = $$.$T;
|
|
8998
|
-
var xAxis = (transitions === null || transitions ===
|
|
8998
|
+
var xAxis = (transitions === null || transitions === undefined ? undefined : transitions.axisX) ?
|
|
8999
8999
|
transitions.axisX :
|
|
9000
9000
|
$T(main.select(".".concat($AXIS.axisX)), withTransition);
|
|
9001
|
-
var yAxis = (transitions === null || transitions ===
|
|
9001
|
+
var yAxis = (transitions === null || transitions === undefined ? undefined : transitions.axisY) ?
|
|
9002
9002
|
transitions.axisY :
|
|
9003
9003
|
$T(main.select(".".concat($AXIS.axisY)), withTransition);
|
|
9004
|
-
var y2Axis = (transitions === null || transitions ===
|
|
9004
|
+
var y2Axis = (transitions === null || transitions === undefined ? undefined : transitions.axisY2) ?
|
|
9005
9005
|
transitions.axisY2 :
|
|
9006
9006
|
$T(main.select(".".concat($AXIS.axisY2)), withTransition);
|
|
9007
9007
|
$T(main, withTransition)
|
|
@@ -9078,16 +9078,16 @@ var typeInternals = {
|
|
|
9078
9078
|
*/
|
|
9079
9079
|
hasType: function (type, targetsValue, checkFromData) {
|
|
9080
9080
|
var _a;
|
|
9081
|
-
if (checkFromData ===
|
|
9081
|
+
if (checkFromData === undefined) { checkFromData = false; }
|
|
9082
9082
|
var $$ = this;
|
|
9083
9083
|
var config = $$.config, current = $$.state.current;
|
|
9084
9084
|
var types = config.data_types;
|
|
9085
9085
|
var targets = targetsValue || $$.data.targets;
|
|
9086
9086
|
var has = false;
|
|
9087
|
-
if (!checkFromData && ((_a = current.types) === null || _a ===
|
|
9087
|
+
if (!checkFromData && ((_a = current.types) === null || _a === undefined ? undefined : _a.indexOf(type)) > -1) {
|
|
9088
9088
|
has = true;
|
|
9089
9089
|
}
|
|
9090
|
-
else if (targets === null || targets ===
|
|
9090
|
+
else if (targets === null || targets === undefined ? undefined : targets.length) {
|
|
9091
9091
|
targets.forEach(function (target) {
|
|
9092
9092
|
var t = types[target.id];
|
|
9093
9093
|
if (t === type || (!t && type === "line")) {
|
|
@@ -9117,7 +9117,7 @@ var typeInternals = {
|
|
|
9117
9117
|
*/
|
|
9118
9118
|
hasTypeOf: function (type, targets, exclude) {
|
|
9119
9119
|
var _this = this;
|
|
9120
|
-
if (exclude ===
|
|
9120
|
+
if (exclude === undefined) { exclude = []; }
|
|
9121
9121
|
if (type in TYPE_BY_CATEGORY) {
|
|
9122
9122
|
return !TYPE_BY_CATEGORY[type]
|
|
9123
9123
|
.filter(function (v) { return exclude.indexOf(v) === -1; })
|
|
@@ -9135,7 +9135,7 @@ var typeInternals = {
|
|
|
9135
9135
|
isTypeOf: function (d, type) {
|
|
9136
9136
|
var _a;
|
|
9137
9137
|
var id = isString(d) ? d : d.id;
|
|
9138
|
-
var dataType = this.config && (((_a = this.config.data_types) === null || _a ===
|
|
9138
|
+
var dataType = this.config && (((_a = this.config.data_types) === null || _a === undefined ? undefined : _a[id]) || this.config.data_type);
|
|
9139
9139
|
return isArray(type) ? type.indexOf(dataType) >= 0 : dataType === type;
|
|
9140
9140
|
},
|
|
9141
9141
|
hasPointType: function () {
|
|
@@ -9217,7 +9217,7 @@ var typeInternals = {
|
|
|
9217
9217
|
var config = this.config;
|
|
9218
9218
|
var pattern = config.point_pattern;
|
|
9219
9219
|
var isCircle = false;
|
|
9220
|
-
if ((node === null || node ===
|
|
9220
|
+
if ((node === null || node === undefined ? undefined : node.tagName) === "circle") {
|
|
9221
9221
|
isCircle = true;
|
|
9222
9222
|
}
|
|
9223
9223
|
else {
|
|
@@ -9319,8 +9319,8 @@ var shape = {
|
|
|
9319
9319
|
}
|
|
9320
9320
|
});
|
|
9321
9321
|
if (!$$.hasArcType() || hasRadar || hasTreemap) {
|
|
9322
|
-
var cx =
|
|
9323
|
-
var cy =
|
|
9322
|
+
var cx = undefined;
|
|
9323
|
+
var cy = undefined;
|
|
9324
9324
|
// generate circle x/y functions depending on updated params
|
|
9325
9325
|
if (!hasTreemap) {
|
|
9326
9326
|
cx = hasRadar ? $$.radarCircleX : (isRotated ? $$.circleY : $$.circleX);
|
|
@@ -9367,18 +9367,18 @@ var shape = {
|
|
|
9367
9367
|
var _a;
|
|
9368
9368
|
var xKey = d.id in xs ? xs[d.id] : "";
|
|
9369
9369
|
var ind = xKey ? indices[xKey] : indices;
|
|
9370
|
-
for (var j = 0, groups =
|
|
9370
|
+
for (var j = 0, groups = undefined; (groups = config.data_groups[j]); j++) {
|
|
9371
9371
|
if (groups.indexOf(d.id) < 0) {
|
|
9372
9372
|
continue;
|
|
9373
9373
|
}
|
|
9374
|
-
for (var k = 0, key =
|
|
9374
|
+
for (var k = 0, key = undefined; (key = groups[k]); k++) {
|
|
9375
9375
|
if (key in ind) {
|
|
9376
9376
|
ind[d.id] = ind[key];
|
|
9377
9377
|
break;
|
|
9378
9378
|
}
|
|
9379
9379
|
// for same grouped data, add other data to same indices
|
|
9380
9380
|
if (d.id !== key && xKey) {
|
|
9381
|
-
ind[key] = (_a = ind[d.id]) !== null && _a !==
|
|
9381
|
+
ind[key] = (_a = ind[d.id]) !== null && _a !== undefined ? _a : i[xKey];
|
|
9382
9382
|
}
|
|
9383
9383
|
}
|
|
9384
9384
|
}
|
|
@@ -9570,7 +9570,7 @@ var shape = {
|
|
|
9570
9570
|
if (!row || Number(row.x) !== dataXAsNumber) {
|
|
9571
9571
|
row = rowValueMapByXValue[dataXAsNumber];
|
|
9572
9572
|
}
|
|
9573
|
-
if ((row === null || row ===
|
|
9573
|
+
if ((row === null || row === undefined ? undefined : row.value) * value >= 0 && isNumber(rValue)) {
|
|
9574
9574
|
var addOffset = value === 0 ?
|
|
9575
9575
|
((groupsZeroAs === "positive" &&
|
|
9576
9576
|
rValue > 0) ||
|
|
@@ -9606,12 +9606,12 @@ var shape = {
|
|
|
9606
9606
|
var $$ = this;
|
|
9607
9607
|
var config = $$.config, org = $$.org, scale = $$.scale, state = $$.state;
|
|
9608
9608
|
var maxDataCount = $$.getMaxDataCount();
|
|
9609
|
-
var isGrouped = type === "bar" && ((_a = config.data_groups) === null || _a ===
|
|
9609
|
+
var isGrouped = type === "bar" && ((_a = config.data_groups) === null || _a === undefined ? undefined : _a.length);
|
|
9610
9610
|
var configName = "".concat(type, "_width");
|
|
9611
|
-
var k = ((_c = (_b = $$.getZoomTransform) === null || _b ===
|
|
9611
|
+
var k = ((_c = (_b = $$.getZoomTransform) === null || _b === undefined ? undefined : _b.call($$)) !== null && _c !== undefined ? _c : { k: 1 }).k;
|
|
9612
9612
|
var xMinMax = [
|
|
9613
|
-
(_d = config.axis_x_min) !== null && _d !==
|
|
9614
|
-
(_e = config.axis_x_max) !== null && _e !==
|
|
9613
|
+
(_d = config.axis_x_min) !== null && _d !== undefined ? _d : org.xDomain[0],
|
|
9614
|
+
(_e = config.axis_x_max) !== null && _e !== undefined ? _e : org.xDomain[1]
|
|
9615
9615
|
].map($$.axis.isTimeSeries() ? parseDate.bind($$) : Number);
|
|
9616
9616
|
var tickInterval = axis.tickInterval(maxDataCount);
|
|
9617
9617
|
if (scale.zoom && !$$.axis.isCategorized() && k > 1) {
|
|
@@ -9678,7 +9678,7 @@ var shape = {
|
|
|
9678
9678
|
if (!$$.isTargetToShow(d.id)) {
|
|
9679
9679
|
isWithin = false;
|
|
9680
9680
|
}
|
|
9681
|
-
else if ((_a = $$.hasValidPointType) === null || _a ===
|
|
9681
|
+
else if ((_a = $$.hasValidPointType) === null || _a === undefined ? undefined : _a.call($$, that.nodeName)) {
|
|
9682
9682
|
isWithin = $$.isStepType(d) ?
|
|
9683
9683
|
$$.isWithinStep(that, $$.getYScaleById(d.id)($$.getBaseValue(d))) :
|
|
9684
9684
|
$$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0);
|
|
@@ -9925,7 +9925,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9925
9925
|
config.axis_y2_show = false;
|
|
9926
9926
|
config.subchart_show = false;
|
|
9927
9927
|
}
|
|
9928
|
-
if ($$.hasPointType() || ((_a = $$.hasLegendDefsPoint) === null || _a ===
|
|
9928
|
+
if ($$.hasPointType() || ((_a = $$.hasLegendDefsPoint) === null || _a === undefined ? undefined : _a.call($$))) {
|
|
9929
9929
|
$$.point = $$.generatePoint();
|
|
9930
9930
|
}
|
|
9931
9931
|
if (state.hasAxis) {
|
|
@@ -10016,15 +10016,15 @@ var ChartInternal = /** @class */ (function () {
|
|
|
10016
10016
|
var isTouch = state.inputType === "touch";
|
|
10017
10017
|
var onclick_1 = config.onclick, onover = config.onover, onout = config.onout;
|
|
10018
10018
|
$el.svg
|
|
10019
|
-
.on("click", (onclick_1 === null || onclick_1 ===
|
|
10020
|
-
.on(isTouch ? "touchstart" : "mouseenter", (onover === null || onover ===
|
|
10021
|
-
.on(isTouch ? "touchend" : "mouseleave", (onout === null || onout ===
|
|
10019
|
+
.on("click", (onclick_1 === null || onclick_1 === undefined ? undefined : onclick_1.bind($$.api)) || null)
|
|
10020
|
+
.on(isTouch ? "touchstart" : "mouseenter", (onover === null || onover === undefined ? undefined : onover.bind($$.api)) || null)
|
|
10021
|
+
.on(isTouch ? "touchend" : "mouseleave", (onout === null || onout === undefined ? undefined : onout.bind($$.api)) || null);
|
|
10022
10022
|
}
|
|
10023
10023
|
config.svg_classname && $el.svg.attr("class", config.svg_classname);
|
|
10024
10024
|
// Define defs
|
|
10025
10025
|
var hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
|
10026
10026
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap ||
|
|
10027
|
-
labelsBGColor || ((_a = $$.hasLegendDefsPoint) === null || _a ===
|
|
10027
|
+
labelsBGColor || ((_a = $$.hasLegendDefsPoint) === null || _a === undefined ? undefined : _a.call($$))) {
|
|
10028
10028
|
$el.defs = $el.svg.append("defs");
|
|
10029
10029
|
if (hasAxis) {
|
|
10030
10030
|
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
@@ -10073,11 +10073,11 @@ var ChartInternal = /** @class */ (function () {
|
|
|
10073
10073
|
$$.initChartElements();
|
|
10074
10074
|
if (hasAxis) {
|
|
10075
10075
|
// Cover whole with rects for events
|
|
10076
|
-
hasInteraction && ((_b = $$.initEventRect) === null || _b ===
|
|
10076
|
+
hasInteraction && ((_b = $$.initEventRect) === null || _b === undefined ? undefined : _b.call($$));
|
|
10077
10077
|
// Grids
|
|
10078
10078
|
$$.initGrid();
|
|
10079
10079
|
// Add Axis here, when clipPath is 'true'
|
|
10080
|
-
config.clipPath && ((_c = $$.axis) === null || _c ===
|
|
10080
|
+
config.clipPath && ((_c = $$.axis) === null || _c === undefined ? undefined : _c.init());
|
|
10081
10081
|
}
|
|
10082
10082
|
// Set targets
|
|
10083
10083
|
$$.updateTargets($$.data.targets);
|
|
@@ -10245,7 +10245,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
10245
10245
|
// Point types
|
|
10246
10246
|
var hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
10247
10247
|
if (hasPointType) {
|
|
10248
|
-
(_a = $$.updateTargetForCircle) === null || _a ===
|
|
10248
|
+
(_a = $$.updateTargetForCircle) === null || _a === undefined ? undefined : _a.call($$);
|
|
10249
10249
|
}
|
|
10250
10250
|
// Fade-in each chart
|
|
10251
10251
|
$$.filterTargetsToShowAtInit(hasPointType);
|
|
@@ -10256,7 +10256,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
10256
10256
|
* @private
|
|
10257
10257
|
*/
|
|
10258
10258
|
ChartInternal.prototype.filterTargetsToShowAtInit = function (hasPointType) {
|
|
10259
|
-
if (hasPointType ===
|
|
10259
|
+
if (hasPointType === undefined) { hasPointType = false; }
|
|
10260
10260
|
var $$ = this;
|
|
10261
10261
|
var svg = $$.$el.svg, $T = $$.$T;
|
|
10262
10262
|
var selector = ".".concat($COMMON.target);
|
|
@@ -10459,15 +10459,15 @@ var apiChart = {
|
|
|
10459
10459
|
if (state.rendered) {
|
|
10460
10460
|
// reset possible zoom scale when is called from resize event
|
|
10461
10461
|
if (state.resizing) { // arguments[1] is given when is called from resize
|
|
10462
|
-
(_a = $$.brush) === null || _a ===
|
|
10462
|
+
(_a = $$.brush) === null || _a === undefined ? undefined : _a.updateResize();
|
|
10463
10463
|
}
|
|
10464
10464
|
else {
|
|
10465
10465
|
// re-update config info
|
|
10466
|
-
(_b = $$.axis) === null || _b ===
|
|
10466
|
+
(_b = $$.axis) === null || _b === undefined ? undefined : _b.setOrient();
|
|
10467
10467
|
}
|
|
10468
10468
|
// hide possible reset zoom button
|
|
10469
10469
|
// https://github.com/naver/billboard.js/issues/2201
|
|
10470
|
-
zoomResetBtn === null || zoomResetBtn ===
|
|
10470
|
+
zoomResetBtn === null || zoomResetBtn === undefined ? undefined : zoomResetBtn.style("display", "none");
|
|
10471
10471
|
$$.scale.zoom = null;
|
|
10472
10472
|
soft ?
|
|
10473
10473
|
$$.redraw({
|
|
@@ -10572,7 +10572,7 @@ var apiChart = {
|
|
|
10572
10572
|
config: function (name, value, redraw) {
|
|
10573
10573
|
var $$ = this.internal;
|
|
10574
10574
|
var config = $$.config, state = $$.state;
|
|
10575
|
-
var key = name === null || name ===
|
|
10575
|
+
var key = name === null || name === undefined ? undefined : name.replace(/\./g, "_");
|
|
10576
10576
|
var res;
|
|
10577
10577
|
if (name && key in config) {
|
|
10578
10578
|
if (isDefined(value)) {
|
|
@@ -10673,7 +10673,7 @@ extend(data, {
|
|
|
10673
10673
|
* // --> [10, 20, 30, 40]
|
|
10674
10674
|
*/
|
|
10675
10675
|
values: function (targetIds, flat) {
|
|
10676
|
-
if (flat ===
|
|
10676
|
+
if (flat === undefined) { flat = true; }
|
|
10677
10677
|
var values = null;
|
|
10678
10678
|
if (targetIds) {
|
|
10679
10679
|
var targets = this.data(targetIds);
|
|
@@ -10796,7 +10796,7 @@ var apiData = { data: data };
|
|
|
10796
10796
|
*/
|
|
10797
10797
|
var b64EncodeUnicode = function (str) {
|
|
10798
10798
|
var _a;
|
|
10799
|
-
return (_a = win.btoa) === null || _a ===
|
|
10799
|
+
return (_a = win.btoa) === null || _a === undefined ? undefined : _a.call(win, encodeURIComponent(str)
|
|
10800
10800
|
.replace(/%([0-9A-F]{2})/g, function (match, p) { return String.fromCharCode(Number("0x".concat(p))); }));
|
|
10801
10801
|
};
|
|
10802
10802
|
/**
|
|
@@ -10831,7 +10831,7 @@ function nodeToSvgDataUrl(node, option, orgSize) {
|
|
|
10831
10831
|
var styleXml = serializer.serializeToString(style);
|
|
10832
10832
|
// foreignObject not supported in IE11 and below
|
|
10833
10833
|
// https://msdn.microsoft.com/en-us/library/hh834675(v=vs.85).aspx
|
|
10834
|
-
var dataStr = "<svg xmlns=\"".concat(namespaces.svg, "\" width=\"").concat(width, "\" height=\"").concat(height, "\" \n\t\tviewBox=\"0 0 ").concat(orgSize.width, " ").concat(orgSize.height, "\" \n\t\tpreserveAspectRatio=\"").concat((option === null || option ===
|
|
10834
|
+
var dataStr = "<svg xmlns=\"".concat(namespaces.svg, "\" width=\"").concat(width, "\" height=\"").concat(height, "\" \n\t\tviewBox=\"0 0 ").concat(orgSize.width, " ").concat(orgSize.height, "\" \n\t\tpreserveAspectRatio=\"").concat((option === null || option === undefined ? undefined : option.preserveAspectRatio) === false ? "none" : "xMinYMid meet", "\">\n\t\t\t<foreignObject width=\"100%\" height=\"100%\">\n\t\t\t\t").concat(styleXml, "\n\t\t\t\t").concat(nodeXml.replace(/(url\()[^#]+/g, "$1"), "\n\t\t\t</foreignObject></svg>");
|
|
10835
10835
|
return "data:image/svg+xml;base64,".concat(b64EncodeUnicode(dataStr));
|
|
10836
10836
|
}
|
|
10837
10837
|
/**
|
|
@@ -11448,7 +11448,7 @@ function showHide(show, targetIdsValue, options) {
|
|
|
11448
11448
|
// https://github.com/naver/billboard.js/issues/1758
|
|
11449
11449
|
if (!show && hiddenIds.length === 0) {
|
|
11450
11450
|
targets.style("display", "none");
|
|
11451
|
-
callFn((_a = $$.config) === null || _a ===
|
|
11451
|
+
callFn((_a = $$.config) === null || _a === undefined ? undefined : _a.data_onhidden, _this, targetIds);
|
|
11452
11452
|
}
|
|
11453
11453
|
targets.style("opacity", opacity);
|
|
11454
11454
|
});
|
|
@@ -11481,7 +11481,7 @@ var apiShow = {
|
|
|
11481
11481
|
* chart.show(["data1", "data3"]);
|
|
11482
11482
|
*/
|
|
11483
11483
|
show: function (targetIdsValue, options) {
|
|
11484
|
-
if (options ===
|
|
11484
|
+
if (options === undefined) { options = {}; }
|
|
11485
11485
|
showHide.call(this, true, targetIdsValue, options);
|
|
11486
11486
|
},
|
|
11487
11487
|
/**
|
|
@@ -11504,7 +11504,7 @@ var apiShow = {
|
|
|
11504
11504
|
* chart.hide(["data1", "data3"]);
|
|
11505
11505
|
*/
|
|
11506
11506
|
hide: function (targetIdsValue, options) {
|
|
11507
|
-
if (options ===
|
|
11507
|
+
if (options === undefined) { options = {}; }
|
|
11508
11508
|
showHide.call(this, false, targetIdsValue, options);
|
|
11509
11509
|
},
|
|
11510
11510
|
/**
|
|
@@ -11528,7 +11528,7 @@ var apiShow = {
|
|
|
11528
11528
|
*/
|
|
11529
11529
|
toggle: function (targetIds, options) {
|
|
11530
11530
|
var _this = this;
|
|
11531
|
-
if (options ===
|
|
11531
|
+
if (options === undefined) { options = {}; }
|
|
11532
11532
|
var $$ = this.internal;
|
|
11533
11533
|
var targets = { show: [], hide: [] };
|
|
11534
11534
|
// sort show & hide target ids
|
|
@@ -11624,7 +11624,7 @@ var tooltip = {
|
|
|
11624
11624
|
// determine focus data
|
|
11625
11625
|
if (args.data) {
|
|
11626
11626
|
var data = args.data;
|
|
11627
|
-
var y = (_a = $$.getYScaleById(data.id)) === null || _a ===
|
|
11627
|
+
var y = (_a = $$.getYScaleById(data.id)) === null || _a === undefined ? undefined : _a(data.value);
|
|
11628
11628
|
if ((hasFunnel || hasTreemap) && data.id) {
|
|
11629
11629
|
var selector = $$.selectorTarget(data.id, undefined, ".".concat($SHAPE.shape));
|
|
11630
11630
|
eventReceiver.rect = $el.main.select(selector);
|
|
@@ -11637,8 +11637,8 @@ var tooltip = {
|
|
|
11637
11637
|
if (!config.tooltip_grouped) {
|
|
11638
11638
|
mouse = [0, y];
|
|
11639
11639
|
}
|
|
11640
|
-
index = (_b = data.index) !== null && _b !==
|
|
11641
|
-
(_c = $$.getArcElementByIdOrIndex(data.id)) === null || _c ===
|
|
11640
|
+
index = (_b = data.index) !== null && _b !== undefined ? _b : ($$.hasArcType() && data.id ?
|
|
11641
|
+
(_c = $$.getArcElementByIdOrIndex(data.id)) === null || _c === undefined ? undefined : _c.datum().index :
|
|
11642
11642
|
$$.getIndexByX(data.x));
|
|
11643
11643
|
}
|
|
11644
11644
|
}
|
|
@@ -11662,7 +11662,7 @@ var tooltip = {
|
|
|
11662
11662
|
var _a, _b, _c;
|
|
11663
11663
|
var $$ = this.internal;
|
|
11664
11664
|
var inputType = $$.state.inputType, tooltip = $$.$el.tooltip;
|
|
11665
|
-
var data = tooltip === null || tooltip ===
|
|
11665
|
+
var data = tooltip === null || tooltip === undefined ? undefined : tooltip.datum();
|
|
11666
11666
|
if (data) {
|
|
11667
11667
|
var index_1 = JSON.parse(data.current)[0].index;
|
|
11668
11668
|
// make to finalize, possible pending event flow set from '.tooltip.show()' call
|
|
@@ -11673,9 +11673,9 @@ var tooltip = {
|
|
|
11673
11673
|
// reset last touch point index
|
|
11674
11674
|
inputType === "touch" && $$.callOverOutForTouch();
|
|
11675
11675
|
$$.hideTooltip(true);
|
|
11676
|
-
(_a = $$.hideGridFocus) === null || _a ===
|
|
11677
|
-
(_b = $$.unexpandCircles) === null || _b ===
|
|
11678
|
-
(_c = $$.expandBarTypeShapes) === null || _c ===
|
|
11676
|
+
(_a = $$.hideGridFocus) === null || _a === undefined ? undefined : _a.call($$);
|
|
11677
|
+
(_b = $$.unexpandCircles) === null || _b === undefined ? undefined : _b.call($$);
|
|
11678
|
+
(_c = $$.expandBarTypeShapes) === null || _c === undefined ? undefined : _c.call($$, false);
|
|
11679
11679
|
}
|
|
11680
11680
|
};
|
|
11681
11681
|
var apiTooltip = { tooltip: tooltip };
|
|
@@ -12528,7 +12528,7 @@ var apiGroup = {
|
|
|
12528
12528
|
* @private
|
|
12529
12529
|
*/
|
|
12530
12530
|
function regionsFn(regions, isAdd) {
|
|
12531
|
-
if (isAdd ===
|
|
12531
|
+
if (isAdd === undefined) { isAdd = false; }
|
|
12532
12532
|
var $$ = this.internal;
|
|
12533
12533
|
var config = $$.config;
|
|
12534
12534
|
var withTransition = config.transition_duration && isTabVisible();
|
|
@@ -12746,7 +12746,7 @@ var AxisRendererHelper = /** @class */ (function () {
|
|
|
12746
12746
|
* @private
|
|
12747
12747
|
*/
|
|
12748
12748
|
AxisRendererHelper.getSizeFor1Char = function (text, memoize) {
|
|
12749
|
-
if (memoize ===
|
|
12749
|
+
if (memoize === undefined) { memoize = true; }
|
|
12750
12750
|
// default size for one character
|
|
12751
12751
|
var size = {
|
|
12752
12752
|
w: 5.5,
|
|
@@ -12874,7 +12874,7 @@ var AxisRendererHelper = /** @class */ (function () {
|
|
|
12874
12874
|
|
|
12875
12875
|
var AxisRenderer = /** @class */ (function () {
|
|
12876
12876
|
function AxisRenderer(params) {
|
|
12877
|
-
if (params ===
|
|
12877
|
+
if (params === undefined) { params = {}; }
|
|
12878
12878
|
var config = {
|
|
12879
12879
|
innerTickSize: 6,
|
|
12880
12880
|
outerTickSize: params.outerTick ? 6 : 0,
|
|
@@ -13060,7 +13060,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
13060
13060
|
*/
|
|
13061
13061
|
AxisRenderer.prototype.getGeneratedTicks = function (count) {
|
|
13062
13062
|
var _a;
|
|
13063
|
-
var len = ((_a = this.generatedTicks) === null || _a ===
|
|
13063
|
+
var len = ((_a = this.generatedTicks) === null || _a === undefined ? undefined : _a.length) - 1;
|
|
13064
13064
|
var res = this.generatedTicks;
|
|
13065
13065
|
if (len > count) {
|
|
13066
13066
|
var interval_1 = Math.round((len / count) + 0.1);
|
|
@@ -13274,7 +13274,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
13274
13274
|
interval = tickOffset * 2;
|
|
13275
13275
|
}
|
|
13276
13276
|
else {
|
|
13277
|
-
var scale_1 = (_a = this.params.owner.scale.zoom) !== null && _a !==
|
|
13277
|
+
var scale_1 = (_a = this.params.owner.scale.zoom) !== null && _a !== undefined ? _a : this.helper.scale;
|
|
13278
13278
|
var length_1 = this.g.select("path.domain")
|
|
13279
13279
|
.node()
|
|
13280
13280
|
.getTotalLength() - outerTickSize * 2;
|
|
@@ -13375,18 +13375,18 @@ var Axis = /** @class */ (function () {
|
|
|
13375
13375
|
return !this.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
|
|
13376
13376
|
};
|
|
13377
13377
|
Axis.prototype.isTimeSeries = function (id) {
|
|
13378
|
-
if (id ===
|
|
13378
|
+
if (id === undefined) { id = "x"; }
|
|
13379
13379
|
return this.owner.config["axis_".concat(id, "_type")] === "timeseries";
|
|
13380
13380
|
};
|
|
13381
13381
|
Axis.prototype.isLog = function (id) {
|
|
13382
|
-
if (id ===
|
|
13382
|
+
if (id === undefined) { id = "x"; }
|
|
13383
13383
|
return this.owner.config["axis_".concat(id, "_type")] === "log";
|
|
13384
13384
|
};
|
|
13385
13385
|
Axis.prototype.isTimeSeriesY = function () {
|
|
13386
13386
|
return this.isTimeSeries("y");
|
|
13387
13387
|
};
|
|
13388
13388
|
Axis.prototype.getAxisType = function (id) {
|
|
13389
|
-
if (id ===
|
|
13389
|
+
if (id === undefined) { id = "x"; }
|
|
13390
13390
|
var type = "linear";
|
|
13391
13391
|
if (this.isTimeSeries(id)) {
|
|
13392
13392
|
type = this.owner.config.axis_x_localtime ? "time" : "utc";
|
|
@@ -13638,7 +13638,7 @@ var Axis = /** @class */ (function () {
|
|
|
13638
13638
|
}
|
|
13639
13639
|
else if (this.x) {
|
|
13640
13640
|
this.x.tickValues(values);
|
|
13641
|
-
(_a = this.subX) === null || _a ===
|
|
13641
|
+
(_a = this.subX) === null || _a === undefined ? undefined : _a.tickValues(values);
|
|
13642
13642
|
}
|
|
13643
13643
|
return values;
|
|
13644
13644
|
};
|
|
@@ -14001,7 +14001,7 @@ var Axis = /** @class */ (function () {
|
|
|
14001
14001
|
var start = values[0];
|
|
14002
14002
|
var end = values[values.length - 1];
|
|
14003
14003
|
var interval = (end - start) / (count + 1);
|
|
14004
|
-
var tickValue =
|
|
14004
|
+
var tickValue = undefined;
|
|
14005
14005
|
// re-construct unique values
|
|
14006
14006
|
tickValues = [start];
|
|
14007
14007
|
for (var i = 0; i < count; i++) {
|
|
@@ -14069,7 +14069,7 @@ var Axis = /** @class */ (function () {
|
|
|
14069
14069
|
}
|
|
14070
14070
|
else if (this.x) {
|
|
14071
14071
|
this.x.tickValues([]);
|
|
14072
|
-
(_a = this.subX) === null || _a ===
|
|
14072
|
+
(_a = this.subX) === null || _a === undefined ? undefined : _a.tickValues([]);
|
|
14073
14073
|
}
|
|
14074
14074
|
if (config.zoom_rescale && !flow) {
|
|
14075
14075
|
xDomainForZoom = scale.x.orgDomain();
|
|
@@ -14098,8 +14098,8 @@ var Axis = /** @class */ (function () {
|
|
|
14098
14098
|
}
|
|
14099
14099
|
// Update sub domain
|
|
14100
14100
|
if (wth.Y) {
|
|
14101
|
-
(_b = scale.subY) === null || _b ===
|
|
14102
|
-
(_c = scale.subY2) === null || _c ===
|
|
14101
|
+
(_b = scale.subY) === null || _b === undefined ? undefined : _b.domain($$.getYDomain(targetsToShow, "y"));
|
|
14102
|
+
(_c = scale.subY2) === null || _c === undefined ? undefined : _c.domain($$.getYDomain(targetsToShow, "y2"));
|
|
14103
14103
|
}
|
|
14104
14104
|
};
|
|
14105
14105
|
/**
|
|
@@ -14161,7 +14161,7 @@ var Axis = /** @class */ (function () {
|
|
|
14161
14161
|
var _a;
|
|
14162
14162
|
var $$ = this.owner;
|
|
14163
14163
|
var _b = $$.config, isRotated = _b.axis_rotated, axis_tooltip = _b.axis_tooltip, _c = $$.$el, axis = _c.axis, axisTooltip = _c.axisTooltip;
|
|
14164
|
-
var bgColor = (_a = axis_tooltip.backgroundColor) !== null && _a !==
|
|
14164
|
+
var bgColor = (_a = axis_tooltip.backgroundColor) !== null && _a !== undefined ? _a : "black";
|
|
14165
14165
|
$$.generateTextBGColorFilter(bgColor, {
|
|
14166
14166
|
x: -0.15,
|
|
14167
14167
|
y: -0.2,
|
|
@@ -14170,16 +14170,16 @@ var Axis = /** @class */ (function () {
|
|
|
14170
14170
|
});
|
|
14171
14171
|
["x", "y", "y2"].forEach(function (v) {
|
|
14172
14172
|
var _a, _b, _c;
|
|
14173
|
-
axisTooltip[v] = (_a = axis[v]) === null || _a ===
|
|
14173
|
+
axisTooltip[v] = (_a = axis[v]) === null || _a === undefined ? undefined : _a.append("text").classed($AXIS["axis".concat(v.toUpperCase(), "Tooltip")], true).attr("filter", $$.updateTextBGColor({ id: v }, bgColor));
|
|
14174
14174
|
if (isRotated) {
|
|
14175
14175
|
var pos = v === "x" ? "x" : "y";
|
|
14176
14176
|
var val = v === "y" ? "1.15em" : (v === "x" ? "-0.3em" : "-0.4em");
|
|
14177
|
-
(_b = axisTooltip[v]) === null || _b ===
|
|
14177
|
+
(_b = axisTooltip[v]) === null || _b === undefined ? undefined : _b.attr(pos, val).attr("d".concat(v === "x" ? "y" : "x"), v === "x" ? "0.4em" : "-1.3em").style("text-anchor", v === "x" ? "end" : null);
|
|
14178
14178
|
}
|
|
14179
14179
|
else {
|
|
14180
14180
|
var pos = v === "x" ? "y" : "x";
|
|
14181
14181
|
var val = v === "x" ? "1.15em" : "".concat(v === "y" ? "-" : "", "0.4em");
|
|
14182
|
-
(_c = axisTooltip[v]) === null || _c ===
|
|
14182
|
+
(_c = axisTooltip[v]) === null || _c === undefined ? undefined : _c.attr(pos, val).attr("d".concat(v === "x" ? "x" : "y"), v === "x" ? "-1em" : "0.3em").style("text-anchor", v === "y" ? "end" : null);
|
|
14183
14183
|
}
|
|
14184
14184
|
});
|
|
14185
14185
|
};
|
|
@@ -14247,7 +14247,7 @@ var eventrect = {
|
|
|
14247
14247
|
// update data's index value to be alinged with the x Axis
|
|
14248
14248
|
$$.updateDataIndexByX(xAxisTickValues);
|
|
14249
14249
|
$$.updateXs(xAxisTickValues);
|
|
14250
|
-
(_a = $$.updatePointClass) === null || _a ===
|
|
14250
|
+
(_a = $$.updatePointClass) === null || _a === undefined ? undefined : _a.call($$, true);
|
|
14251
14251
|
state.eventReceiver.data = xAxisTickValues;
|
|
14252
14252
|
}
|
|
14253
14253
|
$$.updateEventRectData();
|
|
@@ -14341,7 +14341,7 @@ var eventrect = {
|
|
|
14341
14341
|
* @private
|
|
14342
14342
|
*/
|
|
14343
14343
|
updateEventRect: function (eventRect, force) {
|
|
14344
|
-
if (force ===
|
|
14344
|
+
if (force === undefined) { force = false; }
|
|
14345
14345
|
var $$ = this;
|
|
14346
14346
|
var state = $$.state, $el = $$.$el;
|
|
14347
14347
|
var eventReceiver = state.eventReceiver, width = state.width, height = state.height, rendered = state.rendered, resizing = state.resizing;
|
|
@@ -14377,10 +14377,10 @@ var eventrect = {
|
|
|
14377
14377
|
var $$ = this;
|
|
14378
14378
|
var isRebindCall = isBoolean(target);
|
|
14379
14379
|
var eventRect = isRebindCall ? $$.$el.eventRect : target;
|
|
14380
|
-
var unbindEvent = isRebindCall ? target !== (eventRect === null || eventRect ===
|
|
14380
|
+
var unbindEvent = isRebindCall ? target !== (eventRect === null || eventRect === undefined ? undefined : eventRect.datum().multipleX) : false;
|
|
14381
14381
|
if (eventRect) {
|
|
14382
14382
|
// release previous event listeners
|
|
14383
|
-
unbindEvent && (eventRect === null || eventRect ===
|
|
14383
|
+
unbindEvent && (eventRect === null || eventRect === undefined ? undefined : eventRect.on("mouseover mousemove mouseout click", null));
|
|
14384
14384
|
$$.isMultipleX() ?
|
|
14385
14385
|
$$.generateEventRectsForMultipleXs(eventRect) :
|
|
14386
14386
|
$$.generateEventRectsForSingleX(eventRect);
|
|
@@ -14410,7 +14410,7 @@ var eventrect = {
|
|
|
14410
14410
|
}
|
|
14411
14411
|
else {
|
|
14412
14412
|
var rectW_1;
|
|
14413
|
-
var rectX =
|
|
14413
|
+
var rectX = undefined;
|
|
14414
14414
|
if ($$.axis.isCategorized()) {
|
|
14415
14415
|
rectW_1 = $$.getEventRectWidth();
|
|
14416
14416
|
rectX = function (d) { return xScale(d.x) - (rectW_1 / 2); };
|
|
@@ -14440,7 +14440,7 @@ var eventrect = {
|
|
|
14440
14440
|
else {
|
|
14441
14441
|
Object.keys(x).forEach(function (key, i) {
|
|
14442
14442
|
var _a;
|
|
14443
|
-
x[key] = (_a = x[key]) !== null && _a !==
|
|
14443
|
+
x[key] = (_a = x[key]) !== null && _a !== undefined ? _a : xDomain[i];
|
|
14444
14444
|
});
|
|
14445
14445
|
val = Math.max(0, (xScale(x.next) - xScale(x.prev)) / 2);
|
|
14446
14446
|
}
|
|
@@ -14497,7 +14497,7 @@ var eventrect = {
|
|
|
14497
14497
|
var selectedData = $$.getAllValuesOnIndex(index);
|
|
14498
14498
|
if (isTooltipGrouped) {
|
|
14499
14499
|
$$.showTooltip(selectedData, context);
|
|
14500
|
-
(_a = $$.showGridFocus) === null || _a ===
|
|
14500
|
+
(_a = $$.showGridFocus) === null || _a === undefined ? undefined : _a.call($$, selectedData);
|
|
14501
14501
|
if (!isSelectionEnabled || isSelectionGrouped) {
|
|
14502
14502
|
return;
|
|
14503
14503
|
}
|
|
@@ -14512,7 +14512,7 @@ var eventrect = {
|
|
|
14512
14512
|
return $$.isWithinShape(this, d);
|
|
14513
14513
|
});
|
|
14514
14514
|
if (shapeAtIndex.empty() && !isTooltipGrouped && config.interaction_onout) {
|
|
14515
|
-
(_b = $$.hideGridFocus) === null || _b ===
|
|
14515
|
+
(_b = $$.hideGridFocus) === null || _b === undefined ? undefined : _b.call($$);
|
|
14516
14516
|
$$.hideTooltip();
|
|
14517
14517
|
!isSelectionGrouped && $$.setExpand(index);
|
|
14518
14518
|
}
|
|
@@ -14521,13 +14521,13 @@ var eventrect = {
|
|
|
14521
14521
|
var _a, _b;
|
|
14522
14522
|
var d = selected.data();
|
|
14523
14523
|
if (isSelectionEnabled &&
|
|
14524
|
-
(isSelectionGrouped || (isSelectable === null || isSelectable ===
|
|
14524
|
+
(isSelectionGrouped || (isSelectable === null || isSelectable === undefined ? undefined : isSelectable.bind($$.api)(d)))) {
|
|
14525
14525
|
context.style.cursor = "pointer";
|
|
14526
14526
|
}
|
|
14527
14527
|
if (!isTooltipGrouped) {
|
|
14528
14528
|
$$.showTooltip(d, context);
|
|
14529
|
-
(_a = $$.showGridFocus) === null || _a ===
|
|
14530
|
-
(_b = $$.unexpandCircles) === null || _b ===
|
|
14529
|
+
(_a = $$.showGridFocus) === null || _a === undefined ? undefined : _a.call($$, d);
|
|
14530
|
+
(_b = $$.unexpandCircles) === null || _b === undefined ? undefined : _b.call($$);
|
|
14531
14531
|
selected.each(function (d) { return $$.setExpand(index, d.id); });
|
|
14532
14532
|
}
|
|
14533
14533
|
});
|
|
@@ -14539,7 +14539,7 @@ var eventrect = {
|
|
|
14539
14539
|
* @private
|
|
14540
14540
|
*/
|
|
14541
14541
|
selectRectForMultipleXs: function (context, triggerEvent) {
|
|
14542
|
-
if (triggerEvent ===
|
|
14542
|
+
if (triggerEvent === undefined) { triggerEvent = true; }
|
|
14543
14543
|
var $$ = this;
|
|
14544
14544
|
var config = $$.config, state = $$.state;
|
|
14545
14545
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
|
@@ -14623,7 +14623,7 @@ var eventrect = {
|
|
|
14623
14623
|
state.event = event;
|
|
14624
14624
|
$$.updateEventRect();
|
|
14625
14625
|
Object.values($$.$el.axisTooltip)
|
|
14626
|
-
.forEach(function (v) { return v === null || v ===
|
|
14626
|
+
.forEach(function (v) { return v === null || v === undefined ? undefined : v.style("display", null); });
|
|
14627
14627
|
})
|
|
14628
14628
|
.on("mousemove", function (event) {
|
|
14629
14629
|
var d = getData_1(event);
|
|
@@ -14691,7 +14691,7 @@ var eventrect = {
|
|
|
14691
14691
|
.each(function (d2) {
|
|
14692
14692
|
var _a;
|
|
14693
14693
|
if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {
|
|
14694
|
-
(_a = $$.toggleShape) === null || _a ===
|
|
14694
|
+
(_a = $$.toggleShape) === null || _a === undefined ? undefined : _a.call($$, this, d2, index);
|
|
14695
14695
|
config.data_onclick.bind($$.api)(d2, this);
|
|
14696
14696
|
}
|
|
14697
14697
|
});
|
|
@@ -14747,7 +14747,7 @@ var eventrect = {
|
|
|
14747
14747
|
.each(function () {
|
|
14748
14748
|
var _a;
|
|
14749
14749
|
if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
|
|
14750
|
-
(_a = $$.toggleShape) === null || _a ===
|
|
14750
|
+
(_a = $$.toggleShape) === null || _a === undefined ? undefined : _a.call($$, this, closest, closest.index);
|
|
14751
14751
|
config.data_onclick.bind($$.api)(closest, this);
|
|
14752
14752
|
}
|
|
14753
14753
|
});
|
|
@@ -14800,7 +14800,7 @@ var flow = {
|
|
|
14800
14800
|
if (node && name.length > 1) {
|
|
14801
14801
|
node = node[name[1]];
|
|
14802
14802
|
}
|
|
14803
|
-
if (node === null || node ===
|
|
14803
|
+
if (node === null || node === undefined ? undefined : node.size()) {
|
|
14804
14804
|
elements[v] = node;
|
|
14805
14805
|
}
|
|
14806
14806
|
});
|
|
@@ -14817,7 +14817,7 @@ var flow = {
|
|
|
14817
14817
|
setFlowList: function (elements, args) {
|
|
14818
14818
|
var $$ = this;
|
|
14819
14819
|
var flow = args.flow, targets = args.targets;
|
|
14820
|
-
var _a = flow.duration, duration = _a ===
|
|
14820
|
+
var _a = flow.duration, duration = _a === undefined ? args.duration : _a, flowIndex = flow.index, flowLength = flow.length, orgDataCount = flow.orgDataCount;
|
|
14821
14821
|
var transform = $$.getFlowTransform(targets, orgDataCount, flowIndex, flowLength);
|
|
14822
14822
|
var wait = generateWait();
|
|
14823
14823
|
var n;
|
|
@@ -14856,7 +14856,7 @@ var flow = {
|
|
|
14856
14856
|
var isRotated = config.axis_rotated;
|
|
14857
14857
|
var flow = args.flow, shape = args.shape, xv = args.xv;
|
|
14858
14858
|
var _a = shape.pos, cx = _a.cx, cy = _a.cy, xForText = _a.xForText, yForText = _a.yForText;
|
|
14859
|
-
var _b = flow.done, done = _b ===
|
|
14859
|
+
var _b = flow.done, done = _b === undefined ? function () { } : _b, flowLength = flow.length;
|
|
14860
14860
|
// Remove flowed elements
|
|
14861
14861
|
if (flowLength) {
|
|
14862
14862
|
["circle", "text", "shape", "eventRect"].forEach(function (v) {
|
|
@@ -14951,13 +14951,13 @@ var flow = {
|
|
|
14951
14951
|
}
|
|
14952
14952
|
}
|
|
14953
14953
|
}
|
|
14954
|
-
else if (orgDataCount === 1 || (flowStart === null || flowStart ===
|
|
14954
|
+
else if (orgDataCount === 1 || (flowStart === null || flowStart === undefined ? undefined : flowStart.x) === (flowEnd === null || flowEnd === undefined ? undefined : flowEnd.x)) {
|
|
14955
14955
|
translateX = x(orgDomain[0]) - x(domain[0]);
|
|
14956
14956
|
}
|
|
14957
14957
|
else {
|
|
14958
14958
|
translateX = $$.axis.isTimeSeries() ?
|
|
14959
14959
|
x(orgDomain[0]) - x(domain[0]) :
|
|
14960
|
-
x((flowStart === null || flowStart ===
|
|
14960
|
+
x((flowStart === null || flowStart === undefined ? undefined : flowStart.x) || 0) - x(flowEnd.x);
|
|
14961
14961
|
}
|
|
14962
14962
|
var scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
|
14963
14963
|
return "translate(".concat(translateX, ",0) scale(").concat(scaleX, ",1)");
|
|
@@ -15263,7 +15263,7 @@ var grid = {
|
|
|
15263
15263
|
.attr("dy", -5))
|
|
15264
15264
|
.text(function (d) {
|
|
15265
15265
|
var _a;
|
|
15266
|
-
return (_a = d.text) !== null && _a !==
|
|
15266
|
+
return (_a = d.text) !== null && _a !== undefined ? _a : this.remove();
|
|
15267
15267
|
});
|
|
15268
15268
|
gridLines[type] = lines;
|
|
15269
15269
|
},
|
|
@@ -15337,19 +15337,19 @@ var grid = {
|
|
|
15337
15337
|
var config = $$.config, format = $$.format, _c = $$.state, event = _c.event, width = _c.width, height = _c.height;
|
|
15338
15338
|
var isRotated = config.axis_rotated;
|
|
15339
15339
|
// get mouse event position
|
|
15340
|
-
var _d = getPointer(event, (_a = $$.$el.eventRect) === null || _a ===
|
|
15340
|
+
var _d = getPointer(event, (_a = $$.$el.eventRect) === null || _a === undefined ? undefined : _a.node()), x = _d[0], y = _d[1];
|
|
15341
15341
|
var pos = { x: x, y: y };
|
|
15342
15342
|
for (var _i = 0, _e = Object.entries($$.$el.axisTooltip); _i < _e.length; _i++) {
|
|
15343
15343
|
var _f = _e[_i], axis = _f[0], node = _f[1];
|
|
15344
15344
|
var attr = (axis === "x" && !isRotated) || (axis !== "x" && isRotated) ? "x" : "y";
|
|
15345
15345
|
var value = pos[attr];
|
|
15346
|
-
var scaleText = (_b = $$.scale[axis]) === null || _b ===
|
|
15346
|
+
var scaleText = (_b = $$.scale[axis]) === null || _b === undefined ? undefined : _b.invert(value);
|
|
15347
15347
|
if (scaleText) {
|
|
15348
15348
|
scaleText = axis === "x" && $$.axis.isTimeSeries() ?
|
|
15349
15349
|
format.xAxisTick(scaleText) :
|
|
15350
|
-
scaleText === null || scaleText ===
|
|
15350
|
+
scaleText === null || scaleText === undefined ? undefined : scaleText.toFixed(2);
|
|
15351
15351
|
// set position & its text value based on position
|
|
15352
|
-
node === null || node ===
|
|
15352
|
+
node === null || node === undefined ? undefined : node.attr(attr, value).text(scaleText);
|
|
15353
15353
|
}
|
|
15354
15354
|
}
|
|
15355
15355
|
$$.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility", null)
|
|
@@ -15375,7 +15375,7 @@ var grid = {
|
|
|
15375
15375
|
var $$ = this;
|
|
15376
15376
|
$$.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility", "hidden");
|
|
15377
15377
|
Object.values($$.$el.axisTooltip)
|
|
15378
|
-
.forEach(function (v) { return v === null || v ===
|
|
15378
|
+
.forEach(function (v) { return v === null || v === undefined ? undefined : v.style("display", "none"); });
|
|
15379
15379
|
},
|
|
15380
15380
|
/**
|
|
15381
15381
|
* Show grid focus line
|
|
@@ -15443,7 +15443,7 @@ var grid = {
|
|
|
15443
15443
|
.forEach(function (v, i) { return el.attr(v, xy[i]); });
|
|
15444
15444
|
});
|
|
15445
15445
|
smoothLines(focusEl);
|
|
15446
|
-
(_a = $$.showCircleFocus) === null || _a ===
|
|
15446
|
+
(_a = $$.showCircleFocus) === null || _a === undefined ? undefined : _a.call($$, data);
|
|
15447
15447
|
},
|
|
15448
15448
|
hideGridFocus: function () {
|
|
15449
15449
|
var _a;
|
|
@@ -15452,7 +15452,7 @@ var grid = {
|
|
|
15452
15452
|
if (inputType === "mouse" || !resizing) {
|
|
15453
15453
|
main.selectAll("line.".concat($FOCUS.xgridFocus, ", line.").concat($FOCUS.ygridFocus))
|
|
15454
15454
|
.style("visibility", "hidden");
|
|
15455
|
-
(_a = $$.hideCircleFocus) === null || _a ===
|
|
15455
|
+
(_a = $$.hideCircleFocus) === null || _a === undefined ? undefined : _a.call($$);
|
|
15456
15456
|
}
|
|
15457
15457
|
},
|
|
15458
15458
|
updateGridFocus: function () {
|
|
@@ -15462,7 +15462,7 @@ var grid = {
|
|
|
15462
15462
|
var xgridFocus = grid.main.select("line.".concat($FOCUS.xgridFocus));
|
|
15463
15463
|
if (inputType === "touch") {
|
|
15464
15464
|
if (xgridFocus.empty()) {
|
|
15465
|
-
resizing && ((_a = $$.showCircleFocus) === null || _a ===
|
|
15465
|
+
resizing && ((_a = $$.showCircleFocus) === null || _a === undefined ? undefined : _a.call($$));
|
|
15466
15466
|
}
|
|
15467
15467
|
else {
|
|
15468
15468
|
$$.showGridFocus();
|
|
@@ -15572,7 +15572,7 @@ var region = {
|
|
|
15572
15572
|
region.list.each(function (d) {
|
|
15573
15573
|
var _a;
|
|
15574
15574
|
var g = select(this);
|
|
15575
|
-
if (g.select("text").empty() && ((_a = d.label) === null || _a ===
|
|
15575
|
+
if (g.select("text").empty() && ((_a = d.label) === null || _a === undefined ? undefined : _a.text)) {
|
|
15576
15576
|
select(this).append("text")
|
|
15577
15577
|
.style("opacity", "0");
|
|
15578
15578
|
}
|
|
@@ -15591,13 +15591,13 @@ var region = {
|
|
|
15591
15591
|
label = $T(label, withTransition)
|
|
15592
15592
|
.attr("transform", function (d) {
|
|
15593
15593
|
var _a;
|
|
15594
|
-
var _b = (_a = d.label) !== null && _a !==
|
|
15594
|
+
var _b = (_a = d.label) !== null && _a !== undefined ? _a : {}, _c = _b.x, x = _c === undefined ? 0 : _c, _d = _b.y, y = _d === undefined ? 0 : _d, _e = _b.rotated, rotated = _e === undefined ? false : _e;
|
|
15595
15595
|
return "translate(".concat($$.regionX.bind($$)(d) + x, ", ").concat($$.regionY.bind($$)(d) + y, ")").concat(rotated ? " rotate(-90)" : "");
|
|
15596
15596
|
})
|
|
15597
|
-
.attr("text-anchor", function (d) { var _a; return (((_a = d.label) === null || _a ===
|
|
15597
|
+
.attr("text-anchor", function (d) { var _a; return (((_a = d.label) === null || _a === undefined ? undefined : _a.rotated) ? "end" : null); })
|
|
15598
15598
|
.attr("dy", "1em")
|
|
15599
|
-
.style("fill", function (d) { var _a, _b; return (_b = (_a = d.label) === null || _a ===
|
|
15600
|
-
.text(function (d) { var _a; return (_a = d.label) === null || _a ===
|
|
15599
|
+
.style("fill", function (d) { var _a, _b; return (_b = (_a = d.label) === null || _a === undefined ? undefined : _a.color) !== null && _b !== undefined ? _b : null; })
|
|
15600
|
+
.text(function (d) { var _a; return (_a = d.label) === null || _a === undefined ? undefined : _a.text; });
|
|
15601
15601
|
return [
|
|
15602
15602
|
regions
|
|
15603
15603
|
.style("fill-opacity", function (d) { return (isValue(d.opacity) ? d.opacity : null); })
|
|
@@ -15692,10 +15692,10 @@ var sizeAxis = {
|
|
|
15692
15692
|
var _a, _b;
|
|
15693
15693
|
var $$ = this;
|
|
15694
15694
|
if ($$.axis) {
|
|
15695
|
-
var position = (_a = $$.axis) === null || _a ===
|
|
15695
|
+
var position = (_a = $$.axis) === null || _a === undefined ? undefined : _a.getLabelPositionById(id);
|
|
15696
15696
|
var width = $$.axis.getMaxTickSize(id, withoutRecompute).width;
|
|
15697
15697
|
var gap = width === 0 ? 0.5 : 0;
|
|
15698
|
-
return width + (((_b = $$.config.padding) === null || _b ===
|
|
15698
|
+
return width + (((_b = $$.config.padding) === null || _b === undefined ? undefined : _b.mode) === "fit" ?
|
|
15699
15699
|
position.isInner ? (10 + gap) : 10 :
|
|
15700
15700
|
position.isInner ?
|
|
15701
15701
|
(20 + gap) :
|
|
@@ -15711,11 +15711,11 @@ var sizeAxis = {
|
|
|
15711
15711
|
var config = $$.config, state = $$.state;
|
|
15712
15712
|
var rotatedPadding = state.rotatedPadding, isLegendRight = state.isLegendRight, isLegendInset = state.isLegendInset;
|
|
15713
15713
|
var isRotated = config.axis_rotated;
|
|
15714
|
-
var isFitPadding = ((_a = config.padding) === null || _a ===
|
|
15714
|
+
var isFitPadding = ((_a = config.padding) === null || _a === undefined ? undefined : _a.mode) === "fit";
|
|
15715
15715
|
var isInner = config["axis_".concat(id, "_inner")];
|
|
15716
15716
|
var hasLabelText = config["axis_".concat(id, "_label")].text;
|
|
15717
15717
|
var defaultHeight = 13;
|
|
15718
|
-
var h = ((_b = config.padding) === null || _b ===
|
|
15718
|
+
var h = ((_b = config.padding) === null || _b === undefined ? undefined : _b.mode) === "fit" ?
|
|
15719
15719
|
(isInner && !hasLabelText ? (id === "y" ? 1 : 0) : 20) :
|
|
15720
15720
|
30;
|
|
15721
15721
|
if (id === "x" && !config.axis_x_show) {
|
|
@@ -17808,7 +17808,7 @@ var options = {
|
|
|
17808
17808
|
* @private
|
|
17809
17809
|
*/
|
|
17810
17810
|
function getRadiusFn(expandRate) {
|
|
17811
|
-
if (expandRate ===
|
|
17811
|
+
if (expandRate === undefined) { expandRate = 0; }
|
|
17812
17812
|
var $$ = this;
|
|
17813
17813
|
var config = $$.config, state = $$.state;
|
|
17814
17814
|
var hasMultiArcGauge = $$.hasMultiArcGauge();
|
|
@@ -17866,7 +17866,7 @@ function getRadiusFn(expandRate) {
|
|
|
17866
17866
|
* @private
|
|
17867
17867
|
*/
|
|
17868
17868
|
corner: function (d, outerRadius) {
|
|
17869
|
-
var _a = config.arc_cornerRadius_ratio, ratio = _a ===
|
|
17869
|
+
var _a = config.arc_cornerRadius_ratio, ratio = _a === undefined ? 0 : _a, _b = config.arc_cornerRadius, cornerRadius = _b === undefined ? 0 : _b;
|
|
17870
17870
|
var id = d.data.id, value = d.value;
|
|
17871
17871
|
var corner = 0;
|
|
17872
17872
|
if (ratio) {
|
|
@@ -17890,7 +17890,7 @@ function getRadiusFn(expandRate) {
|
|
|
17890
17890
|
function getAttrTweenFn(fn) {
|
|
17891
17891
|
return function (d) {
|
|
17892
17892
|
var getAngleKeyValue = function (_a) {
|
|
17893
|
-
var _b = _a.startAngle, startAngle = _b ===
|
|
17893
|
+
var _b = _a.startAngle, startAngle = _b === undefined ? 0 : _b, _c = _a.endAngle, endAngle = _c === undefined ? 0 : _c, _d = _a.padAngle, padAngle = _d === undefined ? 0 : _d;
|
|
17894
17894
|
return ({
|
|
17895
17895
|
startAngle: startAngle,
|
|
17896
17896
|
endAngle: endAngle,
|
|
@@ -17921,7 +17921,7 @@ var shapeArc = {
|
|
|
17921
17921
|
.startAngle(startingAngle)
|
|
17922
17922
|
.endAngle(startingAngle + (2 * Math.PI))
|
|
17923
17923
|
.padAngle(padAngle)
|
|
17924
|
-
.value(function (d) { var _a, _b; return (_b = (_a = d.values) === null || _a ===
|
|
17924
|
+
.value(function (d) { var _a, _b; return (_b = (_a = d.values) === null || _a === undefined ? undefined : _a.reduce(function (a, b) { return a + b.value; }, 0)) !== null && _b !== undefined ? _b : d; })
|
|
17925
17925
|
.sort($$.getSortCompareFn.bind($$)(true));
|
|
17926
17926
|
},
|
|
17927
17927
|
updateRadius: function () {
|
|
@@ -17954,7 +17954,7 @@ var shapeArc = {
|
|
|
17954
17954
|
*/
|
|
17955
17955
|
getRadius: function (d) {
|
|
17956
17956
|
var $$ = this;
|
|
17957
|
-
var data = d === null || d ===
|
|
17957
|
+
var data = d === null || d === undefined ? undefined : d.data;
|
|
17958
17958
|
var _a = $$.state, innerRadius = _a.innerRadius, outerRadius = _a.outerRadius;
|
|
17959
17959
|
if (!isNumber(innerRadius) && data) {
|
|
17960
17960
|
innerRadius = innerRadius[data.id] || 0;
|
|
@@ -18014,7 +18014,7 @@ var shapeArc = {
|
|
|
18014
18014
|
*/
|
|
18015
18015
|
updateAngle: function (dValue, forRange) {
|
|
18016
18016
|
var _a;
|
|
18017
|
-
if (forRange ===
|
|
18017
|
+
if (forRange === undefined) { forRange = false; }
|
|
18018
18018
|
var $$ = this;
|
|
18019
18019
|
var config = $$.config, state = $$.state;
|
|
18020
18020
|
var hasGauge = forRange && $$.hasType("gauge");
|
|
@@ -18044,7 +18044,7 @@ var shapeArc = {
|
|
|
18044
18044
|
pie($$.filterTargetsToShow())
|
|
18045
18045
|
.forEach(function (t, i) {
|
|
18046
18046
|
var _a;
|
|
18047
|
-
if (!found && t.data.id === ((_a = d.data) === null || _a ===
|
|
18047
|
+
if (!found && t.data.id === ((_a = d.data) === null || _a === undefined ? undefined : _a.id)) {
|
|
18048
18048
|
found = true;
|
|
18049
18049
|
d = t;
|
|
18050
18050
|
d.index = i;
|
|
@@ -18061,7 +18061,7 @@ var shapeArc = {
|
|
|
18061
18061
|
var gMin = config.gauge_min, gMax = config.gauge_max;
|
|
18062
18062
|
var max = forRange && !hasGauge ? $$.getTotalDataSum(state.rendered) : gMax;
|
|
18063
18063
|
var gTic = radius / (max - gMin);
|
|
18064
|
-
var value = (_a = d.value) !== null && _a !==
|
|
18064
|
+
var value = (_a = d.value) !== null && _a !== undefined ? _a : 0;
|
|
18065
18065
|
var gValue = value < gMin ? 0 : value < max ? value - gMin : (max - gMin);
|
|
18066
18066
|
d.startAngle = gStart;
|
|
18067
18067
|
d.endAngle = gStart + gTic * gValue;
|
|
@@ -18078,7 +18078,7 @@ var shapeArc = {
|
|
|
18078
18078
|
var _a;
|
|
18079
18079
|
var path = "M 0 0";
|
|
18080
18080
|
if (d.value || d.data) {
|
|
18081
|
-
var data = withoutUpdate ? d : (_a = $$.updateAngle(d)) !== null && _a !==
|
|
18081
|
+
var data = withoutUpdate ? d : (_a = $$.updateAngle(d)) !== null && _a !== undefined ? _a : null;
|
|
18082
18082
|
if (data) {
|
|
18083
18083
|
path = arc$1.cornerRadius(corner(data, outer(data)))(data);
|
|
18084
18084
|
}
|
|
@@ -18096,7 +18096,7 @@ var shapeArc = {
|
|
|
18096
18096
|
* @private
|
|
18097
18097
|
*/
|
|
18098
18098
|
getSvgArcExpanded: function (rate) {
|
|
18099
|
-
if (rate ===
|
|
18099
|
+
if (rate === undefined) { rate = 1; }
|
|
18100
18100
|
var $$ = this;
|
|
18101
18101
|
var _a = getRadiusFn.call($$, rate), inner = _a.inner, outer = _a.outer, corner = _a.corner;
|
|
18102
18102
|
var arc$1 = arc()
|
|
@@ -18125,7 +18125,7 @@ var shapeArc = {
|
|
|
18125
18125
|
var format = config.arc_rangeText_format;
|
|
18126
18126
|
var fixed = $$.hasType("gauge") && config.arc_rangeText_fixed;
|
|
18127
18127
|
var values = config.arc_rangeText_values;
|
|
18128
|
-
if (values === null || values ===
|
|
18128
|
+
if (values === null || values === undefined ? undefined : values.length) {
|
|
18129
18129
|
var isPercent_1 = config.arc_rangeText_unit === "%";
|
|
18130
18130
|
var totalSum_1 = $$.getTotalDataSum(state.rendered);
|
|
18131
18131
|
if (isPercent_1) {
|
|
@@ -18161,7 +18161,7 @@ var shapeArc = {
|
|
|
18161
18161
|
*/
|
|
18162
18162
|
transformForArcLabel: function (d, forRange) {
|
|
18163
18163
|
var _a, _b, _c;
|
|
18164
|
-
if (forRange ===
|
|
18164
|
+
if (forRange === undefined) { forRange = false; }
|
|
18165
18165
|
var $$ = this;
|
|
18166
18166
|
var config = $$.config, radiusExpanded = $$.state.radiusExpanded;
|
|
18167
18167
|
var updated = $$.updateAngle(d, forRange);
|
|
@@ -18178,8 +18178,8 @@ var shapeArc = {
|
|
|
18178
18178
|
var pos = isFunction(rangeTextPosition) ?
|
|
18179
18179
|
rangeTextPosition(rangeValues[d.index]) :
|
|
18180
18180
|
rangeTextPosition;
|
|
18181
|
-
x += (_a = pos === null || pos ===
|
|
18182
|
-
y += (_b = pos === null || pos ===
|
|
18181
|
+
x += (_a = pos === null || pos === undefined ? undefined : pos.x) !== null && _a !== undefined ? _a : 0;
|
|
18182
|
+
y += (_b = pos === null || pos === undefined ? undefined : pos.y) !== null && _b !== undefined ? _b : 0;
|
|
18183
18183
|
}
|
|
18184
18184
|
translate = "translate(".concat(x, ",").concat(y, ")");
|
|
18185
18185
|
}
|
|
@@ -18193,7 +18193,7 @@ var shapeArc = {
|
|
|
18193
18193
|
var h = Math.sqrt(x * x + y * y);
|
|
18194
18194
|
var ratio = (_c = ["donut", "gauge", "pie", "polar"]
|
|
18195
18195
|
.filter($$.hasType.bind($$))
|
|
18196
|
-
.map(function (v) { return config["".concat(v, "_label_ratio")]; })) === null || _c ===
|
|
18196
|
+
.map(function (v) { return config["".concat(v, "_label_ratio")]; })) === null || _c === undefined ? undefined : _c[0];
|
|
18197
18197
|
if (ratio) {
|
|
18198
18198
|
ratio = isFunction(ratio) ? ratio.bind($$.api)(d, outerRadius, h) : ratio;
|
|
18199
18199
|
}
|
|
@@ -18230,7 +18230,7 @@ var shapeArc = {
|
|
|
18230
18230
|
var node = select(this);
|
|
18231
18231
|
var updated = $$.updateAngle(d);
|
|
18232
18232
|
var ratio = $$.getRatio("arc", updated);
|
|
18233
|
-
var isUnderThreshold = $$.meetsLabelThreshold(ratio, (_a = ["donut", "gauge", "pie", "polar"].filter($$.hasType.bind($$))) === null || _a ===
|
|
18233
|
+
var isUnderThreshold = $$.meetsLabelThreshold(ratio, (_a = ["donut", "gauge", "pie", "polar"].filter($$.hasType.bind($$))) === null || _a === undefined ? undefined : _a[0]);
|
|
18234
18234
|
if (isUnderThreshold) {
|
|
18235
18235
|
var value = (updated || d).value;
|
|
18236
18236
|
var text = ($$.getArcLabelFormat() || $$.defaultArcValueFormat)(value, ratio, d.data.id).toString();
|
|
@@ -18446,7 +18446,7 @@ var shapeArc = {
|
|
|
18446
18446
|
.append("path")
|
|
18447
18447
|
.attr("class", $$.getClass("arc", true))
|
|
18448
18448
|
.style("fill", function (d) { return $$.color(d.data); })
|
|
18449
|
-
.style("cursor", function (d) { var _a; return (((_a = isSelectable === null || isSelectable ===
|
|
18449
|
+
.style("cursor", function (d) { var _a; return (((_a = isSelectable === null || isSelectable === undefined ? undefined : isSelectable.bind) === null || _a === undefined ? undefined : _a.call(isSelectable, $$.api)(d)) ? "pointer" : null); })
|
|
18450
18450
|
.style("opacity", "0")
|
|
18451
18451
|
.each(function (d) {
|
|
18452
18452
|
if ($$.isGaugeType(d.data)) {
|
|
@@ -18558,7 +18558,7 @@ var shapeArc = {
|
|
|
18558
18558
|
* @private
|
|
18559
18559
|
*/
|
|
18560
18560
|
$el.needle.updateHelper = function (v, updateConfig) {
|
|
18561
|
-
if (updateConfig ===
|
|
18561
|
+
if (updateConfig === undefined) { updateConfig = false; }
|
|
18562
18562
|
if ($el.needle.style("display") !== "none") {
|
|
18563
18563
|
$$.$T($el.needle)
|
|
18564
18564
|
.style("transform", "rotate(".concat($$.getNeedleAngle(v), "deg)"))
|
|
@@ -18689,7 +18689,7 @@ var shapeArc = {
|
|
|
18689
18689
|
var arcData;
|
|
18690
18690
|
if (updated) {
|
|
18691
18691
|
arcData = $$.convertToArcData(updated);
|
|
18692
|
-
(_a = $$.toggleShape) === null || _a ===
|
|
18692
|
+
(_a = $$.toggleShape) === null || _a === undefined ? undefined : _a.call($$, this, arcData, i);
|
|
18693
18693
|
config.data_onclick.bind($$.api)(arcData, this);
|
|
18694
18694
|
}
|
|
18695
18695
|
});
|
|
@@ -18703,7 +18703,7 @@ var shapeArc = {
|
|
|
18703
18703
|
state.event = event;
|
|
18704
18704
|
var updated = $$.updateAngle(d);
|
|
18705
18705
|
var arcData = updated ? $$.convertToArcData(updated) : null;
|
|
18706
|
-
var id = (arcData === null || arcData ===
|
|
18706
|
+
var id = (arcData === null || arcData === undefined ? undefined : arcData.id) || undefined;
|
|
18707
18707
|
selectArc(this, arcData, id);
|
|
18708
18708
|
$$.setOverOut(true, arcData);
|
|
18709
18709
|
})
|
|
@@ -18728,7 +18728,7 @@ var shapeArc = {
|
|
|
18728
18728
|
if (isTouch && $$.hasArcType() && !$$.radars) {
|
|
18729
18729
|
var getEventArc_1 = function (event) {
|
|
18730
18730
|
var _a, _b;
|
|
18731
|
-
var _c = (_b = (_a = event.changedTouches) === null || _a ===
|
|
18731
|
+
var _c = (_b = (_a = event.changedTouches) === null || _a === undefined ? undefined : _a[0]) !== null && _b !== undefined ? _b : { clientX: 0, clientY: 0 }, clientX = _c.clientX, clientY = _c.clientY;
|
|
18732
18732
|
var eventArc = select(doc.elementFromPoint(clientX, clientY));
|
|
18733
18733
|
return eventArc;
|
|
18734
18734
|
};
|
|
@@ -18740,9 +18740,9 @@ var shapeArc = {
|
|
|
18740
18740
|
state.event = event;
|
|
18741
18741
|
var eventArc = getEventArc_1(event);
|
|
18742
18742
|
var datum = eventArc.datum();
|
|
18743
|
-
var updated = ((datum === null || datum ===
|
|
18743
|
+
var updated = ((datum === null || datum === undefined ? undefined : datum.data) && datum.data.id) ? $$.updateAngle(datum) : null;
|
|
18744
18744
|
var arcData = updated ? $$.convertToArcData(updated) : null;
|
|
18745
|
-
var id = (arcData === null || arcData ===
|
|
18745
|
+
var id = (arcData === null || arcData === undefined ? undefined : arcData.id) || undefined;
|
|
18746
18746
|
$$.callOverOutForTouch(arcData);
|
|
18747
18747
|
isUndefined(id) ? unselectArc() : selectArc(this, arcData, id);
|
|
18748
18748
|
});
|
|
@@ -18775,7 +18775,7 @@ var shapeArc = {
|
|
|
18775
18775
|
if (hasGauge) {
|
|
18776
18776
|
var isFullCircle = config.gauge_fullCircle;
|
|
18777
18777
|
isFullCircle &&
|
|
18778
|
-
(text === null || text ===
|
|
18778
|
+
(text === null || text === undefined ? undefined : text.attr("dy", "".concat(hasMultiArcGauge ? 0 : Math.round(state.radius / 14))));
|
|
18779
18779
|
if (config.gauge_label_show) {
|
|
18780
18780
|
arcs.select(".".concat($GAUGE.chartArcsGaugeUnit))
|
|
18781
18781
|
.attr("dy", "".concat(isFullCircle ? 1.5 : 0.75, "em"))
|
|
@@ -18804,7 +18804,7 @@ var shapeArc = {
|
|
|
18804
18804
|
var $$ = this;
|
|
18805
18805
|
var arcs = $$.$el.arcs;
|
|
18806
18806
|
var filterFn = isNumber(value) ? function (d) { return d.index === value; } : function (d) { return d.data.id === value; };
|
|
18807
|
-
return arcs === null || arcs ===
|
|
18807
|
+
return arcs === null || arcs === undefined ? undefined : arcs.selectAll(".".concat($COMMON.target, " path")).filter(filterFn);
|
|
18808
18808
|
}
|
|
18809
18809
|
};
|
|
18810
18810
|
|
|
@@ -18837,7 +18837,7 @@ var shapeArea = {
|
|
|
18837
18837
|
* @private
|
|
18838
18838
|
*/
|
|
18839
18839
|
updateArea: function (withTransition, isSub) {
|
|
18840
|
-
if (isSub ===
|
|
18840
|
+
if (isSub === undefined) { isSub = false; }
|
|
18841
18841
|
var $$ = this;
|
|
18842
18842
|
var config = $$.config, state = $$.state, $el = $$.$el, $T = $$.$T;
|
|
18843
18843
|
var $root = isSub ? $el.subchart : $el;
|
|
@@ -18868,7 +18868,7 @@ var shapeArea = {
|
|
|
18868
18868
|
* @returns {Array}
|
|
18869
18869
|
*/
|
|
18870
18870
|
redrawArea: function (drawFn, withTransition, isSub) {
|
|
18871
|
-
if (isSub ===
|
|
18871
|
+
if (isSub === undefined) { isSub = false; }
|
|
18872
18872
|
var $$ = this;
|
|
18873
18873
|
var area = (isSub ? this.$el.subchart : this.$el).area;
|
|
18874
18874
|
var orgAreaOpacity = $$.state.orgAreaOpacity;
|
|
@@ -18994,7 +18994,7 @@ var shapeBar = {
|
|
|
18994
18994
|
// Bars for each data
|
|
18995
18995
|
mainBarEnter.append("g")
|
|
18996
18996
|
.attr("class", classBars)
|
|
18997
|
-
.style("cursor", function (d) { var _a; return (((_a = isSelectable === null || isSelectable ===
|
|
18997
|
+
.style("cursor", function (d) { var _a; return (((_a = isSelectable === null || isSelectable === undefined ? undefined : isSelectable.bind) === null || _a === undefined ? undefined : _a.call(isSelectable, $$.api)(d)) ? "pointer" : null); })
|
|
18998
18998
|
.call($$.setCssRule(true, " .".concat($BAR.bar), ["fill"], $$.color));
|
|
18999
18999
|
},
|
|
19000
19000
|
/**
|
|
@@ -19004,7 +19004,7 @@ var shapeBar = {
|
|
|
19004
19004
|
* @private
|
|
19005
19005
|
*/
|
|
19006
19006
|
updateBar: function (withTransition, isSub) {
|
|
19007
|
-
if (isSub ===
|
|
19007
|
+
if (isSub === undefined) { isSub = false; }
|
|
19008
19008
|
var $$ = this;
|
|
19009
19009
|
var config = $$.config, $el = $$.$el, $T = $$.$T;
|
|
19010
19010
|
var $root = isSub ? $el.subchart : $el;
|
|
@@ -19045,7 +19045,7 @@ var shapeBar = {
|
|
|
19045
19045
|
* @private
|
|
19046
19046
|
*/
|
|
19047
19047
|
redrawBar: function (drawFn, withTransition, isSub) {
|
|
19048
|
-
if (isSub ===
|
|
19048
|
+
if (isSub === undefined) { isSub = false; }
|
|
19049
19049
|
var $$ = this;
|
|
19050
19050
|
var bar = (isSub ? $$.$el.subchart : $$.$el).bar;
|
|
19051
19051
|
return [
|
|
@@ -19323,7 +19323,7 @@ var shapeCandlestick = {
|
|
|
19323
19323
|
* @private
|
|
19324
19324
|
*/
|
|
19325
19325
|
updateCandlestick: function (withTransition, isSub) {
|
|
19326
|
-
if (isSub ===
|
|
19326
|
+
if (isSub === undefined) { isSub = false; }
|
|
19327
19327
|
var $$ = this;
|
|
19328
19328
|
var $el = $$.$el, $T = $$.$T;
|
|
19329
19329
|
var $root = isSub ? $el.subchart : $el;
|
|
@@ -19360,7 +19360,7 @@ var shapeCandlestick = {
|
|
|
19360
19360
|
return function (d, i, g) {
|
|
19361
19361
|
var points = getPoints(d, i);
|
|
19362
19362
|
var value = $$.getCandlestickData(d);
|
|
19363
|
-
var isUp = value === null || value ===
|
|
19363
|
+
var isUp = value === null || value === undefined ? undefined : value._isUp;
|
|
19364
19364
|
// switch points if axis is rotated, not applicable for sub chart
|
|
19365
19365
|
var indexX = +isRotated;
|
|
19366
19366
|
var indexY = +!indexX;
|
|
@@ -19403,7 +19403,7 @@ var shapeCandlestick = {
|
|
|
19403
19403
|
* @returns {Function}
|
|
19404
19404
|
*/
|
|
19405
19405
|
generateGetCandlestickPoints: function (indices, isSub) {
|
|
19406
|
-
if (isSub ===
|
|
19406
|
+
if (isSub === undefined) { isSub = false; }
|
|
19407
19407
|
var $$ = this;
|
|
19408
19408
|
var axis = isSub ? $$.axis.subX : $$.axis.x;
|
|
19409
19409
|
var targetsNum = $$.getIndicesMax(indices) + 1;
|
|
@@ -19454,7 +19454,7 @@ var shapeCandlestick = {
|
|
|
19454
19454
|
* @returns {Array}
|
|
19455
19455
|
*/
|
|
19456
19456
|
redrawCandlestick: function (drawFn, withTransition, isSub) {
|
|
19457
|
-
if (isSub ===
|
|
19457
|
+
if (isSub === undefined) { isSub = false; }
|
|
19458
19458
|
var $$ = this;
|
|
19459
19459
|
var $el = $$.$el, $T = $$.$T;
|
|
19460
19460
|
var candlestick = (isSub ? $el.subchart : $el).candlestick;
|
|
@@ -19479,7 +19479,7 @@ var shapeCandlestick = {
|
|
|
19479
19479
|
var value = _a.value;
|
|
19480
19480
|
var d;
|
|
19481
19481
|
if (isArray(value)) {
|
|
19482
|
-
var open_1 = value[0], high = value[1], low = value[2], close_1 = value[3], _b = value[4], volume = _b ===
|
|
19482
|
+
var open_1 = value[0], high = value[1], low = value[2], close_1 = value[3], _b = value[4], volume = _b === undefined ? false : _b;
|
|
19483
19483
|
d = { open: open_1, high: high, low: low, close: close_1 };
|
|
19484
19484
|
if (volume !== false) {
|
|
19485
19485
|
d.volume = volume;
|
|
@@ -19502,7 +19502,7 @@ var shapeCandlestick = {
|
|
|
19502
19502
|
* @private
|
|
19503
19503
|
*/
|
|
19504
19504
|
function getSize(checkNeck) {
|
|
19505
|
-
if (checkNeck ===
|
|
19505
|
+
if (checkNeck === undefined) { checkNeck = false; }
|
|
19506
19506
|
var $$ = this;
|
|
19507
19507
|
var config = $$.config, _a = $$.state.current, width = _a.width, height = _a.height;
|
|
19508
19508
|
var padding = $$.getCurrentPadding();
|
|
@@ -19583,7 +19583,7 @@ function getCoord(d) {
|
|
|
19583
19583
|
* @private
|
|
19584
19584
|
*/
|
|
19585
19585
|
function getClipPath(forBackground) {
|
|
19586
|
-
if (forBackground ===
|
|
19586
|
+
if (forBackground === undefined) { forBackground = false; }
|
|
19587
19587
|
var $$ = this;
|
|
19588
19588
|
var _a = getSize.call($$, true), width = _a.width, height = _a.height, top = _a.top, left = _a.left;
|
|
19589
19589
|
var neck = getNecklSize.call($$, { width: width, height: height });
|
|
@@ -19666,7 +19666,7 @@ var shapeFunnel = {
|
|
|
19666
19666
|
var funnel = $$.$el.funnel, config = $$.config, state = $$.state;
|
|
19667
19667
|
var getTarget = function (event) {
|
|
19668
19668
|
var _a;
|
|
19669
|
-
var target = event.isTrusted ? event.target : (_a = state.eventReceiver.rect) === null || _a ===
|
|
19669
|
+
var target = event.isTrusted ? event.target : (_a = state.eventReceiver.rect) === null || _a === undefined ? undefined : _a.node();
|
|
19670
19670
|
var data;
|
|
19671
19671
|
if (/^path$/i.test(target.tagName)) {
|
|
19672
19672
|
state.event = event;
|
|
@@ -19750,12 +19750,12 @@ var shapeFunnel = {
|
|
|
19750
19750
|
var _a = getSize.call($$), top = _a.top, left = _a.left, right = _a.right;
|
|
19751
19751
|
var center = (left - right) / 2;
|
|
19752
19752
|
var points = {};
|
|
19753
|
-
var accumulatedHeight = top !== null && top !==
|
|
19753
|
+
var accumulatedHeight = top !== null && top !== undefined ? top : 0;
|
|
19754
19754
|
targets.each(function (d, i) {
|
|
19755
19755
|
var _a;
|
|
19756
19756
|
points[d.id] = [
|
|
19757
19757
|
[center, accumulatedHeight],
|
|
19758
|
-
[center, accumulatedHeight += ((_a = targets === null || targets ===
|
|
19758
|
+
[center, accumulatedHeight += ((_a = targets === null || targets === undefined ? undefined : targets[i]) !== null && _a !== undefined ? _a : d).ratio]
|
|
19759
19759
|
];
|
|
19760
19760
|
});
|
|
19761
19761
|
return function (d) { return points[d.id]; };
|
|
@@ -19788,8 +19788,8 @@ var shapeGauge = {
|
|
|
19788
19788
|
var $$ = this;
|
|
19789
19789
|
var config = $$.config, arcs = $$.$el.arcs;
|
|
19790
19790
|
var appendText = function (className, value) {
|
|
19791
|
-
if (className ===
|
|
19792
|
-
if (value ===
|
|
19791
|
+
if (className === undefined) { className = null; }
|
|
19792
|
+
if (value === undefined) { value = ""; }
|
|
19793
19793
|
arcs.append("text")
|
|
19794
19794
|
.attr("class", className)
|
|
19795
19795
|
.style("text-anchor", "middle")
|
|
@@ -19895,7 +19895,7 @@ var shapeGauge = {
|
|
|
19895
19895
|
* @private
|
|
19896
19896
|
*/
|
|
19897
19897
|
function getStrokeDashArray(start, end, pattern, isLastX) {
|
|
19898
|
-
if (isLastX ===
|
|
19898
|
+
if (isLastX === undefined) { isLastX = false; }
|
|
19899
19899
|
var dash = start ? [start, 0] : pattern;
|
|
19900
19900
|
var _loop_1 = function (i) {
|
|
19901
19901
|
pattern.forEach(function (v) {
|
|
@@ -19933,7 +19933,7 @@ function getRegions(d, _regions, isTimeSeries) {
|
|
|
19933
19933
|
// Check start/end of regions
|
|
19934
19934
|
if (isDefined(_regions)) {
|
|
19935
19935
|
var getValue = function (v, def) { return (isUndefined(v) ? def : (isTimeSeries ? parseDate.call($$, v) : v)); };
|
|
19936
|
-
for (var i = 0, reg =
|
|
19936
|
+
for (var i = 0, reg = undefined; (reg = _regions[i]); i++) {
|
|
19937
19937
|
var start = getValue(reg.start, d[0].x);
|
|
19938
19938
|
var end = getValue(reg.end, d[d.length - 1].x);
|
|
19939
19939
|
var style = reg.style || { dasharray: dasharray };
|
|
@@ -19984,7 +19984,7 @@ var shapeLine = {
|
|
|
19984
19984
|
* @private
|
|
19985
19985
|
*/
|
|
19986
19986
|
updateLine: function (withTransition, isSub) {
|
|
19987
|
-
if (isSub ===
|
|
19987
|
+
if (isSub === undefined) { isSub = false; }
|
|
19988
19988
|
var $$ = this;
|
|
19989
19989
|
var extraLineClasses = $$.format.extraLineClasses, $el = $$.$el, $T = $$.$T;
|
|
19990
19990
|
var $root = isSub ? $el.subchart : $el;
|
|
@@ -20012,7 +20012,7 @@ var shapeLine = {
|
|
|
20012
20012
|
* @private
|
|
20013
20013
|
*/
|
|
20014
20014
|
redrawLine: function (drawFn, withTransition, isSub) {
|
|
20015
|
-
if (isSub ===
|
|
20015
|
+
if (isSub === undefined) { isSub = false; }
|
|
20016
20016
|
var $$ = this;
|
|
20017
20017
|
var $el = $$.$el, $T = $$.$T;
|
|
20018
20018
|
var line = (isSub ? $el.subchart : $el).line;
|
|
@@ -20175,7 +20175,7 @@ var shapeLine = {
|
|
|
20175
20175
|
lastLength: 0
|
|
20176
20176
|
};
|
|
20177
20177
|
var isLastX = false;
|
|
20178
|
-
for (var i = 0, data =
|
|
20178
|
+
for (var i = 0, data = undefined; (data = d[i]); i++) {
|
|
20179
20179
|
var prevData = d[i - 1];
|
|
20180
20180
|
var hasPrevData = prevData && isValue(prevData.value);
|
|
20181
20181
|
var style = $$.isWithinRegions(data.x, regions);
|
|
@@ -20188,7 +20188,7 @@ var shapeLine = {
|
|
|
20188
20188
|
path += "".concat(i && hasPrevData ? "L" : "M").concat(xValue(data), ",").concat(yValue(data));
|
|
20189
20189
|
}
|
|
20190
20190
|
else if (hasPrevData) {
|
|
20191
|
-
style = ((style === null || style ===
|
|
20191
|
+
style = ((style === null || style === undefined ? undefined : style.dasharray) || dasharray).split(" ").map(Number);
|
|
20192
20192
|
// Draw with region // TODO: Fix for horizotal charts
|
|
20193
20193
|
xp = getScale(axisType.x, prevData.x, data.x);
|
|
20194
20194
|
yp = getScale(axisType.y, prevData.value, data.value);
|
|
@@ -20243,7 +20243,7 @@ var shapeLine = {
|
|
|
20243
20243
|
return path;
|
|
20244
20244
|
},
|
|
20245
20245
|
isWithinRegions: function (withinX, withinRegions) {
|
|
20246
|
-
for (var i = 0, reg =
|
|
20246
|
+
for (var i = 0, reg = undefined; (reg = withinRegions[i]); i++) {
|
|
20247
20247
|
if (reg.start < withinX && withinX <= reg.end) {
|
|
20248
20248
|
return reg.style;
|
|
20249
20249
|
}
|
|
@@ -20282,7 +20282,7 @@ var shapePoint = {
|
|
|
20282
20282
|
var config = this.config;
|
|
20283
20283
|
var opacity = config.point_opacity;
|
|
20284
20284
|
if (isUndefined(opacity)) {
|
|
20285
|
-
opacity = config.point_show && !((_a = this.isPointFocusOnly) === null || _a ===
|
|
20285
|
+
opacity = config.point_show && !((_a = this.isPointFocusOnly) === null || _a === undefined ? undefined : _a.call(this)) ? null : "0";
|
|
20286
20286
|
opacity = isValue(this.getBaseValue(d)) ?
|
|
20287
20287
|
(this.isBubbleType(d) || this.isScatterType(d) ? "0.5" : opacity) :
|
|
20288
20288
|
"0";
|
|
@@ -20348,7 +20348,7 @@ var shapePoint = {
|
|
|
20348
20348
|
});
|
|
20349
20349
|
},
|
|
20350
20350
|
updateCircle: function (isSub) {
|
|
20351
|
-
if (isSub ===
|
|
20351
|
+
if (isSub === undefined) { isSub = false; }
|
|
20352
20352
|
var $$ = this;
|
|
20353
20353
|
var config = $$.config, state = $$.state, $el = $$.$el;
|
|
20354
20354
|
var focusOnly = $$.isPointFocusOnly();
|
|
@@ -20382,7 +20382,7 @@ var shapePoint = {
|
|
|
20382
20382
|
return $$.config.point_radialGradient ? $$.getGradienColortUrl(d.id) : (fn ? fn(d) : null);
|
|
20383
20383
|
},
|
|
20384
20384
|
redrawCircle: function (cx, cy, withTransition, flow, isSub) {
|
|
20385
|
-
if (isSub ===
|
|
20385
|
+
if (isSub === undefined) { isSub = false; }
|
|
20386
20386
|
var $$ = this;
|
|
20387
20387
|
var rendered = $$.state.rendered, $el = $$.$el, $T = $$.$T;
|
|
20388
20388
|
var $root = isSub ? $el.subchart : $el;
|
|
@@ -20426,7 +20426,7 @@ var shapePoint = {
|
|
|
20426
20426
|
circle = circle
|
|
20427
20427
|
.filter(function (t) {
|
|
20428
20428
|
var _a;
|
|
20429
|
-
var data = (_a = d.filter) === null || _a ===
|
|
20429
|
+
var data = (_a = d.filter) === null || _a === undefined ? undefined : _a.call(d, function (v) { return v.id === t.id; });
|
|
20430
20430
|
return data.length ? select(this).datum(data[0]) : false;
|
|
20431
20431
|
});
|
|
20432
20432
|
}
|
|
@@ -20461,7 +20461,7 @@ var shapePoint = {
|
|
|
20461
20461
|
return this.xx(d);
|
|
20462
20462
|
},
|
|
20463
20463
|
updateCircleY: function (isSub) {
|
|
20464
|
-
if (isSub ===
|
|
20464
|
+
if (isSub === undefined) { isSub = false; }
|
|
20465
20465
|
var $$ = this;
|
|
20466
20466
|
var getPoints = $$.generateGetLinePoints($$.getShapeIndices($$.isLineType), isSub);
|
|
20467
20467
|
return function (d, i) {
|
|
@@ -20553,7 +20553,7 @@ var shapePoint = {
|
|
|
20553
20553
|
var mouse = getPointer(state.event, node);
|
|
20554
20554
|
var element = select(node);
|
|
20555
20555
|
var prefix = this.isCirclePoint(node) ? "c" : "";
|
|
20556
|
-
var pointSensitivity = this.getPointSensitivity(element === null || element ===
|
|
20556
|
+
var pointSensitivity = this.getPointSensitivity(element === null || element === undefined ? undefined : element.datum());
|
|
20557
20557
|
var cx = +element.attr("".concat(prefix, "x"));
|
|
20558
20558
|
var cy = +element.attr("".concat(prefix, "y"));
|
|
20559
20559
|
// if node don't have cx/y or x/y attribute value
|
|
@@ -20743,7 +20743,7 @@ function insertPointInfoDefs(point, id) {
|
|
|
20743
20743
|
clone.style.fill = "inherit";
|
|
20744
20744
|
clone.style.stroke = "inherit";
|
|
20745
20745
|
copyAttr(node, clone);
|
|
20746
|
-
if ((_a = node.childNodes) === null || _a ===
|
|
20746
|
+
if ((_a = node.childNodes) === null || _a === undefined ? undefined : _a.length) {
|
|
20747
20747
|
var parent_1 = select(clone);
|
|
20748
20748
|
if ("innerHTML" in clone) {
|
|
20749
20749
|
parent_1.html(node.innerHTML);
|
|
@@ -20774,7 +20774,7 @@ var shapePointCommon = {
|
|
|
20774
20774
|
hasLegendDefsPoint: function () {
|
|
20775
20775
|
var _a;
|
|
20776
20776
|
var config = this.config;
|
|
20777
|
-
return config.legend_show && ((_a = config.point_pattern) === null || _a ===
|
|
20777
|
+
return config.legend_show && ((_a = config.point_pattern) === null || _a === undefined ? undefined : _a.length) && config.legend_usePoint;
|
|
20778
20778
|
},
|
|
20779
20779
|
getDefsPointId: function (id) {
|
|
20780
20780
|
var datetimeId = this.state.datetimeId;
|
|
@@ -20797,7 +20797,7 @@ var shapePointCommon = {
|
|
|
20797
20797
|
}
|
|
20798
20798
|
return function (d) {
|
|
20799
20799
|
var _a, _b, _c, _d;
|
|
20800
|
-
var id = $$.getTargetSelectorSuffix(d.id || ((_a = d.data) === null || _a ===
|
|
20800
|
+
var id = $$.getTargetSelectorSuffix(d.id || ((_a = d.data) === null || _a === undefined ? undefined : _a.id) || d);
|
|
20801
20801
|
var element = select(this);
|
|
20802
20802
|
ids.indexOf(id) < 0 && ids.push(id);
|
|
20803
20803
|
var point = pattern[ids.indexOf(id) % pattern.length];
|
|
@@ -20811,13 +20811,13 @@ var shapePointCommon = {
|
|
|
20811
20811
|
insertPointInfoDefs.bind($$)(point, pointId);
|
|
20812
20812
|
}
|
|
20813
20813
|
if (method === "create") {
|
|
20814
|
-
return (_b = $$.custom) === null || _b ===
|
|
20814
|
+
return (_b = $$.custom) === null || _b === undefined ? undefined : _b.create.bind(context).apply(undefined, __spreadArray([element, pointId], args, false));
|
|
20815
20815
|
}
|
|
20816
20816
|
else if (method === "update") {
|
|
20817
|
-
return (_c = $$.custom) === null || _c ===
|
|
20817
|
+
return (_c = $$.custom) === null || _c === undefined ? undefined : _c.update.bind(context).apply(undefined, __spreadArray([element], args, false));
|
|
20818
20818
|
}
|
|
20819
20819
|
}
|
|
20820
|
-
return (_d = point[method]) === null || _d ===
|
|
20820
|
+
return (_d = point[method]) === null || _d === undefined ? undefined : _d.bind(context).apply(undefined, __spreadArray([element], args, false));
|
|
20821
20821
|
};
|
|
20822
20822
|
};
|
|
20823
20823
|
}
|
|
@@ -20870,7 +20870,7 @@ var shapePolar = {
|
|
|
20870
20870
|
getPolarOuterRadius: function (d, outerRadius) {
|
|
20871
20871
|
var _a;
|
|
20872
20872
|
var dataMax = getDataMax(this);
|
|
20873
|
-
return (((_a = d === null || d ===
|
|
20873
|
+
return (((_a = d === null || d === undefined ? undefined : d.data.values[0].value) !== null && _a !== undefined ? _a : 0) / dataMax) * outerRadius;
|
|
20874
20874
|
},
|
|
20875
20875
|
/**
|
|
20876
20876
|
* Update polar based on given data array
|
|
@@ -21134,7 +21134,7 @@ var shapeRadar = {
|
|
|
21134
21134
|
}
|
|
21135
21135
|
// axis text
|
|
21136
21136
|
if (config.radar_axis_text_show) {
|
|
21137
|
-
var _b = config.radar_axis_text_position, _c = _b.x, x_1 = _c ===
|
|
21137
|
+
var _b = config.radar_axis_text_position, _c = _b.x, x_1 = _c === undefined ? 0 : _c, _d = _b.y, y_1 = _d === undefined ? 0 : _d;
|
|
21138
21138
|
var textWidth = $$.cache.get(cacheKeyTextWidth) || 0;
|
|
21139
21139
|
axis.select("text")
|
|
21140
21140
|
.style("text-anchor", "middle")
|
|
@@ -21337,13 +21337,13 @@ var shapeTreemap = {
|
|
|
21337
21337
|
var $el = $$.$el, config = $$.config, state = $$.state;
|
|
21338
21338
|
var getTarget = function (event) {
|
|
21339
21339
|
var _a;
|
|
21340
|
-
var target = event.isTrusted ? event.target : (_a = state.eventReceiver.rect) === null || _a ===
|
|
21340
|
+
var target = event.isTrusted ? event.target : (_a = state.eventReceiver.rect) === null || _a === undefined ? undefined : _a.node();
|
|
21341
21341
|
var data;
|
|
21342
21342
|
if (/^rect$/i.test(target.tagName)) {
|
|
21343
21343
|
state.event = event;
|
|
21344
21344
|
data = select(target).datum();
|
|
21345
21345
|
}
|
|
21346
|
-
return data === null || data ===
|
|
21346
|
+
return data === null || data === undefined ? undefined : data.data;
|
|
21347
21347
|
};
|
|
21348
21348
|
if (config.interaction_enabled) {
|
|
21349
21349
|
var isTouch = state.inputType === "touch";
|
|
@@ -21380,7 +21380,7 @@ var shapeTreemap = {
|
|
|
21380
21380
|
sliceDice: treemapSliceDice,
|
|
21381
21381
|
squarify: treemapSquarify,
|
|
21382
21382
|
resquarify: treemapResquarify
|
|
21383
|
-
}[(_a = config.treemap_tile) !== null && _a !==
|
|
21383
|
+
}[(_a = config.treemap_tile) !== null && _a !== undefined ? _a : "binary"]) !== null && _b !== undefined ? _b : treemapBinary;
|
|
21384
21384
|
return function (node, x0, y0, x1, y1) {
|
|
21385
21385
|
tile(node, 0, 0, width, height);
|
|
21386
21386
|
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
|
|
@@ -21413,7 +21413,7 @@ var shapeTreemap = {
|
|
|
21413
21413
|
updateTargetsForTreemap: function (targets) {
|
|
21414
21414
|
var $$ = this;
|
|
21415
21415
|
var treemap = $$.$el.treemap;
|
|
21416
|
-
var treemapData = getHierachyData.call($$, $$.getTreemapData(targets !== null && targets !==
|
|
21416
|
+
var treemapData = getHierachyData.call($$, $$.getTreemapData(targets !== null && targets !== undefined ? targets : $$.data.targets));
|
|
21417
21417
|
// using $el.treemap reference can alter data, so select treemap <g> again
|
|
21418
21418
|
treemap.data(treemapData);
|
|
21419
21419
|
},
|
|
@@ -22423,8 +22423,9 @@ var optGauge = {
|
|
|
22423
22423
|
* @property {number} [gauge.expand.rate=0.98] Set expand rate.
|
|
22424
22424
|
* @property {number} [gauge.expand.duration=50] Set the expand transition time in milliseconds.
|
|
22425
22425
|
* @property {boolean} [gauge.enforceMinMax=false] Enforce to given min/max value.
|
|
22426
|
-
* -
|
|
22427
|
-
*
|
|
22426
|
+
* - **Note:** Only works for single data series.
|
|
22427
|
+
* - When `gauge.min=50` and given value is `30`, gauge will render as empty value.
|
|
22428
|
+
* - When `gauge.max=100` and given value is `120`, gauge will render till 100, not surpassing max value.
|
|
22428
22429
|
* @property {number} [gauge.min=0] Set min value of the gauge.
|
|
22429
22430
|
* @property {number} [gauge.max=100] Set max value of the gauge.
|
|
22430
22431
|
* @property {number} [gauge.startingAngle=-1 * Math.PI / 2] Set starting angle where data draws.
|
|
@@ -22930,7 +22931,7 @@ var treemap = function () { return (extendAxis([shapeTreemap], [optTreemap]), (t
|
|
|
22930
22931
|
* @private
|
|
22931
22932
|
*/
|
|
22932
22933
|
function setSelection(isSelection, ids, indices, resetOther) {
|
|
22933
|
-
if (isSelection ===
|
|
22934
|
+
if (isSelection === undefined) { isSelection = false; }
|
|
22934
22935
|
var $$ = this;
|
|
22935
22936
|
var config = $$.config, main = $$.$el.main;
|
|
22936
22937
|
var selectionGrouped = config.data_selection_grouped;
|
|
@@ -23081,7 +23082,7 @@ var subchart$1 = function (domainValue) {
|
|
|
23081
23082
|
}
|
|
23082
23083
|
}
|
|
23083
23084
|
else {
|
|
23084
|
-
domain = (_a = state.domain) !== null && _a !==
|
|
23085
|
+
domain = (_a = state.domain) !== null && _a !== undefined ? _a : x.orgDomain();
|
|
23085
23086
|
}
|
|
23086
23087
|
}
|
|
23087
23088
|
return domain;
|
|
@@ -23125,10 +23126,10 @@ extend(subchart$1, {
|
|
|
23125
23126
|
if ($$.data.targets.length !== $target.size()) {
|
|
23126
23127
|
$$.updateSizes();
|
|
23127
23128
|
$$.updateTargetsForSubchart($$.data.targets);
|
|
23128
|
-
$target = (_a = subchart.main) === null || _a ===
|
|
23129
|
+
$target = (_a = subchart.main) === null || _a === undefined ? undefined : _a.selectAll(".".concat($COMMON.target));
|
|
23129
23130
|
}
|
|
23130
|
-
$target === null || $target ===
|
|
23131
|
-
(_b = subchart.main) === null || _b ===
|
|
23131
|
+
$target === null || $target === undefined ? undefined : $target.style("opacity", null);
|
|
23132
|
+
(_b = subchart.main) === null || _b === undefined ? undefined : _b.style("display", null);
|
|
23132
23133
|
this.resize();
|
|
23133
23134
|
}
|
|
23134
23135
|
},
|
|
@@ -23144,7 +23145,7 @@ extend(subchart$1, {
|
|
|
23144
23145
|
hide: function () {
|
|
23145
23146
|
var $$ = this.internal;
|
|
23146
23147
|
var main = $$.$el.subchart.main, config = $$.config;
|
|
23147
|
-
if (config.subchart_show && (main === null || main ===
|
|
23148
|
+
if (config.subchart_show && (main === null || main === undefined ? undefined : main.style("display")) !== "none") {
|
|
23148
23149
|
config.subchart_show = false;
|
|
23149
23150
|
main.style("display", "none");
|
|
23150
23151
|
this.resize();
|
|
@@ -23251,7 +23252,7 @@ var zoom$1 = function (domainValue) {
|
|
|
23251
23252
|
domain = $$.zoom.getDomain();
|
|
23252
23253
|
}
|
|
23253
23254
|
}
|
|
23254
|
-
return (_a = state.domain) !== null && _a !==
|
|
23255
|
+
return (_a = state.domain) !== null && _a !== undefined ? _a : domain;
|
|
23255
23256
|
};
|
|
23256
23257
|
extend(zoom$1, {
|
|
23257
23258
|
/**
|
|
@@ -23375,7 +23376,7 @@ var apiZoom = {
|
|
|
23375
23376
|
$$.brush.getSelection().call($$.brush.move, null) :
|
|
23376
23377
|
$$.zoom.updateTransformScale(zoomIdentity);
|
|
23377
23378
|
$$.updateZoom(true);
|
|
23378
|
-
zoomResetBtn === null || zoomResetBtn ===
|
|
23379
|
+
zoomResetBtn === null || zoomResetBtn === undefined ? undefined : zoomResetBtn.style("display", "none");
|
|
23379
23380
|
// reset transform
|
|
23380
23381
|
if (zoomTransform(eventRect.node()) !== zoomIdentity) {
|
|
23381
23382
|
$$.zoom.transform(eventRect, zoomIdentity);
|
|
@@ -23417,7 +23418,7 @@ var subchart = {
|
|
|
23417
23418
|
// when brush selection updates happens on one edge, update only chainging edge and
|
|
23418
23419
|
// is only for adjustment of given domain range to be used to return current domain range.
|
|
23419
23420
|
type === "brush" && sourceEvent && state.domain &&
|
|
23420
|
-
(lastSelection === null || lastSelection ===
|
|
23421
|
+
(lastSelection === null || lastSelection === undefined ? undefined : lastSelection.forEach(function (v, i) {
|
|
23421
23422
|
if (v !== selection[i]) {
|
|
23422
23423
|
state.domain[i] = scale.x.orgDomain()[i];
|
|
23423
23424
|
}
|
|
@@ -23428,7 +23429,7 @@ var subchart = {
|
|
|
23428
23429
|
lastDomain = scale.x.orgDomain();
|
|
23429
23430
|
}
|
|
23430
23431
|
// handle brush's handle position & visibility
|
|
23431
|
-
if (target === null || target ===
|
|
23432
|
+
if (target === null || target === undefined ? undefined : target.handle) {
|
|
23432
23433
|
if (selection === null) {
|
|
23433
23434
|
$$.brush.handle.attr("display", "none");
|
|
23434
23435
|
}
|
|
@@ -23454,7 +23455,7 @@ var subchart = {
|
|
|
23454
23455
|
var _a;
|
|
23455
23456
|
var extent = this.extent()();
|
|
23456
23457
|
if (extent[1].filter(function (v) { return isNaN(v); }).length === 0) {
|
|
23457
|
-
(_a = subchart.main) === null || _a ===
|
|
23458
|
+
(_a = subchart.main) === null || _a === undefined ? undefined : _a.select(".".concat(CLASS.brush)).call(this);
|
|
23458
23459
|
}
|
|
23459
23460
|
return this;
|
|
23460
23461
|
};
|
|
@@ -23626,7 +23627,7 @@ var subchart = {
|
|
|
23626
23627
|
// subchart
|
|
23627
23628
|
if (config.subchart_show) {
|
|
23628
23629
|
// reflect main chart to extent on subchart if zoomed
|
|
23629
|
-
if (((_a = state.event) === null || _a ===
|
|
23630
|
+
if (((_a = state.event) === null || _a === undefined ? undefined : _a.type) === "zoom") {
|
|
23630
23631
|
$$.brush.update();
|
|
23631
23632
|
}
|
|
23632
23633
|
// update subchart elements if needed
|
|
@@ -23661,7 +23662,7 @@ var subchart = {
|
|
|
23661
23662
|
*/
|
|
23662
23663
|
redrawForBrush: function (callCallbck) {
|
|
23663
23664
|
var _a;
|
|
23664
|
-
if (callCallbck ===
|
|
23665
|
+
if (callCallbck === undefined) { callCallbck = true; }
|
|
23665
23666
|
var $$ = this;
|
|
23666
23667
|
var _b = $$.config, onBrush = _b.subchart_onbrush, withY = _b.zoom_rescale, scale = $$.scale, state = $$.state;
|
|
23667
23668
|
$$.redraw({
|
|
@@ -23672,7 +23673,7 @@ var subchart = {
|
|
|
23672
23673
|
withDimension: false
|
|
23673
23674
|
});
|
|
23674
23675
|
callCallbck && state.rendered &&
|
|
23675
|
-
onBrush.bind($$.api)((_a = state.domain) !== null && _a !==
|
|
23676
|
+
onBrush.bind($$.api)((_a = state.domain) !== null && _a !== undefined ? _a : scale.x.orgDomain());
|
|
23676
23677
|
},
|
|
23677
23678
|
/**
|
|
23678
23679
|
* Transform context
|
|
@@ -23683,7 +23684,7 @@ var subchart = {
|
|
|
23683
23684
|
transformContext: function (withTransition, transitions) {
|
|
23684
23685
|
var $$ = this;
|
|
23685
23686
|
var subchart = $$.$el.subchart, $T = $$.$T;
|
|
23686
|
-
var subXAxis = (transitions === null || transitions ===
|
|
23687
|
+
var subXAxis = (transitions === null || transitions === undefined ? undefined : transitions.axisSubX) ?
|
|
23687
23688
|
transitions.axisSubX :
|
|
23688
23689
|
$T(subchart.main.select(".".concat(CLASS.axisX)), withTransition);
|
|
23689
23690
|
subchart.main.attr("transform", $$.getTranslate("context"));
|
|
@@ -23713,7 +23714,7 @@ var zoom = {
|
|
|
23713
23714
|
* @private
|
|
23714
23715
|
*/
|
|
23715
23716
|
bindZoomEvent: function (bind) {
|
|
23716
|
-
if (bind ===
|
|
23717
|
+
if (bind === undefined) { bind = true; }
|
|
23717
23718
|
var $$ = this;
|
|
23718
23719
|
var config = $$.config;
|
|
23719
23720
|
var zoomEnabled = config.zoom_enabled;
|
|
@@ -23763,7 +23764,7 @@ var zoom = {
|
|
|
23763
23764
|
var _a;
|
|
23764
23765
|
var isRotated = config.axis_rotated;
|
|
23765
23766
|
// in case of resize, update range of orgXScale
|
|
23766
|
-
(_a = org.xScale) === null || _a ===
|
|
23767
|
+
(_a = org.xScale) === null || _a === undefined ? undefined : _a.range(scale.x.range());
|
|
23767
23768
|
// rescale from the original scale
|
|
23768
23769
|
var newScale = transform[isRotated ? "rescaleY" : "rescaleX"](org.xScale || scale.x);
|
|
23769
23770
|
// prevent drag zoom to be out of range
|
|
@@ -23836,19 +23837,19 @@ var zoom = {
|
|
|
23836
23837
|
var $$ = this;
|
|
23837
23838
|
var config = $$.config, scale = $$.scale, state = $$.state, org = $$.org;
|
|
23838
23839
|
var sourceEvent = event.sourceEvent;
|
|
23839
|
-
var isUnZoom = (event === null || event ===
|
|
23840
|
+
var isUnZoom = (event === null || event === undefined ? undefined : event.transform) === zoomIdentity;
|
|
23840
23841
|
if (!config.zoom_enabled ||
|
|
23841
23842
|
$$.filterTargetsToShow($$.data.targets).length === 0 ||
|
|
23842
|
-
(!scale.zoom && (sourceEvent === null || sourceEvent ===
|
|
23843
|
-
(sourceEvent === null || sourceEvent ===
|
|
23843
|
+
(!scale.zoom && (sourceEvent === null || sourceEvent === undefined ? undefined : sourceEvent.type.indexOf("touch")) > -1 &&
|
|
23844
|
+
(sourceEvent === null || sourceEvent === undefined ? undefined : sourceEvent.touches.length) === 1)) {
|
|
23844
23845
|
return;
|
|
23845
23846
|
}
|
|
23846
23847
|
if (event.sourceEvent) {
|
|
23847
23848
|
state.zooming = true;
|
|
23848
23849
|
state.domain = undefined;
|
|
23849
23850
|
}
|
|
23850
|
-
var isMousemove = (sourceEvent === null || sourceEvent ===
|
|
23851
|
-
var isZoomOut = (sourceEvent === null || sourceEvent ===
|
|
23851
|
+
var isMousemove = (sourceEvent === null || sourceEvent === undefined ? undefined : sourceEvent.type) === "mousemove";
|
|
23852
|
+
var isZoomOut = (sourceEvent === null || sourceEvent === undefined ? undefined : sourceEvent.wheelDelta) < 0;
|
|
23852
23853
|
var transform = event.transform;
|
|
23853
23854
|
if (!isMousemove && isZoomOut && scale.x.domain().every(function (v, i) { return v !== org.xDomain[i]; })) {
|
|
23854
23855
|
scale.x.domain(org.xDomain);
|
|
@@ -23868,7 +23869,7 @@ var zoom = {
|
|
|
23868
23869
|
});
|
|
23869
23870
|
$$.state.cancelClick = isMousemove;
|
|
23870
23871
|
// do not call event cb when is .unzoom() is called
|
|
23871
|
-
!isUnZoom && callFn(config.zoom_onzoom, $$.api, (_a = $$.state.domain) !== null && _a !==
|
|
23872
|
+
!isUnZoom && callFn(config.zoom_onzoom, $$.api, (_a = $$.state.domain) !== null && _a !== undefined ? _a : $$.zoom.getDomain());
|
|
23872
23873
|
},
|
|
23873
23874
|
/**
|
|
23874
23875
|
* 'end' event listener
|
|
@@ -23880,11 +23881,11 @@ var zoom = {
|
|
|
23880
23881
|
var $$ = this;
|
|
23881
23882
|
var config = $$.config, state = $$.state;
|
|
23882
23883
|
var startEvent = $$.zoom.startEvent;
|
|
23883
|
-
var e = event === null || event ===
|
|
23884
|
-
var isUnZoom = (event === null || event ===
|
|
23885
|
-
if ((startEvent === null || startEvent ===
|
|
23884
|
+
var e = event === null || event === undefined ? undefined : event.sourceEvent;
|
|
23885
|
+
var isUnZoom = (event === null || event === undefined ? undefined : event.transform) === zoomIdentity;
|
|
23886
|
+
if ((startEvent === null || startEvent === undefined ? undefined : startEvent.type.indexOf("touch")) > -1) {
|
|
23886
23887
|
startEvent = startEvent.changedTouches[0];
|
|
23887
|
-
e = (_a = e === null || e ===
|
|
23888
|
+
e = (_a = e === null || e === undefined ? undefined : e.changedTouches) === null || _a === undefined ? undefined : _a[0];
|
|
23888
23889
|
}
|
|
23889
23890
|
// if click, do nothing. otherwise, click interaction will be canceled.
|
|
23890
23891
|
if (config.zoom_type === "drag" && (e && startEvent.clientX === e.clientX && startEvent.clientY === e.clientY)) {
|
|
@@ -23894,7 +23895,7 @@ var zoom = {
|
|
|
23894
23895
|
$$.redrawEventRect();
|
|
23895
23896
|
$$.updateZoom();
|
|
23896
23897
|
// do not call event cb when is .unzoom() is called
|
|
23897
|
-
!isUnZoom && (e || state.dragging) && callFn(config.zoom_onzoomend, $$.api, (_b = $$.state.domain) !== null && _b !==
|
|
23898
|
+
!isUnZoom && (e || state.dragging) && callFn(config.zoom_onzoomend, $$.api, (_b = $$.state.domain) !== null && _b !== undefined ? _b : $$.zoom.getDomain());
|
|
23898
23899
|
},
|
|
23899
23900
|
/**
|
|
23900
23901
|
* Update zoom
|
|
@@ -23952,10 +23953,10 @@ var zoom = {
|
|
|
23952
23953
|
// https://bugs.webkit.org/show_bug.cgi?id=226683#c3
|
|
23953
23954
|
// https://stackoverflow.com/questions/67836886/wheel-event-is-not-fired-on-a-svg-group-element-in-safari
|
|
23954
23955
|
if (win.GestureEvent &&
|
|
23955
|
-
/^((?!chrome|android|mobile).)*safari/i.test((_a = win.navigator) === null || _a ===
|
|
23956
|
+
/^((?!chrome|android|mobile).)*safari/i.test((_a = win.navigator) === null || _a === undefined ? undefined : _a.userAgent)) {
|
|
23956
23957
|
svg.on("wheel", function () { });
|
|
23957
23958
|
}
|
|
23958
|
-
eventRect === null || eventRect ===
|
|
23959
|
+
eventRect === null || eventRect === undefined ? undefined : eventRect.call(behaviour).on("dblclick.zoom", null);
|
|
23959
23960
|
},
|
|
23960
23961
|
/**
|
|
23961
23962
|
* Initialize the drag behaviour used for zooming.
|
|
@@ -24062,7 +24063,7 @@ var zoom = {
|
|
|
24062
24063
|
getZoomTransform: function () {
|
|
24063
24064
|
var $$ = this;
|
|
24064
24065
|
var eventRect = $$.$el.eventRect;
|
|
24065
|
-
return (eventRect === null || eventRect ===
|
|
24066
|
+
return (eventRect === null || eventRect === undefined ? undefined : eventRect.node()) ? zoomTransform(eventRect.node()) : { k: 1 };
|
|
24066
24067
|
}
|
|
24067
24068
|
};
|
|
24068
24069
|
|
|
@@ -24106,7 +24107,7 @@ var drag = {
|
|
|
24106
24107
|
// TODO: binary search when multiple xs
|
|
24107
24108
|
main.selectAll(".".concat($SHAPE.shapes))
|
|
24108
24109
|
.selectAll(".".concat($SHAPE.shape))
|
|
24109
|
-
.filter(function (d) { return isSelectable === null || isSelectable ===
|
|
24110
|
+
.filter(function (d) { return isSelectable === null || isSelectable === undefined ? undefined : isSelectable.bind($$.api)(d); })
|
|
24110
24111
|
.each(function (d, i) {
|
|
24111
24112
|
var shape = select(this);
|
|
24112
24113
|
var isSelected = shape.classed($SELECT.SELECTED);
|
|
@@ -24214,7 +24215,7 @@ var selection = __assign(__assign({}, drag), {
|
|
|
24214
24215
|
unselectPoint: function (target, d, i) {
|
|
24215
24216
|
var $$ = this;
|
|
24216
24217
|
var config = $$.config, main = $$.$el.main, $T = $$.$T;
|
|
24217
|
-
callFn(config.data_onunselected, $$.api, d, target === null || target ===
|
|
24218
|
+
callFn(config.data_onunselected, $$.api, d, target === null || target === undefined ? undefined : target.node());
|
|
24218
24219
|
// remove selected-circle from low layer g
|
|
24219
24220
|
$T(main.select(".".concat($SELECT.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
|
|
24220
24221
|
.selectAll(".".concat($SELECT.selectedCircle, "-").concat(i)))
|
|
@@ -24302,7 +24303,7 @@ var selection = __assign(__assign({}, drag), {
|
|
|
24302
24303
|
var toggle_1 = $$.getToggle(that, d).bind($$);
|
|
24303
24304
|
var toggledShape_1;
|
|
24304
24305
|
if (!config.data_selection_multiple) {
|
|
24305
|
-
var focusOnly = (_a = $$.isPointFocusOnly) === null || _a ===
|
|
24306
|
+
var focusOnly = (_a = $$.isPointFocusOnly) === null || _a === undefined ? undefined : _a.call($$);
|
|
24306
24307
|
var selector = ".".concat(focusOnly ? $SELECT.selectedCircles : $SHAPE.shapes);
|
|
24307
24308
|
if (config.data_selection_grouped) {
|
|
24308
24309
|
selector += $$.getTargetSelectorSuffix(d.id);
|
|
@@ -24646,7 +24647,7 @@ var zoomModule = function () {
|
|
|
24646
24647
|
var defaults = {};
|
|
24647
24648
|
/**
|
|
24648
24649
|
* @namespace bb
|
|
24649
|
-
* @version 3.14.
|
|
24650
|
+
* @version 3.14.3
|
|
24650
24651
|
*/
|
|
24651
24652
|
var bb = {
|
|
24652
24653
|
/**
|
|
@@ -24656,7 +24657,7 @@ var bb = {
|
|
|
24656
24657
|
* bb.version; // "1.0.0"
|
|
24657
24658
|
* @memberof bb
|
|
24658
24659
|
*/
|
|
24659
|
-
version: "3.14.
|
|
24660
|
+
version: "3.14.3",
|
|
24660
24661
|
/**
|
|
24661
24662
|
* Generate chart
|
|
24662
24663
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|