billboard.js 3.12.0 → 3.12.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.
Files changed (47) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +56 -32
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +9 -9
  5. package/dist/billboard.pkgd.js +223 -199
  6. package/dist/billboard.pkgd.min.js +16 -16
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +70 -34
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +7 -7
  44. package/src/ChartInternal/data/load.ts +3 -0
  45. package/src/ChartInternal/shape/funnel.ts +49 -25
  46. package/src/ChartInternal/shape/treemap.ts +19 -10
  47. package/types/types.d.ts +1 -0
@@ -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.0
8
+ * @version 3.12.2
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
@@ -27708,6 +27708,7 @@ function callDone(fn, resizeAfter = false) {
27708
27708
  $$.data.targets = $$.data.targets.filter((t) => t.id !== id);
27709
27709
  hasLegendDefsPoint && ((_a2 = $el.defs) == null ? void 0 : _a2.select(`#${$$.getDefsPointId(suffixId)}`).remove());
27710
27710
  });
27711
+ state.hasFunnel && $$.updateFunnel($$.data.targets);
27711
27712
  state.hasTreemap && $$.updateTargetsForTreemap($$.data.targets);
27712
27713
  $$.updateTypesElements();
27713
27714
  }
@@ -45205,13 +45206,16 @@ function getSize(checkNeck = false) {
45205
45206
  height: height - (config.legend_show ? $$.getLegendHeight() + 10 : 0) - (padding.top + padding.bottom)
45206
45207
  }, padding);
45207
45208
  if (checkNeck) {
45208
- const { width: neckWidth } = getNecklSize.call($$, {
45209
+ const { width: neckWidth, height: neckHeight } = getNecklSize.call($$, {
45209
45210
  width: size.width,
45210
45211
  height: size.height
45211
45212
  });
45212
45213
  if (size.width < neckWidth) {
45213
45214
  size.width = neckWidth;
45214
45215
  }
45216
+ if (size.height < neckHeight) {
45217
+ size.height = neckHeight;
45218
+ }
45215
45219
  }
45216
45220
  return size;
45217
45221
  }
@@ -45234,49 +45238,55 @@ function getNecklSize(current) {
45234
45238
  }
45235
45239
  function getCoord(d) {
45236
45240
  const $$ = this;
45237
- const { top, width } = getSize.call($$, true);
45241
+ const { top, left, width } = getSize.call($$, true);
45238
45242
  const coords = [];
45239
45243
  d.forEach((d2, i) => {
45240
45244
  const { ratio } = d2;
45241
45245
  const y = i > 0 ? coords[i - 1][2][1] : top;
45242
45246
  coords.push(d2.coords = [
45243
- [0, y],
45247
+ [left, y],
45244
45248
  // M
45245
- [width, y],
45249
+ [left + width, y],
45246
45250
  // 1
45247
- [width, i > 0 ? ratio + y : ratio + top],
45251
+ [left + width, i > 0 ? ratio + y : ratio + top],
45248
45252
  // 2
45249
- [0, i > 0 ? ratio + y : ratio + top],
45253
+ [left, i > 0 ? ratio + y : ratio + top],
45250
45254
  // 3
45251
- [0, y]
45255
+ [left, y]
45252
45256
  // 4
45253
45257
  ]);
45254
45258
  });
45255
45259
  return coords;
45256
45260
  }
45257
- function getNeckPath() {
45261
+ function getClipPath(forBackground = false) {
45258
45262
  const $$ = this;
45259
45263
  const { width, height, top, left } = getSize.call($$, true);
45260
45264
  const neck = getNecklSize.call($$, { width, height });
45261
- const rightX = (width + neck.width) / 2;
45262
45265
  const leftX = (width - neck.width) / 2;
45266
+ const rightX = (width + neck.width) / 2;
45263
45267
  const bodyHeigth = height - neck.height;
45264
45268
  const coords = [
45265
- [0 + left, 0 + top],
45269
+ [0, 0],
45266
45270
  // M
45267
- [width + left, 0 + top],
45271
+ [width, 0],
45268
45272
  // 1
45269
45273
  [rightX, bodyHeigth],
45270
45274
  // 2
45271
- [rightX, height + top],
45275
+ [rightX, height],
45272
45276
  // 3
45273
- [leftX, height + top],
45277
+ [leftX, height],
45274
45278
  // 4
45275
45279
  [leftX, bodyHeigth],
45276
45280
  // 5
45277
- [0 + left, 0 + top]
45281
+ [0, 0]
45278
45282
  // 6
45279
45283
  ];
45284
+ if (forBackground) {
45285
+ coords.forEach((d) => {
45286
+ d[0] += left;
45287
+ d[1] += top;
45288
+ });
45289
+ }
45280
45290
  return `M${coords.join("L")}z`;
45281
45291
  }
45282
45292
  function getFunnelData(d) {
@@ -45364,23 +45374,35 @@ function updateRatio(data) {
45364
45374
  mainFunnelEnter.append("path");
45365
45375
  funnel.path = mainFunnelEnter.merge(mainFunnelUpdate).attr("class", (d) => classChartFunnel(d)).select("path").attr("class", classFunnel).style("opacity", "0").style("fill", $$.color);
45366
45376
  },
45377
+ /**
45378
+ * Update funnel path selection
45379
+ * @param {object} targets Updated target data
45380
+ * @private
45381
+ */
45382
+ updateFunnel(targets) {
45383
+ const $$ = this;
45384
+ const { $el: { funnel } } = $$;
45385
+ const targetIds = targets.map(({ id }) => id);
45386
+ funnel.path = funnel.path.filter((d) => targetIds.indexOf(d.id) >= 0);
45387
+ },
45367
45388
  /**
45368
45389
  * Generate treemap coordinate points data
45369
45390
  * @returns {Array} Array of coordinate points
45370
45391
  * @private
45371
45392
  */
45372
45393
  generateGetFunnelPoints() {
45373
- var _a;
45374
45394
  const $$ = this;
45375
45395
  const { $el: { funnel } } = $$;
45376
45396
  const targets = $$.filterTargetsToShow(funnel.path);
45397
+ const { top, left, right } = getSize.call($$);
45398
+ const center = (left - right) / 2;
45377
45399
  const points = {};
45378
- let accumulatedHeight = (_a = getSize.call($$).top) != null ? _a : 0;
45400
+ let accumulatedHeight = top != null ? top : 0;
45379
45401
  targets.each((d, i) => {
45380
- var _a2;
45402
+ var _a;
45381
45403
  points[d.id] = [
45382
- [0, accumulatedHeight],
45383
- [0, accumulatedHeight += ((_a2 = targets == null ? void 0 : targets[i]) != null ? _a2 : d).ratio]
45404
+ [center, accumulatedHeight],
45405
+ [center, accumulatedHeight += ((_a = targets == null ? void 0 : targets[i]) != null ? _a : d).ratio]
45384
45406
  ];
45385
45407
  });
45386
45408
  return (d) => points[d.id];
@@ -45394,9 +45416,8 @@ function updateRatio(data) {
45394
45416
  const { $T, $el: { funnel } } = $$;
45395
45417
  const targets = $$.filterTargetsToShow(funnel.path);
45396
45418
  const coords = getCoord.call($$, updateRatio.call($$, targets.data()));
45397
- const neckPath = getNeckPath.bind($$)();
45398
- funnel.attr("clip-path", `path('${neckPath}')`);
45399
- funnel.background.attr("d", neckPath);
45419
+ funnel.attr("clip-path", `path('${getClipPath.bind($$)()}')`);
45420
+ funnel.background.attr("d", getClipPath.call($$, true));
45400
45421
  $T(targets).attr("d", (d, i) => `M${coords[i].join("L")}z`).style("opacity", "1");
45401
45422
  funnel.selectAll("g").style("opacity", null);
45402
45423
  }
@@ -46527,173 +46548,6 @@ const cacheKeyTextWidth = KEY.radarTextWidth;
46527
46548
  }
46528
46549
  });
46529
46550
 
46530
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/round.js
46531
- /* harmony default export */ function treemap_round(node) {
46532
- node.x0 = Math.round(node.x0);
46533
- node.y0 = Math.round(node.y0);
46534
- node.x1 = Math.round(node.x1);
46535
- node.y1 = Math.round(node.y1);
46536
- }
46537
-
46538
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/dice.js
46539
- /* harmony default export */ function dice(parent, x0, y0, x1, y1) {
46540
- var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
46541
- while (++i < n) {
46542
- node = nodes[i], node.y0 = y0, node.y1 = y1;
46543
- node.x0 = x0, node.x1 = x0 += node.value * k;
46544
- }
46545
- }
46546
-
46547
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/slice.js
46548
- /* harmony default export */ function treemap_slice(parent, x0, y0, x1, y1) {
46549
- var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
46550
- while (++i < n) {
46551
- node = nodes[i], node.x0 = x0, node.x1 = x1;
46552
- node.y0 = y0, node.y1 = y0 += node.value * k;
46553
- }
46554
- }
46555
-
46556
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/squarify.js
46557
-
46558
-
46559
- var phi = (1 + Math.sqrt(5)) / 2;
46560
- function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
46561
- 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;
46562
- while (i0 < n) {
46563
- dx = x1 - x0, dy = y1 - y0;
46564
- do
46565
- sumValue = nodes[i1++].value;
46566
- while (!sumValue && i1 < n);
46567
- minValue = maxValue = sumValue;
46568
- alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
46569
- beta = sumValue * sumValue * alpha;
46570
- minRatio = Math.max(maxValue / beta, beta / minValue);
46571
- for (; i1 < n; ++i1) {
46572
- sumValue += nodeValue = nodes[i1].value;
46573
- if (nodeValue < minValue)
46574
- minValue = nodeValue;
46575
- if (nodeValue > maxValue)
46576
- maxValue = nodeValue;
46577
- beta = sumValue * sumValue * alpha;
46578
- newRatio = Math.max(maxValue / beta, beta / minValue);
46579
- if (newRatio > minRatio) {
46580
- sumValue -= nodeValue;
46581
- break;
46582
- }
46583
- minRatio = newRatio;
46584
- }
46585
- rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
46586
- if (row.dice)
46587
- dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
46588
- else
46589
- treemap_slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
46590
- value -= sumValue, i0 = i1;
46591
- }
46592
- return rows;
46593
- }
46594
- /* harmony default export */ var squarify = ((function custom(ratio) {
46595
- function squarify(parent, x0, y0, x1, y1) {
46596
- squarifyRatio(ratio, parent, x0, y0, x1, y1);
46597
- }
46598
- squarify.ratio = function(x) {
46599
- return custom((x = +x) > 1 ? x : 1);
46600
- };
46601
- return squarify;
46602
- })(phi));
46603
-
46604
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/accessors.js
46605
- function optional(f) {
46606
- return f == null ? null : required(f);
46607
- }
46608
- function required(f) {
46609
- if (typeof f !== "function")
46610
- throw new Error();
46611
- return f;
46612
- }
46613
-
46614
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/constant.js
46615
- function constantZero() {
46616
- return 0;
46617
- }
46618
- /* harmony default export */ function d3_hierarchy_src_constant(x) {
46619
- return function() {
46620
- return x;
46621
- };
46622
- }
46623
-
46624
- ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/index.js
46625
-
46626
-
46627
-
46628
-
46629
- /* harmony default export */ function treemap() {
46630
- var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
46631
- function treemap(root) {
46632
- root.x0 = root.y0 = 0;
46633
- root.x1 = dx;
46634
- root.y1 = dy;
46635
- root.eachBefore(positionNode);
46636
- paddingStack = [0];
46637
- if (round)
46638
- root.eachBefore(treemap_round);
46639
- return root;
46640
- }
46641
- function positionNode(node) {
46642
- var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
46643
- if (x1 < x0)
46644
- x0 = x1 = (x0 + x1) / 2;
46645
- if (y1 < y0)
46646
- y0 = y1 = (y0 + y1) / 2;
46647
- node.x0 = x0;
46648
- node.y0 = y0;
46649
- node.x1 = x1;
46650
- node.y1 = y1;
46651
- if (node.children) {
46652
- p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
46653
- x0 += paddingLeft(node) - p;
46654
- y0 += paddingTop(node) - p;
46655
- x1 -= paddingRight(node) - p;
46656
- y1 -= paddingBottom(node) - p;
46657
- if (x1 < x0)
46658
- x0 = x1 = (x0 + x1) / 2;
46659
- if (y1 < y0)
46660
- y0 = y1 = (y0 + y1) / 2;
46661
- tile(node, x0, y0, x1, y1);
46662
- }
46663
- }
46664
- treemap.round = function(x) {
46665
- return arguments.length ? (round = !!x, treemap) : round;
46666
- };
46667
- treemap.size = function(x) {
46668
- return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
46669
- };
46670
- treemap.tile = function(x) {
46671
- return arguments.length ? (tile = required(x), treemap) : tile;
46672
- };
46673
- treemap.padding = function(x) {
46674
- return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
46675
- };
46676
- treemap.paddingInner = function(x) {
46677
- return arguments.length ? (paddingInner = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingInner;
46678
- };
46679
- treemap.paddingOuter = function(x) {
46680
- return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
46681
- };
46682
- treemap.paddingTop = function(x) {
46683
- return arguments.length ? (paddingTop = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingTop;
46684
- };
46685
- treemap.paddingRight = function(x) {
46686
- return arguments.length ? (paddingRight = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingRight;
46687
- };
46688
- treemap.paddingBottom = function(x) {
46689
- return arguments.length ? (paddingBottom = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingBottom;
46690
- };
46691
- treemap.paddingLeft = function(x) {
46692
- return arguments.length ? (paddingLeft = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingLeft;
46693
- };
46694
- return treemap;
46695
- }
46696
-
46697
46551
  ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/hierarchy/count.js
46698
46552
  function count(node) {
46699
46553
  var sum = 0, children = node.children, i = children && children.length;
@@ -46935,6 +46789,173 @@ Node.prototype = hierarchy.prototype = {
46935
46789
  [Symbol.iterator]: hierarchy_iterator
46936
46790
  };
46937
46791
 
46792
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/round.js
46793
+ /* harmony default export */ function treemap_round(node) {
46794
+ node.x0 = Math.round(node.x0);
46795
+ node.y0 = Math.round(node.y0);
46796
+ node.x1 = Math.round(node.x1);
46797
+ node.y1 = Math.round(node.y1);
46798
+ }
46799
+
46800
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/dice.js
46801
+ /* harmony default export */ function dice(parent, x0, y0, x1, y1) {
46802
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
46803
+ while (++i < n) {
46804
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
46805
+ node.x0 = x0, node.x1 = x0 += node.value * k;
46806
+ }
46807
+ }
46808
+
46809
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/slice.js
46810
+ /* harmony default export */ function treemap_slice(parent, x0, y0, x1, y1) {
46811
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
46812
+ while (++i < n) {
46813
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
46814
+ node.y0 = y0, node.y1 = y0 += node.value * k;
46815
+ }
46816
+ }
46817
+
46818
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/squarify.js
46819
+
46820
+
46821
+ var phi = (1 + Math.sqrt(5)) / 2;
46822
+ function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
46823
+ 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;
46824
+ while (i0 < n) {
46825
+ dx = x1 - x0, dy = y1 - y0;
46826
+ do
46827
+ sumValue = nodes[i1++].value;
46828
+ while (!sumValue && i1 < n);
46829
+ minValue = maxValue = sumValue;
46830
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
46831
+ beta = sumValue * sumValue * alpha;
46832
+ minRatio = Math.max(maxValue / beta, beta / minValue);
46833
+ for (; i1 < n; ++i1) {
46834
+ sumValue += nodeValue = nodes[i1].value;
46835
+ if (nodeValue < minValue)
46836
+ minValue = nodeValue;
46837
+ if (nodeValue > maxValue)
46838
+ maxValue = nodeValue;
46839
+ beta = sumValue * sumValue * alpha;
46840
+ newRatio = Math.max(maxValue / beta, beta / minValue);
46841
+ if (newRatio > minRatio) {
46842
+ sumValue -= nodeValue;
46843
+ break;
46844
+ }
46845
+ minRatio = newRatio;
46846
+ }
46847
+ rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
46848
+ if (row.dice)
46849
+ dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
46850
+ else
46851
+ treemap_slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
46852
+ value -= sumValue, i0 = i1;
46853
+ }
46854
+ return rows;
46855
+ }
46856
+ /* harmony default export */ var squarify = ((function custom(ratio) {
46857
+ function squarify(parent, x0, y0, x1, y1) {
46858
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
46859
+ }
46860
+ squarify.ratio = function(x) {
46861
+ return custom((x = +x) > 1 ? x : 1);
46862
+ };
46863
+ return squarify;
46864
+ })(phi));
46865
+
46866
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/accessors.js
46867
+ function optional(f) {
46868
+ return f == null ? null : required(f);
46869
+ }
46870
+ function required(f) {
46871
+ if (typeof f !== "function")
46872
+ throw new Error();
46873
+ return f;
46874
+ }
46875
+
46876
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/constant.js
46877
+ function constantZero() {
46878
+ return 0;
46879
+ }
46880
+ /* harmony default export */ function d3_hierarchy_src_constant(x) {
46881
+ return function() {
46882
+ return x;
46883
+ };
46884
+ }
46885
+
46886
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/index.js
46887
+
46888
+
46889
+
46890
+
46891
+ /* harmony default export */ function treemap() {
46892
+ var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
46893
+ function treemap(root) {
46894
+ root.x0 = root.y0 = 0;
46895
+ root.x1 = dx;
46896
+ root.y1 = dy;
46897
+ root.eachBefore(positionNode);
46898
+ paddingStack = [0];
46899
+ if (round)
46900
+ root.eachBefore(treemap_round);
46901
+ return root;
46902
+ }
46903
+ function positionNode(node) {
46904
+ var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
46905
+ if (x1 < x0)
46906
+ x0 = x1 = (x0 + x1) / 2;
46907
+ if (y1 < y0)
46908
+ y0 = y1 = (y0 + y1) / 2;
46909
+ node.x0 = x0;
46910
+ node.y0 = y0;
46911
+ node.x1 = x1;
46912
+ node.y1 = y1;
46913
+ if (node.children) {
46914
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
46915
+ x0 += paddingLeft(node) - p;
46916
+ y0 += paddingTop(node) - p;
46917
+ x1 -= paddingRight(node) - p;
46918
+ y1 -= paddingBottom(node) - p;
46919
+ if (x1 < x0)
46920
+ x0 = x1 = (x0 + x1) / 2;
46921
+ if (y1 < y0)
46922
+ y0 = y1 = (y0 + y1) / 2;
46923
+ tile(node, x0, y0, x1, y1);
46924
+ }
46925
+ }
46926
+ treemap.round = function(x) {
46927
+ return arguments.length ? (round = !!x, treemap) : round;
46928
+ };
46929
+ treemap.size = function(x) {
46930
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
46931
+ };
46932
+ treemap.tile = function(x) {
46933
+ return arguments.length ? (tile = required(x), treemap) : tile;
46934
+ };
46935
+ treemap.padding = function(x) {
46936
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
46937
+ };
46938
+ treemap.paddingInner = function(x) {
46939
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingInner;
46940
+ };
46941
+ treemap.paddingOuter = function(x) {
46942
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
46943
+ };
46944
+ treemap.paddingTop = function(x) {
46945
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingTop;
46946
+ };
46947
+ treemap.paddingRight = function(x) {
46948
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingRight;
46949
+ };
46950
+ treemap.paddingBottom = function(x) {
46951
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingBottom;
46952
+ };
46953
+ treemap.paddingLeft = function(x) {
46954
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingLeft;
46955
+ };
46956
+ return treemap;
46957
+ }
46958
+
46938
46959
  ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/binary.js
46939
46960
  /* harmony default export */ function binary(parent, x0, y0, x1, y1) {
46940
46961
  var nodes = parent.children, i, n = nodes.length, sum, sums = new Array(n + 1);
@@ -47032,6 +47053,16 @@ function convertDataToTreemapData(data) {
47032
47053
  };
47033
47054
  });
47034
47055
  }
47056
+ function getHierachyData(data) {
47057
+ const $$ = this;
47058
+ const hierarchyData = hierarchy(data).sum((d) => d.value);
47059
+ const sortFn = $$.getSortCompareFn(true);
47060
+ return [
47061
+ $$.treemap(
47062
+ sortFn ? hierarchyData.sort(sortFn) : hierarchyData
47063
+ )
47064
+ ];
47065
+ }
47035
47066
  /* harmony default export */ var shape_treemap = ({
47036
47067
  initTreemap() {
47037
47068
  const $$ = this;
@@ -47045,13 +47076,6 @@ function convertDataToTreemapData(data) {
47045
47076
  } = $$;
47046
47077
  clip.id = `${datetimeId}-clip`;
47047
47078
  $$.treemap = treemap().tile($$.getTreemapTile());
47048
- $$.treemapFn = (data) => {
47049
- const hierarchyData = hierarchy(data).sum((d) => d.value);
47050
- const sortFn = $$.getSortCompareFn(true);
47051
- return $$.treemap(
47052
- sortFn ? hierarchyData.sort(sortFn) : hierarchyData
47053
- );
47054
- };
47055
47079
  $el.defs.append("clipPath").attr("id", clip.id).append("rect").attr("width", width).attr("height", height);
47056
47080
  $el.treemap = $el.main.select(`.${$COMMON.chart}`).attr("clip-path", `url(#${clip.id})`).append("g").classed($TREEMAP.chartTreemaps, true);
47057
47081
  $$.bindTreemapEvent();
@@ -47138,7 +47162,7 @@ function convertDataToTreemapData(data) {
47138
47162
  updateTargetsForTreemap(targets) {
47139
47163
  const $$ = this;
47140
47164
  const { $el: { treemap } } = $$;
47141
- const treemapData = $$.treemapFn($$.getTreemapData(targets != null ? targets : $$.data.targets));
47165
+ const treemapData = getHierachyData.call($$, $$.getTreemapData(targets != null ? targets : $$.data.targets));
47142
47166
  treemap.data(treemapData);
47143
47167
  },
47144
47168
  /**
@@ -48555,7 +48579,7 @@ const bb = {
48555
48579
  * bb.version; // "1.0.0"
48556
48580
  * @memberof bb
48557
48581
  */
48558
- version: "3.12.0",
48582
+ version: "3.12.2",
48559
48583
  /**
48560
48584
  * Generate chart
48561
48585
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: