billboard.js 3.12.0 → 3.12.2-patch

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 (50) hide show
  1. package/README.md +1 -1
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +57 -35
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +9 -9
  6. package/dist/billboard.pkgd.js +224 -202
  7. package/dist/billboard.pkgd.min.js +16 -16
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +3 -3
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.js +3 -3
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +3 -3
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -3
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +3 -3
  21. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +5 -5
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +3 -3
  23. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +6 -6
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +3 -3
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +3 -3
  27. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  28. package/dist/theme/dark.css +1 -1
  29. package/dist/theme/dark.min.css +1 -1
  30. package/dist/theme/datalab.css +1 -1
  31. package/dist/theme/datalab.min.css +1 -1
  32. package/dist/theme/graph.css +1 -1
  33. package/dist/theme/graph.min.css +1 -1
  34. package/dist/theme/insight.css +1 -1
  35. package/dist/theme/insight.min.css +1 -1
  36. package/dist/theme/modern.css +1 -1
  37. package/dist/theme/modern.min.css +1 -1
  38. package/dist-esm/billboard.js +72 -39
  39. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  44. package/package.json +12 -12
  45. package/src/ChartInternal/data/load.ts +3 -0
  46. package/src/ChartInternal/interactions/zoom.ts +0 -4
  47. package/src/ChartInternal/shape/funnel.ts +49 -25
  48. package/src/ChartInternal/shape/treemap.ts +19 -10
  49. package/src/module/util.ts +2 -2
  50. 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-patch
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
@@ -25727,7 +25727,7 @@ function convertInputType(mouse, touch) {
25727
25727
  }
25728
25728
  }
25729
25729
  }
25730
- const hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some((v) => matchMedia == null ? void 0 : matchMedia(`(${v})`).matches);
25730
+ const hasMouse = mouse && ((matchMedia == null ? void 0 : matchMedia("any-hover:hover").matches) || (matchMedia == null ? void 0 : matchMedia("any-pointer:fine").matches));
25731
25731
  return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
25732
25732
  }
25733
25733
  function runUntil(fn, conditionFn) {
@@ -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
  }
@@ -37186,8 +37187,6 @@ util_extend(zoom, {
37186
37187
  const $$ = this;
37187
37188
  const { config, $el: { eventRect } } = $$;
37188
37189
  const behaviour = config.zoom_type === "drag" ? $$.zoomBehaviour : $$.zoom;
37189
- $$.$el.svg.on("wheel", () => {
37190
- });
37191
37190
  eventRect == null ? void 0 : eventRect.call(behaviour).on("dblclick.zoom", null);
37192
37191
  },
37193
37192
  /**
@@ -45205,13 +45204,16 @@ function getSize(checkNeck = false) {
45205
45204
  height: height - (config.legend_show ? $$.getLegendHeight() + 10 : 0) - (padding.top + padding.bottom)
45206
45205
  }, padding);
45207
45206
  if (checkNeck) {
45208
- const { width: neckWidth } = getNecklSize.call($$, {
45207
+ const { width: neckWidth, height: neckHeight } = getNecklSize.call($$, {
45209
45208
  width: size.width,
45210
45209
  height: size.height
45211
45210
  });
45212
45211
  if (size.width < neckWidth) {
45213
45212
  size.width = neckWidth;
45214
45213
  }
45214
+ if (size.height < neckHeight) {
45215
+ size.height = neckHeight;
45216
+ }
45215
45217
  }
45216
45218
  return size;
45217
45219
  }
@@ -45234,49 +45236,55 @@ function getNecklSize(current) {
45234
45236
  }
45235
45237
  function getCoord(d) {
45236
45238
  const $$ = this;
45237
- const { top, width } = getSize.call($$, true);
45239
+ const { top, left, width } = getSize.call($$, true);
45238
45240
  const coords = [];
45239
45241
  d.forEach((d2, i) => {
45240
45242
  const { ratio } = d2;
45241
45243
  const y = i > 0 ? coords[i - 1][2][1] : top;
45242
45244
  coords.push(d2.coords = [
45243
- [0, y],
45245
+ [left, y],
45244
45246
  // M
45245
- [width, y],
45247
+ [left + width, y],
45246
45248
  // 1
45247
- [width, i > 0 ? ratio + y : ratio + top],
45249
+ [left + width, i > 0 ? ratio + y : ratio + top],
45248
45250
  // 2
45249
- [0, i > 0 ? ratio + y : ratio + top],
45251
+ [left, i > 0 ? ratio + y : ratio + top],
45250
45252
  // 3
45251
- [0, y]
45253
+ [left, y]
45252
45254
  // 4
45253
45255
  ]);
45254
45256
  });
45255
45257
  return coords;
45256
45258
  }
45257
- function getNeckPath() {
45259
+ function getClipPath(forBackground = false) {
45258
45260
  const $$ = this;
45259
45261
  const { width, height, top, left } = getSize.call($$, true);
45260
45262
  const neck = getNecklSize.call($$, { width, height });
45261
- const rightX = (width + neck.width) / 2;
45262
45263
  const leftX = (width - neck.width) / 2;
45264
+ const rightX = (width + neck.width) / 2;
45263
45265
  const bodyHeigth = height - neck.height;
45264
45266
  const coords = [
45265
- [0 + left, 0 + top],
45267
+ [0, 0],
45266
45268
  // M
45267
- [width + left, 0 + top],
45269
+ [width, 0],
45268
45270
  // 1
45269
45271
  [rightX, bodyHeigth],
45270
45272
  // 2
45271
- [rightX, height + top],
45273
+ [rightX, height],
45272
45274
  // 3
45273
- [leftX, height + top],
45275
+ [leftX, height],
45274
45276
  // 4
45275
45277
  [leftX, bodyHeigth],
45276
45278
  // 5
45277
- [0 + left, 0 + top]
45279
+ [0, 0]
45278
45280
  // 6
45279
45281
  ];
45282
+ if (forBackground) {
45283
+ coords.forEach((d) => {
45284
+ d[0] += left;
45285
+ d[1] += top;
45286
+ });
45287
+ }
45280
45288
  return `M${coords.join("L")}z`;
45281
45289
  }
45282
45290
  function getFunnelData(d) {
@@ -45364,23 +45372,35 @@ function updateRatio(data) {
45364
45372
  mainFunnelEnter.append("path");
45365
45373
  funnel.path = mainFunnelEnter.merge(mainFunnelUpdate).attr("class", (d) => classChartFunnel(d)).select("path").attr("class", classFunnel).style("opacity", "0").style("fill", $$.color);
45366
45374
  },
45375
+ /**
45376
+ * Update funnel path selection
45377
+ * @param {object} targets Updated target data
45378
+ * @private
45379
+ */
45380
+ updateFunnel(targets) {
45381
+ const $$ = this;
45382
+ const { $el: { funnel } } = $$;
45383
+ const targetIds = targets.map(({ id }) => id);
45384
+ funnel.path = funnel.path.filter((d) => targetIds.indexOf(d.id) >= 0);
45385
+ },
45367
45386
  /**
45368
45387
  * Generate treemap coordinate points data
45369
45388
  * @returns {Array} Array of coordinate points
45370
45389
  * @private
45371
45390
  */
45372
45391
  generateGetFunnelPoints() {
45373
- var _a;
45374
45392
  const $$ = this;
45375
45393
  const { $el: { funnel } } = $$;
45376
45394
  const targets = $$.filterTargetsToShow(funnel.path);
45395
+ const { top, left, right } = getSize.call($$);
45396
+ const center = (left - right) / 2;
45377
45397
  const points = {};
45378
- let accumulatedHeight = (_a = getSize.call($$).top) != null ? _a : 0;
45398
+ let accumulatedHeight = top != null ? top : 0;
45379
45399
  targets.each((d, i) => {
45380
- var _a2;
45400
+ var _a;
45381
45401
  points[d.id] = [
45382
- [0, accumulatedHeight],
45383
- [0, accumulatedHeight += ((_a2 = targets == null ? void 0 : targets[i]) != null ? _a2 : d).ratio]
45402
+ [center, accumulatedHeight],
45403
+ [center, accumulatedHeight += ((_a = targets == null ? void 0 : targets[i]) != null ? _a : d).ratio]
45384
45404
  ];
45385
45405
  });
45386
45406
  return (d) => points[d.id];
@@ -45394,9 +45414,8 @@ function updateRatio(data) {
45394
45414
  const { $T, $el: { funnel } } = $$;
45395
45415
  const targets = $$.filterTargetsToShow(funnel.path);
45396
45416
  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);
45417
+ funnel.attr("clip-path", `path('${getClipPath.bind($$)()}')`);
45418
+ funnel.background.attr("d", getClipPath.call($$, true));
45400
45419
  $T(targets).attr("d", (d, i) => `M${coords[i].join("L")}z`).style("opacity", "1");
45401
45420
  funnel.selectAll("g").style("opacity", null);
45402
45421
  }
@@ -46527,173 +46546,6 @@ const cacheKeyTextWidth = KEY.radarTextWidth;
46527
46546
  }
46528
46547
  });
46529
46548
 
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
46549
  ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/hierarchy/count.js
46698
46550
  function count(node) {
46699
46551
  var sum = 0, children = node.children, i = children && children.length;
@@ -46935,6 +46787,173 @@ Node.prototype = hierarchy.prototype = {
46935
46787
  [Symbol.iterator]: hierarchy_iterator
46936
46788
  };
46937
46789
 
46790
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/round.js
46791
+ /* harmony default export */ function treemap_round(node) {
46792
+ node.x0 = Math.round(node.x0);
46793
+ node.y0 = Math.round(node.y0);
46794
+ node.x1 = Math.round(node.x1);
46795
+ node.y1 = Math.round(node.y1);
46796
+ }
46797
+
46798
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/dice.js
46799
+ /* harmony default export */ function dice(parent, x0, y0, x1, y1) {
46800
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
46801
+ while (++i < n) {
46802
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
46803
+ node.x0 = x0, node.x1 = x0 += node.value * k;
46804
+ }
46805
+ }
46806
+
46807
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/slice.js
46808
+ /* harmony default export */ function treemap_slice(parent, x0, y0, x1, y1) {
46809
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
46810
+ while (++i < n) {
46811
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
46812
+ node.y0 = y0, node.y1 = y0 += node.value * k;
46813
+ }
46814
+ }
46815
+
46816
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/squarify.js
46817
+
46818
+
46819
+ var phi = (1 + Math.sqrt(5)) / 2;
46820
+ function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
46821
+ 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;
46822
+ while (i0 < n) {
46823
+ dx = x1 - x0, dy = y1 - y0;
46824
+ do
46825
+ sumValue = nodes[i1++].value;
46826
+ while (!sumValue && i1 < n);
46827
+ minValue = maxValue = sumValue;
46828
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
46829
+ beta = sumValue * sumValue * alpha;
46830
+ minRatio = Math.max(maxValue / beta, beta / minValue);
46831
+ for (; i1 < n; ++i1) {
46832
+ sumValue += nodeValue = nodes[i1].value;
46833
+ if (nodeValue < minValue)
46834
+ minValue = nodeValue;
46835
+ if (nodeValue > maxValue)
46836
+ maxValue = nodeValue;
46837
+ beta = sumValue * sumValue * alpha;
46838
+ newRatio = Math.max(maxValue / beta, beta / minValue);
46839
+ if (newRatio > minRatio) {
46840
+ sumValue -= nodeValue;
46841
+ break;
46842
+ }
46843
+ minRatio = newRatio;
46844
+ }
46845
+ rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
46846
+ if (row.dice)
46847
+ dice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
46848
+ else
46849
+ treemap_slice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
46850
+ value -= sumValue, i0 = i1;
46851
+ }
46852
+ return rows;
46853
+ }
46854
+ /* harmony default export */ var squarify = ((function custom(ratio) {
46855
+ function squarify(parent, x0, y0, x1, y1) {
46856
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
46857
+ }
46858
+ squarify.ratio = function(x) {
46859
+ return custom((x = +x) > 1 ? x : 1);
46860
+ };
46861
+ return squarify;
46862
+ })(phi));
46863
+
46864
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/accessors.js
46865
+ function optional(f) {
46866
+ return f == null ? null : required(f);
46867
+ }
46868
+ function required(f) {
46869
+ if (typeof f !== "function")
46870
+ throw new Error();
46871
+ return f;
46872
+ }
46873
+
46874
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/constant.js
46875
+ function constantZero() {
46876
+ return 0;
46877
+ }
46878
+ /* harmony default export */ function d3_hierarchy_src_constant(x) {
46879
+ return function() {
46880
+ return x;
46881
+ };
46882
+ }
46883
+
46884
+ ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/index.js
46885
+
46886
+
46887
+
46888
+
46889
+ /* harmony default export */ function treemap() {
46890
+ var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
46891
+ function treemap(root) {
46892
+ root.x0 = root.y0 = 0;
46893
+ root.x1 = dx;
46894
+ root.y1 = dy;
46895
+ root.eachBefore(positionNode);
46896
+ paddingStack = [0];
46897
+ if (round)
46898
+ root.eachBefore(treemap_round);
46899
+ return root;
46900
+ }
46901
+ function positionNode(node) {
46902
+ var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
46903
+ if (x1 < x0)
46904
+ x0 = x1 = (x0 + x1) / 2;
46905
+ if (y1 < y0)
46906
+ y0 = y1 = (y0 + y1) / 2;
46907
+ node.x0 = x0;
46908
+ node.y0 = y0;
46909
+ node.x1 = x1;
46910
+ node.y1 = y1;
46911
+ if (node.children) {
46912
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
46913
+ x0 += paddingLeft(node) - p;
46914
+ y0 += paddingTop(node) - p;
46915
+ x1 -= paddingRight(node) - p;
46916
+ y1 -= paddingBottom(node) - p;
46917
+ if (x1 < x0)
46918
+ x0 = x1 = (x0 + x1) / 2;
46919
+ if (y1 < y0)
46920
+ y0 = y1 = (y0 + y1) / 2;
46921
+ tile(node, x0, y0, x1, y1);
46922
+ }
46923
+ }
46924
+ treemap.round = function(x) {
46925
+ return arguments.length ? (round = !!x, treemap) : round;
46926
+ };
46927
+ treemap.size = function(x) {
46928
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
46929
+ };
46930
+ treemap.tile = function(x) {
46931
+ return arguments.length ? (tile = required(x), treemap) : tile;
46932
+ };
46933
+ treemap.padding = function(x) {
46934
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
46935
+ };
46936
+ treemap.paddingInner = function(x) {
46937
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingInner;
46938
+ };
46939
+ treemap.paddingOuter = function(x) {
46940
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
46941
+ };
46942
+ treemap.paddingTop = function(x) {
46943
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingTop;
46944
+ };
46945
+ treemap.paddingRight = function(x) {
46946
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingRight;
46947
+ };
46948
+ treemap.paddingBottom = function(x) {
46949
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingBottom;
46950
+ };
46951
+ treemap.paddingLeft = function(x) {
46952
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : d3_hierarchy_src_constant(+x), treemap) : paddingLeft;
46953
+ };
46954
+ return treemap;
46955
+ }
46956
+
46938
46957
  ;// CONCATENATED MODULE: ./node_modules/d3-hierarchy/src/treemap/binary.js
46939
46958
  /* harmony default export */ function binary(parent, x0, y0, x1, y1) {
46940
46959
  var nodes = parent.children, i, n = nodes.length, sum, sums = new Array(n + 1);
@@ -47032,6 +47051,16 @@ function convertDataToTreemapData(data) {
47032
47051
  };
47033
47052
  });
47034
47053
  }
47054
+ function getHierachyData(data) {
47055
+ const $$ = this;
47056
+ const hierarchyData = hierarchy(data).sum((d) => d.value);
47057
+ const sortFn = $$.getSortCompareFn(true);
47058
+ return [
47059
+ $$.treemap(
47060
+ sortFn ? hierarchyData.sort(sortFn) : hierarchyData
47061
+ )
47062
+ ];
47063
+ }
47035
47064
  /* harmony default export */ var shape_treemap = ({
47036
47065
  initTreemap() {
47037
47066
  const $$ = this;
@@ -47045,13 +47074,6 @@ function convertDataToTreemapData(data) {
47045
47074
  } = $$;
47046
47075
  clip.id = `${datetimeId}-clip`;
47047
47076
  $$.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
47077
  $el.defs.append("clipPath").attr("id", clip.id).append("rect").attr("width", width).attr("height", height);
47056
47078
  $el.treemap = $el.main.select(`.${$COMMON.chart}`).attr("clip-path", `url(#${clip.id})`).append("g").classed($TREEMAP.chartTreemaps, true);
47057
47079
  $$.bindTreemapEvent();
@@ -47138,7 +47160,7 @@ function convertDataToTreemapData(data) {
47138
47160
  updateTargetsForTreemap(targets) {
47139
47161
  const $$ = this;
47140
47162
  const { $el: { treemap } } = $$;
47141
- const treemapData = $$.treemapFn($$.getTreemapData(targets != null ? targets : $$.data.targets));
47163
+ const treemapData = getHierachyData.call($$, $$.getTreemapData(targets != null ? targets : $$.data.targets));
47142
47164
  treemap.data(treemapData);
47143
47165
  },
47144
47166
  /**
@@ -48555,7 +48577,7 @@ const bb = {
48555
48577
  * bb.version; // "1.0.0"
48556
48578
  * @memberof bb
48557
48579
  */
48558
- version: "3.12.0",
48580
+ version: "3.12.2-patch",
48559
48581
  /**
48560
48582
  * Generate chart
48561
48583
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: