billboard.js 3.7.0-next.1 → 3.7.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +6 -1
- package/dist/billboard.js +1196 -699
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2180 -1057
- package/dist/billboard.pkgd.min.js +4 -3
- 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 +29 -22
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +29 -22
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +15 -13
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +15 -13
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +219 -158
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +270 -238
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +321 -295
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +258 -231
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +464 -445
- package/dist/theme/datalab.css +6 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +577 -180
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -5
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -5
- package/package.json +17 -16
- package/src/Chart/api/legend.ts +1 -0
- package/src/Chart/api/load.ts +1 -0
- package/src/Chart/api/tooltip.ts +11 -2
- package/src/ChartInternal/ChartInternal.ts +35 -25
- package/src/ChartInternal/data/IData.ts +8 -0
- package/src/ChartInternal/data/convert.helper.ts +35 -21
- package/src/ChartInternal/data/data.ts +5 -3
- package/src/ChartInternal/data/load.ts +3 -0
- package/src/ChartInternal/interactions/interaction.ts +42 -33
- package/src/ChartInternal/internals/class.ts +3 -4
- package/src/ChartInternal/internals/clip.ts +13 -10
- package/src/ChartInternal/internals/legend.ts +3 -2
- package/src/ChartInternal/internals/redraw.ts +12 -5
- package/src/ChartInternal/internals/scale.ts +7 -2
- package/src/ChartInternal/internals/size.ts +41 -26
- package/src/ChartInternal/internals/text.ts +60 -32
- package/src/ChartInternal/internals/tooltip.ts +12 -8
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +6 -1
- package/src/ChartInternal/shape/bar.ts +1 -1
- package/src/ChartInternal/shape/radar.ts +2 -2
- package/src/ChartInternal/shape/shape.ts +10 -5
- package/src/ChartInternal/shape/treemap.ts +293 -0
- package/src/config/Options/data/data.ts +6 -3
- package/src/config/Options/shape/arc.ts +1 -1
- package/src/config/Options/shape/pie.ts +1 -1
- package/src/config/Options/shape/polar.ts +1 -1
- package/src/config/Options/shape/radar.ts +1 -1
- package/src/config/Options/shape/spline.ts +1 -1
- package/src/config/Options/shape/treemap.ts +53 -0
- package/src/config/Store/State.ts +1 -0
- package/src/config/classes.ts +7 -0
- package/src/config/const.ts +4 -2
- package/src/config/resolver/shape.ts +9 -1
- package/src/index.esm.ts +2 -1
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/types/bb.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +4 -1
- package/types/options.shape.d.ts +31 -0
- package/types/types.d.ts +2 -1
package/dist/billboard.js
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.7.0-next.
|
|
8
|
+
* @version 3.7.0-next.2
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
12
|
-
module.exports = factory(require("d3-axis"), require("d3-brush"), require("d3-drag"), require("d3-dsv"), require("d3-ease"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("d3-transition"), require("d3-zoom"));
|
|
12
|
+
module.exports = factory(require("d3-axis"), require("d3-brush"), require("d3-drag"), require("d3-dsv"), require("d3-ease"), require("d3-hierarchy"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("d3-transition"), require("d3-zoom"));
|
|
13
13
|
else if(typeof define === 'function' && define.amd)
|
|
14
|
-
define(["d3-axis", "d3-brush", "d3-drag", "d3-dsv", "d3-ease", "d3-interpolate", "d3-scale", "d3-selection", "d3-shape", "d3-time-format", "d3-transition", "d3-zoom"], factory);
|
|
14
|
+
define(["d3-axis", "d3-brush", "d3-drag", "d3-dsv", "d3-ease", "d3-hierarchy", "d3-interpolate", "d3-scale", "d3-selection", "d3-shape", "d3-time-format", "d3-transition", "d3-zoom"], factory);
|
|
15
15
|
else {
|
|
16
|
-
var a = typeof exports === 'object' ? factory(require("d3-axis"), require("d3-brush"), require("d3-drag"), require("d3-dsv"), require("d3-ease"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("d3-transition"), require("d3-zoom")) : factory(root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"]);
|
|
16
|
+
var a = typeof exports === 'object' ? factory(require("d3-axis"), require("d3-brush"), require("d3-drag"), require("d3-dsv"), require("d3-ease"), require("d3-hierarchy"), require("d3-interpolate"), require("d3-scale"), require("d3-selection"), require("d3-shape"), require("d3-time-format"), require("d3-transition"), require("d3-zoom")) : factory(root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"], root["d3"]);
|
|
17
17
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
18
18
|
}
|
|
19
|
-
})(this, function(__WEBPACK_EXTERNAL_MODULE__10__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__11__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__6__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__9__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__8__,
|
|
19
|
+
})(this, function(__WEBPACK_EXTERNAL_MODULE__10__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__11__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__6__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__9__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__14__) {
|
|
20
20
|
return /******/ (function() { // webpackBootstrap
|
|
21
21
|
/******/ "use strict";
|
|
22
22
|
/******/ var __webpack_modules__ = ([
|
|
@@ -93,6 +93,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
|
|
93
93
|
|
|
94
94
|
module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
|
95
95
|
|
|
96
|
+
/***/ }),
|
|
97
|
+
/* 14 */
|
|
98
|
+
/***/ (function(module) {
|
|
99
|
+
|
|
100
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__14__;
|
|
101
|
+
|
|
96
102
|
/***/ })
|
|
97
103
|
/******/ ]);
|
|
98
104
|
/************************************************************************/
|
|
@@ -187,7 +193,8 @@ __webpack_require__.d(resolver_shape_namespaceObject, {
|
|
|
187
193
|
"radar": function() { return resolver_shape_radar; },
|
|
188
194
|
"scatter": function() { return shape_scatter; },
|
|
189
195
|
"spline": function() { return shape_spline; },
|
|
190
|
-
"step": function() { return step; }
|
|
196
|
+
"step": function() { return step; },
|
|
197
|
+
"treemap": function() { return resolver_shape_treemap; }
|
|
191
198
|
});
|
|
192
199
|
|
|
193
200
|
// NAMESPACE OBJECT: ./src/config/resolver/interaction.ts
|
|
@@ -266,7 +273,8 @@ var TYPE = {
|
|
|
266
273
|
RADAR: "radar",
|
|
267
274
|
SCATTER: "scatter",
|
|
268
275
|
SPLINE: "spline",
|
|
269
|
-
STEP: "step"
|
|
276
|
+
STEP: "step",
|
|
277
|
+
TREEMAP: "treemap"
|
|
270
278
|
};
|
|
271
279
|
|
|
272
280
|
/**
|
|
@@ -290,7 +298,8 @@ var TYPE_METHOD_NEEDED = {
|
|
|
290
298
|
RADAR: "initCircle",
|
|
291
299
|
SCATTER: "initCircle",
|
|
292
300
|
SPLINE: "initLine",
|
|
293
|
-
STEP: "initLine"
|
|
301
|
+
STEP: "initLine",
|
|
302
|
+
TREEMAP: "initTreemap"
|
|
294
303
|
};
|
|
295
304
|
|
|
296
305
|
/**
|
|
@@ -466,7 +475,8 @@ function hasValue(dict, value) {
|
|
|
466
475
|
* @private
|
|
467
476
|
*/
|
|
468
477
|
function callFn(fn, thisArg) {
|
|
469
|
-
|
|
478
|
+
var isFn = isFunction(fn);
|
|
479
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
470
480
|
args[_key - 2] = arguments[_key];
|
|
471
481
|
}
|
|
472
482
|
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
@@ -638,8 +648,9 @@ function getPointer(event, element) {
|
|
|
638
648
|
function getBrushSelection(ctx) {
|
|
639
649
|
var event = ctx.event,
|
|
640
650
|
$el = ctx.$el,
|
|
641
|
-
main = $el.subchart.main || $el.main
|
|
642
|
-
|
|
651
|
+
main = $el.subchart.main || $el.main;
|
|
652
|
+
var selection;
|
|
653
|
+
|
|
643
654
|
// check from event
|
|
644
655
|
if (event && event.type === "brush") {
|
|
645
656
|
selection = event.selection;
|
|
@@ -698,8 +709,8 @@ function findIndex(arr, v, start, end, isRotated) {
|
|
|
698
709
|
if (start > end) {
|
|
699
710
|
return -1;
|
|
700
711
|
}
|
|
701
|
-
var mid = Math.floor((start + end) / 2)
|
|
702
|
-
|
|
712
|
+
var mid = Math.floor((start + end) / 2);
|
|
713
|
+
var _arr$mid = arr[mid],
|
|
703
714
|
x = _arr$mid.x,
|
|
704
715
|
_arr$mid$w = _arr$mid.w,
|
|
705
716
|
w = _arr$mid$w === void 0 ? 0 : _arr$mid$w;
|
|
@@ -737,12 +748,12 @@ function brushEmpty(ctx) {
|
|
|
737
748
|
* @private
|
|
738
749
|
*/
|
|
739
750
|
function deepClone() {
|
|
740
|
-
for (var _this6 = this,
|
|
751
|
+
for (var _this6 = this, _clone = function clone(v) {
|
|
741
752
|
_newArrowCheck(this, _this6);
|
|
742
753
|
if (isObject(v) && v.constructor) {
|
|
743
754
|
var r = new v.constructor();
|
|
744
755
|
for (var k in v) {
|
|
745
|
-
r[k] =
|
|
756
|
+
r[k] = _clone(v[k]);
|
|
746
757
|
}
|
|
747
758
|
return r;
|
|
748
759
|
}
|
|
@@ -752,7 +763,7 @@ function deepClone() {
|
|
|
752
763
|
}
|
|
753
764
|
return objectN.map(function (v) {
|
|
754
765
|
_newArrowCheck(this, _this6);
|
|
755
|
-
return
|
|
766
|
+
return _clone(v);
|
|
756
767
|
}.bind(this)).reduce(function (a, c) {
|
|
757
768
|
_newArrowCheck(this, _this6);
|
|
758
769
|
return _objectSpread(_objectSpread({}, a), c);
|
|
@@ -1230,8 +1241,8 @@ function runUntil(fn, conditionFn) {
|
|
|
1230
1241
|
*/
|
|
1231
1242
|
function checkModuleImport(ctx) {
|
|
1232
1243
|
var $$ = ctx,
|
|
1233
|
-
config = $$.config
|
|
1234
|
-
|
|
1244
|
+
config = $$.config;
|
|
1245
|
+
var type = "";
|
|
1235
1246
|
if (isEmpty(config.data_type || config.data_types) && !$$[TYPE_METHOD_NEEDED.LINE]) {
|
|
1236
1247
|
type = "line";
|
|
1237
1248
|
} else {
|
|
@@ -1416,11 +1427,16 @@ var $TOOLTIP = {
|
|
|
1416
1427
|
tooltipContainer: "bb-tooltip-container",
|
|
1417
1428
|
tooltipName: "bb-tooltip-name"
|
|
1418
1429
|
};
|
|
1430
|
+
var $TREEMAP = {
|
|
1431
|
+
treemap: "bb-treemap",
|
|
1432
|
+
chartTreemap: "bb-chart-treemap",
|
|
1433
|
+
chartTreemaps: "bb-chart-treemaps"
|
|
1434
|
+
};
|
|
1419
1435
|
var $ZOOM = {
|
|
1420
1436
|
buttonZoomReset: "bb-zoom-reset",
|
|
1421
1437
|
zoomBrush: "bb-zoom-brush"
|
|
1422
1438
|
};
|
|
1423
|
-
/* harmony default export */ var classes = (classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $ZOOM));
|
|
1439
|
+
/* harmony default export */ var classes = (classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $TREEMAP), $ZOOM));
|
|
1424
1440
|
;// CONCATENATED MODULE: ./src/config/Store/Element.ts
|
|
1425
1441
|
/**
|
|
1426
1442
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -1539,6 +1555,7 @@ var State = function () {
|
|
|
1539
1555
|
xAxisHeight: 0,
|
|
1540
1556
|
hasAxis: !1,
|
|
1541
1557
|
hasRadar: !1,
|
|
1558
|
+
hasTreemap: !1,
|
|
1542
1559
|
// for data CSS rule index (used when boost.useCssRule is true)
|
|
1543
1560
|
cssRule: {},
|
|
1544
1561
|
current: {
|
|
@@ -2204,6 +2221,7 @@ var data_this = undefined;
|
|
|
2204
2221
|
* - scatter
|
|
2205
2222
|
* - spline
|
|
2206
2223
|
* - step
|
|
2224
|
+
* - treemap
|
|
2207
2225
|
* @name data․type
|
|
2208
2226
|
* @memberof Options
|
|
2209
2227
|
* @type {string}
|
|
@@ -2232,7 +2250,8 @@ var data_this = undefined;
|
|
|
2232
2250
|
* radar,
|
|
2233
2251
|
* scatter,
|
|
2234
2252
|
* spline,
|
|
2235
|
-
* step
|
|
2253
|
+
* step,
|
|
2254
|
+
* treemap
|
|
2236
2255
|
* }
|
|
2237
2256
|
*
|
|
2238
2257
|
* bb.generate({
|
|
@@ -2246,7 +2265,7 @@ var data_this = undefined;
|
|
|
2246
2265
|
/**
|
|
2247
2266
|
* Set chart type for each data.<br>
|
|
2248
2267
|
* This setting overwrites data.type setting.
|
|
2249
|
-
* - **NOTE:** `radar` type can't be combined with other types.
|
|
2268
|
+
* - **NOTE:** `radar` and `treemap` type can't be combined with other types.
|
|
2250
2269
|
* @name data․types
|
|
2251
2270
|
* @memberof Options
|
|
2252
2271
|
* @type {object}
|
|
@@ -2278,7 +2297,8 @@ var data_this = undefined;
|
|
|
2278
2297
|
* radar,
|
|
2279
2298
|
* scatter,
|
|
2280
2299
|
* spline,
|
|
2281
|
-
* step
|
|
2300
|
+
* step,
|
|
2301
|
+
* treemap
|
|
2282
2302
|
* }
|
|
2283
2303
|
*
|
|
2284
2304
|
* bb.generate({
|
|
@@ -3723,40 +3743,42 @@ function generateResize(option) {
|
|
|
3723
3743
|
* @private
|
|
3724
3744
|
*/
|
|
3725
3745
|
function generateWait() {
|
|
3726
|
-
var transitionsToWait = []
|
|
3727
|
-
f = function (selection, callback) {
|
|
3728
|
-
var _this5 = this;
|
|
3729
|
-
/**
|
|
3730
|
-
* Check if transition is complete
|
|
3731
|
-
* @returns {boolean} Whether transition is complete
|
|
3732
|
-
* @private
|
|
3733
|
-
*/
|
|
3734
|
-
function loop() {
|
|
3735
|
-
var done = 0;
|
|
3736
|
-
for (var i = 0, t; t = transitionsToWait[i]; i++) {
|
|
3737
|
-
if (t === !0 || t.empty != null && t.empty()) {
|
|
3738
|
-
done++;
|
|
3739
|
-
continue;
|
|
3740
|
-
}
|
|
3746
|
+
var transitionsToWait = [];
|
|
3741
3747
|
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3748
|
+
// 'f' is called as selection.call(f, ...);
|
|
3749
|
+
var f = function (selection, callback) {
|
|
3750
|
+
var _this5 = this;
|
|
3751
|
+
/**
|
|
3752
|
+
* Check if transition is complete
|
|
3753
|
+
* @returns {boolean} Whether transition is complete
|
|
3754
|
+
* @private
|
|
3755
|
+
*/
|
|
3756
|
+
function loop() {
|
|
3757
|
+
var done = 0;
|
|
3758
|
+
for (var i = 0, t; t = transitionsToWait[i]; i++) {
|
|
3759
|
+
if (t === !0 || t.empty != null && t.empty()) {
|
|
3760
|
+
done++;
|
|
3761
|
+
continue;
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
// when tab isn't visible exit loop
|
|
3765
|
+
if (isTabVisible() === !1) {
|
|
3766
|
+
done = transitionsToWait.length;
|
|
3767
|
+
break;
|
|
3768
|
+
}
|
|
3769
|
+
try {
|
|
3770
|
+
t.transition();
|
|
3771
|
+
} catch (e) {
|
|
3772
|
+
done++;
|
|
3752
3773
|
}
|
|
3753
|
-
return done === transitionsToWait.length;
|
|
3754
3774
|
}
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3775
|
+
return done === transitionsToWait.length;
|
|
3776
|
+
}
|
|
3777
|
+
runUntil(function () {
|
|
3778
|
+
_newArrowCheck(this, _this5);
|
|
3779
|
+
callback == null ? void 0 : callback();
|
|
3780
|
+
}.bind(this), loop);
|
|
3781
|
+
};
|
|
3760
3782
|
f.add = function (t) {
|
|
3761
3783
|
isArray(t) ? transitionsToWait = transitionsToWait.concat(t) : transitionsToWait.push(t);
|
|
3762
3784
|
};
|
|
@@ -3929,22 +3951,22 @@ function rows(rows) {
|
|
|
3929
3951
|
* @private
|
|
3930
3952
|
*/
|
|
3931
3953
|
function json(json, keysParam) {
|
|
3932
|
-
var newRows = []
|
|
3933
|
-
|
|
3954
|
+
var newRows = [];
|
|
3955
|
+
var targetKeys, data;
|
|
3956
|
+
if (Array.isArray(json)) {
|
|
3957
|
+
var findValueInJson = function (object, path) {
|
|
3934
3958
|
if (object[path] !== undefined) {
|
|
3935
3959
|
return object[path];
|
|
3936
3960
|
}
|
|
3937
3961
|
var convertedPath = path.replace(/\[(\w+)\]/g, ".$1"),
|
|
3938
|
-
pathArray = convertedPath.replace(/^\./, "").split(".")
|
|
3939
|
-
|
|
3962
|
+
pathArray = convertedPath.replace(/^\./, "").split("."); // convert indexes to properties (replace [] with .)
|
|
3963
|
+
// strip a leading dot
|
|
3964
|
+
var target = object;
|
|
3940
3965
|
pathArray.some(function (k) {
|
|
3941
3966
|
return !(target = target && k in target ? target[k] : undefined);
|
|
3942
3967
|
});
|
|
3943
3968
|
return target;
|
|
3944
|
-
}
|
|
3945
|
-
targetKeys,
|
|
3946
|
-
data;
|
|
3947
|
-
if (Array.isArray(json)) {
|
|
3969
|
+
};
|
|
3948
3970
|
if (keysParam.x) {
|
|
3949
3971
|
targetKeys = keysParam.value.concat(keysParam.x);
|
|
3950
3972
|
} else {
|
|
@@ -3966,13 +3988,25 @@ function json(json, keysParam) {
|
|
|
3966
3988
|
} else {
|
|
3967
3989
|
Object.keys(json).forEach(function (key) {
|
|
3968
3990
|
var tmp = json[key].concat();
|
|
3969
|
-
tmp.unshift(key);
|
|
3991
|
+
tmp.unshift == null ? void 0 : tmp.unshift(key);
|
|
3970
3992
|
newRows.push(tmp);
|
|
3971
3993
|
});
|
|
3972
3994
|
data = columns(newRows);
|
|
3973
3995
|
}
|
|
3974
3996
|
return data;
|
|
3975
3997
|
}
|
|
3998
|
+
function jsonTreemap(json) {
|
|
3999
|
+
var _this = this,
|
|
4000
|
+
_convertKey = function convertKey(v) {
|
|
4001
|
+
_newArrowCheck(this, _this);
|
|
4002
|
+
if (v.children) {
|
|
4003
|
+
v.children.forEach(_convertKey);
|
|
4004
|
+
}
|
|
4005
|
+
v.name = v.id;
|
|
4006
|
+
}.bind(this);
|
|
4007
|
+
json.forEach(_convertKey);
|
|
4008
|
+
return json;
|
|
4009
|
+
}
|
|
3976
4010
|
|
|
3977
4011
|
/***** Functions can't be executed on Web Worker *****/
|
|
3978
4012
|
/**
|
|
@@ -4021,13 +4055,13 @@ function url(url, mimeType, headers, keys, done) {
|
|
|
4021
4055
|
* @private
|
|
4022
4056
|
*/
|
|
4023
4057
|
function convertCsvTsvToData(parser, xsv) {
|
|
4024
|
-
var
|
|
4058
|
+
var _this2 = this,
|
|
4025
4059
|
rows = parser.rows(xsv),
|
|
4026
4060
|
d;
|
|
4027
4061
|
if (rows.length === 1) {
|
|
4028
4062
|
d = [{}];
|
|
4029
4063
|
rows[0].forEach(function (id) {
|
|
4030
|
-
_newArrowCheck(this,
|
|
4064
|
+
_newArrowCheck(this, _this2);
|
|
4031
4065
|
d[0][id] = null;
|
|
4032
4066
|
}.bind(this));
|
|
4033
4067
|
} else {
|
|
@@ -4126,8 +4160,9 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4126
4160
|
}
|
|
4127
4161
|
var dataKeys = Object.keys(data[0] || {}),
|
|
4128
4162
|
ids = dataKeys.length ? dataKeys.filter($$.isNotX, $$) : [],
|
|
4129
|
-
xs = dataKeys.length ? dataKeys.filter($$.isX, $$) : []
|
|
4130
|
-
|
|
4163
|
+
xs = dataKeys.length ? dataKeys.filter($$.isX, $$) : [];
|
|
4164
|
+
var xsData;
|
|
4165
|
+
|
|
4131
4166
|
// save x for update data by load when custom x and bb.x API
|
|
4132
4167
|
ids.forEach(function (id) {
|
|
4133
4168
|
var _this3 = this;
|
|
@@ -4189,8 +4224,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4189
4224
|
id_org: id,
|
|
4190
4225
|
values: data.map(function (d, i) {
|
|
4191
4226
|
_newArrowCheck(this, _this4);
|
|
4192
|
-
var rawX = d[xKey]
|
|
4193
|
-
|
|
4227
|
+
var rawX = d[xKey];
|
|
4228
|
+
var value = d[id],
|
|
4194
4229
|
x;
|
|
4195
4230
|
value = value !== null && !isNaN(value) && !isObject(value) ? +value : isArray(value) || isObject(value) ? value : null;
|
|
4196
4231
|
|
|
@@ -4363,8 +4398,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4363
4398
|
},
|
|
4364
4399
|
addName: function addName(data) {
|
|
4365
4400
|
var $$ = this,
|
|
4366
|
-
config = $$.config
|
|
4367
|
-
|
|
4401
|
+
config = $$.config;
|
|
4402
|
+
var name;
|
|
4368
4403
|
if (data) {
|
|
4369
4404
|
name = config.data_names[data.id];
|
|
4370
4405
|
data.name = name !== undefined ? name : data.id;
|
|
@@ -4383,11 +4418,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4383
4418
|
if (filterNull === void 0) {
|
|
4384
4419
|
filterNull = !1;
|
|
4385
4420
|
}
|
|
4386
|
-
var $$ = this
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4421
|
+
var $$ = this;
|
|
4422
|
+
var value = $$.filterTargetsToShow($$.data.targets).map(function (t) {
|
|
4423
|
+
_newArrowCheck(this, _this4);
|
|
4424
|
+
return $$.addName($$.getValueOnIndex(t.values, index));
|
|
4425
|
+
}.bind(this));
|
|
4391
4426
|
if (filterNull) {
|
|
4392
4427
|
value = value.filter(function (v) {
|
|
4393
4428
|
_newArrowCheck(this, _this4);
|
|
@@ -4427,8 +4462,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4427
4462
|
},
|
|
4428
4463
|
generateTargetX: function generateTargetX(rawX, id, index) {
|
|
4429
4464
|
var $$ = this,
|
|
4430
|
-
axis = $$.axis
|
|
4431
|
-
|
|
4465
|
+
axis = $$.axis;
|
|
4466
|
+
var x = axis != null && axis.isCategorized() ? index : rawX || index;
|
|
4432
4467
|
if (axis != null && axis.isTimeSeries()) {
|
|
4433
4468
|
var fn = parseDate.bind($$);
|
|
4434
4469
|
x = rawX ? fn(rawX) : fn($$.getXValue(id, index));
|
|
@@ -4462,8 +4497,9 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4462
4497
|
*/
|
|
4463
4498
|
getBaseValue: function getBaseValue(data) {
|
|
4464
4499
|
var $$ = this,
|
|
4465
|
-
hasAxis = $$.state.hasAxis
|
|
4466
|
-
|
|
4500
|
+
hasAxis = $$.state.hasAxis;
|
|
4501
|
+
var value = data.value;
|
|
4502
|
+
|
|
4467
4503
|
// In case of area-range, data is given as: [low, mid, high] or {low, mid, high}
|
|
4468
4504
|
// will take the 'mid' as the base value
|
|
4469
4505
|
if (value && hasAxis) {
|
|
@@ -4515,25 +4551,25 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4515
4551
|
_newArrowCheck(this, _this11);
|
|
4516
4552
|
return t.values;
|
|
4517
4553
|
}.bind(this)),
|
|
4518
|
-
minMax = $$.getMinMaxValue(data)
|
|
4519
|
-
|
|
4520
|
-
|
|
4554
|
+
minMax = $$.getMinMaxValue(data);
|
|
4555
|
+
var min = [],
|
|
4556
|
+
max = [];
|
|
4521
4557
|
data.forEach(function (v) {
|
|
4522
4558
|
_newArrowCheck(this, _this11);
|
|
4523
4559
|
var minData = $$.getFilteredDataByValue(v, minMax.min),
|
|
4524
4560
|
maxData = $$.getFilteredDataByValue(v, minMax.max);
|
|
4525
4561
|
if (minData.length) {
|
|
4526
|
-
|
|
4562
|
+
min = min.concat(minData);
|
|
4527
4563
|
}
|
|
4528
4564
|
if (maxData.length) {
|
|
4529
|
-
|
|
4565
|
+
max = max.concat(maxData);
|
|
4530
4566
|
}
|
|
4531
4567
|
}.bind(this));
|
|
4532
4568
|
|
|
4533
4569
|
// update the cached data
|
|
4534
4570
|
$$.cache.add(cacheKey, minMaxData = {
|
|
4535
|
-
min:
|
|
4536
|
-
max:
|
|
4571
|
+
min: min,
|
|
4572
|
+
max: max
|
|
4537
4573
|
});
|
|
4538
4574
|
}
|
|
4539
4575
|
return minMaxData;
|
|
@@ -4576,7 +4612,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4576
4612
|
cacheKey = KEY.dataTotalSum,
|
|
4577
4613
|
total = $$.cache.get(cacheKey);
|
|
4578
4614
|
if (!isNumber(total)) {
|
|
4579
|
-
var
|
|
4615
|
+
var sum = mergeArray($$.data.targets.map(function (t) {
|
|
4580
4616
|
_newArrowCheck(this, _this14);
|
|
4581
4617
|
return t.values;
|
|
4582
4618
|
}.bind(this))).map(function (v) {
|
|
@@ -4586,7 +4622,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4586
4622
|
_newArrowCheck(this, _this14);
|
|
4587
4623
|
return p + c;
|
|
4588
4624
|
}.bind(this));
|
|
4589
|
-
$$.cache.add(cacheKey, total =
|
|
4625
|
+
$$.cache.add(cacheKey, total = sum);
|
|
4590
4626
|
}
|
|
4591
4627
|
if (subtractHidden) {
|
|
4592
4628
|
total -= $$.getHiddenTotalDataSum();
|
|
@@ -4808,8 +4844,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4808
4844
|
return ys;
|
|
4809
4845
|
},
|
|
4810
4846
|
checkValueInTargets: function checkValueInTargets(targets, checker) {
|
|
4811
|
-
var ids = Object.keys(targets)
|
|
4812
|
-
|
|
4847
|
+
var ids = Object.keys(targets);
|
|
4848
|
+
var values;
|
|
4813
4849
|
for (var i = 0; i < ids.length; i++) {
|
|
4814
4850
|
values = targets[ids[i]].values;
|
|
4815
4851
|
for (var j = 0; j < values.length; j++) {
|
|
@@ -4853,21 +4889,21 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4853
4889
|
},
|
|
4854
4890
|
/**
|
|
4855
4891
|
* Get data.order compare function
|
|
4856
|
-
* @param {boolean}
|
|
4892
|
+
* @param {boolean} isReversed for Arc & Treemap type sort order needs to be reversed
|
|
4857
4893
|
* @returns {Function} compare function
|
|
4858
4894
|
* @private
|
|
4859
4895
|
*/
|
|
4860
|
-
getSortCompareFn: function getSortCompareFn(
|
|
4896
|
+
getSortCompareFn: function getSortCompareFn(isReversed) {
|
|
4861
4897
|
var _this29 = this;
|
|
4862
|
-
if (
|
|
4863
|
-
|
|
4898
|
+
if (isReversed === void 0) {
|
|
4899
|
+
isReversed = !1;
|
|
4864
4900
|
}
|
|
4865
4901
|
var $$ = this,
|
|
4866
4902
|
config = $$.config,
|
|
4867
4903
|
order = config.data_order,
|
|
4868
4904
|
orderAsc = /asc/i.test(order),
|
|
4869
|
-
orderDesc = /desc/i.test(order)
|
|
4870
|
-
|
|
4905
|
+
orderDesc = /desc/i.test(order);
|
|
4906
|
+
var fn;
|
|
4871
4907
|
if (orderAsc || orderDesc) {
|
|
4872
4908
|
var reducer = function (p, c) {
|
|
4873
4909
|
_newArrowCheck(this, _this29);
|
|
@@ -4877,7 +4913,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4877
4913
|
_newArrowCheck(this, _this29);
|
|
4878
4914
|
var t1Sum = "values" in t1 ? t1.values.reduce(reducer, 0) : t1.value,
|
|
4879
4915
|
t2Sum = "values" in t2 ? t2.values.reduce(reducer, 0) : t2.value;
|
|
4880
|
-
return
|
|
4916
|
+
return isReversed ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
|
|
4881
4917
|
}.bind(this);
|
|
4882
4918
|
} else if (isFunction(order)) {
|
|
4883
4919
|
fn = order.bind($$.api);
|
|
@@ -4958,8 +4994,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4958
4994
|
},
|
|
4959
4995
|
findSameXOfValues: function findSameXOfValues(values, index) {
|
|
4960
4996
|
var targetX = values[index].x,
|
|
4961
|
-
sames = []
|
|
4962
|
-
|
|
4997
|
+
sames = [];
|
|
4998
|
+
var i;
|
|
4963
4999
|
for (i = index - 1; i >= 0; i--) {
|
|
4964
5000
|
if (targetX !== values[i].x) {
|
|
4965
5001
|
break;
|
|
@@ -5054,8 +5090,9 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5054
5090
|
// insert & append cloning first/last value to be fully rendered covering on each gap sides
|
|
5055
5091
|
var head = converted[0],
|
|
5056
5092
|
tail = converted[converted.length - 1],
|
|
5057
|
-
id = head.id
|
|
5058
|
-
|
|
5093
|
+
id = head.id;
|
|
5094
|
+
var x = head.x;
|
|
5095
|
+
|
|
5059
5096
|
// insert head
|
|
5060
5097
|
converted.unshift({
|
|
5061
5098
|
x: --x,
|
|
@@ -5180,8 +5217,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5180
5217
|
var $$ = this,
|
|
5181
5218
|
config = $$.config,
|
|
5182
5219
|
state = $$.state,
|
|
5183
|
-
api = $$.api
|
|
5184
|
-
|
|
5220
|
+
api = $$.api;
|
|
5221
|
+
var ratio = 0;
|
|
5185
5222
|
if (d && api.data.shown().length) {
|
|
5186
5223
|
ratio = d.ratio || d.value;
|
|
5187
5224
|
if (type === "arc") {
|
|
@@ -5196,8 +5233,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5196
5233
|
ratio = (d.endAngle - d.startAngle) / arcLength;
|
|
5197
5234
|
}
|
|
5198
5235
|
} else if (type === "index") {
|
|
5199
|
-
var dataValues = api.data.values.bind(api)
|
|
5200
|
-
|
|
5236
|
+
var dataValues = api.data.values.bind(api);
|
|
5237
|
+
var total = this.getTotalPerIndex();
|
|
5201
5238
|
if (state.hiddenTargetIds.length) {
|
|
5202
5239
|
var hiddenSum = dataValues(state.hiddenTargetIds, !1);
|
|
5203
5240
|
if (hiddenSum.length) {
|
|
@@ -5221,12 +5258,14 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5221
5258
|
ratio = parseFloat(Math.max(d.value, 0) + "") / state.current.dataMax * config.radar_size_ratio;
|
|
5222
5259
|
} else if (type === "bar") {
|
|
5223
5260
|
var yScale = $$.getYScaleById.bind($$)(d.id),
|
|
5224
|
-
|
|
5261
|
+
max = yScale.domain().reduce(function (a, c) {
|
|
5225
5262
|
_newArrowCheck(this, _this40);
|
|
5226
5263
|
return c - a;
|
|
5227
5264
|
}.bind(this));
|
|
5228
5265
|
// when all data are 0, return 0
|
|
5229
|
-
ratio =
|
|
5266
|
+
ratio = max === 0 ? 0 : Math.abs(d.value) / max;
|
|
5267
|
+
} else if (type === "treemap") {
|
|
5268
|
+
ratio /= $$.getTotalDataSum(!0);
|
|
5230
5269
|
}
|
|
5231
5270
|
}
|
|
5232
5271
|
return asPercent && ratio ? ratio * 100 : ratio;
|
|
@@ -5420,6 +5459,9 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
5420
5459
|
}.bind(this));
|
|
5421
5460
|
}.bind(this));
|
|
5422
5461
|
|
|
5462
|
+
// since treemap uses different data types, it needs to be transformed
|
|
5463
|
+
state.hasTreemap && $$.updateTargetsForTreemap($$.data.targets);
|
|
5464
|
+
|
|
5423
5465
|
// Update current state chart type and elements list after redraw
|
|
5424
5466
|
$$.updateTypesElements();
|
|
5425
5467
|
}
|
|
@@ -5533,15 +5575,18 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5533
5575
|
var _this5 = this,
|
|
5534
5576
|
$$ = this,
|
|
5535
5577
|
config = $$.config,
|
|
5536
|
-
|
|
5578
|
+
_$$$state = $$.state,
|
|
5579
|
+
hasRadar = _$$$state.hasRadar,
|
|
5580
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
5537
5581
|
main = $$.$el.main,
|
|
5538
|
-
|
|
5582
|
+
isArcTreemap = isObject(d);
|
|
5539
5583
|
// Call event handler
|
|
5540
|
-
if (
|
|
5584
|
+
if (isArcTreemap || d !== -1) {
|
|
5541
5585
|
var callback = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
|
|
5542
|
-
config.color_onover && $$.setOverColor(isOver, d,
|
|
5543
|
-
if (
|
|
5544
|
-
|
|
5586
|
+
config.color_onover && $$.setOverColor(isOver, d, isArcTreemap);
|
|
5587
|
+
if (isArcTreemap && "id") {
|
|
5588
|
+
var selector = hasTreemap ? $TREEMAP.treemap : $ARC.arc;
|
|
5589
|
+
callback(d, main.select("." + selector + $$.getTargetSelectorSuffix(d.id)).node());
|
|
5545
5590
|
} else if (!config.tooltip_grouped) {
|
|
5546
5591
|
var last = $$.cache.get(KEY.setOverOut) || [],
|
|
5547
5592
|
shapesAtIndex = main.selectAll("." + $SHAPE.shape + "-" + d).filter(function (d) {
|
|
@@ -5629,40 +5674,45 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5629
5674
|
* @param {Array} mouse x and y coordinate value
|
|
5630
5675
|
*/
|
|
5631
5676
|
dispatchEvent: function dispatchEvent(type, index, mouse) {
|
|
5632
|
-
var
|
|
5677
|
+
var _ref,
|
|
5678
|
+
_this7 = this,
|
|
5633
5679
|
$$ = this,
|
|
5634
5680
|
config = $$.config,
|
|
5635
|
-
_$$$
|
|
5636
|
-
eventReceiver = _$$$
|
|
5637
|
-
hasAxis = _$$$
|
|
5638
|
-
hasRadar = _$$$
|
|
5681
|
+
_$$$state2 = $$.state,
|
|
5682
|
+
eventReceiver = _$$$state2.eventReceiver,
|
|
5683
|
+
hasAxis = _$$$state2.hasAxis,
|
|
5684
|
+
hasRadar = _$$$state2.hasRadar,
|
|
5685
|
+
hasTreemap = _$$$state2.hasTreemap,
|
|
5639
5686
|
_$$$$el = $$.$el,
|
|
5640
5687
|
eventRect = _$$$$el.eventRect,
|
|
5641
5688
|
arcs = _$$$$el.arcs,
|
|
5642
5689
|
radar = _$$$$el.radar,
|
|
5643
|
-
|
|
5644
|
-
element = (hasRadar
|
|
5690
|
+
treemap = _$$$$el.treemap,
|
|
5691
|
+
element = (_ref = hasTreemap && eventReceiver.rect || hasRadar && radar.axes.select("." + $AXIS.axis + "-" + index + " text") || eventRect || (arcs == null ? void 0 : arcs.selectAll("." + $COMMON.target + " path").filter(function (d, i) {
|
|
5645
5692
|
_newArrowCheck(this, _this7);
|
|
5646
5693
|
return i === index;
|
|
5647
|
-
}.bind(this))).node()
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5694
|
+
}.bind(this)))) == null ? void 0 : _ref.node();
|
|
5695
|
+
if (element) {
|
|
5696
|
+
var isMultipleX = $$.isMultipleX();
|
|
5697
|
+
var _element$getBoundingC = element.getBoundingClientRect(),
|
|
5698
|
+
width = _element$getBoundingC.width,
|
|
5699
|
+
left = _element$getBoundingC.left,
|
|
5700
|
+
top = _element$getBoundingC.top;
|
|
5701
|
+
if (hasAxis && !hasRadar && !isMultipleX) {
|
|
5702
|
+
var coords = eventReceiver.coords[index];
|
|
5703
|
+
width = coords.w;
|
|
5704
|
+
left += coords.x;
|
|
5705
|
+
top += coords.y;
|
|
5706
|
+
}
|
|
5707
|
+
var x = left + (mouse ? mouse[0] : 0) + (isMultipleX || config.axis_rotated ? 0 : width / 2),
|
|
5708
|
+
y = top + (mouse ? mouse[1] : 0);
|
|
5709
|
+
emulateEvent[/^(mouse|click)/.test(type) ? "mouse" : "touch"](hasTreemap ? treemap.node() : element, type, {
|
|
5710
|
+
screenX: x,
|
|
5711
|
+
screenY: y,
|
|
5712
|
+
clientX: x,
|
|
5713
|
+
clientY: y
|
|
5714
|
+
});
|
|
5715
|
+
}
|
|
5666
5716
|
},
|
|
5667
5717
|
setDragStatus: function setDragStatus(isDragging) {
|
|
5668
5718
|
this.state.dragging = isDragging;
|
|
@@ -5692,9 +5742,10 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5692
5742
|
legend = _$$$$el3.legend,
|
|
5693
5743
|
region = _$$$$el3.region,
|
|
5694
5744
|
svg = _$$$$el3.svg,
|
|
5745
|
+
treemap = _$$$$el3.treemap,
|
|
5695
5746
|
brush = $$.brush;
|
|
5696
5747
|
// detach all possible event types
|
|
5697
|
-
[svg, eventRect, region == null ? void 0 : region.list, brush == null ? void 0 : brush.getSelection(), arcs == null ? void 0 : arcs.selectAll("path"), legend == null ? void 0 : legend.selectAll("g")].forEach(function (v) {
|
|
5748
|
+
[svg, eventRect, region == null ? void 0 : region.list, brush == null ? void 0 : brush.getSelection(), arcs == null ? void 0 : arcs.selectAll("path"), legend == null ? void 0 : legend.selectAll("g"), treemap].forEach(function (v) {
|
|
5698
5749
|
_newArrowCheck(this, _this8);
|
|
5699
5750
|
return v == null ? void 0 : v.on("wheel click mouseover mousemove mouseout touchstart touchmove touchend touchstart.eventRect touchmove.eventRect touchend.eventRect .brush .drag .zoom wheel.zoom dblclick.zoom", null);
|
|
5700
5751
|
}.bind(this));
|
|
@@ -5722,7 +5773,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5722
5773
|
getClass: function getClass(type, withShape) {
|
|
5723
5774
|
var _this = this,
|
|
5724
5775
|
isPlural = /s$/.test(type),
|
|
5725
|
-
useIdKey = /^(area|arc|line)s?$/.test(type),
|
|
5776
|
+
useIdKey = /^(area|arc|line|treemap)s?$/.test(type),
|
|
5726
5777
|
key = isPlural ? "id" : "index";
|
|
5727
5778
|
return function (d) {
|
|
5728
5779
|
_newArrowCheck(this, _this);
|
|
@@ -5761,8 +5812,8 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5761
5812
|
return this.generateClass(classes.region, i) + " " + ("class" in d ? d.class : "");
|
|
5762
5813
|
},
|
|
5763
5814
|
classTarget: function classTarget(id) {
|
|
5764
|
-
var additionalClassSuffix = this.config.data_classes[id]
|
|
5765
|
-
|
|
5815
|
+
var additionalClassSuffix = this.config.data_classes[id];
|
|
5816
|
+
var additionalClass = "";
|
|
5766
5817
|
if (additionalClassSuffix) {
|
|
5767
5818
|
additionalClass = " " + classes.target + "-" + additionalClassSuffix;
|
|
5768
5819
|
}
|
|
@@ -5781,11 +5832,17 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
|
|
|
5781
5832
|
var targetStr = targetId || targetId === 0 ? "-" + targetId : "";
|
|
5782
5833
|
return targetStr.replace(/([\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g, "-");
|
|
5783
5834
|
},
|
|
5784
|
-
selectorTarget: function selectorTarget(id, prefix) {
|
|
5785
|
-
|
|
5786
|
-
|
|
5835
|
+
selectorTarget: function selectorTarget(id, prefix, postfix) {
|
|
5836
|
+
if (prefix === void 0) {
|
|
5837
|
+
prefix = "";
|
|
5838
|
+
}
|
|
5839
|
+
if (postfix === void 0) {
|
|
5840
|
+
postfix = "";
|
|
5841
|
+
}
|
|
5842
|
+
var target = this.getTargetSelectorSuffix(id);
|
|
5843
|
+
|
|
5787
5844
|
// select target & circle
|
|
5788
|
-
return
|
|
5845
|
+
return prefix + "." + (classes.target + target) + " " + postfix + ", " + prefix + "." + (classes.circles + target) + " " + postfix;
|
|
5789
5846
|
},
|
|
5790
5847
|
selectorTargets: function selectorTargets(idsValue, prefix) {
|
|
5791
5848
|
var _this3 = this,
|
|
@@ -5944,8 +6001,8 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
5944
6001
|
max = threshold.max || 100,
|
|
5945
6002
|
values = threshold.values && threshold.values.length ? threshold.values : [];
|
|
5946
6003
|
return notEmpty(threshold) ? function (value) {
|
|
5947
|
-
var v = asValue ? value : value * 100 / max
|
|
5948
|
-
|
|
6004
|
+
var v = asValue ? value : value * 100 / max;
|
|
6005
|
+
var color = colors[colors.length - 1];
|
|
5949
6006
|
for (var i = 0, l = values.length; i < l; i++) {
|
|
5950
6007
|
if (v <= values[i]) {
|
|
5951
6008
|
color = colors[i];
|
|
@@ -6167,8 +6224,8 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6167
6224
|
center = config[pfx + "_center"],
|
|
6168
6225
|
isInverted = config[pfx + "_inverted"],
|
|
6169
6226
|
showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated,
|
|
6170
|
-
showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated
|
|
6171
|
-
|
|
6227
|
+
showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;
|
|
6228
|
+
var yDomainMin = $$.getYDomainMinMax(yTargets, "min"),
|
|
6172
6229
|
yDomainMax = $$.getYDomainMinMax(yTargets, "max"),
|
|
6173
6230
|
isZeroBased = [TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER].concat(TYPE_BY_CATEGORY.Line).some(function (v) {
|
|
6174
6231
|
_newArrowCheck(this, _this5);
|
|
@@ -6201,11 +6258,11 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6201
6258
|
isAllPositive && (yDomainMin = 0);
|
|
6202
6259
|
isAllNegative && (yDomainMax = 0);
|
|
6203
6260
|
}
|
|
6204
|
-
var domainLength = Math.abs(yDomainMax - yDomainMin)
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6261
|
+
var domainLength = Math.abs(yDomainMax - yDomainMin);
|
|
6262
|
+
var padding = {
|
|
6263
|
+
top: domainLength * .1,
|
|
6264
|
+
bottom: domainLength * .1
|
|
6265
|
+
};
|
|
6209
6266
|
if (isDefined(center)) {
|
|
6210
6267
|
var yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
|
|
6211
6268
|
yDomainMax = center + yDomainAbs;
|
|
@@ -6265,8 +6322,8 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6265
6322
|
return v.x;
|
|
6266
6323
|
}.bind(this)));
|
|
6267
6324
|
}.bind(this))),
|
|
6268
|
-
|
|
6269
|
-
|
|
6325
|
+
_$$$axis,
|
|
6326
|
+
value = isObject(configValue) ? configValue.value : configValue;
|
|
6270
6327
|
value = isDefined(value) && (_$$$axis = $$.axis) != null && _$$$axis.isTimeSeries() ? parseDate.bind(this)(value) : value;
|
|
6271
6328
|
if (isObject(configValue) && configValue.fit && (type === "min" && value < dataValue || type === "max" && value > dataValue)) {
|
|
6272
6329
|
value = undefined;
|
|
@@ -6286,8 +6343,9 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6286
6343
|
config = $$.config,
|
|
6287
6344
|
padding = config.axis_x_padding,
|
|
6288
6345
|
isTimeSeriesTickCount = axis.isTimeSeries() && tickCount,
|
|
6289
|
-
diff = diffDomain(domain)
|
|
6290
|
-
|
|
6346
|
+
diff = diffDomain(domain);
|
|
6347
|
+
var defaultValue;
|
|
6348
|
+
|
|
6291
6349
|
// determine default padding value
|
|
6292
6350
|
if (axis.isCategorized() || isTimeSeriesTickCount) {
|
|
6293
6351
|
defaultValue = 0;
|
|
@@ -6334,18 +6392,18 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6334
6392
|
var $$ = this,
|
|
6335
6393
|
axis = $$.axis,
|
|
6336
6394
|
x = $$.scale.x,
|
|
6337
|
-
domain = [$$.getXDomainMinMax(targets, "min"), $$.getXDomainMinMax(targets, "max")]
|
|
6338
|
-
|
|
6339
|
-
_domain$ = _domain[0],
|
|
6395
|
+
domain = [$$.getXDomainMinMax(targets, "min"), $$.getXDomainMinMax(targets, "max")];
|
|
6396
|
+
var _domain$ = domain[0],
|
|
6340
6397
|
min = _domain$ === void 0 ? 0 : _domain$,
|
|
6341
|
-
_domain$2 =
|
|
6398
|
+
_domain$2 = domain[1],
|
|
6342
6399
|
max = _domain$2 === void 0 ? 0 : _domain$2;
|
|
6343
6400
|
if (x.type !== "log") {
|
|
6344
6401
|
var isCategorized = axis.isCategorized(),
|
|
6345
6402
|
isTimeSeries = axis.isTimeSeries(),
|
|
6346
|
-
|
|
6347
|
-
|
|
6403
|
+
padding = $$.getXDomainPadding(domain);
|
|
6404
|
+
var firstX = domain[0],
|
|
6348
6405
|
lastX = domain[1];
|
|
6406
|
+
|
|
6349
6407
|
// show center of x domain if min and max are the same
|
|
6350
6408
|
if (firstX - lastX === 0 && !isCategorized) {
|
|
6351
6409
|
if (isTimeSeries) {
|
|
@@ -6357,10 +6415,10 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6357
6415
|
}
|
|
6358
6416
|
}
|
|
6359
6417
|
if (firstX || firstX === 0) {
|
|
6360
|
-
min = isTimeSeries ? new Date(firstX.getTime() -
|
|
6418
|
+
min = isTimeSeries ? new Date(firstX.getTime() - padding.left) : firstX - padding.left;
|
|
6361
6419
|
}
|
|
6362
6420
|
if (lastX || lastX === 0) {
|
|
6363
|
-
max = isTimeSeries ? new Date(lastX.getTime() +
|
|
6421
|
+
max = isTimeSeries ? new Date(lastX.getTime() + padding.right) : lastX + padding.right;
|
|
6364
6422
|
}
|
|
6365
6423
|
}
|
|
6366
6424
|
return [min, max];
|
|
@@ -6413,8 +6471,8 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6413
6471
|
getZoomDomain: function getZoomDomain() {
|
|
6414
6472
|
var $$ = this,
|
|
6415
6473
|
config = $$.config,
|
|
6416
|
-
org = $$.org
|
|
6417
|
-
|
|
6474
|
+
org = $$.org;
|
|
6475
|
+
var _org$xDomain = org.xDomain,
|
|
6418
6476
|
min = _org$xDomain[0],
|
|
6419
6477
|
max = _org$xDomain[1];
|
|
6420
6478
|
if (isDefined(config.zoom_x_min)) {
|
|
@@ -6437,8 +6495,8 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6437
6495
|
var $$ = this,
|
|
6438
6496
|
config = $$.config,
|
|
6439
6497
|
state = $$.state,
|
|
6440
|
-
isRotated = config.axis_rotated
|
|
6441
|
-
|
|
6498
|
+
isRotated = config.axis_rotated;
|
|
6499
|
+
var length;
|
|
6442
6500
|
if (type === "x") {
|
|
6443
6501
|
length = isRotated ? "height" : "width";
|
|
6444
6502
|
} else {
|
|
@@ -6580,7 +6638,8 @@ function getLegendColor(id) {
|
|
|
6580
6638
|
* @private
|
|
6581
6639
|
*/
|
|
6582
6640
|
updateLegend: function updateLegend(targetIds, options, transitions) {
|
|
6583
|
-
var
|
|
6641
|
+
var _$el$legend,
|
|
6642
|
+
$$ = this,
|
|
6584
6643
|
config = $$.config,
|
|
6585
6644
|
state = $$.state,
|
|
6586
6645
|
scale = $$.scale,
|
|
@@ -6594,12 +6653,12 @@ function getLegendColor(id) {
|
|
|
6594
6653
|
optionz.withTransitionForTransform = getOption(optionz, "withTransitionForTransform", !0);
|
|
6595
6654
|
if (config.legend_contents_bindto && config.legend_contents_template) {
|
|
6596
6655
|
$$.updateLegendTemplate();
|
|
6597
|
-
} else {
|
|
6656
|
+
} else if (!state.hasTreemap) {
|
|
6598
6657
|
$$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions);
|
|
6599
6658
|
}
|
|
6600
6659
|
|
|
6601
6660
|
// toggle legend state
|
|
6602
|
-
$el.legend.selectAll("." + $LEGEND.legendItem).classed($LEGEND.legendItemHidden, function (id) {
|
|
6661
|
+
(_$el$legend = $el.legend) == null ? void 0 : _$el$legend.selectAll("." + $LEGEND.legendItem).classed($LEGEND.legendItemHidden, function (id) {
|
|
6603
6662
|
var hide = !$$.isTargetToShow(id);
|
|
6604
6663
|
if (hide) {
|
|
6605
6664
|
this.style.opacity = null;
|
|
@@ -6628,8 +6687,8 @@ function getLegendColor(id) {
|
|
|
6628
6687
|
template = config.legend_contents_template;
|
|
6629
6688
|
if (!wrapper.empty()) {
|
|
6630
6689
|
var targets = $$.mapToIds($$.data.targets),
|
|
6631
|
-
ids = []
|
|
6632
|
-
|
|
6690
|
+
ids = [];
|
|
6691
|
+
var html = "";
|
|
6633
6692
|
targets.forEach(function (v) {
|
|
6634
6693
|
_newArrowCheck(this, _this);
|
|
6635
6694
|
var content = isFunction(template) ? template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) : tplProcess(template, {
|
|
@@ -6833,9 +6892,11 @@ function getLegendColor(id) {
|
|
|
6833
6892
|
getLegendItemTextBox: function getLegendItemTextBox(id, textElement) {
|
|
6834
6893
|
var $$ = this,
|
|
6835
6894
|
cache = $$.cache,
|
|
6836
|
-
state = $$.state
|
|
6837
|
-
|
|
6838
|
-
|
|
6895
|
+
state = $$.state;
|
|
6896
|
+
var data;
|
|
6897
|
+
|
|
6898
|
+
// do not prefix w/'$', to not be resetted cache in .load() call
|
|
6899
|
+
var cacheKey = KEY.legendItemTextBox;
|
|
6839
6900
|
if (id) {
|
|
6840
6901
|
data = !state.redrawing && cache.get(cacheKey) || {};
|
|
6841
6902
|
if (!data[id]) {
|
|
@@ -7288,7 +7349,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7288
7349
|
config = $$.config,
|
|
7289
7350
|
state = $$.state,
|
|
7290
7351
|
$el = $$.$el,
|
|
7291
|
-
|
|
7352
|
+
_$el = $el,
|
|
7353
|
+
main = _$el.main,
|
|
7354
|
+
treemap = _$el.treemap;
|
|
7292
7355
|
state.redrawing = !0;
|
|
7293
7356
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
|
7294
7357
|
_options = options,
|
|
@@ -7304,7 +7367,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7304
7367
|
// update legend and transform each g
|
|
7305
7368
|
if (wth.Legend && config.legend_show) {
|
|
7306
7369
|
options.withTransition = !!duration;
|
|
7307
|
-
$$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
|
|
7370
|
+
treemap || $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
|
|
7308
7371
|
} else if (wth.Dimension) {
|
|
7309
7372
|
// need to update dimension (e.g. axis.y.tick.values) because y tick values should change
|
|
7310
7373
|
// no need to update axis in it because they will be updated in redraw()
|
|
@@ -7312,7 +7375,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7312
7375
|
}
|
|
7313
7376
|
|
|
7314
7377
|
// update circleY based on updated parameters
|
|
7315
|
-
if (!$$.hasArcType() || state.hasRadar) {
|
|
7378
|
+
if (!treemap && (!$$.hasArcType() || state.hasRadar)) {
|
|
7316
7379
|
$$.updateCircleY && ($$.circleY = $$.updateCircleY());
|
|
7317
7380
|
}
|
|
7318
7381
|
|
|
@@ -7354,10 +7417,13 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7354
7417
|
|
|
7355
7418
|
// polar
|
|
7356
7419
|
$el.polar && $$.redrawPolar();
|
|
7420
|
+
|
|
7421
|
+
// treemap
|
|
7422
|
+
treemap && $$.updateTreemap(durationForExit);
|
|
7357
7423
|
}
|
|
7358
7424
|
|
|
7359
7425
|
// @TODO: Axis & Radar type
|
|
7360
|
-
if (!state.resizing && ($$.hasPointType() || state.hasRadar)) {
|
|
7426
|
+
if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
|
|
7361
7427
|
$$.updateCircle();
|
|
7362
7428
|
}
|
|
7363
7429
|
|
|
@@ -7441,6 +7507,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7441
7507
|
_$$$state = $$.state,
|
|
7442
7508
|
hasAxis = _$$$state.hasAxis,
|
|
7443
7509
|
hasRadar = _$$$state.hasRadar,
|
|
7510
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
7444
7511
|
grid = $$.$el.grid,
|
|
7445
7512
|
_shape$pos = shape.pos,
|
|
7446
7513
|
cx = _shape$pos.cx,
|
|
@@ -7471,6 +7538,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7471
7538
|
if (($$.hasPointType() || hasRadar) && !config.point_focus_only) {
|
|
7472
7539
|
$$.redrawCircle && list.push($$.redrawCircle(cx, cy, withTransition, flowFn));
|
|
7473
7540
|
}
|
|
7541
|
+
if (hasTreemap) {
|
|
7542
|
+
list.push($$.redrawTreemap(withTransition));
|
|
7543
|
+
}
|
|
7474
7544
|
return list;
|
|
7475
7545
|
},
|
|
7476
7546
|
updateAndRedraw: function updateAndRedraw(options) {
|
|
@@ -7479,8 +7549,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
7479
7549
|
}
|
|
7480
7550
|
var $$ = this,
|
|
7481
7551
|
config = $$.config,
|
|
7482
|
-
state = $$.state
|
|
7483
|
-
|
|
7552
|
+
state = $$.state;
|
|
7553
|
+
var transitions;
|
|
7554
|
+
|
|
7484
7555
|
// same with redraw
|
|
7485
7556
|
options.withTransition = getOption(options, "withTransition", !0);
|
|
7486
7557
|
options.withTransform = getOption(options, "withTransform", !1);
|
|
@@ -7599,10 +7670,11 @@ function getScale(type, min, max) {
|
|
|
7599
7670
|
* @private
|
|
7600
7671
|
*/
|
|
7601
7672
|
getYScaleById: function getYScaleById(id, isSub) {
|
|
7673
|
+
var _this$axis;
|
|
7602
7674
|
if (isSub === void 0) {
|
|
7603
7675
|
isSub = !1;
|
|
7604
7676
|
}
|
|
7605
|
-
var isY2 = this.axis.getId(id) === "y2",
|
|
7677
|
+
var isY2 = ((_this$axis = this.axis) == null ? void 0 : _this$axis.getId(id)) === "y2",
|
|
7606
7678
|
key = isSub ? isY2 ? "subY2" : "subY" : isY2 ? "y2" : "y";
|
|
7607
7679
|
return this.scale[key];
|
|
7608
7680
|
},
|
|
@@ -7669,11 +7741,13 @@ function getScale(type, min, max) {
|
|
|
7669
7741
|
org = $$.org,
|
|
7670
7742
|
scale = $$.scale,
|
|
7671
7743
|
_$$$state = $$.state,
|
|
7744
|
+
current = _$$$state.current,
|
|
7672
7745
|
width = _$$$state.width,
|
|
7673
7746
|
height = _$$$state.height,
|
|
7674
7747
|
width2 = _$$$state.width2,
|
|
7675
7748
|
height2 = _$$$state.height2,
|
|
7676
|
-
hasAxis = _$$$state.hasAxis
|
|
7749
|
+
hasAxis = _$$$state.hasAxis,
|
|
7750
|
+
hasTreemap = _$$$state.hasTreemap;
|
|
7677
7751
|
if (hasAxis) {
|
|
7678
7752
|
var _scale$x,
|
|
7679
7753
|
isRotated = config.axis_rotated,
|
|
@@ -7719,6 +7793,10 @@ function getScale(type, min, max) {
|
|
|
7719
7793
|
scale.subY2 = $$.getYScale("y2", min.subY, max.subY, scale.subY2 ? scale.subY2.domain() : config.axis_y2_default);
|
|
7720
7794
|
axis.setAxis("y2", scale.y2, config.axis_y2_tick_outer, isInit);
|
|
7721
7795
|
}
|
|
7796
|
+
} else if (hasTreemap) {
|
|
7797
|
+
var padding = $$.getCurrentPadding();
|
|
7798
|
+
scale.x = (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleLinear)().rangeRound([padding.left, current.width - padding.right]);
|
|
7799
|
+
scale.y = (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleLinear)().rangeRound([padding.top, current.height - padding.bottom]);
|
|
7722
7800
|
} else {
|
|
7723
7801
|
// update for arc
|
|
7724
7802
|
$$.updateArc == null ? void 0 : $$.updateArc();
|
|
@@ -7746,8 +7824,8 @@ function getScale(type, min, max) {
|
|
|
7746
7824
|
_$$$scale2 = $$.scale,
|
|
7747
7825
|
x = _$$$scale2.x,
|
|
7748
7826
|
zoom = _$$$scale2.zoom,
|
|
7749
|
-
fn = config.zoom_enabled && zoom ? zoom : x
|
|
7750
|
-
|
|
7827
|
+
fn = config.zoom_enabled && zoom ? zoom : x;
|
|
7828
|
+
var value = $$.getBaseValue(d);
|
|
7751
7829
|
if (axis.isTimeSeries()) {
|
|
7752
7830
|
value = parseDate.call($$, value);
|
|
7753
7831
|
} else if (axis.isCategorized() && isString(value)) {
|
|
@@ -7789,13 +7867,15 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7789
7867
|
var _this = this,
|
|
7790
7868
|
$$ = this,
|
|
7791
7869
|
isRotated = $$.config.axis_rotated,
|
|
7792
|
-
|
|
7870
|
+
_$$$state = $$.state,
|
|
7871
|
+
hasRadar = _$$$state.hasRadar,
|
|
7872
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
7793
7873
|
shape = {
|
|
7794
7874
|
type: {},
|
|
7795
7875
|
indices: {},
|
|
7796
7876
|
pos: {}
|
|
7797
7877
|
};
|
|
7798
|
-
["bar", "candlestick", "line", "area"].forEach(function (v) {
|
|
7878
|
+
hasTreemap || ["bar", "candlestick", "line", "area"].forEach(function (v) {
|
|
7799
7879
|
_newArrowCheck(this, _this);
|
|
7800
7880
|
var name = capitalize(/^(bubble|scatter)$/.test(v) ? "line" : v);
|
|
7801
7881
|
if ($$.hasType(v) || $$.hasTypeOf(name) || v === "line" && ($$.hasType("bubble") || $$.hasType("scatter"))) {
|
|
@@ -7805,10 +7885,13 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7805
7885
|
shape.type[v] = drawFn ? drawFn.bind($$)(indices, !1) : undefined;
|
|
7806
7886
|
}
|
|
7807
7887
|
}.bind(this));
|
|
7808
|
-
if (!$$.hasArcType() || hasRadar) {
|
|
7888
|
+
if (!$$.hasArcType() || hasRadar || hasTreemap) {
|
|
7889
|
+
var cx, cy;
|
|
7809
7890
|
// generate circle x/y functions depending on updated params
|
|
7810
|
-
|
|
7891
|
+
if (!hasTreemap) {
|
|
7892
|
+
cx = hasRadar ? $$.radarCircleX : isRotated ? $$.circleY : $$.circleX;
|
|
7811
7893
|
cy = hasRadar ? $$.radarCircleY : isRotated ? $$.circleX : $$.circleY;
|
|
7894
|
+
}
|
|
7812
7895
|
shape.pos = {
|
|
7813
7896
|
xForText: $$.generateXYForText(shape.indices, !0),
|
|
7814
7897
|
yForText: $$.generateXYForText(shape.indices, !1),
|
|
@@ -7935,8 +8018,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7935
8018
|
_newArrowCheck(this, _this5);
|
|
7936
8019
|
var ind = $$.getIndices(indices, d, "getShapeX"),
|
|
7937
8020
|
index = d.id in ind ? ind[d.id] : 0,
|
|
7938
|
-
targetsNum = (ind.__max__ || 0) + 1
|
|
7939
|
-
|
|
8021
|
+
targetsNum = (ind.__max__ || 0) + 1;
|
|
8022
|
+
var x = 0;
|
|
7940
8023
|
if (notEmpty(d.x)) {
|
|
7941
8024
|
var xPos = currScale(d.x, !0);
|
|
7942
8025
|
if (halfWidth) {
|
|
@@ -8060,8 +8143,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8060
8143
|
return scale(value[0]);
|
|
8061
8144
|
}
|
|
8062
8145
|
var dataXAsNumber = +x,
|
|
8063
|
-
y0 = scale(groupsZeroAs === "zero" ? 0 : $$.getShapeYMin(id))
|
|
8064
|
-
|
|
8146
|
+
y0 = scale(groupsZeroAs === "zero" ? 0 : $$.getShapeYMin(id));
|
|
8147
|
+
var offset = y0;
|
|
8065
8148
|
shapeOffsetTargets.filter(function (t) {
|
|
8066
8149
|
_newArrowCheck(this, _this10);
|
|
8067
8150
|
return t.id !== id && ind[t.id] === ind[id];
|
|
@@ -8162,8 +8245,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8162
8245
|
},
|
|
8163
8246
|
isWithinShape: function isWithinShape(that, d) {
|
|
8164
8247
|
var $$ = this,
|
|
8165
|
-
shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(that)
|
|
8166
|
-
|
|
8248
|
+
shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(that);
|
|
8249
|
+
var isWithin;
|
|
8167
8250
|
if (!$$.isTargetToShow(d.id)) {
|
|
8168
8251
|
isWithin = !1;
|
|
8169
8252
|
} else if ($$.hasValidPointType != null && $$.hasValidPointType(that.nodeName)) {
|
|
@@ -8255,8 +8338,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8255
8338
|
config = $$.config,
|
|
8256
8339
|
hasAxis = $$.state.hasAxis,
|
|
8257
8340
|
$el = $$.$el,
|
|
8258
|
-
axesLen = hasAxis ? config.axis_y2_axes.length : 0
|
|
8259
|
-
|
|
8341
|
+
axesLen = hasAxis ? config.axis_y2_axes.length : 0;
|
|
8342
|
+
var padding = isValue(config.padding_top) ? config.padding_top : 0;
|
|
8260
8343
|
if ($el.title && $el.title.node()) {
|
|
8261
8344
|
padding += $$.getTitlePadding();
|
|
8262
8345
|
}
|
|
@@ -8281,8 +8364,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8281
8364
|
isRotated = config.axis_rotated,
|
|
8282
8365
|
axisId = isRotated ? "x" : "y",
|
|
8283
8366
|
axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
|
8284
|
-
axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0
|
|
8285
|
-
|
|
8367
|
+
axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0;
|
|
8368
|
+
var padding;
|
|
8286
8369
|
if (isValue(config.padding_left)) {
|
|
8287
8370
|
padding = config.padding_left;
|
|
8288
8371
|
} else if (hasAxis && isRotated) {
|
|
@@ -8305,10 +8388,10 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8305
8388
|
legendWidthOnRight = $$.state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
|
8306
8389
|
axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
|
8307
8390
|
axisWidth = hasAxis ? $$.getAxisWidthByAxisId("y2") : 0,
|
|
8308
|
-
xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(10) : 0
|
|
8309
|
-
|
|
8391
|
+
xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(10) : 0;
|
|
8392
|
+
var padding;
|
|
8310
8393
|
if (isValue(config.padding_right)) {
|
|
8311
|
-
padding = config.padding_right + 1; // 1 is needed not to hide tick line
|
|
8394
|
+
padding = config.padding_right + (hasAxis ? 1 : 0); // 1 is needed not to hide tick line
|
|
8312
8395
|
} else if ($$.axis && config.axis_rotated) {
|
|
8313
8396
|
padding = 10 + legendWidthOnRight;
|
|
8314
8397
|
} else if ($$.axis && (!config.axis_y2_show || config.axis_y2_inner)) {
|
|
@@ -8326,8 +8409,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8326
8409
|
* @private
|
|
8327
8410
|
*/
|
|
8328
8411
|
getParentRectValue: function getParentRectValue(key) {
|
|
8329
|
-
var offsetName = "offset" + capitalize(key)
|
|
8330
|
-
|
|
8412
|
+
var offsetName = "offset" + capitalize(key);
|
|
8413
|
+
var parent = this.$el.chart.node(),
|
|
8331
8414
|
v = 0;
|
|
8332
8415
|
while (v < 30 && parent && parent.tagName !== "BODY") {
|
|
8333
8416
|
try {
|
|
@@ -8352,8 +8435,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8352
8435
|
return this.getParentRectValue("width");
|
|
8353
8436
|
},
|
|
8354
8437
|
getParentHeight: function getParentHeight() {
|
|
8355
|
-
var h = this.$el.chart.style("height")
|
|
8356
|
-
|
|
8438
|
+
var h = this.$el.chart.style("height");
|
|
8439
|
+
var height = 0;
|
|
8357
8440
|
if (h) {
|
|
8358
8441
|
height = /px$/.test(h) ? parseInt(h, 10) : this.getParentRectValue("height");
|
|
8359
8442
|
}
|
|
@@ -8415,6 +8498,15 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8415
8498
|
clip.idSubchart && svg.select("#" + clip.idSubchart).select("rect").attr("width", width).attr("height", brushSize.height);
|
|
8416
8499
|
}
|
|
8417
8500
|
},
|
|
8501
|
+
getCurrentPadding: function getCurrentPadding() {
|
|
8502
|
+
var $$ = this;
|
|
8503
|
+
return {
|
|
8504
|
+
top: $$.getCurrentPaddingTop(),
|
|
8505
|
+
bottom: $$.getCurrentPaddingBottom(),
|
|
8506
|
+
left: $$.getCurrentPaddingLeft(),
|
|
8507
|
+
right: $$.getCurrentPaddingRight()
|
|
8508
|
+
};
|
|
8509
|
+
},
|
|
8418
8510
|
/**
|
|
8419
8511
|
* Get resetted padding values when 'padding=false' option is set
|
|
8420
8512
|
* https://github.com/naver/billboard.js/issues/2367
|
|
@@ -8450,31 +8542,32 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8450
8542
|
state = $$.state,
|
|
8451
8543
|
legend = $$.$el.legend,
|
|
8452
8544
|
isRotated = config.axis_rotated,
|
|
8453
|
-
|
|
8545
|
+
isNonAxis = $$.hasArcType() || state.hasTreemap;
|
|
8454
8546
|
isInit || $$.setContainerSize();
|
|
8455
8547
|
var currLegend = {
|
|
8456
8548
|
width: legend ? $$.getLegendWidth() : 0,
|
|
8457
8549
|
height: legend ? $$.getLegendHeight() : 0
|
|
8458
8550
|
};
|
|
8459
|
-
if (!
|
|
8551
|
+
if (!isNonAxis && config.axis_x_show && config.axis_x_tick_autorotate) {
|
|
8460
8552
|
$$.updateXAxisTickClip();
|
|
8461
8553
|
}
|
|
8462
8554
|
var legendHeightForBottom = state.isLegendRight || state.isLegendInset ? 0 : currLegend.height,
|
|
8463
|
-
xAxisHeight = isRotated ||
|
|
8555
|
+
xAxisHeight = isRotated || isNonAxis ? 0 : $$.getHorizontalAxisHeight("x"),
|
|
8464
8556
|
subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30,
|
|
8465
|
-
subchartHeight = config.subchart_show && !
|
|
8557
|
+
subchartHeight = config.subchart_show && !isNonAxis ? config.subchart_size_height + subchartXAxisHeight : 0,
|
|
8558
|
+
padding = $$.getCurrentPadding();
|
|
8466
8559
|
// for main
|
|
8467
|
-
state.margin = !
|
|
8468
|
-
top: $$.getHorizontalAxisHeight("y2") +
|
|
8469
|
-
right:
|
|
8470
|
-
bottom: $$.getHorizontalAxisHeight("y") + legendHeightForBottom +
|
|
8471
|
-
left: subchartHeight + (
|
|
8560
|
+
state.margin = !isNonAxis && isRotated ? {
|
|
8561
|
+
top: $$.getHorizontalAxisHeight("y2") + padding.top,
|
|
8562
|
+
right: isNonAxis ? 0 : $$.getCurrentPaddingRight(!0),
|
|
8563
|
+
bottom: $$.getHorizontalAxisHeight("y") + legendHeightForBottom + padding.bottom,
|
|
8564
|
+
left: subchartHeight + (isNonAxis ? 0 : padding.left)
|
|
8472
8565
|
} : {
|
|
8473
|
-
top: 4 +
|
|
8566
|
+
top: 4 + padding.top,
|
|
8474
8567
|
// for top tick text
|
|
8475
|
-
right:
|
|
8476
|
-
bottom: xAxisHeight + subchartHeight + legendHeightForBottom +
|
|
8477
|
-
left:
|
|
8568
|
+
right: isNonAxis ? 0 : $$.getCurrentPaddingRight(!0),
|
|
8569
|
+
bottom: xAxisHeight + subchartHeight + legendHeightForBottom + padding.bottom,
|
|
8570
|
+
left: isNonAxis ? 0 : padding.left
|
|
8478
8571
|
};
|
|
8479
8572
|
state.margin = $$.getResettedPadding(state.margin);
|
|
8480
8573
|
|
|
@@ -8517,15 +8610,17 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8517
8610
|
}
|
|
8518
8611
|
|
|
8519
8612
|
// for arc
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8613
|
+
if ($$.hasArcType()) {
|
|
8614
|
+
var hasGauge = $$.hasType("gauge"),
|
|
8615
|
+
isLegendRight = config.legend_show && state.isLegendRight;
|
|
8616
|
+
state.arcWidth = state.width - (isLegendRight ? currLegend.width + 10 : 0);
|
|
8617
|
+
state.arcHeight = state.height - (isLegendRight && !hasGauge ? 0 : 10);
|
|
8618
|
+
if (hasGauge && !config.gauge_fullCircle) {
|
|
8619
|
+
state.arcHeight += state.height - $$.getPaddingBottomForGauge();
|
|
8620
|
+
}
|
|
8621
|
+
$$.updateRadius == null ? void 0 : $$.updateRadius();
|
|
8622
|
+
}
|
|
8623
|
+
if (state.isLegendRight && isNonAxis) {
|
|
8529
8624
|
state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;
|
|
8530
8625
|
}
|
|
8531
8626
|
}
|
|
@@ -8630,27 +8725,26 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8630
8725
|
isNegative = isNumber(value) && value < 0 || isCandlestickType && !((_$$$getCandlestickDat = $$.getCandlestickData(d)) != null && _$$$getCandlestickDat._isUp),
|
|
8631
8726
|
x = pos.x,
|
|
8632
8727
|
y = pos.y,
|
|
8633
|
-
gap = 4,
|
|
8634
8728
|
doubleGap = 8;
|
|
8635
8729
|
if (isRotated) {
|
|
8636
8730
|
if (anchor === "start") {
|
|
8637
8731
|
x += isNegative ? 0 : doubleGap;
|
|
8638
|
-
y +=
|
|
8732
|
+
y += 4;
|
|
8639
8733
|
} else if (anchor === "middle") {
|
|
8640
8734
|
x += doubleGap;
|
|
8641
8735
|
y -= doubleGap;
|
|
8642
8736
|
} else if (anchor === "end") {
|
|
8643
8737
|
isNegative && (x -= doubleGap);
|
|
8644
|
-
y +=
|
|
8738
|
+
y += 4;
|
|
8645
8739
|
}
|
|
8646
8740
|
} else {
|
|
8647
8741
|
if (anchor === "start") {
|
|
8648
|
-
x +=
|
|
8742
|
+
x += 4;
|
|
8649
8743
|
isNegative && (y += doubleGap * 2);
|
|
8650
8744
|
} else if (anchor === "middle") {
|
|
8651
8745
|
y -= doubleGap;
|
|
8652
8746
|
} else if (anchor === "end") {
|
|
8653
|
-
x -=
|
|
8747
|
+
x -= 4;
|
|
8654
8748
|
isNegative && (y += doubleGap * 2);
|
|
8655
8749
|
}
|
|
8656
8750
|
if (isInverted) {
|
|
@@ -8673,7 +8767,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8673
8767
|
*/
|
|
8674
8768
|
initText: function initText() {
|
|
8675
8769
|
var $el = this.$el;
|
|
8676
|
-
$el.main.select("." + $COMMON.chart).append("g").attr("class", $TEXT.chartTexts);
|
|
8770
|
+
$el.main.select("." + $COMMON.chart).append("g").attr("class", $TEXT.chartTexts).style("pointer-events", $el.treemap ? "none" : null);
|
|
8677
8771
|
},
|
|
8678
8772
|
/**
|
|
8679
8773
|
* Update chartText
|
|
@@ -8688,7 +8782,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8688
8782
|
classFocus = $$.classFocus.bind($$),
|
|
8689
8783
|
mainTextUpdate = $$.$el.main.select("." + $TEXT.chartTexts).selectAll("." + $TEXT.chartText).data(targets).attr("class", function (d) {
|
|
8690
8784
|
_newArrowCheck(this, _this);
|
|
8691
|
-
return classChartText(d) + classFocus(d);
|
|
8785
|
+
return ("" + classChartText(d) + classFocus(d)).trim();
|
|
8692
8786
|
}.bind(this)),
|
|
8693
8787
|
mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).call($$.setCssRule(!0, " ." + $TEXT.text, ["fill", "pointer-events:none"], $$.updateTextColor));
|
|
8694
8788
|
mainTextEnter.append("g").attr("class", classTexts);
|
|
@@ -8704,6 +8798,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8704
8798
|
$T = $$.$T,
|
|
8705
8799
|
config = $$.config,
|
|
8706
8800
|
classText = $$.getClass("text", "index"),
|
|
8801
|
+
labelsCentered = config.data_labels.centered,
|
|
8707
8802
|
text = $el.main.selectAll("." + $TEXT.texts).selectAll("." + $TEXT.text).data($$.labelishData.bind($$));
|
|
8708
8803
|
$T(text.exit()).style("fill-opacity", "0").remove();
|
|
8709
8804
|
$el.text = text.enter().append("text").merge(text).attr("class", classText).attr("text-anchor", function (d) {
|
|
@@ -8713,11 +8808,13 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8713
8808
|
if ($$.isCandlestickType(d)) {
|
|
8714
8809
|
var data = $$.getCandlestickData(d);
|
|
8715
8810
|
isEndAnchor = !(data != null && data._isUp);
|
|
8811
|
+
} else if ($$.isTreemapType(d)) {
|
|
8812
|
+
return labelsCentered ? "middle" : "start";
|
|
8716
8813
|
}
|
|
8717
8814
|
return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
|
8718
8815
|
}.bind(this)).style("fill", $$.getStylePropValue($$.updateTextColor)).style("fill-opacity", "0").each(function (d, i, texts) {
|
|
8719
|
-
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this)
|
|
8720
|
-
|
|
8816
|
+
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
|
|
8817
|
+
var value = d.value;
|
|
8721
8818
|
if ($$.isBubbleZType(d)) {
|
|
8722
8819
|
value = $$.getBubbleZData(value, "z");
|
|
8723
8820
|
} else if ($$.isCandlestickType(d)) {
|
|
@@ -8726,7 +8823,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8726
8823
|
value = data.close;
|
|
8727
8824
|
}
|
|
8728
8825
|
}
|
|
8729
|
-
value = $$.dataLabelFormat(d.id)(value, d.id, i, texts);
|
|
8826
|
+
value = $$.isTreemapType(d) ? $$.treemapDataLabelFormat(d)(node) : $$.dataLabelFormat(d.id)(value, d.id, i, texts);
|
|
8730
8827
|
if (isNumber(value)) {
|
|
8731
8828
|
this.textContent = value;
|
|
8732
8829
|
} else {
|
|
@@ -8738,8 +8835,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8738
8835
|
var $$ = this,
|
|
8739
8836
|
config = $$.config,
|
|
8740
8837
|
labelColors = config.data_labels_colors,
|
|
8741
|
-
defaultColor = $$.isArcType(d) && !$$.isRadarType(d) ? null : $$.color(d)
|
|
8742
|
-
|
|
8838
|
+
defaultColor = $$.isArcType(d) && !$$.isRadarType(d) || $$.isTreemapType(d) ? null : $$.color(d);
|
|
8839
|
+
var color;
|
|
8743
8840
|
if (isString(labelColors)) {
|
|
8744
8841
|
color = labelColors;
|
|
8745
8842
|
} else if (isObject(labelColors)) {
|
|
@@ -8768,8 +8865,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8768
8865
|
var $$ = this,
|
|
8769
8866
|
$el = $$.$el,
|
|
8770
8867
|
config = $$.config,
|
|
8771
|
-
backgroundColor = config.data_labels_backgroundColors
|
|
8772
|
-
|
|
8868
|
+
backgroundColor = config.data_labels_backgroundColors;
|
|
8869
|
+
var color = "";
|
|
8773
8870
|
if (isString(backgroundColor) || isObject(backgroundColor)) {
|
|
8774
8871
|
var id = isString(backgroundColor) ? "" : $$.getTargetSelectorSuffix("id" in d ? d.id : d.data.id),
|
|
8775
8872
|
filter = $el.defs.select(["filter[id*='labels-bg", "']"].join(id));
|
|
@@ -8793,19 +8890,22 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8793
8890
|
$T = $$.$T,
|
|
8794
8891
|
axis = $$.axis,
|
|
8795
8892
|
config = $$.config,
|
|
8893
|
+
hasTreemap = $$.state.hasTreemap,
|
|
8796
8894
|
t = getRandom(!0),
|
|
8797
8895
|
isRotated = config.axis_rotated,
|
|
8798
8896
|
angle = config.data_labels.rotate,
|
|
8799
8897
|
anchorString = getRotateAnchor(angle),
|
|
8800
8898
|
rotateString = angle ? "rotate(" + angle + ")" : "";
|
|
8899
|
+
// $$.meetsLabelThreshold(ratio,
|
|
8900
|
+
|
|
8801
8901
|
$$.$el.text.style("fill", $$.getStylePropValue($$.updateTextColor)).attr("filter", $$.updateTextBacgroundColor.bind($$)).style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$)).each(function (d, i) {
|
|
8802
8902
|
// do not apply transition for newly added text elements
|
|
8803
|
-
var node = $T(this, !!(withTransition && this.getAttribute("x")), t),
|
|
8804
|
-
isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"]
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8903
|
+
var node = $T(hasTreemap && this.childElementCount ? this.parentNode : this, !!(withTransition && this.getAttribute("x")), t),
|
|
8904
|
+
isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"];
|
|
8905
|
+
var pos = {
|
|
8906
|
+
x: getX.bind(this)(d, i),
|
|
8907
|
+
y: getY.bind(this)(d, i)
|
|
8908
|
+
};
|
|
8809
8909
|
if (angle) {
|
|
8810
8910
|
pos = setRotatePos.bind($$)(d, pos, anchorString, isRotated, isInverted);
|
|
8811
8911
|
node.attr("text-anchor", anchorString);
|
|
@@ -8838,8 +8938,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8838
8938
|
base = base.querySelector("text");
|
|
8839
8939
|
}
|
|
8840
8940
|
var text = base.textContent,
|
|
8841
|
-
cacheKey = KEY.textRect + "-" + text.replace(/\W/g, "_")
|
|
8842
|
-
|
|
8941
|
+
cacheKey = KEY.textRect + "-" + text.replace(/\W/g, "_");
|
|
8942
|
+
var rect = $$.cache.get(cacheKey);
|
|
8843
8943
|
if (!rect) {
|
|
8844
8944
|
$$.$el.svg.append("text").style("visibility", "hidden").style("font", (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(base).style("font")).classed(className, !0).text(text).call(function (v) {
|
|
8845
8945
|
_newArrowCheck(this, _this3);
|
|
@@ -8859,16 +8959,20 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8859
8959
|
generateXYForText: function generateXYForText(indices, forX) {
|
|
8860
8960
|
var _this4 = this,
|
|
8861
8961
|
$$ = this,
|
|
8962
|
+
_$$$state = $$.state,
|
|
8963
|
+
hasRadar = _$$$state.hasRadar,
|
|
8964
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
8862
8965
|
types = Object.keys(indices),
|
|
8863
8966
|
points = {},
|
|
8864
8967
|
getter = forX ? $$.getXForText : $$.getYForText;
|
|
8865
|
-
|
|
8968
|
+
hasRadar && types.push("radar");
|
|
8969
|
+
hasTreemap && types.push("treemap");
|
|
8866
8970
|
types.forEach(function (v) {
|
|
8867
8971
|
_newArrowCheck(this, _this4);
|
|
8868
8972
|
points[v] = $$["generateGet" + capitalize(v) + "Points"](indices[v], !1);
|
|
8869
8973
|
}.bind(this));
|
|
8870
8974
|
return function (d, i) {
|
|
8871
|
-
var type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || $$.isCandlestickType(d) && "candlestick" || $$.isRadarType(d) && "radar" || "line";
|
|
8975
|
+
var type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || $$.isCandlestickType(d) && "candlestick" || $$.isRadarType(d) && "radar" || $$.isTreemapType(d) && "treemap" || "line";
|
|
8872
8976
|
return getter.call($$, points[type](d, i), d, this);
|
|
8873
8977
|
};
|
|
8874
8978
|
},
|
|
@@ -8877,22 +8981,29 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8877
8981
|
* @param {object} d Data object
|
|
8878
8982
|
* @param {Array} points Data points position
|
|
8879
8983
|
* @param {HTMLElement} textElement Data label text element
|
|
8984
|
+
* @param {string} type 'x' or 'y'
|
|
8880
8985
|
* @returns {number} Position value
|
|
8881
8986
|
* @private
|
|
8882
8987
|
*/
|
|
8883
|
-
getCenteredTextPos: function getCenteredTextPos(d, points, textElement) {
|
|
8988
|
+
getCenteredTextPos: function getCenteredTextPos(d, points, textElement, type) {
|
|
8884
8989
|
var $$ = this,
|
|
8885
8990
|
config = $$.config,
|
|
8886
|
-
isRotated = config.axis_rotated
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8991
|
+
isRotated = config.axis_rotated,
|
|
8992
|
+
isBarType = $$.isBarType(d),
|
|
8993
|
+
isTreemapType = $$.isTreemapType(d);
|
|
8994
|
+
if (config.data_labels.centered && (isBarType || isTreemapType)) {
|
|
8995
|
+
var rect = getBoundingRect(textElement);
|
|
8996
|
+
if (isBarType) {
|
|
8997
|
+
var isPositive = d.value >= 0;
|
|
8998
|
+
if (isRotated) {
|
|
8999
|
+
var w = (isPositive ? points[1][1] - points[0][1] : points[0][1] - points[1][1]) / 2 + rect.width / 2;
|
|
9000
|
+
return isPositive ? -w - 3 : w + 2;
|
|
9001
|
+
} else {
|
|
9002
|
+
var h = (isPositive ? points[0][1] - points[1][1] : points[1][1] - points[0][1]) / 2 + rect.height / 2;
|
|
9003
|
+
return isPositive ? h : -h - 2;
|
|
9004
|
+
}
|
|
9005
|
+
} else if (isTreemapType) {
|
|
9006
|
+
return type === "x" ? (points[1][0] - points[0][0]) / 2 : (points[1][1] - points[0][1]) / 2 + rect.height / 2;
|
|
8896
9007
|
}
|
|
8897
9008
|
}
|
|
8898
9009
|
return 0;
|
|
@@ -8921,7 +9032,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8921
9032
|
config = $$.config,
|
|
8922
9033
|
state = $$.state,
|
|
8923
9034
|
isRotated = config.axis_rotated,
|
|
8924
|
-
|
|
9035
|
+
isTreemapType = $$.isTreemapType(d);
|
|
9036
|
+
var xPos = points[0][0];
|
|
8925
9037
|
if ($$.isCandlestickType(d)) {
|
|
8926
9038
|
if (isRotated) {
|
|
8927
9039
|
var _$$$getCandlestickDat2;
|
|
@@ -8929,6 +9041,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8929
9041
|
} else {
|
|
8930
9042
|
xPos += (points[1][0] - xPos) / 2;
|
|
8931
9043
|
}
|
|
9044
|
+
} else if (isTreemapType) {
|
|
9045
|
+
xPos += config.data_labels.centered ? 0 : 5;
|
|
8932
9046
|
} else {
|
|
8933
9047
|
if (isRotated) {
|
|
8934
9048
|
var padding = $$.isBarType(d) ? 4 : 6;
|
|
@@ -8948,8 +9062,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8948
9062
|
xPos = 4;
|
|
8949
9063
|
}
|
|
8950
9064
|
}
|
|
8951
|
-
if (isRotated) {
|
|
8952
|
-
xPos += $$.getCenteredTextPos(d, points, textElement);
|
|
9065
|
+
if (isRotated || isTreemapType) {
|
|
9066
|
+
xPos += $$.getCenteredTextPos(d, points, textElement, "x");
|
|
8953
9067
|
}
|
|
8954
9068
|
return xPos + $$.getTextPos(d.id, "x");
|
|
8955
9069
|
},
|
|
@@ -8969,9 +9083,10 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8969
9083
|
isRotated = config.axis_rotated,
|
|
8970
9084
|
isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"],
|
|
8971
9085
|
isBarType = $$.isBarType(d),
|
|
9086
|
+
isTreemapType = $$.isTreemapType(d),
|
|
8972
9087
|
r = config.point_r,
|
|
8973
|
-
rect = getBoundingRect(textElement)
|
|
8974
|
-
|
|
9088
|
+
rect = getBoundingRect(textElement);
|
|
9089
|
+
var value = d.value,
|
|
8975
9090
|
baseY = 3,
|
|
8976
9091
|
yPos;
|
|
8977
9092
|
if ($$.isCandlestickType(d)) {
|
|
@@ -8985,6 +9100,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8985
9100
|
yPos += 15 * (value._isUp ? 1 : -1);
|
|
8986
9101
|
}
|
|
8987
9102
|
}
|
|
9103
|
+
} else if (isTreemapType) {
|
|
9104
|
+
yPos = points[0][1] + (config.data_labels.centered ? 0 : rect.height + 5);
|
|
8988
9105
|
} else {
|
|
8989
9106
|
if (isRotated) {
|
|
8990
9107
|
yPos = (points[0][0] + points[2][0] + rect.height * .6) / 2;
|
|
@@ -9019,8 +9136,8 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
9019
9136
|
yPos = state.height - 4;
|
|
9020
9137
|
}
|
|
9021
9138
|
}
|
|
9022
|
-
if (!isRotated) {
|
|
9023
|
-
yPos += $$.getCenteredTextPos(d, points, textElement);
|
|
9139
|
+
if (!isRotated || isTreemapType) {
|
|
9140
|
+
yPos += $$.getCenteredTextPos(d, points, textElement, "y");
|
|
9024
9141
|
}
|
|
9025
9142
|
return yPos + $$.getTextPos(d.id, "y");
|
|
9026
9143
|
},
|
|
@@ -9105,8 +9222,8 @@ function getTextPos(pos, width) {
|
|
|
9105
9222
|
if (pos === void 0) {
|
|
9106
9223
|
pos = "left";
|
|
9107
9224
|
}
|
|
9108
|
-
var isNum = isNumber(width)
|
|
9109
|
-
|
|
9225
|
+
var isNum = isNumber(width);
|
|
9226
|
+
var position;
|
|
9110
9227
|
if (pos.indexOf("center") > -1) {
|
|
9111
9228
|
position = isNum ? width / 2 : "middle";
|
|
9112
9229
|
} else if (pos.indexOf("right") > -1) {
|
|
@@ -9159,8 +9276,8 @@ function getTextPos(pos, width) {
|
|
|
9159
9276
|
config = $$.config,
|
|
9160
9277
|
current = $$.state.current,
|
|
9161
9278
|
position = config.title_position || "left",
|
|
9162
|
-
textRectWidth = $$.getTextRect($$.$el.title, $TEXT.title).width
|
|
9163
|
-
|
|
9279
|
+
textRectWidth = $$.getTextRect($$.$el.title, $TEXT.title).width;
|
|
9280
|
+
var x;
|
|
9164
9281
|
if (/(right|center)/.test(position)) {
|
|
9165
9282
|
x = current.width - textRectWidth;
|
|
9166
9283
|
if (position.indexOf("right") >= 0) {
|
|
@@ -9232,9 +9349,8 @@ function getTextPos(pos, width) {
|
|
|
9232
9349
|
_$$$axis2,
|
|
9233
9350
|
isArc = !(hasAxis && hasRadar);
|
|
9234
9351
|
if ((_$$$axis = $$.axis) != null && _$$$axis.isTimeSeries() && isString(config.tooltip_init_x)) {
|
|
9235
|
-
var targets = $$.data.targets[0]
|
|
9236
|
-
|
|
9237
|
-
val;
|
|
9352
|
+
var targets = $$.data.targets[0];
|
|
9353
|
+
var i, val;
|
|
9238
9354
|
config.tooltip_init_x = parseDate.call($$, config.tooltip_init_x);
|
|
9239
9355
|
for (i = 0; val = targets.values[i]; i++) {
|
|
9240
9356
|
if (val.x - config.tooltip_init_x === 0) {
|
|
@@ -9278,12 +9394,13 @@ function getTextPos(pos, width) {
|
|
|
9278
9394
|
* @returns {string} html
|
|
9279
9395
|
* @private
|
|
9280
9396
|
*/
|
|
9281
|
-
getTooltipContent: function getTooltipContent(d, defaultTitleFormat, defaultValueFormat,
|
|
9397
|
+
getTooltipContent: function getTooltipContent(d, defaultTitleFormat, defaultValueFormat, _color) {
|
|
9282
9398
|
var _this2 = this,
|
|
9283
9399
|
$$ = this,
|
|
9284
9400
|
api = $$.api,
|
|
9285
9401
|
config = $$.config,
|
|
9286
9402
|
state = $$.state,
|
|
9403
|
+
$el = $$.$el,
|
|
9287
9404
|
_map = ["title", "name", "value"].map(function (v) {
|
|
9288
9405
|
_newArrowCheck(this, _this2);
|
|
9289
9406
|
var fn = config["tooltip_format_" + v];
|
|
@@ -9297,7 +9414,7 @@ function getTextPos(pos, width) {
|
|
|
9297
9414
|
_newArrowCheck(this, _this2);
|
|
9298
9415
|
return name;
|
|
9299
9416
|
}.bind(this);
|
|
9300
|
-
valueFormat = valueFormat || ($$.isStackNormalized() ? function (v, ratio) {
|
|
9417
|
+
valueFormat = valueFormat || (state.hasTreemap || $$.isStackNormalized() ? function (v, ratio) {
|
|
9301
9418
|
_newArrowCheck(this, _this2);
|
|
9302
9419
|
return (ratio * 100).toFixed(2) + "%";
|
|
9303
9420
|
}.bind(this) : defaultValueFormat);
|
|
@@ -9311,7 +9428,7 @@ function getTextPos(pos, width) {
|
|
|
9311
9428
|
return $$.levelColor(row.value);
|
|
9312
9429
|
}.bind(this) : function (row) {
|
|
9313
9430
|
_newArrowCheck(this, _this2);
|
|
9314
|
-
return
|
|
9431
|
+
return _color(row);
|
|
9315
9432
|
}.bind(this),
|
|
9316
9433
|
contents = config.tooltip_contents,
|
|
9317
9434
|
tplStr = contents.template,
|
|
@@ -9343,16 +9460,13 @@ function getTextPos(pos, width) {
|
|
|
9343
9460
|
d.sort(order.bind(api));
|
|
9344
9461
|
}
|
|
9345
9462
|
var tpl = $$.getTooltipContentTemplate(tplStr),
|
|
9346
|
-
len = d.length
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
value,
|
|
9351
|
-
i;
|
|
9352
|
-
for (i = 0; i < len; i++) {
|
|
9463
|
+
len = d.length;
|
|
9464
|
+
var text, row, param, value, i;
|
|
9465
|
+
var _loop = function () {
|
|
9466
|
+
var _this3 = this;
|
|
9353
9467
|
row = d[i];
|
|
9354
9468
|
if (!row || !(getRowValue(row) || getRowValue(row) === 0)) {
|
|
9355
|
-
continue;
|
|
9469
|
+
return "continue";
|
|
9356
9470
|
}
|
|
9357
9471
|
if (isUndefined(text)) {
|
|
9358
9472
|
var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
|
|
@@ -9361,14 +9475,15 @@ function getTextPos(pos, width) {
|
|
|
9361
9475
|
TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
|
|
9362
9476
|
});
|
|
9363
9477
|
}
|
|
9364
|
-
if (!row.ratio &&
|
|
9365
|
-
|
|
9478
|
+
if (!row.ratio && $el.arcs) {
|
|
9479
|
+
param = ["arc", $$.$el.arcs.select("path." + $ARC.arc + "-" + row.id).data()[0]];
|
|
9480
|
+
row.ratio = $$.getRatio.apply($$, param);
|
|
9366
9481
|
}
|
|
9367
9482
|
param = [row.ratio, row.id, row.index, d];
|
|
9368
9483
|
value = sanitise(valueFormat.apply(void 0, [getRowValue(row)].concat(param)));
|
|
9369
9484
|
if ($$.isAreaRangeType(row)) {
|
|
9370
9485
|
var _map2 = ["high", "low"].map(function (v) {
|
|
9371
|
-
_newArrowCheck(this,
|
|
9486
|
+
_newArrowCheck(this, _this3);
|
|
9372
9487
|
return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v)].concat(param)));
|
|
9373
9488
|
}.bind(this)),
|
|
9374
9489
|
high = _map2[0],
|
|
@@ -9376,7 +9491,7 @@ function getTextPos(pos, width) {
|
|
|
9376
9491
|
value = "<b>Mid:</b> " + value + " <b>High:</b> " + high + " <b>Low:</b> " + low;
|
|
9377
9492
|
} else if ($$.isCandlestickType(row)) {
|
|
9378
9493
|
var _map3 = ["open", "high", "low", "close", "volume"].map(function (v) {
|
|
9379
|
-
_newArrowCheck(this,
|
|
9494
|
+
_newArrowCheck(this, _this3);
|
|
9380
9495
|
return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v, "candlestick")].concat(param)));
|
|
9381
9496
|
}.bind(this)),
|
|
9382
9497
|
open = _map3[0],
|
|
@@ -9392,31 +9507,31 @@ function getTextPos(pos, width) {
|
|
|
9392
9507
|
value = valueFormat(start) + " ~ " + valueFormat(end);
|
|
9393
9508
|
}
|
|
9394
9509
|
if (value !== undefined) {
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
}
|
|
9416
|
-
text += tplProcess(tpl[1], contentValue);
|
|
9417
|
-
}();
|
|
9418
|
-
if (_ret === "continue") continue;
|
|
9510
|
+
// Skip elements when their name is set to null
|
|
9511
|
+
if (row.name === null) {
|
|
9512
|
+
return "continue";
|
|
9513
|
+
}
|
|
9514
|
+
var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
|
|
9515
|
+
_color = getBgColor(row),
|
|
9516
|
+
contentValue = {
|
|
9517
|
+
CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
|
9518
|
+
COLOR: tplStr || !$$.patterns ? _color : "<svg><rect style=\"fill:" + _color + "\" width=\"10\" height=\"10\"></rect></svg>",
|
|
9519
|
+
NAME: name,
|
|
9520
|
+
VALUE: value
|
|
9521
|
+
};
|
|
9522
|
+
if (tplStr && isObject(contents.text)) {
|
|
9523
|
+
var index = targetIds.indexOf(row.id);
|
|
9524
|
+
Object.keys(contents.text).forEach(function (key) {
|
|
9525
|
+
_newArrowCheck(this, _this3);
|
|
9526
|
+
contentValue[key] = contents.text[key][index];
|
|
9527
|
+
}.bind(this));
|
|
9528
|
+
}
|
|
9529
|
+
text += tplProcess(tpl[1], contentValue);
|
|
9419
9530
|
}
|
|
9531
|
+
};
|
|
9532
|
+
for (i = 0; i < len; i++) {
|
|
9533
|
+
var _ret = _loop();
|
|
9534
|
+
if (_ret === "continue") continue;
|
|
9420
9535
|
}
|
|
9421
9536
|
return text + "</table>";
|
|
9422
9537
|
},
|
|
@@ -9452,6 +9567,7 @@ function getTextPos(pos, width) {
|
|
|
9452
9567
|
inputType = _state.inputType,
|
|
9453
9568
|
event = _state.event,
|
|
9454
9569
|
hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
|
9570
|
+
hasTreemap = state.hasTreemap,
|
|
9455
9571
|
svgLeft = $$.getSvgLeft(!0),
|
|
9456
9572
|
chartRight = svgLeft + current.width - $$.getCurrentPaddingRight(),
|
|
9457
9573
|
chartLeft = $$.getCurrentPaddingLeft(!0),
|
|
@@ -9465,7 +9581,7 @@ function getTextPos(pos, width) {
|
|
|
9465
9581
|
y += hasGauge ? height : height / 2;
|
|
9466
9582
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
9467
9583
|
}
|
|
9468
|
-
} else {
|
|
9584
|
+
} else if (!hasTreemap) {
|
|
9469
9585
|
var dataScale = scale.x(dataToShow[0].x);
|
|
9470
9586
|
if (config.axis_rotated) {
|
|
9471
9587
|
y = dataScale + 20;
|
|
@@ -9473,16 +9589,17 @@ function getTextPos(pos, width) {
|
|
|
9473
9589
|
chartRight -= svgLeft;
|
|
9474
9590
|
} else {
|
|
9475
9591
|
y -= 5;
|
|
9476
|
-
x = svgLeft + chartLeft + 20 + (
|
|
9592
|
+
x = svgLeft + chartLeft + 20 + (scale.zoom ? x : dataScale);
|
|
9477
9593
|
}
|
|
9478
9594
|
}
|
|
9479
9595
|
|
|
9480
9596
|
// when tooltip left + tWidth > chart's width
|
|
9481
9597
|
if (x + tWidth + 15 > chartRight) {
|
|
9482
|
-
x -= tWidth + chartLeft;
|
|
9598
|
+
x -= tWidth + (hasTreemap ? 0 : chartLeft);
|
|
9483
9599
|
}
|
|
9484
9600
|
if (y + tHeight > current.height) {
|
|
9485
|
-
|
|
9601
|
+
var gap = hasTreemap ? 0 : 30;
|
|
9602
|
+
y -= hasGauge ? tHeight * 3 : tHeight + gap;
|
|
9486
9603
|
}
|
|
9487
9604
|
var pos = {
|
|
9488
9605
|
top: y,
|
|
@@ -9524,8 +9641,8 @@ function getTextPos(pos, width) {
|
|
|
9524
9641
|
_ref$width = _ref.width,
|
|
9525
9642
|
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
9526
9643
|
_ref$height = _ref.height,
|
|
9527
|
-
height = _ref$height === void 0 ? 0 : _ref$height
|
|
9528
|
-
|
|
9644
|
+
height = _ref$height === void 0 ? 0 : _ref$height;
|
|
9645
|
+
var dataStr = JSON.stringify(selectedData);
|
|
9529
9646
|
if (!datum || datum.current !== dataStr) {
|
|
9530
9647
|
var index = selectedData.concat().sort()[0].index;
|
|
9531
9648
|
callFn(config.tooltip_onshow, $$.api, selectedData);
|
|
@@ -9594,9 +9711,10 @@ function getTextPos(pos, width) {
|
|
|
9594
9711
|
var current = state.current,
|
|
9595
9712
|
_tooltip$datum = tooltip.datum(),
|
|
9596
9713
|
width = _tooltip$datum.width,
|
|
9597
|
-
xPosInPercent = _tooltip$datum.xPosInPercent
|
|
9598
|
-
|
|
9599
|
-
|
|
9714
|
+
xPosInPercent = _tooltip$datum.xPosInPercent;
|
|
9715
|
+
var _value = current.width / 100 * xPosInPercent;
|
|
9716
|
+
var diff = current.width - (_value + width);
|
|
9717
|
+
|
|
9600
9718
|
// if tooltip size overs current viewport size
|
|
9601
9719
|
if (diff < 0) {
|
|
9602
9720
|
_value += diff;
|
|
@@ -9680,8 +9798,8 @@ function getTextPos(pos, width) {
|
|
|
9680
9798
|
var $$ = this,
|
|
9681
9799
|
config = $$.config,
|
|
9682
9800
|
state = $$.state,
|
|
9683
|
-
isRotated = config.axis_rotated
|
|
9684
|
-
|
|
9801
|
+
isRotated = config.axis_rotated;
|
|
9802
|
+
var padding = 0,
|
|
9685
9803
|
x,
|
|
9686
9804
|
y;
|
|
9687
9805
|
if (index && /^(x|y2?)$/.test(target)) {
|
|
@@ -9738,9 +9856,11 @@ function getTextPos(pos, width) {
|
|
|
9738
9856
|
transformAll: function transformAll(withTransition, transitions) {
|
|
9739
9857
|
var $$ = this,
|
|
9740
9858
|
config = $$.config,
|
|
9741
|
-
|
|
9859
|
+
_$$$state = $$.state,
|
|
9860
|
+
hasAxis = _$$$state.hasAxis,
|
|
9861
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
9742
9862
|
$el = $$.$el;
|
|
9743
|
-
$$.transformMain(withTransition, transitions);
|
|
9863
|
+
hasTreemap || $$.transformMain(withTransition, transitions);
|
|
9744
9864
|
hasAxis && config.subchart_show && $$.transformContext(withTransition, transitions);
|
|
9745
9865
|
$el.legend && $$.transformLegend(withTransition);
|
|
9746
9866
|
}
|
|
@@ -9809,8 +9929,8 @@ function getTextPos(pos, width) {
|
|
|
9809
9929
|
config = $$.config,
|
|
9810
9930
|
current = $$.state.current,
|
|
9811
9931
|
types = config.data_types,
|
|
9812
|
-
targets = targetsValue || $$.data.targets
|
|
9813
|
-
|
|
9932
|
+
targets = targetsValue || $$.data.targets;
|
|
9933
|
+
var has = !1;
|
|
9814
9934
|
if (!checkFromData && ((_current$types = current.types) == null ? void 0 : _current$types.indexOf(type)) > -1) {
|
|
9815
9935
|
has = !0;
|
|
9816
9936
|
} else if (targets != null && targets.length) {
|
|
@@ -9914,6 +10034,9 @@ function getTextPos(pos, width) {
|
|
|
9914
10034
|
isScatterType: function isScatterType(d) {
|
|
9915
10035
|
return this.isTypeOf(d, "scatter");
|
|
9916
10036
|
},
|
|
10037
|
+
isTreemapType: function isTreemapType(d) {
|
|
10038
|
+
return this.isTypeOf(d, "treemap");
|
|
10039
|
+
},
|
|
9917
10040
|
isPieType: function isPieType(d) {
|
|
9918
10041
|
return this.isTypeOf(d, "pie");
|
|
9919
10042
|
},
|
|
@@ -9935,8 +10058,8 @@ function getTextPos(pos, width) {
|
|
|
9935
10058
|
// determine if is 'circle' data point
|
|
9936
10059
|
isCirclePoint: function isCirclePoint(node) {
|
|
9937
10060
|
var config = this.config,
|
|
9938
|
-
pattern = config.point_pattern
|
|
9939
|
-
|
|
10061
|
+
pattern = config.point_pattern;
|
|
10062
|
+
var isCircle = !1;
|
|
9940
10063
|
if ((node == null ? void 0 : node.tagName) === "circle") {
|
|
9941
10064
|
isCircle = !0;
|
|
9942
10065
|
} else {
|
|
@@ -9958,7 +10081,7 @@ function getTextPos(pos, width) {
|
|
|
9958
10081
|
*/
|
|
9959
10082
|
labelishData: function labelishData(d) {
|
|
9960
10083
|
var _this5 = this;
|
|
9961
|
-
return this.isBarType(d) || this.isLineType(d) || this.isScatterType(d) || this.isBubbleType(d) || this.isCandlestickType(d) || this.isRadarType(d) ? d.values.filter(function (v) {
|
|
10084
|
+
return this.isBarType(d) || this.isLineType(d) || this.isScatterType(d) || this.isBubbleType(d) || this.isCandlestickType(d) || this.isRadarType(d) || this.isTreemapType(d) ? d.values.filter(function (v) {
|
|
9962
10085
|
_newArrowCheck(this, _this5);
|
|
9963
10086
|
return isNumber(v.value) || !!v.value;
|
|
9964
10087
|
}.bind(this)) : [];
|
|
@@ -10106,8 +10229,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10106
10229
|
var config = this.config,
|
|
10107
10230
|
state = this.state,
|
|
10108
10231
|
duration = config.transition_duration,
|
|
10109
|
-
subchart = config.subchart_show
|
|
10110
|
-
|
|
10232
|
+
subchart = config.subchart_show;
|
|
10233
|
+
var t = selection;
|
|
10111
10234
|
if (t) {
|
|
10112
10235
|
// in case of non d3 selection, wrap with d3 selection
|
|
10113
10236
|
if ("tagName" in t) {
|
|
@@ -10145,8 +10268,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10145
10268
|
$el = $$.$el,
|
|
10146
10269
|
useCssRule = config.boost_useCssRule;
|
|
10147
10270
|
checkModuleImport($$);
|
|
10148
|
-
state.hasAxis = !$$.hasArcType();
|
|
10149
10271
|
state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
|
10272
|
+
state.hasTreemap = !state.hasAxis && $$.hasType("treemap");
|
|
10273
|
+
state.hasAxis = !$$.hasArcType() && !state.hasTreemap;
|
|
10150
10274
|
|
|
10151
10275
|
// datetime to be used for uniqueness
|
|
10152
10276
|
state.datetimeId = "bb-" + +new Date() * getRandom();
|
|
@@ -10242,8 +10366,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10242
10366
|
if ($$.hasPointType()) {
|
|
10243
10367
|
$$.point = $$.generatePoint();
|
|
10244
10368
|
}
|
|
10369
|
+
$$.initClip();
|
|
10245
10370
|
if (state.hasAxis) {
|
|
10246
|
-
$$.initClip();
|
|
10247
10371
|
format.extraLineClasses = $$.generateExtraLineClass();
|
|
10248
10372
|
format.dataTime = config.data_xLocaltime ? external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.timeParse : external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.utcParse;
|
|
10249
10373
|
format.axisTime = config.axis_x_localtime ? external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.timeFormat : external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.utcFormat;
|
|
@@ -10274,7 +10398,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10274
10398
|
state = $$.state,
|
|
10275
10399
|
$el = $$.$el,
|
|
10276
10400
|
org = $$.org,
|
|
10277
|
-
|
|
10401
|
+
_state = state,
|
|
10402
|
+
hasAxis = _state.hasAxis,
|
|
10403
|
+
hasTreemap = _state.hasTreemap,
|
|
10278
10404
|
hasInteraction = config.interaction_enabled,
|
|
10279
10405
|
hasPolar = $$.hasType("polar");
|
|
10280
10406
|
// for arc type, set axes to not be shown
|
|
@@ -10305,28 +10431,30 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10305
10431
|
$$.updateScales(!0);
|
|
10306
10432
|
|
|
10307
10433
|
// retrieve scale after the 'updateScales()' is called
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
x
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10434
|
+
if (hasAxis) {
|
|
10435
|
+
var x = scale.x,
|
|
10436
|
+
y = scale.y,
|
|
10437
|
+
y2 = scale.y2,
|
|
10438
|
+
subX = scale.subX,
|
|
10439
|
+
subY = scale.subY,
|
|
10440
|
+
subY2 = scale.subY2;
|
|
10441
|
+
|
|
10442
|
+
// Set domains for each scale
|
|
10443
|
+
if (x) {
|
|
10444
|
+
x.domain(sortValue($$.getXDomain($$.data.targets)));
|
|
10445
|
+
subX.domain(x.domain());
|
|
10446
|
+
|
|
10447
|
+
// Save original x domain for zoom update
|
|
10448
|
+
org.xDomain = x.domain();
|
|
10449
|
+
}
|
|
10450
|
+
if (y) {
|
|
10451
|
+
y.domain($$.getYDomain($$.data.targets, "y"));
|
|
10452
|
+
subY.domain(y.domain());
|
|
10453
|
+
}
|
|
10454
|
+
if (y2) {
|
|
10455
|
+
y2.domain($$.getYDomain($$.data.targets, "y2"));
|
|
10456
|
+
subY2 && subY2.domain(y2.domain());
|
|
10457
|
+
}
|
|
10330
10458
|
}
|
|
10331
10459
|
|
|
10332
10460
|
// -- Basic Elements --
|
|
@@ -10342,7 +10470,7 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10342
10470
|
|
|
10343
10471
|
// Define defs
|
|
10344
10472
|
var hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
|
10345
|
-
if (hasAxis || hasColorPatterns || config.data_labels_backgroundColors
|
|
10473
|
+
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
|
|
10346
10474
|
$el.defs = $el.svg.append("defs");
|
|
10347
10475
|
if (hasAxis) {
|
|
10348
10476
|
["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
|
@@ -10372,14 +10500,14 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10372
10500
|
$$.bindResize();
|
|
10373
10501
|
|
|
10374
10502
|
// Define regions
|
|
10375
|
-
var main = $el.svg.append("g").classed($COMMON.main, !0).attr("transform", $$.getTranslate("main"));
|
|
10503
|
+
var main = $el.svg.append("g").classed($COMMON.main, !0).attr("transform", hasTreemap ? null : $$.getTranslate("main"));
|
|
10376
10504
|
$el.main = main;
|
|
10377
10505
|
|
|
10378
10506
|
// initialize subchart when subchart show option is set
|
|
10379
10507
|
config.subchart_show && $$.initSubchart();
|
|
10380
10508
|
config.tooltip_show && $$.initTooltip();
|
|
10381
10509
|
config.title_text && $$.initTitle();
|
|
10382
|
-
config.legend_show && $$.initLegend();
|
|
10510
|
+
!hasTreemap && config.legend_show && $$.initLegend();
|
|
10383
10511
|
|
|
10384
10512
|
// -- Main Region --
|
|
10385
10513
|
|
|
@@ -10453,6 +10581,7 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10453
10581
|
_$$$state = $$.state,
|
|
10454
10582
|
hasAxis = _$$$state.hasAxis,
|
|
10455
10583
|
hasRadar = _$$$state.hasRadar,
|
|
10584
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
10456
10585
|
types = [];
|
|
10457
10586
|
if (hasAxis) {
|
|
10458
10587
|
["bar", "bubble", "candlestick", "line"].forEach(function (v) {
|
|
@@ -10462,6 +10591,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10462
10591
|
types.push(name);
|
|
10463
10592
|
}
|
|
10464
10593
|
}.bind(this));
|
|
10594
|
+
} else if (hasTreemap) {
|
|
10595
|
+
types.push("Treemap");
|
|
10465
10596
|
} else {
|
|
10466
10597
|
var hasPolar = $$.hasType("polar");
|
|
10467
10598
|
if (!hasRadar) {
|
|
@@ -10560,6 +10691,7 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10560
10691
|
_$$$state2 = $$.state,
|
|
10561
10692
|
hasAxis = _$$$state2.hasAxis,
|
|
10562
10693
|
hasRadar = _$$$state2.hasRadar,
|
|
10694
|
+
hasTreemap = _$$$state2.hasTreemap,
|
|
10563
10695
|
helper = function (type) {
|
|
10564
10696
|
_newArrowCheck(this, _this6);
|
|
10565
10697
|
return $$["updateTargetsFor" + type](targets.filter($$["is" + type + "Type"].bind($$)));
|
|
@@ -10587,6 +10719,9 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10587
10719
|
type = "Polar";
|
|
10588
10720
|
}
|
|
10589
10721
|
helper(type);
|
|
10722
|
+
// Arc, Polar, Radar
|
|
10723
|
+
} else if (hasTreemap) {
|
|
10724
|
+
helper("Treemap");
|
|
10590
10725
|
}
|
|
10591
10726
|
|
|
10592
10727
|
// Point types
|
|
@@ -10611,8 +10746,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10611
10746
|
}
|
|
10612
10747
|
var $$ = this,
|
|
10613
10748
|
svg = $$.$el.svg,
|
|
10614
|
-
$T = $$.$T
|
|
10615
|
-
|
|
10749
|
+
$T = $$.$T;
|
|
10750
|
+
var selector = "." + $COMMON.target;
|
|
10616
10751
|
if (hasPointType) {
|
|
10617
10752
|
selector += ", ." + $CIRCLE.chartCircles + " > ." + $CIRCLE.circles;
|
|
10618
10753
|
}
|
|
@@ -10738,12 +10873,12 @@ function loadConfig(config) {
|
|
|
10738
10873
|
target,
|
|
10739
10874
|
keys,
|
|
10740
10875
|
read,
|
|
10741
|
-
|
|
10876
|
+
_find = function find() {
|
|
10742
10877
|
_newArrowCheck(this, _this);
|
|
10743
10878
|
var key = keys.shift();
|
|
10744
10879
|
if (key && target && isObjectType(target) && key in target) {
|
|
10745
10880
|
target = target[key];
|
|
10746
|
-
return
|
|
10881
|
+
return _find();
|
|
10747
10882
|
} else if (!key) {
|
|
10748
10883
|
return target;
|
|
10749
10884
|
}
|
|
@@ -10753,7 +10888,7 @@ function loadConfig(config) {
|
|
|
10753
10888
|
_newArrowCheck(this, _this);
|
|
10754
10889
|
target = config;
|
|
10755
10890
|
keys = key.split("_");
|
|
10756
|
-
read =
|
|
10891
|
+
read = _find();
|
|
10757
10892
|
if (isDefined(read)) {
|
|
10758
10893
|
thisConfig[key] = read;
|
|
10759
10894
|
}
|
|
@@ -10946,8 +11081,8 @@ function loadConfig(config) {
|
|
|
10946
11081
|
var $$ = this.internal,
|
|
10947
11082
|
config = $$.config,
|
|
10948
11083
|
state = $$.state,
|
|
10949
|
-
key = name == null ? void 0 : name.replace(/\./g, "_")
|
|
10950
|
-
|
|
11084
|
+
key = name == null ? void 0 : name.replace(/\./g, "_");
|
|
11085
|
+
var res;
|
|
10951
11086
|
if (name && key in config) {
|
|
10952
11087
|
if (isDefined(value)) {
|
|
10953
11088
|
config[key] = value;
|
|
@@ -11615,6 +11750,7 @@ function renderText(ctx, glyph) {
|
|
|
11615
11750
|
var legend_legend = {
|
|
11616
11751
|
/**
|
|
11617
11752
|
* Show legend for each target.
|
|
11753
|
+
* - **NOTE:** Legend APIs aren't supported for `treemap` type.
|
|
11618
11754
|
* @function legend․show
|
|
11619
11755
|
* @instance
|
|
11620
11756
|
* @memberof Chart
|
|
@@ -11854,6 +11990,7 @@ var legend_legend = {
|
|
|
11854
11990
|
}.bind(this));
|
|
11855
11991
|
}.bind(this));
|
|
11856
11992
|
} else {
|
|
11993
|
+
$$.api.tooltip.hide();
|
|
11857
11994
|
$$.loadFromArgs(args);
|
|
11858
11995
|
}
|
|
11859
11996
|
},
|
|
@@ -12094,6 +12231,13 @@ var tooltip_tooltip = {
|
|
|
12094
12231
|
* x: new Date("2018-01-02 00:00")
|
|
12095
12232
|
* });
|
|
12096
12233
|
*
|
|
12234
|
+
* // treemap type can be shown by using "id" only.
|
|
12235
|
+
* chart.tooltip.show({
|
|
12236
|
+
* data: {
|
|
12237
|
+
* id: "data1" // data id
|
|
12238
|
+
* }
|
|
12239
|
+
* });
|
|
12240
|
+
*
|
|
12097
12241
|
* // when data.xs is used
|
|
12098
12242
|
* chart.tooltip.show({
|
|
12099
12243
|
* data: {
|
|
@@ -12115,8 +12259,12 @@ var tooltip_tooltip = {
|
|
|
12115
12259
|
show: function show(args) {
|
|
12116
12260
|
var _this = this,
|
|
12117
12261
|
$$ = this.internal,
|
|
12262
|
+
$el = $$.$el,
|
|
12118
12263
|
config = $$.config,
|
|
12119
|
-
|
|
12264
|
+
_$$$state = $$.state,
|
|
12265
|
+
eventReceiver = _$$$state.eventReceiver,
|
|
12266
|
+
hasTreemap = _$$$state.hasTreemap,
|
|
12267
|
+
inputType = _$$$state.inputType,
|
|
12120
12268
|
index,
|
|
12121
12269
|
mouse;
|
|
12122
12270
|
// determine mouse position on the chart
|
|
@@ -12128,7 +12276,9 @@ var tooltip_tooltip = {
|
|
|
12128
12276
|
if (args.data) {
|
|
12129
12277
|
var data = args.data,
|
|
12130
12278
|
y = $$.getYScaleById(data.id)(data.value);
|
|
12131
|
-
if (
|
|
12279
|
+
if (hasTreemap && data.id) {
|
|
12280
|
+
eventReceiver.rect = $el.main.select("" + $$.selectorTarget(data.id, undefined, "rect"));
|
|
12281
|
+
} else if ($$.isMultipleX()) {
|
|
12132
12282
|
// if multiple xs, target point will be determined by mouse
|
|
12133
12283
|
mouse = [$$.scale.x(data.x), y];
|
|
12134
12284
|
} else {
|
|
@@ -13327,8 +13477,8 @@ var AxisRendererHelper = /*#__PURE__*/function () {
|
|
|
13327
13477
|
return isDefined(formatted) ? formatted : "";
|
|
13328
13478
|
};
|
|
13329
13479
|
_proto.transitionise = function transitionise(selection) {
|
|
13330
|
-
var config = this.config
|
|
13331
|
-
|
|
13480
|
+
var config = this.config;
|
|
13481
|
+
var transitionSelection = selection;
|
|
13332
13482
|
if (config.withoutTransition) {
|
|
13333
13483
|
transitionSelection = selection.interrupt();
|
|
13334
13484
|
} else if (config.transition || !this.owner.params.noTransition) {
|
|
@@ -13419,8 +13569,8 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
13419
13569
|
tickShow = {
|
|
13420
13570
|
tick: axisShow ? params.config[prefix + "_tick_show"] : !1,
|
|
13421
13571
|
text: axisShow ? params.config[prefix + "_tick_text_show"] : !1
|
|
13422
|
-
}
|
|
13423
|
-
|
|
13572
|
+
}; // // get the axis' tick position configuration
|
|
13573
|
+
var $g;
|
|
13424
13574
|
g.each(function () {
|
|
13425
13575
|
var _this = this,
|
|
13426
13576
|
g = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
@@ -13449,28 +13599,30 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
13449
13599
|
ctx.generatedTicks = ticks;
|
|
13450
13600
|
|
|
13451
13601
|
// update selection
|
|
13452
|
-
var tick = g.selectAll(".tick").data(ticks, scale1)
|
|
13453
|
-
|
|
13454
|
-
|
|
13602
|
+
var tick = g.selectAll(".tick").data(ticks, scale1);
|
|
13603
|
+
|
|
13604
|
+
// enter selection
|
|
13605
|
+
var tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick"),
|
|
13606
|
+
tickExit = tick.exit().remove(); // MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.
|
|
13455
13607
|
// enter + update selection
|
|
13456
13608
|
tick = tickEnter.merge(tick);
|
|
13457
13609
|
tickShow.tick && tickEnter.append("line");
|
|
13458
13610
|
tickShow.text && tickEnter.append("text");
|
|
13459
13611
|
var sizeFor1Char = AxisRendererHelper.getSizeFor1Char(tick),
|
|
13460
|
-
counts = []
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
}.bind(this));
|
|
13612
|
+
counts = [];
|
|
13613
|
+
var tspan = tick.select("text").selectAll("tspan").data(function (d, index) {
|
|
13614
|
+
var _this2 = this;
|
|
13615
|
+
_newArrowCheck(this, _this);
|
|
13616
|
+
var split = params.tickMultiline ? splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w) : isArray(helper.textFormatted(d)) ? helper.textFormatted(d).concat() : [helper.textFormatted(d)];
|
|
13617
|
+
counts[index] = split.length;
|
|
13618
|
+
return split.map(function (splitted) {
|
|
13619
|
+
_newArrowCheck(this, _this2);
|
|
13620
|
+
return {
|
|
13621
|
+
index: index,
|
|
13622
|
+
splitted: splitted
|
|
13623
|
+
};
|
|
13473
13624
|
}.bind(this));
|
|
13625
|
+
}.bind(this));
|
|
13474
13626
|
tspan.exit().remove();
|
|
13475
13627
|
tspan = tspan.enter().append("tspan").merge(tspan).text(function (d) {
|
|
13476
13628
|
_newArrowCheck(this, _this);
|
|
@@ -13542,9 +13694,9 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
13542
13694
|
*/;
|
|
13543
13695
|
_proto.getGeneratedTicks = function getGeneratedTicks(count) {
|
|
13544
13696
|
var _this$generatedTicks,
|
|
13697
|
+
_this3 = this,
|
|
13545
13698
|
len = ((_this$generatedTicks = this.generatedTicks) == null ? void 0 : _this$generatedTicks.length) - 1,
|
|
13546
|
-
res = this.generatedTicks
|
|
13547
|
-
_this3 = this;
|
|
13699
|
+
res = this.generatedTicks;
|
|
13548
13700
|
if (len > count) {
|
|
13549
13701
|
var interval = Math.round(len / count + .1);
|
|
13550
13702
|
res = this.generatedTicks.map(function (v, i) {
|
|
@@ -13754,7 +13906,8 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
13754
13906
|
return interval === Infinity ? 0 : interval;
|
|
13755
13907
|
};
|
|
13756
13908
|
_proto.ticks = function ticks() {
|
|
13757
|
-
|
|
13909
|
+
var config = this.config;
|
|
13910
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
13758
13911
|
args[_key] = arguments[_key];
|
|
13759
13912
|
}
|
|
13760
13913
|
if (!args.length) {
|
|
@@ -13997,8 +14150,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
13997
14150
|
}.bind(this))) {
|
|
13998
14151
|
v.scale().range(range);
|
|
13999
14152
|
}
|
|
14000
|
-
var className = this.getAxisClassName(id) + "-" + (i + 1)
|
|
14001
|
-
|
|
14153
|
+
var className = this.getAxisClassName(id) + "-" + (i + 1);
|
|
14154
|
+
var g = main.select("." + className.replace(/\s/, "."));
|
|
14002
14155
|
if (g.empty()) {
|
|
14003
14156
|
g = main.append("g").attr("class", className).style("visibility", config["axis_" + id + "_show"] ? null : "hidden").call(v);
|
|
14004
14157
|
} else {
|
|
@@ -14052,21 +14205,21 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14052
14205
|
tickFormat = fn.bind($$.api);
|
|
14053
14206
|
}
|
|
14054
14207
|
}
|
|
14055
|
-
var tickValues = this.tick[type]
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14208
|
+
var tickValues = this.tick[type];
|
|
14209
|
+
var axisParams = mergeObj({
|
|
14210
|
+
outerTick: outerTick,
|
|
14211
|
+
noTransition: noTransition,
|
|
14212
|
+
config: config,
|
|
14213
|
+
id: id,
|
|
14214
|
+
tickTextRotate: tickTextRotate,
|
|
14215
|
+
owner: $$
|
|
14216
|
+
}, isX && {
|
|
14217
|
+
isCategory: isCategory,
|
|
14218
|
+
tickMultiline: config.axis_x_tick_multiline,
|
|
14219
|
+
tickWidth: config.axis_x_tick_width,
|
|
14220
|
+
tickTitle: isCategory && config.axis_x_tick_tooltip && $$.api.categories(),
|
|
14221
|
+
orgXScale: $$.scale.x
|
|
14222
|
+
});
|
|
14070
14223
|
if (!isX) {
|
|
14071
14224
|
axisParams.tickStepSize = config["axis_" + type + "_tick_stepSize"];
|
|
14072
14225
|
}
|
|
@@ -14102,8 +14255,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14102
14255
|
_proto.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
|
|
14103
14256
|
var $$ = this.owner,
|
|
14104
14257
|
config = $$.config,
|
|
14105
|
-
fit = config.axis_x_tick_fit
|
|
14106
|
-
|
|
14258
|
+
fit = config.axis_x_tick_fit;
|
|
14259
|
+
var count = config.axis_x_tick_count,
|
|
14107
14260
|
values;
|
|
14108
14261
|
if (fit || count && fit) {
|
|
14109
14262
|
values = $$.mapTargetsToUniqueXs(targets);
|
|
@@ -14126,8 +14279,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14126
14279
|
_proto.getId = function getId(id) {
|
|
14127
14280
|
var _this$owner2 = this.owner,
|
|
14128
14281
|
config = _this$owner2.config,
|
|
14129
|
-
scale = _this$owner2.scale
|
|
14130
|
-
|
|
14282
|
+
scale = _this$owner2.scale;
|
|
14283
|
+
var axis = config.data_axes[id];
|
|
14284
|
+
|
|
14131
14285
|
// when data.axes option has 'y2', but 'axis.y2.show=true' isn't set will return 'y'
|
|
14132
14286
|
if (!axis || !scale[axis]) {
|
|
14133
14287
|
axis = "y";
|
|
@@ -14217,8 +14371,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14217
14371
|
_$$$state = $$.state,
|
|
14218
14372
|
width = _$$$state.width,
|
|
14219
14373
|
height = _$$$state.height,
|
|
14220
|
-
position = this.getAxisLabelPosition(id)
|
|
14221
|
-
|
|
14374
|
+
position = this.getAxisLabelPosition(id);
|
|
14375
|
+
var x = position.isMiddle ? -height / 2 : 0;
|
|
14222
14376
|
if (this.isHorizontal($$, id !== "x")) {
|
|
14223
14377
|
x = position.isLeft ? 0 : position.isCenter ? width / 2 : width;
|
|
14224
14378
|
} else if (position.isBottom) {
|
|
@@ -14228,8 +14382,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14228
14382
|
};
|
|
14229
14383
|
_proto.dxForAxisLabel = function dxForAxisLabel(id) {
|
|
14230
14384
|
var $$ = this.owner,
|
|
14231
|
-
position = this.getAxisLabelPosition(id)
|
|
14232
|
-
|
|
14385
|
+
position = this.getAxisLabelPosition(id);
|
|
14386
|
+
var dx = position.isBottom ? "0.5em" : "0";
|
|
14233
14387
|
if (this.isHorizontal($$, id !== "x")) {
|
|
14234
14388
|
dx = position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0";
|
|
14235
14389
|
} else if (position.isTop) {
|
|
@@ -14239,8 +14393,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14239
14393
|
};
|
|
14240
14394
|
_proto.textAnchorForAxisLabel = function textAnchorForAxisLabel(id) {
|
|
14241
14395
|
var $$ = this.owner,
|
|
14242
|
-
position = this.getAxisLabelPosition(id)
|
|
14243
|
-
|
|
14396
|
+
position = this.getAxisLabelPosition(id);
|
|
14397
|
+
var anchor = position.isMiddle ? "middle" : "end";
|
|
14244
14398
|
if (this.isHorizontal($$, id !== "x")) {
|
|
14245
14399
|
anchor = position.isLeft ? "start" : position.isCenter ? "middle" : "end";
|
|
14246
14400
|
} else if (position.isBottom) {
|
|
@@ -14254,8 +14408,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14254
14408
|
isRotated = config.axis_rotated,
|
|
14255
14409
|
isInner = this.getAxisLabelPosition(id).isInner,
|
|
14256
14410
|
tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
|
|
14257
|
-
maxTickWidth = this.getMaxTickWidth(id)
|
|
14258
|
-
|
|
14411
|
+
maxTickWidth = this.getMaxTickWidth(id);
|
|
14412
|
+
var dy;
|
|
14259
14413
|
if (id === "x") {
|
|
14260
14414
|
var xHeight = config.axis_x_height;
|
|
14261
14415
|
if (isRotated) {
|
|
@@ -14304,8 +14458,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14304
14458
|
if (svg) {
|
|
14305
14459
|
var isYAxis = /^y2?$/.test(id),
|
|
14306
14460
|
targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
|
14307
|
-
|
|
14308
|
-
domain =
|
|
14461
|
+
scale = $$.scale[id].copy().domain($$["get" + (isYAxis ? "Y" : "X") + "Domain"](targetsToShow, id)),
|
|
14462
|
+
domain = scale.domain(),
|
|
14309
14463
|
isDomainSame = domain[0] === domain[1] && domain.every(function (v) {
|
|
14310
14464
|
_newArrowCheck(this, _this11);
|
|
14311
14465
|
return v > 0;
|
|
@@ -14325,7 +14479,7 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14325
14479
|
if (!isYAxis) {
|
|
14326
14480
|
currentTickMax.ticks.splice(0);
|
|
14327
14481
|
}
|
|
14328
|
-
var axis = this.getAxis(id,
|
|
14482
|
+
var axis = this.getAxis(id, scale, !1, !1, !0),
|
|
14329
14483
|
tickCount = config["axis_" + id + "_tick_count"],
|
|
14330
14484
|
tickValues = config["axis_" + id + "_tick_values"];
|
|
14331
14485
|
// Make to generate the final tick text to be rendered
|
|
@@ -14379,9 +14533,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14379
14533
|
tickCount = tickTextWidths.length,
|
|
14380
14534
|
_state$axis$x$padding = state.axis.x.padding,
|
|
14381
14535
|
left = _state$axis$x$padding.left,
|
|
14382
|
-
right = _state$axis$x$padding.right
|
|
14383
|
-
|
|
14384
|
-
|
|
14536
|
+
right = _state$axis$x$padding.right;
|
|
14537
|
+
var maxOverflow = 0;
|
|
14538
|
+
var remaining = tickCount - (isTimeSeries && config.axis_x_tick_fit ? .5 : 0);
|
|
14385
14539
|
for (var i = 0; i < tickCount; i++) {
|
|
14386
14540
|
var tickIndex = i + 1,
|
|
14387
14541
|
rotatedTickTextWidth = Math.cos(Math.PI * xAxisTickRotate / 180) * tickTextWidths[i],
|
|
@@ -14398,8 +14552,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14398
14552
|
overflow = rotatedTickTextWidth - tickLength / 2 - remainingTickWidth;
|
|
14399
14553
|
maxOverflow = Math.max(maxOverflow, overflow);
|
|
14400
14554
|
}
|
|
14401
|
-
var filteredTargets = $$.filterTargetsToShow($$.data.targets)
|
|
14402
|
-
|
|
14555
|
+
var filteredTargets = $$.filterTargetsToShow($$.data.targets);
|
|
14556
|
+
var tickOffset = 0;
|
|
14403
14557
|
if (!isTimeSeries && config.axis_x_tick_count <= filteredTargets.length && filteredTargets[0].values.length) {
|
|
14404
14558
|
var _scale2 = getScale($$.axis.getAxisType("x"), 0, widthWithoutCurrentPaddingLeft - maxOverflow).domain([left * -1, $$.getXDomainMax($$.data.targets) + 1 + right]);
|
|
14405
14559
|
tickOffset = Math.ceil((_scale2(1) - _scale2(0)) / 2);
|
|
@@ -14472,8 +14626,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14472
14626
|
var isCategorized = this.isCategorized(),
|
|
14473
14627
|
count = targetCount - 2,
|
|
14474
14628
|
start = values[0],
|
|
14475
|
-
end = values[values.length - 1]
|
|
14476
|
-
|
|
14629
|
+
end = values[values.length - 1];
|
|
14630
|
+
var tickValue;
|
|
14631
|
+
|
|
14477
14632
|
// re-construct unique values
|
|
14478
14633
|
tickValues = [start];
|
|
14479
14634
|
for (var i = 0; i < count; i++) {
|
|
@@ -14627,8 +14782,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14627
14782
|
tickValues = sortValue(tickNodes.data()),
|
|
14628
14783
|
tickSize = tickValues.length,
|
|
14629
14784
|
cullingMax = config[cullingOptionPrefix + "_max"],
|
|
14630
|
-
lines = config[cullingOptionPrefix + "_lines"]
|
|
14631
|
-
|
|
14785
|
+
lines = config[cullingOptionPrefix + "_lines"];
|
|
14786
|
+
var intervalForCulling;
|
|
14632
14787
|
if (tickSize) {
|
|
14633
14788
|
for (var i = 1; i < tickSize; i++) {
|
|
14634
14789
|
if (tickSize / i < cullingMax) {
|
|
@@ -14874,8 +15029,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14874
15029
|
var _this4 = this;
|
|
14875
15030
|
_newArrowCheck(this, _this3);
|
|
14876
15031
|
var x = getPrevNextX(d),
|
|
14877
|
-
xDomain = xScale.domain()
|
|
14878
|
-
|
|
15032
|
+
xDomain = xScale.domain();
|
|
15033
|
+
var val;
|
|
15034
|
+
|
|
14879
15035
|
// if there this is a single data point make the eventRect full width (or height)
|
|
14880
15036
|
if (x.prev === null && x.next === null) {
|
|
14881
15037
|
val = isRotated ? state.height : state.width;
|
|
@@ -14895,8 +15051,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14895
15051
|
}.bind(this);
|
|
14896
15052
|
rectX = function (d) {
|
|
14897
15053
|
_newArrowCheck(this, _this3);
|
|
14898
|
-
var x = getPrevNextX(d)
|
|
14899
|
-
|
|
15054
|
+
var x = getPrevNextX(d);
|
|
15055
|
+
var val;
|
|
15056
|
+
|
|
14900
15057
|
// if there this is a single data point position the eventRect at 0
|
|
14901
15058
|
if (x.prev === null && x.next === null) {
|
|
14902
15059
|
val = 0;
|
|
@@ -15027,8 +15184,9 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
15027
15184
|
if (!d) {
|
|
15028
15185
|
return;
|
|
15029
15186
|
}
|
|
15030
|
-
var index = d.index
|
|
15031
|
-
|
|
15187
|
+
var index = d.index;
|
|
15188
|
+
var stepType = config.line_step_type;
|
|
15189
|
+
|
|
15032
15190
|
// tooltip position match for step-before & step-after
|
|
15033
15191
|
if (config.line_step_tooltipMatch && $$.hasType("step") && /^step\-(before|after)$/.test(stepType)) {
|
|
15034
15192
|
var scale = $$.scale.zoom || $$.scale.x,
|
|
@@ -15189,8 +15347,8 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15189
15347
|
["axis.x", "grid.x", "gridLines.x", "region.list", "text", "bar", "line", "area", "circle"].forEach(function (v) {
|
|
15190
15348
|
var _node;
|
|
15191
15349
|
_newArrowCheck(this, _this);
|
|
15192
|
-
var name = v.split(".")
|
|
15193
|
-
|
|
15350
|
+
var name = v.split(".");
|
|
15351
|
+
var node = $el[name[0]];
|
|
15194
15352
|
if (node && name.length > 1) {
|
|
15195
15353
|
node = node[name[1]];
|
|
15196
15354
|
}
|
|
@@ -15382,18 +15540,22 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15382
15540
|
/* harmony default export */ var clip = ({
|
|
15383
15541
|
initClip: function initClip() {
|
|
15384
15542
|
var $$ = this,
|
|
15385
|
-
|
|
15543
|
+
_$$$state = $$.state,
|
|
15544
|
+
clip = _$$$state.clip,
|
|
15545
|
+
hasAxis = _$$$state.hasAxis;
|
|
15386
15546
|
// MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
|
15387
15547
|
clip.id = $$.state.datetimeId + "-clip";
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15548
|
+
if (hasAxis) {
|
|
15549
|
+
clip.idXAxis = clip.id + "-xaxis";
|
|
15550
|
+
clip.idYAxis = clip.id + "-yaxis";
|
|
15551
|
+
clip.idGrid = clip.id + "-grid";
|
|
15391
15552
|
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15553
|
+
// Define 'clip-path' attribute values
|
|
15554
|
+
clip.path = $$.getClipPath(clip.id);
|
|
15555
|
+
clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
|
15556
|
+
clip.pathYAxis = $$.getClipPath(clip.idYAxis);
|
|
15557
|
+
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
15558
|
+
}
|
|
15397
15559
|
},
|
|
15398
15560
|
getClipPath: function getClipPath(id) {
|
|
15399
15561
|
var $$ = this,
|
|
@@ -15415,10 +15577,10 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15415
15577
|
setXAxisClipPath: function setXAxisClipPath(node) {
|
|
15416
15578
|
var $$ = this,
|
|
15417
15579
|
config = $$.config,
|
|
15418
|
-
_$$$
|
|
15419
|
-
margin = _$$$
|
|
15420
|
-
width = _$$$
|
|
15421
|
-
height = _$$$
|
|
15580
|
+
_$$$state2 = $$.state,
|
|
15581
|
+
margin = _$$$state2.margin,
|
|
15582
|
+
width = _$$$state2.width,
|
|
15583
|
+
height = _$$$state2.height,
|
|
15422
15584
|
isRotated = config.axis_rotated,
|
|
15423
15585
|
left = Math.max(30, margin.left) - (isRotated ? 0 : 20),
|
|
15424
15586
|
x = isRotated ? -(1 + left) : -(left - 1),
|
|
@@ -15435,10 +15597,10 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15435
15597
|
setYAxisClipPath: function setYAxisClipPath(node) {
|
|
15436
15598
|
var $$ = this,
|
|
15437
15599
|
config = $$.config,
|
|
15438
|
-
_$$$
|
|
15439
|
-
margin = _$$$
|
|
15440
|
-
width = _$$$
|
|
15441
|
-
height = _$$$
|
|
15600
|
+
_$$$state3 = $$.state,
|
|
15601
|
+
margin = _$$$state3.margin,
|
|
15602
|
+
width = _$$$state3.width,
|
|
15603
|
+
height = _$$$state3.height,
|
|
15442
15604
|
isRotated = config.axis_rotated,
|
|
15443
15605
|
left = Math.max(30, margin.left) - (isRotated ? 20 : 0),
|
|
15444
15606
|
isInner = config.axis_y_inner,
|
|
@@ -15451,9 +15613,9 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15451
15613
|
updateXAxisTickClip: function updateXAxisTickClip() {
|
|
15452
15614
|
var $$ = this,
|
|
15453
15615
|
config = $$.config,
|
|
15454
|
-
_$$$
|
|
15455
|
-
clip = _$$$
|
|
15456
|
-
xAxisHeight = _$$$
|
|
15616
|
+
_$$$state4 = $$.state,
|
|
15617
|
+
clip = _$$$state4.clip,
|
|
15618
|
+
xAxisHeight = _$$$state4.xAxisHeight,
|
|
15457
15619
|
defs = $$.$el.defs,
|
|
15458
15620
|
newXAxisHeight = $$.getHorizontalAxisHeight("x");
|
|
15459
15621
|
if (defs && !clip.idXAxisTickTexts) {
|
|
@@ -15482,9 +15644,9 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15482
15644
|
},
|
|
15483
15645
|
setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
|
|
15484
15646
|
var $$ = this,
|
|
15485
|
-
_$$$
|
|
15486
|
-
clip = _$$$
|
|
15487
|
-
current = _$$$
|
|
15647
|
+
_$$$state5 = $$.state,
|
|
15648
|
+
clip = _$$$state5.clip,
|
|
15649
|
+
current = _$$$state5.current,
|
|
15488
15650
|
svg = $$.$el.svg;
|
|
15489
15651
|
if (svg) {
|
|
15490
15652
|
svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickWidths.x.clipPath).attr("height", 30);
|
|
@@ -15980,8 +16142,8 @@ function smoothLines(el, type) {
|
|
|
15980
16142
|
config = $$.config,
|
|
15981
16143
|
scale = $$.scale,
|
|
15982
16144
|
isRotated = config.axis_rotated,
|
|
15983
|
-
isX = type === "x"
|
|
15984
|
-
|
|
16145
|
+
isX = type === "x";
|
|
16146
|
+
var key = "start",
|
|
15985
16147
|
currScale,
|
|
15986
16148
|
pos = 0;
|
|
15987
16149
|
if (d.axis === "y" || d.axis === "y2") {
|
|
@@ -16011,8 +16173,8 @@ function smoothLines(el, type) {
|
|
|
16011
16173
|
state = $$.state,
|
|
16012
16174
|
isRotated = config.axis_rotated,
|
|
16013
16175
|
isWidth = type === "width",
|
|
16014
|
-
start = $$[isWidth ? "regionX" : "regionY"](d)
|
|
16015
|
-
|
|
16176
|
+
start = $$[isWidth ? "regionX" : "regionY"](d);
|
|
16177
|
+
var currScale,
|
|
16016
16178
|
key = "end",
|
|
16017
16179
|
end = state[type];
|
|
16018
16180
|
if (d.axis === "y" || d.axis === "y2") {
|
|
@@ -16078,8 +16240,8 @@ function smoothLines(el, type) {
|
|
|
16078
16240
|
rotatedPadding = _state.rotatedPadding,
|
|
16079
16241
|
isLegendRight = _state.isLegendRight,
|
|
16080
16242
|
isLegendInset = _state.isLegendInset,
|
|
16081
|
-
isRotated = config.axis_rotated
|
|
16082
|
-
|
|
16243
|
+
isRotated = config.axis_rotated;
|
|
16244
|
+
var h = 30;
|
|
16083
16245
|
if (id === "x" && !config.axis_x_show) {
|
|
16084
16246
|
return 8;
|
|
16085
16247
|
}
|
|
@@ -16119,14 +16281,14 @@ function smoothLines(el, type) {
|
|
|
16119
16281
|
axis = $$.axis,
|
|
16120
16282
|
config = $$.config,
|
|
16121
16283
|
state = $$.state,
|
|
16122
|
-
$el = $$.$el
|
|
16123
|
-
|
|
16284
|
+
$el = $$.$el;
|
|
16285
|
+
var rotate = config["axis_" + id + "_tick_rotate"];
|
|
16124
16286
|
if (id === "x") {
|
|
16125
16287
|
var allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
|
|
16126
16288
|
if (config.axis_x_tick_fit && allowedXAxisTypes) {
|
|
16127
16289
|
var xTickCount = config.axis_x_tick_count,
|
|
16128
|
-
currentXTicksLength = state.current.maxTickWidths.x.ticks.length
|
|
16129
|
-
|
|
16290
|
+
currentXTicksLength = state.current.maxTickWidths.x.ticks.length;
|
|
16291
|
+
var tickCount = 0;
|
|
16130
16292
|
if (xTickCount) {
|
|
16131
16293
|
tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;
|
|
16132
16294
|
} else if (currentXTicksLength) {
|
|
@@ -18095,8 +18257,8 @@ function getRadiusFn(expandRate) {
|
|
|
18095
18257
|
*/
|
|
18096
18258
|
outer: function outer(d) {
|
|
18097
18259
|
var _$$$getRadius2 = $$.getRadius(d),
|
|
18098
|
-
outerRadius = _$$$getRadius2.outerRadius
|
|
18099
|
-
|
|
18260
|
+
outerRadius = _$$$getRadius2.outerRadius;
|
|
18261
|
+
var radius;
|
|
18100
18262
|
if (hasMultiArcGauge) {
|
|
18101
18263
|
radius = state.radius - singleArcWidth * d.index + expandWidth;
|
|
18102
18264
|
} else if ($$.hasType("polar") && !expandRate) {
|
|
@@ -18126,8 +18288,8 @@ function getRadiusFn(expandRate) {
|
|
|
18126
18288
|
_config$arc_cornerRad2 = config.arc_cornerRadius,
|
|
18127
18289
|
cornerRadius = _config$arc_cornerRad2 === void 0 ? 0 : _config$arc_cornerRad2,
|
|
18128
18290
|
id = d.data.id,
|
|
18129
|
-
value = d.value
|
|
18130
|
-
|
|
18291
|
+
value = d.value;
|
|
18292
|
+
var corner = 0;
|
|
18131
18293
|
if (ratio) {
|
|
18132
18294
|
corner = ratio * outerRadius;
|
|
18133
18295
|
} else {
|
|
@@ -18199,8 +18361,8 @@ function getAttrTweenFn(fn) {
|
|
|
18199
18361
|
*/
|
|
18200
18362
|
getRadius: function getRadius(d) {
|
|
18201
18363
|
var $$ = this,
|
|
18202
|
-
data = d == null ? void 0 : d.data
|
|
18203
|
-
|
|
18364
|
+
data = d == null ? void 0 : d.data;
|
|
18365
|
+
var _$$$state = $$.state,
|
|
18204
18366
|
innerRadius = _$$$state.innerRadius,
|
|
18205
18367
|
outerRadius = _$$$state.outerRadius;
|
|
18206
18368
|
if (!isNumber(innerRadius) && data) {
|
|
@@ -18225,8 +18387,8 @@ function getAttrTweenFn(fn) {
|
|
|
18225
18387
|
getArcLength: function getArcLength() {
|
|
18226
18388
|
var $$ = this,
|
|
18227
18389
|
config = $$.config,
|
|
18228
|
-
arcLengthInPercent = config.gauge_arcLength * 3.6
|
|
18229
|
-
|
|
18390
|
+
arcLengthInPercent = config.gauge_arcLength * 3.6;
|
|
18391
|
+
var len = 2 * (arcLengthInPercent / 360);
|
|
18230
18392
|
if (arcLengthInPercent < -360) {
|
|
18231
18393
|
len = -2;
|
|
18232
18394
|
} else if (arcLengthInPercent > 360) {
|
|
@@ -18239,8 +18401,8 @@ function getAttrTweenFn(fn) {
|
|
|
18239
18401
|
config = $$.config,
|
|
18240
18402
|
isFullCircle = config.gauge_fullCircle,
|
|
18241
18403
|
defaultStartAngle = -1 * Math.PI / 2,
|
|
18242
|
-
defaultEndAngle = Math.PI / 2
|
|
18243
|
-
|
|
18404
|
+
defaultEndAngle = Math.PI / 2;
|
|
18405
|
+
var startAngle = config.gauge_startingAngle;
|
|
18244
18406
|
if (!isFullCircle && startAngle <= defaultStartAngle) {
|
|
18245
18407
|
startAngle = defaultStartAngle;
|
|
18246
18408
|
} else if (!isFullCircle && startAngle >= defaultEndAngle) {
|
|
@@ -18334,8 +18496,8 @@ function getAttrTweenFn(fn) {
|
|
|
18334
18496
|
return function (d) {
|
|
18335
18497
|
_newArrowCheck(this, _this5);
|
|
18336
18498
|
var updated = $$.updateAngle(d),
|
|
18337
|
-
outerR = outer(updated)
|
|
18338
|
-
|
|
18499
|
+
outerR = outer(updated);
|
|
18500
|
+
var cornerR = 0;
|
|
18339
18501
|
if (updated) {
|
|
18340
18502
|
cornerR = corner(updated, outerR);
|
|
18341
18503
|
}
|
|
@@ -18378,11 +18540,11 @@ function getAttrTweenFn(fn) {
|
|
|
18378
18540
|
}.bind(this)),
|
|
18379
18541
|
x = _c$map[0],
|
|
18380
18542
|
y = _c$map[1],
|
|
18381
|
-
h = Math.sqrt(x * x + y * y)
|
|
18382
|
-
|
|
18383
|
-
|
|
18384
|
-
|
|
18385
|
-
|
|
18543
|
+
h = Math.sqrt(x * x + y * y);
|
|
18544
|
+
var ratio = (_filter$map = ["donut", "pie", "polar"].filter($$.hasType.bind($$)).map(function (v) {
|
|
18545
|
+
_newArrowCheck(this, _this6);
|
|
18546
|
+
return config[v + "_label_ratio"];
|
|
18547
|
+
}.bind(this))) == null ? void 0 : _filter$map[0];
|
|
18386
18548
|
if (ratio) {
|
|
18387
18549
|
ratio = isFunction(ratio) ? ratio.bind($$.api)(d, outerRadius, h) : ratio;
|
|
18388
18550
|
} else {
|
|
@@ -18471,8 +18633,8 @@ function getAttrTweenFn(fn) {
|
|
|
18471
18633
|
*/
|
|
18472
18634
|
getExpandConfig: function getExpandConfig(id, key) {
|
|
18473
18635
|
var $$ = this,
|
|
18474
|
-
config = $$.config
|
|
18475
|
-
|
|
18636
|
+
config = $$.config;
|
|
18637
|
+
var type;
|
|
18476
18638
|
if ($$.isDonutType(id)) {
|
|
18477
18639
|
type = "donut";
|
|
18478
18640
|
} else if ($$.isGaugeType(id)) {
|
|
@@ -18633,8 +18795,8 @@ function getAttrTweenFn(fn) {
|
|
|
18633
18795
|
.style("opacity", null).call(endall, function () {
|
|
18634
18796
|
if ($$.levelColor) {
|
|
18635
18797
|
var path = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
18636
|
-
|
|
18637
|
-
$$.updateLegendItemColor(
|
|
18798
|
+
d = path.datum();
|
|
18799
|
+
$$.updateLegendItemColor(d.data.id, path.style("fill"));
|
|
18638
18800
|
}
|
|
18639
18801
|
state.transiting = !1;
|
|
18640
18802
|
callFn(config.onrendered, $$.api);
|
|
@@ -18718,8 +18880,8 @@ function getAttrTweenFn(fn) {
|
|
|
18718
18880
|
$$.hideTooltip();
|
|
18719
18881
|
}
|
|
18720
18882
|
arc.on("click", function (event, d, i) {
|
|
18721
|
-
var updated = $$.updateAngle(d)
|
|
18722
|
-
|
|
18883
|
+
var updated = $$.updateAngle(d);
|
|
18884
|
+
var arcData;
|
|
18723
18885
|
if (updated) {
|
|
18724
18886
|
arcData = $$.convertToArcData(updated);
|
|
18725
18887
|
$$.toggleShape == null ? void 0 : $$.toggleShape(this, arcData, i);
|
|
@@ -18969,8 +19131,9 @@ function getAttrTweenFn(fn) {
|
|
|
18969
19131
|
var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
|
18970
19132
|
offset = areaOffset(d, i) || y0,
|
|
18971
19133
|
posX = x(d),
|
|
18972
|
-
value = d.value
|
|
18973
|
-
|
|
19134
|
+
value = d.value;
|
|
19135
|
+
var posY = y(d);
|
|
19136
|
+
|
|
18974
19137
|
// fix posY not to overflow opposite quadrant
|
|
18975
19138
|
if (config.axis_rotated && (value > 0 && posY < y0 || value < 0 && y0 < posY)) {
|
|
18976
19139
|
posY = y0;
|
|
@@ -19020,7 +19183,7 @@ function getAttrTweenFn(fn) {
|
|
|
19020
19183
|
if (!$el.bar) {
|
|
19021
19184
|
$$.initBar();
|
|
19022
19185
|
}
|
|
19023
|
-
var mainBarUpdate =
|
|
19186
|
+
var mainBarUpdate = $el.main.select("." + $BAR.chartBars).selectAll("." + $BAR.chartBar).data(
|
|
19024
19187
|
// remove
|
|
19025
19188
|
targets.filter(function (v) {
|
|
19026
19189
|
var _this2 = this;
|
|
@@ -19139,10 +19302,10 @@ function getAttrTweenFn(fn) {
|
|
|
19139
19302
|
indexX = +isRotated,
|
|
19140
19303
|
indexY = +!indexX,
|
|
19141
19304
|
isNegative = d.value < 0,
|
|
19142
|
-
pathRadius = ["", ""],
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
isRadiusData = getRadius && isGrouped ? $$.isStackingRadiusData(d) : !1; //
|
|
19305
|
+
pathRadius = ["", ""]; // switch points if axis is rotated, not applicable for sub chart
|
|
19306
|
+
var radius = 0;
|
|
19307
|
+
var isGrouped = $$.isGrouped(d.id),
|
|
19308
|
+
isRadiusData = getRadius && isGrouped ? $$.isStackingRadiusData(d) : !1; // const hasRadius = d.value !== 0 && getRadius;
|
|
19146
19309
|
if (getRadius && (!isGrouped || isRadiusData)) {
|
|
19147
19310
|
var index = isRotated ? indexY : indexX,
|
|
19148
19311
|
barW = points[2][index] - points[0][index];
|
|
@@ -19230,8 +19393,9 @@ function getAttrTweenFn(fn) {
|
|
|
19230
19393
|
offset = barOffset(d, i) || y0,
|
|
19231
19394
|
width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
|
19232
19395
|
value = d.value,
|
|
19233
|
-
posX = barX(d)
|
|
19234
|
-
|
|
19396
|
+
posX = barX(d);
|
|
19397
|
+
var posY = barY(d);
|
|
19398
|
+
|
|
19235
19399
|
// fix posY not to overflow opposite quadrant
|
|
19236
19400
|
if (config.axis_rotated && (value > 0 && posY < y0 || value < 0 && y0 < posY)) {
|
|
19237
19401
|
posY = y0;
|
|
@@ -19391,8 +19555,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19391
19555
|
var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
|
19392
19556
|
offset = shapeOffset(d, i) || y0,
|
|
19393
19557
|
width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
|
19394
|
-
value = $$.getCandlestickData(d)
|
|
19395
|
-
|
|
19558
|
+
value = $$.getCandlestickData(d);
|
|
19559
|
+
var points;
|
|
19396
19560
|
if (value) {
|
|
19397
19561
|
var posX = {
|
|
19398
19562
|
start: x(d),
|
|
@@ -19533,9 +19697,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19533
19697
|
_newArrowCheck(this, _this2);
|
|
19534
19698
|
return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
|
|
19535
19699
|
}.bind(this)).style("display", config.gauge_label_show ? null : "none").each(function (d) {
|
|
19536
|
-
var lineLength = 0
|
|
19537
|
-
|
|
19538
|
-
x = 0,
|
|
19700
|
+
var lineLength = 0;
|
|
19701
|
+
var x = 0,
|
|
19539
19702
|
y = 0,
|
|
19540
19703
|
transform = "";
|
|
19541
19704
|
if (hiddenTargetIds.indexOf(d.data.id) < 0) {
|
|
@@ -19549,7 +19712,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19549
19712
|
y = Math.sin(linePositioningAngle) * arcInnerRadius;
|
|
19550
19713
|
transform = "rotate(" + lineAngle * 180 / Math.PI + ", " + x + ", " + y + ")";
|
|
19551
19714
|
}
|
|
19552
|
-
(0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).attr("x", x).attr("y", y).attr("width", lineLength).attr("height",
|
|
19715
|
+
(0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).attr("x", x).attr("y", y).attr("width", lineLength).attr("height", 2).attr("transform", transform).style("stroke-dasharray", "0, " + (lineLength + 2) + ", 0");
|
|
19553
19716
|
});
|
|
19554
19717
|
},
|
|
19555
19718
|
textForGaugeMinMax: function textForGaugeMinMax(value, isMax) {
|
|
@@ -19599,8 +19762,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19599
19762
|
_$$$state = $$.state,
|
|
19600
19763
|
width = _$$$state.width,
|
|
19601
19764
|
height = _$$$state.height,
|
|
19602
|
-
cacheKey = KEY.bubbleBaseLength
|
|
19603
|
-
|
|
19765
|
+
cacheKey = KEY.bubbleBaseLength;
|
|
19766
|
+
var baseLength = $$.cache.get(cacheKey);
|
|
19604
19767
|
if (!baseLength) {
|
|
19605
19768
|
$$.cache.add(cacheKey, baseLength = getMinMax("min", [width, height]));
|
|
19606
19769
|
}
|
|
@@ -19793,8 +19956,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19793
19956
|
var x = isSub ? scale.subX : scale.x;
|
|
19794
19957
|
return function (d) {
|
|
19795
19958
|
_newArrowCheck(this, _this4);
|
|
19796
|
-
var y = yScale(d.id, isSub)
|
|
19797
|
-
|
|
19959
|
+
var y = yScale(d.id, isSub);
|
|
19960
|
+
var values = lineConnectNull ? $$.filterRemoveNull(d.values) : d.values,
|
|
19798
19961
|
x0 = 0,
|
|
19799
19962
|
y0 = 0,
|
|
19800
19963
|
path;
|
|
@@ -19884,12 +20047,13 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
19884
20047
|
axisType = {
|
|
19885
20048
|
x: $$.axis.getAxisType("x"),
|
|
19886
20049
|
y: $$.axis.getAxisType("y")
|
|
19887
|
-
}
|
|
19888
|
-
|
|
20050
|
+
};
|
|
20051
|
+
var path = "";
|
|
19889
20052
|
for (var _i = 0, data; data = d[_i]; _i++) {
|
|
19890
20053
|
var prevData = d[_i - 1],
|
|
19891
|
-
hasPrevData = prevData && isValue(prevData.value)
|
|
19892
|
-
|
|
20054
|
+
hasPrevData = prevData && isValue(prevData.value);
|
|
20055
|
+
var style = $$.isWithinRegions(data.x, regions);
|
|
20056
|
+
|
|
19893
20057
|
// https://github.com/naver/billboard.js/issues/1172
|
|
19894
20058
|
if (!isValue(data.value)) {
|
|
19895
20059
|
continue;
|
|
@@ -19966,16 +20130,16 @@ var getTransitionName = function () {
|
|
|
19966
20130
|
},
|
|
19967
20131
|
initialOpacityForCircle: function initialOpacityForCircle(d) {
|
|
19968
20132
|
var config = this.config,
|
|
19969
|
-
withoutFadeIn = this.state.withoutFadeIn
|
|
19970
|
-
|
|
20133
|
+
withoutFadeIn = this.state.withoutFadeIn;
|
|
20134
|
+
var opacity = config.point_opacity;
|
|
19971
20135
|
if (isUndefined(opacity)) {
|
|
19972
20136
|
opacity = this.getBaseValue(d) !== null && withoutFadeIn[d.id] ? this.opacityForCircle(d) : "0";
|
|
19973
20137
|
}
|
|
19974
20138
|
return opacity;
|
|
19975
20139
|
},
|
|
19976
20140
|
opacityForCircle: function opacityForCircle(d) {
|
|
19977
|
-
var config = this.config
|
|
19978
|
-
|
|
20141
|
+
var config = this.config;
|
|
20142
|
+
var opacity = config.point_opacity;
|
|
19979
20143
|
if (isUndefined(opacity)) {
|
|
19980
20144
|
opacity = config.point_show && !config.point_focus_only ? null : "0";
|
|
19981
20145
|
opacity = isValue(this.getBaseValue(d)) ? this.isBubbleType(d) || this.isScatterType(d) ? "0.5" : opacity : "0";
|
|
@@ -20101,8 +20265,8 @@ var getTransitionName = function () {
|
|
|
20101
20265
|
resizing = _$$$state.resizing,
|
|
20102
20266
|
toggling = _$$$state.toggling,
|
|
20103
20267
|
transiting = _$$$state.transiting,
|
|
20104
|
-
$el = $$.$el
|
|
20105
|
-
|
|
20268
|
+
$el = $$.$el;
|
|
20269
|
+
var circle = $el.circle;
|
|
20106
20270
|
if (transiting === !1 && config.point_focus_only && circle) {
|
|
20107
20271
|
var cx = (hasRadar ? $$.radarCircleX : $$.circleX).bind($$),
|
|
20108
20272
|
cy = (hasRadar ? $$.radarCircleY : $$.circleY).bind($$),
|
|
@@ -20121,8 +20285,8 @@ var getTransitionName = function () {
|
|
|
20121
20285
|
circle.attr("class", this.updatePointClass.bind(this)).style("opacity", null).each(function (d) {
|
|
20122
20286
|
var id = d.id,
|
|
20123
20287
|
index = d.index,
|
|
20124
|
-
value = d.value
|
|
20125
|
-
|
|
20288
|
+
value = d.value;
|
|
20289
|
+
var visibility = "hidden";
|
|
20126
20290
|
if (isValue(value)) {
|
|
20127
20291
|
fn.bind(this)(d);
|
|
20128
20292
|
$$.expandCircles(index, id);
|
|
@@ -20202,8 +20366,8 @@ var getTransitionName = function () {
|
|
|
20202
20366
|
pointR: function (d) {
|
|
20203
20367
|
var $$ = this,
|
|
20204
20368
|
config = $$.config,
|
|
20205
|
-
pointR = config.point_r
|
|
20206
|
-
|
|
20369
|
+
pointR = config.point_r;
|
|
20370
|
+
var r = pointR;
|
|
20207
20371
|
if ($$.isBubbleType(d)) {
|
|
20208
20372
|
r = $$.getBubbleR(d);
|
|
20209
20373
|
} else if (isFunction(pointR)) {
|
|
@@ -20225,8 +20389,8 @@ var getTransitionName = function () {
|
|
|
20225
20389
|
isWithinCircle: function isWithinCircle(node, r) {
|
|
20226
20390
|
var mouse = getPointer(this.state.event, node),
|
|
20227
20391
|
element = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(node),
|
|
20228
|
-
prefix = this.isCirclePoint(node) ? "c" : ""
|
|
20229
|
-
|
|
20392
|
+
prefix = this.isCirclePoint(node) ? "c" : "";
|
|
20393
|
+
var cx = +element.attr(prefix + "x"),
|
|
20230
20394
|
cy = +element.attr(prefix + "y");
|
|
20231
20395
|
// if node don't have cx/y or x/y attribute value
|
|
20232
20396
|
if (!(cx || cy) && node.nodeType === 1) {
|
|
@@ -20274,8 +20438,8 @@ var getTransitionName = function () {
|
|
|
20274
20438
|
},
|
|
20275
20439
|
updatePointClass: function updatePointClass(d) {
|
|
20276
20440
|
var $$ = this,
|
|
20277
|
-
circle = $$.$el.circle
|
|
20278
|
-
|
|
20441
|
+
circle = $$.$el.circle;
|
|
20442
|
+
var pointClass = !1;
|
|
20279
20443
|
if (isObject(d) || circle) {
|
|
20280
20444
|
pointClass = d === !0 ? circle.each(function (d) {
|
|
20281
20445
|
var className = $$.getClass("circle", !0)(d);
|
|
@@ -20299,8 +20463,9 @@ var getTransitionName = function () {
|
|
|
20299
20463
|
_newArrowCheck(this, _this8);
|
|
20300
20464
|
var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
|
20301
20465
|
offset = lineOffset(d, i) || y0,
|
|
20302
|
-
posX = x(d)
|
|
20303
|
-
|
|
20466
|
+
posX = x(d);
|
|
20467
|
+
var posY = y(d);
|
|
20468
|
+
|
|
20304
20469
|
// fix posY not to overflow opposite quadrant
|
|
20305
20470
|
if (config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY)) {
|
|
20306
20471
|
posY = y0;
|
|
@@ -20380,8 +20545,9 @@ var getTransitionName = function () {
|
|
|
20380
20545
|
return element.append("circle").attr("class", this.updatePointClass.bind(this)).attr("r", sizeFn).style("fill", fillStyleFn).node();
|
|
20381
20546
|
},
|
|
20382
20547
|
update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
|
20383
|
-
var $$ = this
|
|
20384
|
-
|
|
20548
|
+
var $$ = this;
|
|
20549
|
+
var mainCircles = element;
|
|
20550
|
+
|
|
20385
20551
|
// when '.load()' called, bubble size should be updated
|
|
20386
20552
|
if ($$.hasType("bubble")) {
|
|
20387
20553
|
mainCircles.attr("r", $$.pointR.bind($$));
|
|
@@ -20443,8 +20609,9 @@ var getTransitionName = function () {
|
|
|
20443
20609
|
* @private
|
|
20444
20610
|
*/
|
|
20445
20611
|
function getDataMax($$) {
|
|
20446
|
-
var levelMax = $$.config.polar_level_max
|
|
20447
|
-
|
|
20612
|
+
var levelMax = $$.config.polar_level_max;
|
|
20613
|
+
var dataMax = $$.getMinMaxData().max[0].value;
|
|
20614
|
+
|
|
20448
20615
|
// Apply level max only when is greater than the data max value
|
|
20449
20616
|
if (levelMax && levelMax > dataMax) {
|
|
20450
20617
|
dataMax = levelMax;
|
|
@@ -20828,9 +20995,9 @@ var cacheKey = KEY.radarPoints;
|
|
|
20828
20995
|
return "translate(" + posX + " " + posY + ")";
|
|
20829
20996
|
});
|
|
20830
20997
|
}
|
|
20831
|
-
$$.
|
|
20998
|
+
$$.bindRadarEvent();
|
|
20832
20999
|
},
|
|
20833
|
-
|
|
21000
|
+
bindRadarEvent: function bindRadarEvent() {
|
|
20834
21001
|
var _this9 = this,
|
|
20835
21002
|
$$ = this,
|
|
20836
21003
|
config = $$.config,
|
|
@@ -20922,6 +21089,271 @@ var cacheKey = KEY.radarPoints;
|
|
|
20922
21089
|
return this.cache.get(cacheKey)[d.id][d.index][1];
|
|
20923
21090
|
}
|
|
20924
21091
|
});
|
|
21092
|
+
// EXTERNAL MODULE: external {"commonjs":"d3-hierarchy","commonjs2":"d3-hierarchy","amd":"d3-hierarchy","root":"d3"}
|
|
21093
|
+
var external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_ = __webpack_require__(13);
|
|
21094
|
+
;// CONCATENATED MODULE: ./src/ChartInternal/shape/treemap.ts
|
|
21095
|
+
|
|
21096
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { done: !1, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21097
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21098
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21099
|
+
/**
|
|
21100
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
21101
|
+
* billboard.js project is licensed under the MIT license
|
|
21102
|
+
*/
|
|
21103
|
+
|
|
21104
|
+
|
|
21105
|
+
|
|
21106
|
+
|
|
21107
|
+
/**
|
|
21108
|
+
* Get treemap elements' position
|
|
21109
|
+
* @param {d3Selection} group Root selection
|
|
21110
|
+
* @param {object} root Root data
|
|
21111
|
+
* @private
|
|
21112
|
+
*/
|
|
21113
|
+
function position(group, root) {
|
|
21114
|
+
var _this = this,
|
|
21115
|
+
$$ = this,
|
|
21116
|
+
_$$$scale = $$.scale,
|
|
21117
|
+
x = _$$$scale.x,
|
|
21118
|
+
y = _$$$scale.y,
|
|
21119
|
+
width = $$.state.width;
|
|
21120
|
+
group.selectAll("g").attr("transform", function (d) {
|
|
21121
|
+
_newArrowCheck(this, _this);
|
|
21122
|
+
return "translate(" + (d === root ? "0,0" : x(d.x0) + "," + y(d.y0)) + ")";
|
|
21123
|
+
}.bind(this)).select("rect").attr("width", function (d) {
|
|
21124
|
+
_newArrowCheck(this, _this);
|
|
21125
|
+
return d === root ? width : x(d.x1) - x(d.x0);
|
|
21126
|
+
}.bind(this)).attr("height", function (d) {
|
|
21127
|
+
_newArrowCheck(this, _this);
|
|
21128
|
+
return d === root ? 0 : y(d.y1) - y(d.y0);
|
|
21129
|
+
}.bind(this));
|
|
21130
|
+
}
|
|
21131
|
+
|
|
21132
|
+
/**
|
|
21133
|
+
* Convert data for treemap hierarchy
|
|
21134
|
+
* @param {object} data Data object
|
|
21135
|
+
* @returns {Array} Array of data for treemap hierarchy
|
|
21136
|
+
* @private
|
|
21137
|
+
*/
|
|
21138
|
+
function convertDataToTreemapData(data) {
|
|
21139
|
+
var _this2 = this,
|
|
21140
|
+
$$ = this;
|
|
21141
|
+
return data.map(function (d) {
|
|
21142
|
+
_newArrowCheck(this, _this2);
|
|
21143
|
+
var id = d.id,
|
|
21144
|
+
values = d.values,
|
|
21145
|
+
value = values[0].value;
|
|
21146
|
+
return {
|
|
21147
|
+
name: id,
|
|
21148
|
+
id: id,
|
|
21149
|
+
// needed to keep compatibility on whole code logic
|
|
21150
|
+
value: value,
|
|
21151
|
+
ratio: $$.getRatio("treemap", values[0])
|
|
21152
|
+
};
|
|
21153
|
+
}.bind(this));
|
|
21154
|
+
}
|
|
21155
|
+
/* harmony default export */ var treemap = ({
|
|
21156
|
+
initTreemap: function initTreemap() {
|
|
21157
|
+
var _this3 = this,
|
|
21158
|
+
$$ = this,
|
|
21159
|
+
$el = $$.$el,
|
|
21160
|
+
_$$$state = $$.state,
|
|
21161
|
+
_$$$state$current = _$$$state.current,
|
|
21162
|
+
width = _$$$state$current.width,
|
|
21163
|
+
height = _$$$state$current.height,
|
|
21164
|
+
clip = _$$$state.clip,
|
|
21165
|
+
clipId = clip.id;
|
|
21166
|
+
$$.treemap = (0,external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemap)().tile($$.getTreemapTile());
|
|
21167
|
+
$$.treemapFn = function (data) {
|
|
21168
|
+
var _this4 = this;
|
|
21169
|
+
_newArrowCheck(this, _this3);
|
|
21170
|
+
var hierarchyData = (0,external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.hierarchy)(data).sum(function (d) {
|
|
21171
|
+
_newArrowCheck(this, _this4);
|
|
21172
|
+
return d.value;
|
|
21173
|
+
}.bind(this)),
|
|
21174
|
+
sortFn = $$.getSortCompareFn(!0);
|
|
21175
|
+
return $$.treemap(sortFn ? hierarchyData.sort(sortFn) : hierarchyData);
|
|
21176
|
+
}.bind(this);
|
|
21177
|
+
$el.defs.append("clipPath").attr("id", clipId).append("rect").attr("width", width).attr("height", height);
|
|
21178
|
+
$el.treemap = $el.main.select("." + $COMMON.chart).attr("clip-path", "url(#" + clipId + ")").append("g").classed($TREEMAP.chartTreemaps, !0);
|
|
21179
|
+
$$.bindTreemapEvent();
|
|
21180
|
+
},
|
|
21181
|
+
/**
|
|
21182
|
+
* Bind events
|
|
21183
|
+
* @private
|
|
21184
|
+
*/
|
|
21185
|
+
bindTreemapEvent: function bindTreemapEvent() {
|
|
21186
|
+
var _this5 = this,
|
|
21187
|
+
$$ = this,
|
|
21188
|
+
$el = $$.$el,
|
|
21189
|
+
config = $$.config,
|
|
21190
|
+
state = $$.state,
|
|
21191
|
+
getTarget = function (event) {
|
|
21192
|
+
var _state$eventReceiver$, _data;
|
|
21193
|
+
_newArrowCheck(this, _this5);
|
|
21194
|
+
var target = event.isTrusted ? event.target : (_state$eventReceiver$ = state.eventReceiver.rect) == null ? void 0 : _state$eventReceiver$.node(),
|
|
21195
|
+
data;
|
|
21196
|
+
if (/^rect$/i.test(target.tagName)) {
|
|
21197
|
+
state.event = event;
|
|
21198
|
+
data = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(target).datum();
|
|
21199
|
+
}
|
|
21200
|
+
return (_data = data) == null ? void 0 : _data.data;
|
|
21201
|
+
}.bind(this);
|
|
21202
|
+
if (config.interaction_enabled) {
|
|
21203
|
+
var isTouch = state.inputType === "touch";
|
|
21204
|
+
$el.treemap.on(isTouch ? "touchstart" : "mousemove", function (event) {
|
|
21205
|
+
_newArrowCheck(this, _this5);
|
|
21206
|
+
var data = getTarget(event);
|
|
21207
|
+
if (data) {
|
|
21208
|
+
$$.showTooltip([data], event.currentTarget);
|
|
21209
|
+
event.type === "mouseover" && $$.setOverOut(!0, data);
|
|
21210
|
+
}
|
|
21211
|
+
}.bind(this)).on(isTouch ? "touchend" : "mouseout", function (event) {
|
|
21212
|
+
_newArrowCheck(this, _this5);
|
|
21213
|
+
var data = getTarget(event);
|
|
21214
|
+
$$.hideTooltip();
|
|
21215
|
+
$$.setOverOut(!1, data);
|
|
21216
|
+
}.bind(this));
|
|
21217
|
+
}
|
|
21218
|
+
},
|
|
21219
|
+
/**
|
|
21220
|
+
* Get tiling function
|
|
21221
|
+
* @returns {Function}
|
|
21222
|
+
* @private
|
|
21223
|
+
*/
|
|
21224
|
+
getTreemapTile: function getTreemapTile() {
|
|
21225
|
+
var _binary$dice$slice$sl,
|
|
21226
|
+
_config$treemap_tile,
|
|
21227
|
+
$$ = this,
|
|
21228
|
+
config = $$.config,
|
|
21229
|
+
_$$$state$current2 = $$.state.current,
|
|
21230
|
+
width = _$$$state$current2.width,
|
|
21231
|
+
height = _$$$state$current2.height,
|
|
21232
|
+
tile = (_binary$dice$slice$sl = {
|
|
21233
|
+
"binary": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapBinary,
|
|
21234
|
+
"dice": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapDice,
|
|
21235
|
+
"slice": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapSlice,
|
|
21236
|
+
"sliceDice": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapSliceDice,
|
|
21237
|
+
"squarify": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapSquarify,
|
|
21238
|
+
"resquarify": external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapResquarify
|
|
21239
|
+
}[(_config$treemap_tile = config.treemap_tile) != null ? _config$treemap_tile : "binary"]) != null ? _binary$dice$slice$sl : external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemapBinary,
|
|
21240
|
+
_this6 = this;
|
|
21241
|
+
return function (node, x0, y0, x1, y1) {
|
|
21242
|
+
_newArrowCheck(this, _this6);
|
|
21243
|
+
tile(node, 0, 0, width, height);
|
|
21244
|
+
for (var _iterator = _createForOfIteratorHelperLoose(node.children), _step; !(_step = _iterator()).done;) {
|
|
21245
|
+
var child = _step.value;
|
|
21246
|
+
child.x0 = x0 + child.x0 / width * (x1 - x0);
|
|
21247
|
+
child.x1 = x0 + child.x1 / width * (x1 - x0);
|
|
21248
|
+
child.y0 = y0 + child.y0 / height * (y1 - y0);
|
|
21249
|
+
child.y1 = y0 + child.y1 / height * (y1 - y0);
|
|
21250
|
+
}
|
|
21251
|
+
}.bind(this);
|
|
21252
|
+
},
|
|
21253
|
+
/**
|
|
21254
|
+
* Get treemap hierarchy data
|
|
21255
|
+
* @param {Array} targets Data targets
|
|
21256
|
+
* @returns {object}
|
|
21257
|
+
* @private
|
|
21258
|
+
*/
|
|
21259
|
+
getTreemapData: function getTreemapData(targets) {
|
|
21260
|
+
var $$ = this;
|
|
21261
|
+
return {
|
|
21262
|
+
name: "root",
|
|
21263
|
+
children: convertDataToTreemapData.bind($$)($$.filterTargetsToShow(targets.filter($$.isTreemapType, $$)))
|
|
21264
|
+
};
|
|
21265
|
+
},
|
|
21266
|
+
/**
|
|
21267
|
+
* Update treemap data
|
|
21268
|
+
* @param {Array} targets Data targets
|
|
21269
|
+
* @private
|
|
21270
|
+
*/
|
|
21271
|
+
updateTargetsForTreemap: function updateTargetsForTreemap(targets) {
|
|
21272
|
+
var $$ = this,
|
|
21273
|
+
treemap = $$.$el.treemap,
|
|
21274
|
+
treemapData = $$.treemapFn($$.getTreemapData(targets != null ? targets : $$.data.targets));
|
|
21275
|
+
// using $el.treemap reference can alter data, so select treemap <g> again
|
|
21276
|
+
treemap.data(treemapData);
|
|
21277
|
+
},
|
|
21278
|
+
/**
|
|
21279
|
+
* Render treemap
|
|
21280
|
+
* @param {number} durationForExit Duration for exit transition
|
|
21281
|
+
* @private
|
|
21282
|
+
*/
|
|
21283
|
+
updateTreemap: function updateTreemap(durationForExit) {
|
|
21284
|
+
var _this7 = this,
|
|
21285
|
+
$$ = this,
|
|
21286
|
+
$el = $$.$el,
|
|
21287
|
+
$T = $$.$T,
|
|
21288
|
+
data = $el.treemap.datum(),
|
|
21289
|
+
classChartTreemap = $$.getChartClass("Treemap"),
|
|
21290
|
+
treemap = $el.treemap.selectAll("g").data(data.children);
|
|
21291
|
+
$T(treemap.exit(), durationForExit).style("opacity", "0").remove();
|
|
21292
|
+
treemap.enter().append("g").append("rect");
|
|
21293
|
+
$el.treemap.selectAll("g").attr("class", classChartTreemap).select("rect").attr("fill", function (d) {
|
|
21294
|
+
_newArrowCheck(this, _this7);
|
|
21295
|
+
return $$.color(d.data.name);
|
|
21296
|
+
}.bind(this));
|
|
21297
|
+
},
|
|
21298
|
+
/**
|
|
21299
|
+
* Generate treemap coordinate points data
|
|
21300
|
+
* @returns {Array} Array of coordinate points
|
|
21301
|
+
* @private
|
|
21302
|
+
*/
|
|
21303
|
+
generateGetTreemapPoints: function generateGetTreemapPoints() {
|
|
21304
|
+
var _this8 = this,
|
|
21305
|
+
$$ = this,
|
|
21306
|
+
$el = $$.$el,
|
|
21307
|
+
_$$$scale2 = $$.scale,
|
|
21308
|
+
x = _$$$scale2.x,
|
|
21309
|
+
y = _$$$scale2.y,
|
|
21310
|
+
points = {};
|
|
21311
|
+
$el.treemap.selectAll("g").each(function (d) {
|
|
21312
|
+
_newArrowCheck(this, _this8);
|
|
21313
|
+
points[d.data.name] = [[x(d.x0), y(d.y0)], [x(d.x1), y(d.y1)]];
|
|
21314
|
+
}.bind(this));
|
|
21315
|
+
return function (d) {
|
|
21316
|
+
_newArrowCheck(this, _this8);
|
|
21317
|
+
return points[d.id];
|
|
21318
|
+
}.bind(this);
|
|
21319
|
+
},
|
|
21320
|
+
/**
|
|
21321
|
+
* Redraw treemap
|
|
21322
|
+
* @param {boolean} withTransition With or without transition
|
|
21323
|
+
* @returns {Array} Selections
|
|
21324
|
+
* @private
|
|
21325
|
+
*/
|
|
21326
|
+
redrawTreemap: function redrawTreemap(withTransition) {
|
|
21327
|
+
var $$ = this,
|
|
21328
|
+
$el = $$.$el,
|
|
21329
|
+
_$$$state$current3 = $$.state.current,
|
|
21330
|
+
width = _$$$state$current3.width,
|
|
21331
|
+
height = _$$$state$current3.height;
|
|
21332
|
+
// update defs
|
|
21333
|
+
$el.defs.select("rect").attr("width", width).attr("height", height);
|
|
21334
|
+
return [$$.$T($el.treemap, withTransition, getRandom()).call(position.bind($$), $el.treemap.datum())];
|
|
21335
|
+
},
|
|
21336
|
+
/**
|
|
21337
|
+
* Get treemap data label format function
|
|
21338
|
+
* @param {object} d Data object
|
|
21339
|
+
* @returns {Function}
|
|
21340
|
+
* @private
|
|
21341
|
+
*/
|
|
21342
|
+
treemapDataLabelFormat: function treemapDataLabelFormat(d) {
|
|
21343
|
+
var $$ = this,
|
|
21344
|
+
config = $$.config,
|
|
21345
|
+
id = d.id,
|
|
21346
|
+
value = d.value,
|
|
21347
|
+
format = config.treemap_label_format,
|
|
21348
|
+
ratio = $$.getRatio("treemap", d),
|
|
21349
|
+
percentValue = (ratio * 100).toFixed(2),
|
|
21350
|
+
meetLabelThreshold = config.treemap_label_show && $$.meetsLabelThreshold(ratio, "treemap") ? null : "0";
|
|
21351
|
+
return function (node) {
|
|
21352
|
+
node.style("opacity", meetLabelThreshold);
|
|
21353
|
+
return isFunction(format) ? format.bind($$.api)(value, ratio, id) : id + "\n" + percentValue + "%";
|
|
21354
|
+
};
|
|
21355
|
+
}
|
|
21356
|
+
});
|
|
20925
21357
|
;// CONCATENATED MODULE: ./src/config/Options/common/point.ts
|
|
20926
21358
|
/**
|
|
20927
21359
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -21417,7 +21849,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
21417
21849
|
* billboard.js project is licensed under the MIT license
|
|
21418
21850
|
*/
|
|
21419
21851
|
/**
|
|
21420
|
-
*
|
|
21852
|
+
* spline config options
|
|
21421
21853
|
*/
|
|
21422
21854
|
/* harmony default export */ var spline = ({
|
|
21423
21855
|
/**
|
|
@@ -21463,7 +21895,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
21463
21895
|
* billboard.js project is licensed under the MIT license
|
|
21464
21896
|
*/
|
|
21465
21897
|
/**
|
|
21466
|
-
*
|
|
21898
|
+
* arc config options
|
|
21467
21899
|
*/
|
|
21468
21900
|
/* harmony default export */ var shape_arc = ({
|
|
21469
21901
|
/**
|
|
@@ -21714,7 +22146,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
21714
22146
|
* billboard.js project is licensed under the MIT license
|
|
21715
22147
|
*/
|
|
21716
22148
|
/**
|
|
21717
|
-
*
|
|
22149
|
+
* pie config options
|
|
21718
22150
|
*/
|
|
21719
22151
|
/* harmony default export */ var pie = ({
|
|
21720
22152
|
/**
|
|
@@ -21816,7 +22248,7 @@ var polar_this = undefined;
|
|
|
21816
22248
|
* billboard.js project is licensed under the MIT license
|
|
21817
22249
|
*/
|
|
21818
22250
|
/**
|
|
21819
|
-
*
|
|
22251
|
+
* polar config options
|
|
21820
22252
|
*/
|
|
21821
22253
|
/* harmony default export */ var shape_polar = ({
|
|
21822
22254
|
/**
|
|
@@ -21903,7 +22335,7 @@ var radar_this = undefined;
|
|
|
21903
22335
|
* billboard.js project is licensed under the MIT license
|
|
21904
22336
|
*/
|
|
21905
22337
|
/**
|
|
21906
|
-
*
|
|
22338
|
+
* radar config options
|
|
21907
22339
|
*/
|
|
21908
22340
|
/* harmony default export */ var shape_radar = ({
|
|
21909
22341
|
/**
|
|
@@ -21976,6 +22408,60 @@ var radar_this = undefined;
|
|
|
21976
22408
|
radar_size_ratio: .87,
|
|
21977
22409
|
radar_direction_clockwise: !1
|
|
21978
22410
|
});
|
|
22411
|
+
;// CONCATENATED MODULE: ./src/config/Options/shape/treemap.ts
|
|
22412
|
+
/**
|
|
22413
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
22414
|
+
* billboard.js project is licensed under the MIT license
|
|
22415
|
+
*/
|
|
22416
|
+
/**
|
|
22417
|
+
* treemap config options
|
|
22418
|
+
*/
|
|
22419
|
+
/* harmony default export */ var shape_treemap = ({
|
|
22420
|
+
/**
|
|
22421
|
+
* Set treemap options
|
|
22422
|
+
* @name treemap
|
|
22423
|
+
* @memberof Options
|
|
22424
|
+
* @type {object}
|
|
22425
|
+
* @property {object} treemap Treemap object
|
|
22426
|
+
* @property {string} [treemap.tile="binary"] Treemap tile type
|
|
22427
|
+
* - **Available tile type values:**
|
|
22428
|
+
* - binary ([d3.treemapBinary](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapBinary))
|
|
22429
|
+
* - dice ([d3.treemapDice](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapDice))
|
|
22430
|
+
* - slice ([d3.treemapSlice](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapSlice))
|
|
22431
|
+
* - sliceDice ([d3.treemapSliceDice](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapSliceDice))
|
|
22432
|
+
* - squrify ([d3.treemapSquarify](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapSquarify))
|
|
22433
|
+
* - resquarify ([d3.treemapResquarify](https://github.com/d3/d3-hierarchy/blob/main/README.md#treemapResquarify))
|
|
22434
|
+
* @property {Function} [treemap.label.format] Set formatter for the label text.
|
|
22435
|
+
* @property {number} [treemap.label.threshold=0.05] Set threshold ratio to show/hide labels text.
|
|
22436
|
+
* @property {number} [treemap.label.show=true] Show or hide label text.
|
|
22437
|
+
* @see [Demo: treemap](https://naver.github.io/billboard.js/demo/#Chart.TreemapChart)
|
|
22438
|
+
* @example
|
|
22439
|
+
* treemap: {
|
|
22440
|
+
* // "binary", "dice", "slice", "sliceDice", "squrify", "resquarify"
|
|
22441
|
+
* tile: "dice",
|
|
22442
|
+
*
|
|
22443
|
+
* label: {
|
|
22444
|
+
* // show or hide label text
|
|
22445
|
+
* show: false,
|
|
22446
|
+
*
|
|
22447
|
+
* // set label text formatter
|
|
22448
|
+
* format: function(value, ratio, id) {
|
|
22449
|
+
* return d3.format("$")(value);
|
|
22450
|
+
*
|
|
22451
|
+
* // to multiline, return with '\n' character
|
|
22452
|
+
* // return value +"%\nLine1\n2Line2";
|
|
22453
|
+
* },
|
|
22454
|
+
*
|
|
22455
|
+
* // set ratio number
|
|
22456
|
+
* ratio: 0.05
|
|
22457
|
+
* }
|
|
22458
|
+
* }
|
|
22459
|
+
*/
|
|
22460
|
+
treemap_tile: "binary",
|
|
22461
|
+
treemap_label_format: undefined,
|
|
22462
|
+
treemap_label_threshold: .05,
|
|
22463
|
+
treemap_label_show: !0
|
|
22464
|
+
});
|
|
21979
22465
|
;// CONCATENATED MODULE: ./src/config/resolver/shape.ts
|
|
21980
22466
|
|
|
21981
22467
|
var shape_this = undefined;
|
|
@@ -22004,6 +22490,7 @@ var shape_this = undefined;
|
|
|
22004
22490
|
|
|
22005
22491
|
|
|
22006
22492
|
|
|
22493
|
+
|
|
22007
22494
|
// Options
|
|
22008
22495
|
|
|
22009
22496
|
|
|
@@ -22023,6 +22510,7 @@ var shape_this = undefined;
|
|
|
22023
22510
|
|
|
22024
22511
|
|
|
22025
22512
|
|
|
22513
|
+
|
|
22026
22514
|
/**
|
|
22027
22515
|
* Extend Axis
|
|
22028
22516
|
* @param {Array} module Module to be extended
|
|
@@ -22193,6 +22681,14 @@ var _area = function area() {
|
|
|
22193
22681
|
_newArrowCheck(this, _this18);
|
|
22194
22682
|
return TYPE.SCATTER;
|
|
22195
22683
|
}.bind(this))();
|
|
22684
|
+
}.bind(undefined),
|
|
22685
|
+
resolver_shape_treemap = function () {
|
|
22686
|
+
var _this19 = this;
|
|
22687
|
+
_newArrowCheck(this, shape_this);
|
|
22688
|
+
return extendAxis([treemap], [shape_treemap]), (resolver_shape_treemap = function () {
|
|
22689
|
+
_newArrowCheck(this, _this19);
|
|
22690
|
+
return TYPE.TREEMAP;
|
|
22691
|
+
}.bind(this))();
|
|
22196
22692
|
}.bind(undefined);
|
|
22197
22693
|
;// CONCATENATED MODULE: ./src/Chart/api/selection.ts
|
|
22198
22694
|
|
|
@@ -22418,7 +22914,7 @@ var _area = function area() {
|
|
|
22418
22914
|
}
|
|
22419
22915
|
});
|
|
22420
22916
|
// EXTERNAL MODULE: external {"commonjs":"d3-zoom","commonjs2":"d3-zoom","amd":"d3-zoom","root":"d3"}
|
|
22421
|
-
var external_commonjs_d3_zoom_commonjs2_d3_zoom_amd_d3_zoom_root_d3_ = __webpack_require__(
|
|
22917
|
+
var external_commonjs_d3_zoom_commonjs2_d3_zoom_amd_d3_zoom_root_d3_ = __webpack_require__(14);
|
|
22422
22918
|
;// CONCATENATED MODULE: ./src/Chart/api/zoom.ts
|
|
22423
22919
|
|
|
22424
22920
|
/**
|
|
@@ -22704,8 +23200,8 @@ extend(zoom, {
|
|
|
22704
23200
|
}.bind(this)).each(function (d, i) {
|
|
22705
23201
|
var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
22706
23202
|
isSelected = shape.classed($SELECT.SELECTED),
|
|
22707
|
-
isIncluded = shape.classed($DRAG.INCLUDED)
|
|
22708
|
-
|
|
23203
|
+
isIncluded = shape.classed($DRAG.INCLUDED);
|
|
23204
|
+
var isWithin = !1,
|
|
22709
23205
|
toggle;
|
|
22710
23206
|
if (shape.classed($CIRCLE.circle)) {
|
|
22711
23207
|
var x = +shape.attr("cx") * 1,
|
|
@@ -22911,8 +23407,8 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
22911
23407
|
if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
|
|
22912
23408
|
var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(that),
|
|
22913
23409
|
isSelected = shape.classed($SELECT.SELECTED),
|
|
22914
|
-
toggle = $$.getToggle(that, d).bind($$)
|
|
22915
|
-
|
|
23410
|
+
toggle = $$.getToggle(that, d).bind($$);
|
|
23411
|
+
var toggledShape;
|
|
22916
23412
|
if (!config.data_selection_multiple) {
|
|
22917
23413
|
var selector = "." + $SHAPE.shapes;
|
|
22918
23414
|
if (config.data_selection_grouped) {
|
|
@@ -23985,147 +24481,148 @@ var _selectionModule = function selectionModule() {
|
|
|
23985
24481
|
|
|
23986
24482
|
// eslint-disable-next-line no-use-before-define
|
|
23987
24483
|
|
|
23988
|
-
var _defaults = {}
|
|
23989
|
-
|
|
23990
|
-
/**
|
|
23991
|
-
* Version information
|
|
23992
|
-
* @property {string} version version
|
|
23993
|
-
* @example
|
|
23994
|
-
* bb.version; // "1.0.0"
|
|
23995
|
-
* @memberof bb
|
|
23996
|
-
*/
|
|
23997
|
-
version: "3.7.0-next.1",
|
|
23998
|
-
/**
|
|
23999
|
-
* Generate chart
|
|
24000
|
-
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
|
24001
|
-
* - Unused option value is given.
|
|
24002
|
-
* - ex) For `data.type="pie"` option, setting 'axis' option can cause unexpected generation error.
|
|
24003
|
-
* - Insufficient value is given for certain option used.
|
|
24004
|
-
* - ex) `data: { x: "x", columns: [["x"], ["data1", 30, 200, 100]] }`
|
|
24005
|
-
* @param {Options} config chart options
|
|
24006
|
-
* @memberof bb
|
|
24007
|
-
* @returns {Chart}
|
|
24008
|
-
* @see {@link Options} for different generation options
|
|
24009
|
-
* @see {@link Chart} for different methods API
|
|
24010
|
-
* @example
|
|
24011
|
-
* <!-- chart holder -->
|
|
24012
|
-
* <div id="LineChart"></div>
|
|
24013
|
-
* @example
|
|
24014
|
-
* // Generate chart with options
|
|
24015
|
-
* var chart = bb.generate({
|
|
24016
|
-
* "bindto": "#LineChart"
|
|
24017
|
-
* "data": {
|
|
24018
|
-
* "columns": [
|
|
24019
|
-
* ["data1", 30, 200, 100, 400, 150, 250],
|
|
24020
|
-
* ["data2", 50, 20, 10, 40, 15, 25]
|
|
24021
|
-
* ],
|
|
24022
|
-
* "type": "line"
|
|
24023
|
-
* }
|
|
24024
|
-
* });
|
|
24025
|
-
*
|
|
24026
|
-
* // call some API
|
|
24027
|
-
* // ex) get the data of 'data1'
|
|
24028
|
-
* chart.data("data1");
|
|
24029
|
-
* @example
|
|
24030
|
-
* // Generate chart by importing ESM
|
|
24031
|
-
* // Import types to be used only, where this will make smaller bundle size.
|
|
24032
|
-
* import bb, {
|
|
24033
|
-
* area,
|
|
24034
|
-
* areaLineRange,
|
|
24035
|
-
* areaSpline,
|
|
24036
|
-
* areaSplineRange,
|
|
24037
|
-
* areaStep,
|
|
24038
|
-
* bar,
|
|
24039
|
-
* bubble,
|
|
24040
|
-
* donut,
|
|
24041
|
-
* gauge,
|
|
24042
|
-
* line,
|
|
24043
|
-
* pie,
|
|
24044
|
-
* polar,
|
|
24045
|
-
* radar,
|
|
24046
|
-
* scatter,
|
|
24047
|
-
* spline,
|
|
24048
|
-
* step
|
|
24049
|
-
* }
|
|
24050
|
-
*
|
|
24051
|
-
* bb.generate({
|
|
24052
|
-
* "bindto": "#LineChart"
|
|
24053
|
-
* "data": {
|
|
24054
|
-
* "columns": [
|
|
24055
|
-
* ["data1", 30, 200, 100, 400, 150, 250],
|
|
24056
|
-
* ["data2", 50, 20, 10, 40, 15, 25]
|
|
24057
|
-
* ]
|
|
24058
|
-
* },
|
|
24059
|
-
* type: line(),
|
|
24060
|
-
*
|
|
24061
|
-
* // or
|
|
24062
|
-
* types: {
|
|
24063
|
-
* data1: bar(),
|
|
24064
|
-
* data2: step()
|
|
24065
|
-
* }
|
|
24066
|
-
* });
|
|
24067
|
-
*/
|
|
24068
|
-
generate: function generate(config) {
|
|
24069
|
-
var options = mergeObj({}, _defaults, config),
|
|
24070
|
-
inst = new Chart(options);
|
|
24071
|
-
inst.internal.charts = this.instance;
|
|
24072
|
-
this.instance.push(inst);
|
|
24073
|
-
return inst;
|
|
24074
|
-
},
|
|
24075
|
-
/**
|
|
24076
|
-
* Set or get global default options.
|
|
24077
|
-
* - **NOTE:**
|
|
24078
|
-
* - The options values settings are valid within page context only.
|
|
24079
|
-
* - If is called multiple times, will override the last value.
|
|
24080
|
-
* @param {Options} options chart options
|
|
24081
|
-
* @memberof bb
|
|
24082
|
-
* @returns {Options}
|
|
24083
|
-
* @see {@link Options}
|
|
24084
|
-
* @example
|
|
24085
|
-
* // Set same option value as for `.generate()`
|
|
24086
|
-
* bb.defaults({
|
|
24087
|
-
* data: {
|
|
24088
|
-
* type: "bar"
|
|
24089
|
-
* }
|
|
24090
|
-
* });
|
|
24091
|
-
*
|
|
24092
|
-
* bb.defaults(); // {data:{type: "bar"}}
|
|
24093
|
-
*
|
|
24094
|
-
* // data.type defaults to 'bar'
|
|
24095
|
-
* var chart = bb.generate({ ... });
|
|
24096
|
-
*/
|
|
24097
|
-
defaults: function defaults(options) {
|
|
24098
|
-
if (isObject(options)) {
|
|
24099
|
-
_defaults = options;
|
|
24100
|
-
}
|
|
24101
|
-
return _defaults;
|
|
24102
|
-
},
|
|
24103
|
-
/**
|
|
24104
|
-
* An array containing instance created
|
|
24105
|
-
* @property {Array} instance instance array
|
|
24106
|
-
* @example
|
|
24107
|
-
* // generate charts
|
|
24108
|
-
* var chart1 = bb.generate(...);
|
|
24109
|
-
* var chart2 = bb.generate(...);
|
|
24110
|
-
*
|
|
24111
|
-
* bb.instance; // [ chart1, chart2, ... ]
|
|
24112
|
-
* @memberof bb
|
|
24113
|
-
*/
|
|
24114
|
-
instance: [],
|
|
24115
|
-
/**
|
|
24116
|
-
* Namespace for plugins
|
|
24117
|
-
* @property {object} plugin plugin namespace
|
|
24118
|
-
* @example
|
|
24119
|
-
* // Stanford diagram plugin
|
|
24120
|
-
* bb.plugin.stanford;
|
|
24121
|
-
* @memberof bb
|
|
24122
|
-
*/
|
|
24123
|
-
plugin: {}
|
|
24124
|
-
};
|
|
24484
|
+
var _defaults = {};
|
|
24485
|
+
|
|
24125
24486
|
/**
|
|
24126
24487
|
* @namespace bb
|
|
24127
|
-
* @version 3.7.0-next.
|
|
24488
|
+
* @version 3.7.0-next.2
|
|
24128
24489
|
*/
|
|
24490
|
+
var bb = {
|
|
24491
|
+
/**
|
|
24492
|
+
* Version information
|
|
24493
|
+
* @property {string} version version
|
|
24494
|
+
* @example
|
|
24495
|
+
* bb.version; // "1.0.0"
|
|
24496
|
+
* @memberof bb
|
|
24497
|
+
*/
|
|
24498
|
+
version: "3.7.0-next.2",
|
|
24499
|
+
/**
|
|
24500
|
+
* Generate chart
|
|
24501
|
+
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
|
24502
|
+
* - Unused option value is given.
|
|
24503
|
+
* - ex) For `data.type="pie"` option, setting 'axis' option can cause unexpected generation error.
|
|
24504
|
+
* - Insufficient value is given for certain option used.
|
|
24505
|
+
* - ex) `data: { x: "x", columns: [["x"], ["data1", 30, 200, 100]] }`
|
|
24506
|
+
* @param {Options} config chart options
|
|
24507
|
+
* @memberof bb
|
|
24508
|
+
* @returns {Chart}
|
|
24509
|
+
* @see {@link Options} for different generation options
|
|
24510
|
+
* @see {@link Chart} for different methods API
|
|
24511
|
+
* @example
|
|
24512
|
+
* <!-- chart holder -->
|
|
24513
|
+
* <div id="LineChart"></div>
|
|
24514
|
+
* @example
|
|
24515
|
+
* // Generate chart with options
|
|
24516
|
+
* var chart = bb.generate({
|
|
24517
|
+
* "bindto": "#LineChart"
|
|
24518
|
+
* "data": {
|
|
24519
|
+
* "columns": [
|
|
24520
|
+
* ["data1", 30, 200, 100, 400, 150, 250],
|
|
24521
|
+
* ["data2", 50, 20, 10, 40, 15, 25]
|
|
24522
|
+
* ],
|
|
24523
|
+
* "type": "line"
|
|
24524
|
+
* }
|
|
24525
|
+
* });
|
|
24526
|
+
*
|
|
24527
|
+
* // call some API
|
|
24528
|
+
* // ex) get the data of 'data1'
|
|
24529
|
+
* chart.data("data1");
|
|
24530
|
+
* @example
|
|
24531
|
+
* // Generate chart by importing ESM
|
|
24532
|
+
* // Import types to be used only, where this will make smaller bundle size.
|
|
24533
|
+
* import bb, {
|
|
24534
|
+
* area,
|
|
24535
|
+
* areaLineRange,
|
|
24536
|
+
* areaSpline,
|
|
24537
|
+
* areaSplineRange,
|
|
24538
|
+
* areaStep,
|
|
24539
|
+
* bar,
|
|
24540
|
+
* bubble,
|
|
24541
|
+
* donut,
|
|
24542
|
+
* gauge,
|
|
24543
|
+
* line,
|
|
24544
|
+
* pie,
|
|
24545
|
+
* polar,
|
|
24546
|
+
* radar,
|
|
24547
|
+
* scatter,
|
|
24548
|
+
* spline,
|
|
24549
|
+
* step
|
|
24550
|
+
* }
|
|
24551
|
+
*
|
|
24552
|
+
* bb.generate({
|
|
24553
|
+
* "bindto": "#LineChart"
|
|
24554
|
+
* "data": {
|
|
24555
|
+
* "columns": [
|
|
24556
|
+
* ["data1", 30, 200, 100, 400, 150, 250],
|
|
24557
|
+
* ["data2", 50, 20, 10, 40, 15, 25]
|
|
24558
|
+
* ]
|
|
24559
|
+
* },
|
|
24560
|
+
* type: line(),
|
|
24561
|
+
*
|
|
24562
|
+
* // or
|
|
24563
|
+
* types: {
|
|
24564
|
+
* data1: bar(),
|
|
24565
|
+
* data2: step()
|
|
24566
|
+
* }
|
|
24567
|
+
* });
|
|
24568
|
+
*/
|
|
24569
|
+
generate: function generate(config) {
|
|
24570
|
+
var options = mergeObj({}, _defaults, config),
|
|
24571
|
+
inst = new Chart(options);
|
|
24572
|
+
inst.internal.charts = this.instance;
|
|
24573
|
+
this.instance.push(inst);
|
|
24574
|
+
return inst;
|
|
24575
|
+
},
|
|
24576
|
+
/**
|
|
24577
|
+
* Set or get global default options.
|
|
24578
|
+
* - **NOTE:**
|
|
24579
|
+
* - The options values settings are valid within page context only.
|
|
24580
|
+
* - If is called multiple times, will override the last value.
|
|
24581
|
+
* @param {Options} options chart options
|
|
24582
|
+
* @memberof bb
|
|
24583
|
+
* @returns {Options}
|
|
24584
|
+
* @see {@link Options}
|
|
24585
|
+
* @example
|
|
24586
|
+
* // Set same option value as for `.generate()`
|
|
24587
|
+
* bb.defaults({
|
|
24588
|
+
* data: {
|
|
24589
|
+
* type: "bar"
|
|
24590
|
+
* }
|
|
24591
|
+
* });
|
|
24592
|
+
*
|
|
24593
|
+
* bb.defaults(); // {data:{type: "bar"}}
|
|
24594
|
+
*
|
|
24595
|
+
* // data.type defaults to 'bar'
|
|
24596
|
+
* var chart = bb.generate({ ... });
|
|
24597
|
+
*/
|
|
24598
|
+
defaults: function defaults(options) {
|
|
24599
|
+
if (isObject(options)) {
|
|
24600
|
+
_defaults = options;
|
|
24601
|
+
}
|
|
24602
|
+
return _defaults;
|
|
24603
|
+
},
|
|
24604
|
+
/**
|
|
24605
|
+
* An array containing instance created
|
|
24606
|
+
* @property {Array} instance instance array
|
|
24607
|
+
* @example
|
|
24608
|
+
* // generate charts
|
|
24609
|
+
* var chart1 = bb.generate(...);
|
|
24610
|
+
* var chart2 = bb.generate(...);
|
|
24611
|
+
*
|
|
24612
|
+
* bb.instance; // [ chart1, chart2, ... ]
|
|
24613
|
+
* @memberof bb
|
|
24614
|
+
*/
|
|
24615
|
+
instance: [],
|
|
24616
|
+
/**
|
|
24617
|
+
* Namespace for plugins
|
|
24618
|
+
* @property {object} plugin plugin namespace
|
|
24619
|
+
* @example
|
|
24620
|
+
* // Stanford diagram plugin
|
|
24621
|
+
* bb.plugin.stanford;
|
|
24622
|
+
* @memberof bb
|
|
24623
|
+
*/
|
|
24624
|
+
plugin: {}
|
|
24625
|
+
};
|
|
24129
24626
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
24130
24627
|
|
|
24131
24628
|
var src_this = undefined;
|