billboard.js 3.12.0-next.3 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +15 -24
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +8 -8
- package/dist/billboard.pkgd.js +182 -191
- package/dist/billboard.pkgd.min.js +7 -7
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +21 -24
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +1 -1
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/shape/treemap.ts +20 -11
- package/src/config/Options/axis/y2.ts +0 -13
package/dist/billboard.pkgd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.12.
|
|
8
|
+
* @version 3.12.1
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.0
|
|
@@ -34295,7 +34295,7 @@ class ChartInternal {
|
|
|
34295
34295
|
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || ((_a = $$.hasLegendDefsPoint) == null ? void 0 : _a.call($$))) {
|
|
34296
34296
|
$el.defs = $el.svg.append("defs");
|
|
34297
34297
|
if (hasAxis) {
|
|
34298
|
-
["id", "idXAxis", "idYAxis", "
|
|
34298
|
+
["id", "idXAxis", "idYAxis", "idGrid"].forEach((v) => {
|
|
34299
34299
|
$$.appendClip($el.defs, state.clip[v]);
|
|
34300
34300
|
});
|
|
34301
34301
|
}
|
|
@@ -42493,18 +42493,6 @@ function smoothLines(el, type) {
|
|
|
42493
42493
|
|
|
42494
42494
|
;// CONCATENATED MODULE: ./src/config/Options/axis/y2.ts
|
|
42495
42495
|
/* harmony default export */ var y2 = ({
|
|
42496
|
-
/**
|
|
42497
|
-
* Set clip-path attribute for y2 axis element
|
|
42498
|
-
* - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
|
|
42499
|
-
* @name axis․y2․clipPath
|
|
42500
|
-
* @memberof Options
|
|
42501
|
-
* @type {boolean}
|
|
42502
|
-
* @default true
|
|
42503
|
-
* @example
|
|
42504
|
-
* // don't set 'clip-path' attribute
|
|
42505
|
-
* clipPath: false
|
|
42506
|
-
*/
|
|
42507
|
-
axis_y2_clipPath: true,
|
|
42508
42496
|
/**
|
|
42509
42497
|
* Show or hide y2 axis.
|
|
42510
42498
|
* - **NOTE**:
|
|
@@ -46539,173 +46527,6 @@ const cacheKeyTextWidth = KEY.radarTextWidth;
|
|
|
46539
46527
|
}
|
|
46540
46528
|
});
|
|
46541
46529
|
|
|
46542
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/round.js
|
|
46543
|
-
/* harmony default export */ function treemap_round(node) {
|
|
46544
|
-
node.x0 = Math.round(node.x0);
|
|
46545
|
-
node.y0 = Math.round(node.y0);
|
|
46546
|
-
node.x1 = Math.round(node.x1);
|
|
46547
|
-
node.y1 = Math.round(node.y1);
|
|
46548
|
-
}
|
|
46549
|
-
|
|
46550
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/dice.js
|
|
46551
|
-
/* harmony default export */ function dice(parent, x0, y0, x1, y1) {
|
|
46552
|
-
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
|
|
46553
|
-
while (++i < n) {
|
|
46554
|
-
node = nodes[i], node.y0 = y0, node.y1 = y1;
|
|
46555
|
-
node.x0 = x0, node.x1 = x0 += node.value * k;
|
|
46556
|
-
}
|
|
46557
|
-
}
|
|
46558
|
-
|
|
46559
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/slice.js
|
|
46560
|
-
/* harmony default export */ function treemap_slice(parent, x0, y0, x1, y1) {
|
|
46561
|
-
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
|
|
46562
|
-
while (++i < n) {
|
|
46563
|
-
node = nodes[i], node.x0 = x0, node.x1 = x1;
|
|
46564
|
-
node.y0 = y0, node.y1 = y0 += node.value * k;
|
|
46565
|
-
}
|
|
46566
|
-
}
|
|
46567
|
-
|
|
46568
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/squarify.js
|
|
46569
|
-
|
|
46570
|
-
|
|
46571
|
-
var phi = (1 + Math.sqrt(5)) / 2;
|
|
46572
|
-
function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
|
|
46573
|
-
var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
|
|
46574
|
-
while (i0 < n) {
|
|
46575
|
-
dx = x1 - x0, dy = y1 - y0;
|
|
46576
|
-
do
|
|
46577
|
-
sumValue = nodes[i1++].value;
|
|
46578
|
-
while (!sumValue && i1 < n);
|
|
46579
|
-
minValue = maxValue = sumValue;
|
|
46580
|
-
alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
|
|
46581
|
-
beta = sumValue * sumValue * alpha;
|
|
46582
|
-
minRatio = Math.max(maxValue / beta, beta / minValue);
|
|
46583
|
-
for (; i1 < n; ++i1) {
|
|
46584
|
-
sumValue += nodeValue = nodes[i1].value;
|
|
46585
|
-
if (nodeValue < minValue)
|
|
46586
|
-
minValue = nodeValue;
|
|
46587
|
-
if (nodeValue > maxValue)
|
|
46588
|
-
maxValue = nodeValue;
|
|
46589
|
-
beta = sumValue * sumValue * alpha;
|
|
46590
|
-
newRatio = Math.max(maxValue / beta, beta / minValue);
|
|
46591
|
-
if (newRatio > minRatio) {
|
|
46592
|
-
sumValue -= nodeValue;
|
|
46593
|
-
break;
|
|
46594
|
-
}
|
|
46595
|
-
minRatio = newRatio;
|
|
46596
|
-
}
|
|
46597
|
-
rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
|
|
46598
|
-
if (row.dice)
|
|
46599
|
-
dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
|
|
46600
|
-
else
|
|
46601
|
-
treemap_slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
|
|
46602
|
-
value -= sumValue, i0 = i1;
|
|
46603
|
-
}
|
|
46604
|
-
return rows;
|
|
46605
|
-
}
|
|
46606
|
-
/* harmony default export */ var squarify = ((function custom(ratio) {
|
|
46607
|
-
function squarify(parent, x0, y0, x1, y1) {
|
|
46608
|
-
squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
46609
|
-
}
|
|
46610
|
-
squarify.ratio = function(x) {
|
|
46611
|
-
return custom((x = +x) > 1 ? x : 1);
|
|
46612
|
-
};
|
|
46613
|
-
return squarify;
|
|
46614
|
-
})(phi));
|
|
46615
|
-
|
|
46616
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/accessors.js
|
|
46617
|
-
function optional(f) {
|
|
46618
|
-
return f == null ? null : required(f);
|
|
46619
|
-
}
|
|
46620
|
-
function required(f) {
|
|
46621
|
-
if (typeof f !== "function")
|
|
46622
|
-
throw new Error();
|
|
46623
|
-
return f;
|
|
46624
|
-
}
|
|
46625
|
-
|
|
46626
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/constant.js
|
|
46627
|
-
function constantZero() {
|
|
46628
|
-
return 0;
|
|
46629
|
-
}
|
|
46630
|
-
/* harmony default export */ function d3_hierarchy_src_constant(x) {
|
|
46631
|
-
return function() {
|
|
46632
|
-
return x;
|
|
46633
|
-
};
|
|
46634
|
-
}
|
|
46635
|
-
|
|
46636
|
-
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/index.js
|
|
46637
|
-
|
|
46638
|
-
|
|
46639
|
-
|
|
46640
|
-
|
|
46641
|
-
/* harmony default export */ function treemap() {
|
|
46642
|
-
var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
|
|
46643
|
-
function treemap(root) {
|
|
46644
|
-
root.x0 = root.y0 = 0;
|
|
46645
|
-
root.x1 = dx;
|
|
46646
|
-
root.y1 = dy;
|
|
46647
|
-
root.eachBefore(positionNode);
|
|
46648
|
-
paddingStack = [0];
|
|
46649
|
-
if (round)
|
|
46650
|
-
root.eachBefore(treemap_round);
|
|
46651
|
-
return root;
|
|
46652
|
-
}
|
|
46653
|
-
function positionNode(node) {
|
|
46654
|
-
var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
|
|
46655
|
-
if (x1 < x0)
|
|
46656
|
-
x0 = x1 = (x0 + x1) / 2;
|
|
46657
|
-
if (y1 < y0)
|
|
46658
|
-
y0 = y1 = (y0 + y1) / 2;
|
|
46659
|
-
node.x0 = x0;
|
|
46660
|
-
node.y0 = y0;
|
|
46661
|
-
node.x1 = x1;
|
|
46662
|
-
node.y1 = y1;
|
|
46663
|
-
if (node.children) {
|
|
46664
|
-
p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
|
|
46665
|
-
x0 += paddingLeft(node) - p;
|
|
46666
|
-
y0 += paddingTop(node) - p;
|
|
46667
|
-
x1 -= paddingRight(node) - p;
|
|
46668
|
-
y1 -= paddingBottom(node) - p;
|
|
46669
|
-
if (x1 < x0)
|
|
46670
|
-
x0 = x1 = (x0 + x1) / 2;
|
|
46671
|
-
if (y1 < y0)
|
|
46672
|
-
y0 = y1 = (y0 + y1) / 2;
|
|
46673
|
-
tile(node, x0, y0, x1, y1);
|
|
46674
|
-
}
|
|
46675
|
-
}
|
|
46676
|
-
treemap.round = function(x) {
|
|
46677
|
-
return arguments.length ? (round = !!x, treemap) : round;
|
|
46678
|
-
};
|
|
46679
|
-
treemap.size = function(x) {
|
|
46680
|
-
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
|
|
46681
|
-
};
|
|
46682
|
-
treemap.tile = function(x) {
|
|
46683
|
-
return arguments.length ? (tile = required(x), treemap) : tile;
|
|
46684
|
-
};
|
|
46685
|
-
treemap.padding = function(x) {
|
|
46686
|
-
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
|
|
46687
|
-
};
|
|
46688
|
-
treemap.paddingInner = function(x) {
|
|
46689
|
-
return arguments.length ? (paddingInner = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingInner;
|
|
46690
|
-
};
|
|
46691
|
-
treemap.paddingOuter = function(x) {
|
|
46692
|
-
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
|
|
46693
|
-
};
|
|
46694
|
-
treemap.paddingTop = function(x) {
|
|
46695
|
-
return arguments.length ? (paddingTop = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingTop;
|
|
46696
|
-
};
|
|
46697
|
-
treemap.paddingRight = function(x) {
|
|
46698
|
-
return arguments.length ? (paddingRight = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingRight;
|
|
46699
|
-
};
|
|
46700
|
-
treemap.paddingBottom = function(x) {
|
|
46701
|
-
return arguments.length ? (paddingBottom = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingBottom;
|
|
46702
|
-
};
|
|
46703
|
-
treemap.paddingLeft = function(x) {
|
|
46704
|
-
return arguments.length ? (paddingLeft = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingLeft;
|
|
46705
|
-
};
|
|
46706
|
-
return treemap;
|
|
46707
|
-
}
|
|
46708
|
-
|
|
46709
46530
|
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/hierarchy/count.js
|
|
46710
46531
|
function count(node) {
|
|
46711
46532
|
var sum = 0, children = node.children, i = children && children.length;
|
|
@@ -46947,6 +46768,173 @@ Node.prototype = hierarchy.prototype = {
|
|
|
46947
46768
|
[Symbol.iterator]: hierarchy_iterator
|
|
46948
46769
|
};
|
|
46949
46770
|
|
|
46771
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/round.js
|
|
46772
|
+
/* harmony default export */ function treemap_round(node) {
|
|
46773
|
+
node.x0 = Math.round(node.x0);
|
|
46774
|
+
node.y0 = Math.round(node.y0);
|
|
46775
|
+
node.x1 = Math.round(node.x1);
|
|
46776
|
+
node.y1 = Math.round(node.y1);
|
|
46777
|
+
}
|
|
46778
|
+
|
|
46779
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/dice.js
|
|
46780
|
+
/* harmony default export */ function dice(parent, x0, y0, x1, y1) {
|
|
46781
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
|
|
46782
|
+
while (++i < n) {
|
|
46783
|
+
node = nodes[i], node.y0 = y0, node.y1 = y1;
|
|
46784
|
+
node.x0 = x0, node.x1 = x0 += node.value * k;
|
|
46785
|
+
}
|
|
46786
|
+
}
|
|
46787
|
+
|
|
46788
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/slice.js
|
|
46789
|
+
/* harmony default export */ function treemap_slice(parent, x0, y0, x1, y1) {
|
|
46790
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
|
|
46791
|
+
while (++i < n) {
|
|
46792
|
+
node = nodes[i], node.x0 = x0, node.x1 = x1;
|
|
46793
|
+
node.y0 = y0, node.y1 = y0 += node.value * k;
|
|
46794
|
+
}
|
|
46795
|
+
}
|
|
46796
|
+
|
|
46797
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/squarify.js
|
|
46798
|
+
|
|
46799
|
+
|
|
46800
|
+
var phi = (1 + Math.sqrt(5)) / 2;
|
|
46801
|
+
function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
|
|
46802
|
+
var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
|
|
46803
|
+
while (i0 < n) {
|
|
46804
|
+
dx = x1 - x0, dy = y1 - y0;
|
|
46805
|
+
do
|
|
46806
|
+
sumValue = nodes[i1++].value;
|
|
46807
|
+
while (!sumValue && i1 < n);
|
|
46808
|
+
minValue = maxValue = sumValue;
|
|
46809
|
+
alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
|
|
46810
|
+
beta = sumValue * sumValue * alpha;
|
|
46811
|
+
minRatio = Math.max(maxValue / beta, beta / minValue);
|
|
46812
|
+
for (; i1 < n; ++i1) {
|
|
46813
|
+
sumValue += nodeValue = nodes[i1].value;
|
|
46814
|
+
if (nodeValue < minValue)
|
|
46815
|
+
minValue = nodeValue;
|
|
46816
|
+
if (nodeValue > maxValue)
|
|
46817
|
+
maxValue = nodeValue;
|
|
46818
|
+
beta = sumValue * sumValue * alpha;
|
|
46819
|
+
newRatio = Math.max(maxValue / beta, beta / minValue);
|
|
46820
|
+
if (newRatio > minRatio) {
|
|
46821
|
+
sumValue -= nodeValue;
|
|
46822
|
+
break;
|
|
46823
|
+
}
|
|
46824
|
+
minRatio = newRatio;
|
|
46825
|
+
}
|
|
46826
|
+
rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
|
|
46827
|
+
if (row.dice)
|
|
46828
|
+
dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
|
|
46829
|
+
else
|
|
46830
|
+
treemap_slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
|
|
46831
|
+
value -= sumValue, i0 = i1;
|
|
46832
|
+
}
|
|
46833
|
+
return rows;
|
|
46834
|
+
}
|
|
46835
|
+
/* harmony default export */ var squarify = ((function custom(ratio) {
|
|
46836
|
+
function squarify(parent, x0, y0, x1, y1) {
|
|
46837
|
+
squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
46838
|
+
}
|
|
46839
|
+
squarify.ratio = function(x) {
|
|
46840
|
+
return custom((x = +x) > 1 ? x : 1);
|
|
46841
|
+
};
|
|
46842
|
+
return squarify;
|
|
46843
|
+
})(phi));
|
|
46844
|
+
|
|
46845
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/accessors.js
|
|
46846
|
+
function optional(f) {
|
|
46847
|
+
return f == null ? null : required(f);
|
|
46848
|
+
}
|
|
46849
|
+
function required(f) {
|
|
46850
|
+
if (typeof f !== "function")
|
|
46851
|
+
throw new Error();
|
|
46852
|
+
return f;
|
|
46853
|
+
}
|
|
46854
|
+
|
|
46855
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/constant.js
|
|
46856
|
+
function constantZero() {
|
|
46857
|
+
return 0;
|
|
46858
|
+
}
|
|
46859
|
+
/* harmony default export */ function d3_hierarchy_src_constant(x) {
|
|
46860
|
+
return function() {
|
|
46861
|
+
return x;
|
|
46862
|
+
};
|
|
46863
|
+
}
|
|
46864
|
+
|
|
46865
|
+
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/index.js
|
|
46866
|
+
|
|
46867
|
+
|
|
46868
|
+
|
|
46869
|
+
|
|
46870
|
+
/* harmony default export */ function treemap() {
|
|
46871
|
+
var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
|
|
46872
|
+
function treemap(root) {
|
|
46873
|
+
root.x0 = root.y0 = 0;
|
|
46874
|
+
root.x1 = dx;
|
|
46875
|
+
root.y1 = dy;
|
|
46876
|
+
root.eachBefore(positionNode);
|
|
46877
|
+
paddingStack = [0];
|
|
46878
|
+
if (round)
|
|
46879
|
+
root.eachBefore(treemap_round);
|
|
46880
|
+
return root;
|
|
46881
|
+
}
|
|
46882
|
+
function positionNode(node) {
|
|
46883
|
+
var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
|
|
46884
|
+
if (x1 < x0)
|
|
46885
|
+
x0 = x1 = (x0 + x1) / 2;
|
|
46886
|
+
if (y1 < y0)
|
|
46887
|
+
y0 = y1 = (y0 + y1) / 2;
|
|
46888
|
+
node.x0 = x0;
|
|
46889
|
+
node.y0 = y0;
|
|
46890
|
+
node.x1 = x1;
|
|
46891
|
+
node.y1 = y1;
|
|
46892
|
+
if (node.children) {
|
|
46893
|
+
p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
|
|
46894
|
+
x0 += paddingLeft(node) - p;
|
|
46895
|
+
y0 += paddingTop(node) - p;
|
|
46896
|
+
x1 -= paddingRight(node) - p;
|
|
46897
|
+
y1 -= paddingBottom(node) - p;
|
|
46898
|
+
if (x1 < x0)
|
|
46899
|
+
x0 = x1 = (x0 + x1) / 2;
|
|
46900
|
+
if (y1 < y0)
|
|
46901
|
+
y0 = y1 = (y0 + y1) / 2;
|
|
46902
|
+
tile(node, x0, y0, x1, y1);
|
|
46903
|
+
}
|
|
46904
|
+
}
|
|
46905
|
+
treemap.round = function(x) {
|
|
46906
|
+
return arguments.length ? (round = !!x, treemap) : round;
|
|
46907
|
+
};
|
|
46908
|
+
treemap.size = function(x) {
|
|
46909
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
|
|
46910
|
+
};
|
|
46911
|
+
treemap.tile = function(x) {
|
|
46912
|
+
return arguments.length ? (tile = required(x), treemap) : tile;
|
|
46913
|
+
};
|
|
46914
|
+
treemap.padding = function(x) {
|
|
46915
|
+
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
|
|
46916
|
+
};
|
|
46917
|
+
treemap.paddingInner = function(x) {
|
|
46918
|
+
return arguments.length ? (paddingInner = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingInner;
|
|
46919
|
+
};
|
|
46920
|
+
treemap.paddingOuter = function(x) {
|
|
46921
|
+
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
|
|
46922
|
+
};
|
|
46923
|
+
treemap.paddingTop = function(x) {
|
|
46924
|
+
return arguments.length ? (paddingTop = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingTop;
|
|
46925
|
+
};
|
|
46926
|
+
treemap.paddingRight = function(x) {
|
|
46927
|
+
return arguments.length ? (paddingRight = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingRight;
|
|
46928
|
+
};
|
|
46929
|
+
treemap.paddingBottom = function(x) {
|
|
46930
|
+
return arguments.length ? (paddingBottom = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingBottom;
|
|
46931
|
+
};
|
|
46932
|
+
treemap.paddingLeft = function(x) {
|
|
46933
|
+
return arguments.length ? (paddingLeft = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingLeft;
|
|
46934
|
+
};
|
|
46935
|
+
return treemap;
|
|
46936
|
+
}
|
|
46937
|
+
|
|
46950
46938
|
;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/binary.js
|
|
46951
46939
|
/* harmony default export */ function binary(parent, x0, y0, x1, y1) {
|
|
46952
46940
|
var nodes = parent.children, i, n = nodes.length, sum, sums = new Array(n + 1);
|
|
@@ -47044,6 +47032,16 @@ function convertDataToTreemapData(data) {
|
|
|
47044
47032
|
};
|
|
47045
47033
|
});
|
|
47046
47034
|
}
|
|
47035
|
+
function getHierachyData(data) {
|
|
47036
|
+
const $$ = this;
|
|
47037
|
+
const hierarchyData = hierarchy(data).sum((d) => d.value);
|
|
47038
|
+
const sortFn = $$.getSortCompareFn(true);
|
|
47039
|
+
return [
|
|
47040
|
+
$$.treemap(
|
|
47041
|
+
sortFn ? hierarchyData.sort(sortFn) : hierarchyData
|
|
47042
|
+
)
|
|
47043
|
+
];
|
|
47044
|
+
}
|
|
47047
47045
|
/* harmony default export */ var shape_treemap = ({
|
|
47048
47046
|
initTreemap() {
|
|
47049
47047
|
const $$ = this;
|
|
@@ -47057,13 +47055,6 @@ function convertDataToTreemapData(data) {
|
|
|
47057
47055
|
} = $$;
|
|
47058
47056
|
clip.id = `${datetimeId}-clip`;
|
|
47059
47057
|
$$.treemap = treemap().tile($$.getTreemapTile());
|
|
47060
|
-
$$.treemapFn = (data) => {
|
|
47061
|
-
const hierarchyData = hierarchy(data).sum((d) => d.value);
|
|
47062
|
-
const sortFn = $$.getSortCompareFn(true);
|
|
47063
|
-
return $$.treemap(
|
|
47064
|
-
sortFn ? hierarchyData.sort(sortFn) : hierarchyData
|
|
47065
|
-
);
|
|
47066
|
-
};
|
|
47067
47058
|
$el.defs.append("clipPath").attr("id", clip.id).append("rect").attr("width", width).attr("height", height);
|
|
47068
47059
|
$el.treemap = $el.main.select(`.${$COMMON.chart}`).attr("clip-path", `url(#${clip.id})`).append("g").classed($TREEMAP.chartTreemaps, true);
|
|
47069
47060
|
$$.bindTreemapEvent();
|
|
@@ -47150,8 +47141,8 @@ function convertDataToTreemapData(data) {
|
|
|
47150
47141
|
updateTargetsForTreemap(targets) {
|
|
47151
47142
|
const $$ = this;
|
|
47152
47143
|
const { $el: { treemap } } = $$;
|
|
47153
|
-
const treemapData =
|
|
47154
|
-
treemap.data(
|
|
47144
|
+
const treemapData = getHierachyData.call($$, $$.getTreemapData(targets != null ? targets : $$.data.targets));
|
|
47145
|
+
treemap.data(treemapData);
|
|
47155
47146
|
},
|
|
47156
47147
|
/**
|
|
47157
47148
|
* Render treemap
|
|
@@ -48567,7 +48558,7 @@ const bb = {
|
|
|
48567
48558
|
* bb.version; // "1.0.0"
|
|
48568
48559
|
* @memberof bb
|
|
48569
48560
|
*/
|
|
48570
|
-
version: "3.12.
|
|
48561
|
+
version: "3.12.1",
|
|
48571
48562
|
/**
|
|
48572
48563
|
* Generate chart
|
|
48573
48564
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|