billboard.js 3.15.1 → 3.16.0-next.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.
Files changed (72) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +215 -30
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +9 -9
  5. package/dist/billboard.pkgd.js +2905 -1484
  6. package/dist/billboard.pkgd.min.js +19 -19
  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 +4 -3
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  11. package/dist/plugin/billboardjs-plugin-stanford.js +4 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +3 -3
  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 +2692 -1456
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +4 -4
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2695 -1458
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -7
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2696 -1459
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +14 -14
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2695 -1459
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +7 -7
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2696 -1460
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -7
  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 +212 -36
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -3
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -3
  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 +23 -23
  44. package/src/Chart/api/category.ts +1 -1
  45. package/src/Chart/api/chart.ts +12 -0
  46. package/src/ChartInternal/Axis/Axis.ts +2 -1
  47. package/src/ChartInternal/Axis/AxisRenderer.ts +2 -1
  48. package/src/ChartInternal/ChartInternal.ts +1 -1
  49. package/src/ChartInternal/data/data.ts +10 -0
  50. package/src/ChartInternal/interactions/interaction.ts +1 -1
  51. package/src/ChartInternal/internals/color.ts +2 -2
  52. package/src/ChartInternal/internals/domain.ts +5 -1
  53. package/src/ChartInternal/internals/style.ts +1 -1
  54. package/src/ChartInternal/internals/text.ts +1 -1
  55. package/src/ChartInternal/shape/bar.ts +113 -14
  56. package/src/ChartInternal/shape/candlestick.ts +1 -1
  57. package/src/ChartInternal/shape/funnel.ts +1 -1
  58. package/src/ChartInternal/shape/line.ts +6 -2
  59. package/src/ChartInternal/shape/point.ts +10 -7
  60. package/src/ChartInternal/shape/radar.ts +1 -1
  61. package/src/ChartInternal/shape/shape.ts +1 -1
  62. package/src/ChartInternal/shape/treemap.ts +1 -1
  63. package/src/config/Options/axis/x.ts +22 -1
  64. package/src/config/Options/axis/y.ts +20 -0
  65. package/src/config/Options/axis/y2.ts +33 -0
  66. package/src/config/Options/common/main.ts +1 -1
  67. package/src/config/Options/shape/bar.ts +1 -0
  68. package/src/config/Store/State.ts +2 -1
  69. package/src/config/classes.ts +2 -1
  70. package/types/axis.d.ts +12 -0
  71. package/types/chart.d.ts +10 -0
  72. package/types/options.shape.d.ts +6 -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.15.1
8
+ * @version 3.16.0-next.1
9
9
  */
10
10
  /*-- Chart --*/
11
11
  .bb svg {
package/dist/billboard.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.15.1
8
+ * @version 3.16.0-next.1
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -268,7 +268,8 @@ const $BAR = {
268
268
  bar: "bb-bar",
269
269
  bars: "bb-bars",
270
270
  chartBar: "bb-chart-bar",
271
- chartBars: "bb-chart-bars"
271
+ chartBars: "bb-chart-bars",
272
+ barConnectLine: "bb-bar-connectLine"
272
273
  };
273
274
  const $CANDLESTICK = {
274
275
  candlestick: "bb-candlestick",
@@ -858,7 +859,7 @@ const $ZOOM = {
858
859
  * }
859
860
  */
860
861
  resize_auto: true,
861
- resize_timer: true,
862
+ resize_timer: false,
862
863
  /**
863
864
  * Set a callback to execute when the chart is clicked.
864
865
  * @name onclick
@@ -2929,8 +2930,10 @@ class State {
2929
2930
  },
2930
2931
  // current used chart type list
2931
2932
  types: [],
2932
- needle: void 0
2933
+ needle: void 0,
2933
2934
  // arc needle current value
2935
+ zoomDomain: null
2936
+ // zoomed domain value
2934
2937
  },
2935
2938
  // legend
2936
2939
  isLegendRight: false,
@@ -4143,6 +4146,12 @@ function getDataKeyForJson(keysParam, config) {
4143
4146
  filterByX(targets, x) {
4144
4147
  return mergeArray(targets.map((t) => t.values)).filter((v) => v.x - x === 0);
4145
4148
  },
4149
+ filterNullish(data) {
4150
+ const filter = (v) => isValue(v.value);
4151
+ return data ? data.filter(
4152
+ (v) => "value" in v ? filter(v) : v.values.some(filter)
4153
+ ) : data;
4154
+ },
4146
4155
  filterRemoveNull(data) {
4147
4156
  return data.filter((d) => isValue(this.getBaseValue(d)));
4148
4157
  },
@@ -4647,7 +4656,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
4647
4656
  if (isArcishData || d !== -1) {
4648
4657
  const callback = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
4649
4658
  config.color_onover && $$.setOverColor(isOver, d, isArcishData);
4650
- if (isArcishData && "id") {
4659
+ if (isArcishData) {
4651
4660
  const suffix = $$.getTargetSelectorSuffix(d.id);
4652
4661
  const selector = hasFunnel || hasTreemap ? `${$COMMON.target + suffix} .${$SHAPE.shape}` : $ARC.arc + suffix;
4653
4662
  callback(d, main.select(`.${selector}`).node());
@@ -4979,8 +4988,6 @@ const schemeCategory10 = [
4979
4988
  generateColor() {
4980
4989
  const $$ = this;
4981
4990
  const { $el, config } = $$;
4982
- const colors = config.data_colors;
4983
- const callback = config.data_color;
4984
4991
  const ids = [];
4985
4992
  let pattern = notEmpty(config.color_pattern) ? config.color_pattern : (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleOrdinal)(getColorFromCss($el.chart) || schemeCategory10).range();
4986
4993
  const originalColorPattern = pattern;
@@ -4996,6 +5003,8 @@ const schemeCategory10 = [
4996
5003
  }
4997
5004
  return function(d) {
4998
5005
  var _a;
5006
+ const colors = config.data_colors;
5007
+ const callback = config.data_color;
4999
5008
  const id = d.id || ((_a = d.data) == null ? void 0 : _a.id) || d;
5000
5009
  const isLine = $$.isTypeOf(id, ["line", "spline", "step"]) || !config.data_types[id];
5001
5010
  let color;
@@ -5256,7 +5265,10 @@ const schemeCategory10 = [
5256
5265
  }
5257
5266
  if (showHorizontalDataLabel) {
5258
5267
  const diff = diffDomain(scale.y.range());
5259
- const ratio = $$.getDataLabelLength(yDomainMin, yDomainMax, "width").map((v) => v / diff);
5268
+ const ratio = $$.getDataLabelLength(yDomainMin, yDomainMax, "width").map((v) => {
5269
+ const result = v / diff;
5270
+ return isFinite(result) ? result : 0;
5271
+ });
5260
5272
  ["bottom", "top"].forEach((v, i) => {
5261
5273
  padding[v] += domainLength * (ratio[i] / (1 - ratio[0] - ratio[1]));
5262
5274
  });
@@ -7016,7 +7028,7 @@ function getTextPos(d, type) {
7016
7028
  const classChartText = $$.getChartClass("Text");
7017
7029
  const classTexts = $$.getClass("texts", "id");
7018
7030
  const classFocus = $$.classFocus.bind($$);
7019
- const mainTextUpdate = $$.$el.main.select(`.${$TEXT.chartTexts}`).selectAll(`.${$TEXT.chartText}`).data(targets).attr("class", (d) => `${classChartText(d)}${classFocus(d)}`.trim());
7031
+ const mainTextUpdate = $$.$el.main.select(`.${$TEXT.chartTexts}`).selectAll(`.${$TEXT.chartText}`).data($$.filterNullish(targets)).attr("class", (d) => `${classChartText(d)}${classFocus(d)}`.trim());
7020
7032
  const mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).call(
7021
7033
  $$.setCssRule(
7022
7034
  true,
@@ -8958,7 +8970,7 @@ class ChartInternal {
8958
8970
  if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || ((_a = $$.hasLegendDefsPoint) == null ? void 0 : _a.call($$))) {
8959
8971
  $el.defs = $el.svg.append("defs");
8960
8972
  if (hasAxis) {
8961
- ["id", "idXAxis", "idYAxis", "idGrid"].forEach((v) => {
8973
+ ["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach((v) => {
8962
8974
  $$.appendClip($el.defs, state.clip[v]);
8963
8975
  });
8964
8976
  }
@@ -9349,6 +9361,9 @@ function loadConfig(config) {
9349
9361
  (_b = $$.axis) == null ? void 0 : _b.setOrient();
9350
9362
  }
9351
9363
  zoomResetBtn == null ? void 0 : zoomResetBtn.style("display", "none");
9364
+ if ($$.scale.zoom) {
9365
+ state.current.zoomDomain = $$.scale.zoom.domain();
9366
+ }
9352
9367
  $$.scale.zoom = null;
9353
9368
  soft ? $$.redraw({
9354
9369
  withTransform: true,
@@ -9364,6 +9379,10 @@ function loadConfig(config) {
9364
9379
  $$.brush.getSelection().call($$.brush.move);
9365
9380
  $$.unselectRect();
9366
9381
  }
9382
+ if (state.current.zoomDomain) {
9383
+ $$.api.zoom(state.current.zoomDomain);
9384
+ state.current.zoomDomain = null;
9385
+ }
9367
9386
  } else {
9368
9387
  $$.initToRender(true);
9369
9388
  }
@@ -12974,7 +12993,7 @@ class AxisRenderer {
12974
12993
  return isTopBottom ? `M${range[0]},${outerTickSized}V0H${range[1]}V${outerTickSized}` : `M${outerTickSized},${range[0]}H0V${range[1]}H${outerTickSized}`;
12975
12994
  });
12976
12995
  if (tickShow.tick || tickShow.text) {
12977
- const ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight);
12996
+ const ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight || params.config.axis_rotated);
12978
12997
  ctx.generatedTicks = ticks;
12979
12998
  let tick = g2.selectAll(".tick").data(ticks, scale1);
12980
12999
  const tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick");
@@ -14012,7 +14031,10 @@ class Axis_Axis {
14012
14031
  const toCull = config[cullingOptionPrefix];
14013
14032
  if (axis && toCull) {
14014
14033
  const tickNodes = axis.selectAll(".tick");
14015
- const tickValues = sortValue(tickNodes.data());
14034
+ const tickValues = sortValue(
14035
+ tickNodes.data(),
14036
+ !config[`${cullingOptionPrefix}_reverse`]
14037
+ );
14016
14038
  const tickSize = tickValues.length;
14017
14039
  const cullingMax = config[`${cullingOptionPrefix}_max`];
14018
14040
  const lines = config[`${cullingOptionPrefix}_lines`];
@@ -15583,7 +15605,7 @@ function smoothLines(el, type) {
15583
15605
  * axis: {
15584
15606
  * x: {
15585
15607
  * tick: {
15586
- * culling: false
15608
+ * culling: false,
15587
15609
  * }
15588
15610
  * }
15589
15611
  * }
@@ -15625,6 +15647,26 @@ function smoothLines(el, type) {
15625
15647
  * }
15626
15648
  */
15627
15649
  axis_x_tick_culling_lines: true,
15650
+ /**
15651
+ * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.
15652
+ * - **NOTE:** This option is only available when `axis.x.tick.culling` is set to truthy value.
15653
+ * @name axis․x․tick․culling․reverse
15654
+ * @memberof Options
15655
+ * @type {boolean}
15656
+ * @default false
15657
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickCulling)
15658
+ * @example
15659
+ * axis: {
15660
+ * x: {
15661
+ * tick: {
15662
+ * culling: {
15663
+ * reverse: true,
15664
+ * }
15665
+ * }
15666
+ * }
15667
+ * }
15668
+ */
15669
+ axis_x_tick_culling_reverse: false,
15628
15670
  /**
15629
15671
  * The number of x axis ticks to show.<br><br>
15630
15672
  * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).
@@ -16358,6 +16400,25 @@ function smoothLines(el, type) {
16358
16400
  * }
16359
16401
  */
16360
16402
  axis_y_tick_culling_lines: true,
16403
+ /**
16404
+ * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.
16405
+ * - **NOTE:** This option is only available when `axis.y.tick.culling` is set to truthy value.
16406
+ * @name axis․y․tick․culling․reverse
16407
+ * @memberof Options
16408
+ * @type {boolean}
16409
+ * @default false
16410
+ * @example
16411
+ * axis: {
16412
+ * y: {
16413
+ * tick: {
16414
+ * culling: {
16415
+ * reverse: true,
16416
+ * }
16417
+ * }
16418
+ * }
16419
+ * }
16420
+ */
16421
+ axis_y_tick_culling_reverse: false,
16361
16422
  /**
16362
16423
  * Show y axis outer tick.
16363
16424
  * @name axis․y․tick․outer
@@ -16613,6 +16674,18 @@ function smoothLines(el, type) {
16613
16674
 
16614
16675
  ;// ./src/config/Options/axis/y2.ts
16615
16676
  /* harmony default export */ var y2 = ({
16677
+ /**
16678
+ * Set clip-path attribute for y2 axis element
16679
+ * - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
16680
+ * @name axis․y2․clipPath
16681
+ * @memberof Options
16682
+ * @type {boolean}
16683
+ * @default true
16684
+ * @example
16685
+ * // don't set 'clip-path' attribute
16686
+ * clipPath: false
16687
+ */
16688
+ axis_y2_clipPath: true,
16616
16689
  /**
16617
16690
  * Show or hide y2 axis.
16618
16691
  * - **NOTE**:
@@ -16827,6 +16900,25 @@ function smoothLines(el, type) {
16827
16900
  * }
16828
16901
  */
16829
16902
  axis_y2_tick_culling_lines: true,
16903
+ /**
16904
+ * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.
16905
+ * - **NOTE:** This option is only available when `axis.y2.tick.culling` is set to truthy value.
16906
+ * @name axis․y2․tick․culling․reverse
16907
+ * @memberof Options
16908
+ * @type {boolean}
16909
+ * @default false
16910
+ * @example
16911
+ * axis: {
16912
+ * y2: {
16913
+ * tick: {
16914
+ * culling: {
16915
+ * reverse: true,
16916
+ * }
16917
+ * }
16918
+ * }
16919
+ * }
16920
+ */
16921
+ axis_y2_tick_culling_reverse: false,
16830
16922
  /**
16831
16923
  * Show or hide y2 axis outer tick.
16832
16924
  * @name axis․y2․tick․outer
@@ -18394,6 +18486,12 @@ function getAttrTweenFn(fn) {
18394
18486
  ;// ./src/ChartInternal/shape/bar.ts
18395
18487
 
18396
18488
 
18489
+
18490
+ function getConnectLineType(id) {
18491
+ const connectLine = this.config.bar_connectLine;
18492
+ const type = (connectLine == null ? void 0 : connectLine[id]) || connectLine;
18493
+ return /^(start|end)\-(start|end)$/.test(type) ? type : null;
18494
+ }
18397
18495
  /* harmony default export */ var bar = ({
18398
18496
  initBar() {
18399
18497
  const { $el, config, state: { clip } } = this;
@@ -18414,17 +18512,19 @@ function getAttrTweenFn(fn) {
18414
18512
  if (!$el.bar) {
18415
18513
  $$.initBar();
18416
18514
  }
18417
- const mainBarUpdate = $el.main.select(`.${$BAR.chartBars}`).selectAll(`.${$BAR.chartBar}`).data(
18418
- // remove
18419
- targets.filter(
18420
- (v) => v.values.some((d) => isNumber(d.value) || $$.isBarRangeType(d))
18421
- )
18422
- ).attr("class", (d) => classChartBar(d) + classFocus(d));
18515
+ const mainBarUpdate = $el.main.select(`.${$BAR.chartBars}`).selectAll(`.${$BAR.chartBar}`).data($$.filterNullish(targets)).attr("class", (d) => classChartBar(d) + classFocus(d));
18423
18516
  const mainBarEnter = mainBarUpdate.enter().append("g").attr("class", classChartBar).style("opacity", "0").style("pointer-events", $$.getStylePropValue("none"));
18424
18517
  mainBarEnter.append("g").attr("class", classBars).style("cursor", (d) => {
18425
18518
  var _a;
18426
18519
  return ((_a = isSelectable == null ? void 0 : isSelectable.bind) == null ? void 0 : _a.call(isSelectable, $$.api)(d)) ? "pointer" : null;
18427
- }).call($$.setCssRule(true, ` .${$BAR.bar}`, ["fill"], $$.color));
18520
+ }).call((selection) => {
18521
+ $$.setCssRule(true, ` .${$BAR.bar}`, ["fill"], $$.color)(selection);
18522
+ selection.each(function(d) {
18523
+ if (getConnectLineType.call($$, d.id)) {
18524
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).append("path").attr("class", $BAR.barConnectLine);
18525
+ }
18526
+ });
18527
+ });
18428
18528
  },
18429
18529
  /**
18430
18530
  * Generate/Update elements
@@ -18466,8 +18566,25 @@ function getAttrTweenFn(fn) {
18466
18566
  redrawBar(drawFn, withTransition, isSub = false) {
18467
18567
  const $$ = this;
18468
18568
  const { bar } = isSub ? $$.$el.subchart : $$.$el;
18569
+ const barPath = [];
18469
18570
  return [
18470
- $$.$T(bar, withTransition, getRandom()).attr("d", (d) => (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d)).style("fill", $$.updateBarColor.bind($$)).style("clip-path", (d) => d.clipPath).style("opacity", null)
18571
+ $$.$T(bar, withTransition, getRandom()).attr("d", function(d, i, arr) {
18572
+ const path = (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d, i);
18573
+ const connectLineType = getConnectLineType.call($$, d.id);
18574
+ if (path.length > 1) {
18575
+ barPath.push(path[1]);
18576
+ if (i === arr.length - 1) {
18577
+ const barConnectLineNode = $$.$T(
18578
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this.parentNode.querySelector(`.${$BAR.barConnectLine}`)),
18579
+ withTransition,
18580
+ getRandom()
18581
+ );
18582
+ $$.updateConnectLine(barConnectLineNode, connectLineType, barPath);
18583
+ barPath.splice(0);
18584
+ }
18585
+ }
18586
+ return path[0];
18587
+ }).style("fill", $$.updateBarColor.bind($$)).style("clip-path", (d) => d.clipPath).style("opacity", null)
18471
18588
  ];
18472
18589
  },
18473
18590
  /**
@@ -18544,7 +18661,21 @@ function getAttrTweenFn(fn) {
18544
18661
  }
18545
18662
  }
18546
18663
  const path = isRotated ? `H${pos} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` : `V${pos} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;
18547
- return `M${points[0][indexX]},${points[0][indexY]}${path}z`;
18664
+ const coords = [`M${points[0][indexX]},${points[0][indexY]}${path}z`];
18665
+ if (getConnectLineType.call($$, d.id)) {
18666
+ coords.push(isRotated ? {
18667
+ x: points[0][indexX],
18668
+ y: points[0][indexY],
18669
+ width: points[0][indexX] - pos,
18670
+ height: points[2][indexY] - points[0][indexY]
18671
+ } : {
18672
+ x: points[0][indexX],
18673
+ y: pos,
18674
+ width: points[2][indexX] - points[0][indexX],
18675
+ height: points[3][indexY] - pos
18676
+ });
18677
+ }
18678
+ return coords;
18548
18679
  };
18549
18680
  },
18550
18681
  /**
@@ -18611,6 +18742,34 @@ function getAttrTweenFn(fn) {
18611
18742
  [startPosX, offset]
18612
18743
  ];
18613
18744
  };
18745
+ },
18746
+ /**
18747
+ * Update the bar connect line path
18748
+ * @param {d3Selection} node d3 selection of bar connect line
18749
+ * @param {string} type Type of connect line, one of "start-start", "start-end", "end-start", "end-end"
18750
+ * @param {Array} barPath d3 path data for the bar
18751
+ */
18752
+ updateConnectLine(node, type, barPath) {
18753
+ const path = barPath.map((v, i, arr) => {
18754
+ const isRotated = this.config.axis_rotated;
18755
+ const isStart = /^start-(start|end)$/.test(type);
18756
+ const isEnd = /^end-(start|end)$/.test(type);
18757
+ const path2 = [];
18758
+ const x = isRotated ? isEnd ? v.x - v.width : v.x : v.x + v.width;
18759
+ const y = isRotated ? v.y + v.height : isStart ? v.y + v.height : v.y;
18760
+ if (i === 0) {
18761
+ path2.push(`${x},${y}`);
18762
+ } else {
18763
+ path2.push(
18764
+ isRotated ? `L${v.x - (/\w+-end$/.test(type) ? v.width : 0)},${v.y}` : `L${v.x},${v.y + (/\w+-start$/.test(type) ? v.height : 0)}`
18765
+ );
18766
+ if (i < arr.length - 1) {
18767
+ path2.push(`M${x},${y}`);
18768
+ }
18769
+ }
18770
+ return path2.join(" ");
18771
+ });
18772
+ node.attr("d", `M${path.join("")}z`);
18614
18773
  }
18615
18774
  });
18616
18775
 
@@ -18714,7 +18873,7 @@ var candlestick_spreadValues = (a, b) => {
18714
18873
  if (!$el.candlestick) {
18715
18874
  $$.initCandlestick();
18716
18875
  }
18717
- const mainUpdate = $$.$el.main.select(`.${$CANDLESTICK.chartCandlesticks}`).selectAll(`.${$CANDLESTICK.chartCandlestick}`).data(targets);
18876
+ const mainUpdate = $$.$el.main.select(`.${$CANDLESTICK.chartCandlesticks}`).selectAll(`.${$CANDLESTICK.chartCandlestick}`).data($$.filterNullish(targets));
18718
18877
  mainUpdate.enter().append("g").attr("class", classChart).style("pointer-events", "none");
18719
18878
  },
18720
18879
  /**
@@ -19065,7 +19224,7 @@ function updateRatio(data) {
19065
19224
  $$.initFunnel();
19066
19225
  }
19067
19226
  const targets = getFunnelData.call($$, t.filter($$.isFunnelType.bind($$)));
19068
- const mainFunnelUpdate = funnel.selectAll(`.${$FUNNEL.chartFunnel}`).data(targets);
19227
+ const mainFunnelUpdate = funnel.selectAll(`.${$FUNNEL.chartFunnel}`).data($$.filterNullish(targets));
19069
19228
  mainFunnelUpdate.exit().remove();
19070
19229
  const mainFunnelEnter = mainFunnelUpdate.enter().insert("g", `.${$FUNNEL.funnelBackground}`);
19071
19230
  mainFunnelEnter.append("path");
@@ -19199,6 +19358,25 @@ function updateRatio(data) {
19199
19358
  });
19200
19359
 
19201
19360
  ;// ./src/ChartInternal/shape/line.ts
19361
+ var line_defProp = Object.defineProperty;
19362
+ var line_defProps = Object.defineProperties;
19363
+ var line_getOwnPropDescs = Object.getOwnPropertyDescriptors;
19364
+ var line_getOwnPropSymbols = Object.getOwnPropertySymbols;
19365
+ var line_hasOwnProp = Object.prototype.hasOwnProperty;
19366
+ var line_propIsEnum = Object.prototype.propertyIsEnumerable;
19367
+ var line_defNormalProp = (obj, key, value) => key in obj ? line_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19368
+ var line_spreadValues = (a, b) => {
19369
+ for (var prop in b || (b = {}))
19370
+ if (line_hasOwnProp.call(b, prop))
19371
+ line_defNormalProp(a, prop, b[prop]);
19372
+ if (line_getOwnPropSymbols)
19373
+ for (var prop of line_getOwnPropSymbols(b)) {
19374
+ if (line_propIsEnum.call(b, prop))
19375
+ line_defNormalProp(a, prop, b[prop]);
19376
+ }
19377
+ return a;
19378
+ };
19379
+ var line_spreadProps = (a, b) => line_defProps(a, line_getOwnPropDescs(b));
19202
19380
 
19203
19381
 
19204
19382
 
@@ -19249,7 +19427,7 @@ function getRegions(d, _regions, isTimeSeries) {
19249
19427
  $$.initLine();
19250
19428
  }
19251
19429
  const targets = t.filter((d) => !($$.isScatterType(d) || $$.isBubbleType(d)));
19252
- const mainLineUpdate = main.select(`.${$LINE.chartLines}`).selectAll(`.${$LINE.chartLine}`).data(targets).attr("class", (d) => classChartLine(d) + classFocus(d));
19430
+ const mainLineUpdate = main.select(`.${$LINE.chartLines}`).selectAll(`.${$LINE.chartLine}`).data($$.filterNullish(targets)).attr("class", (d) => classChartLine(d) + classFocus(d));
19253
19431
  const mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", $$.getStylePropValue("none"));
19254
19432
  mainLineEnter.append("g").attr("class", classLines);
19255
19433
  if ($$.hasTypeOf("Area")) {
@@ -19338,6 +19516,9 @@ function getRegions(d, _regions, isTimeSeries) {
19338
19516
  if ($$.isLineType(d)) {
19339
19517
  const regions = config.data_regions[d.id];
19340
19518
  if (regions) {
19519
+ if ($$.isAreaRangeType(d)) {
19520
+ values = values.map((dv) => line_spreadProps(line_spreadValues({}, dv), { value: $$.getRangedData(dv, "mid") }));
19521
+ }
19341
19522
  path = $$.lineWithRegions(values, scale.zoom || x, y, regions);
19342
19523
  } else {
19343
19524
  if ($$.isStepType(d)) {
@@ -19546,7 +19727,7 @@ const getTransitionName = () => getRandom();
19546
19727
  let targets = targetsValue;
19547
19728
  let enterNode = enterNodeValue;
19548
19729
  if (!targets) {
19549
- targets = data.targets.filter((d) => this.isScatterType(d) || this.isBubbleType(d));
19730
+ targets = $$.filterNullish(data.targets).filter((d) => this.isScatterType(d) || this.isBubbleType(d));
19550
19731
  const mainCircle = $el.main.select(`.${$CIRCLE.chartCircles}`).style("pointer-events", "none").selectAll(`.${$CIRCLE.circles}`).data(targets);
19551
19732
  mainCircle.exit().remove();
19552
19733
  enterNode = mainCircle.enter();
@@ -19574,7 +19755,10 @@ const getTransitionName = () => getRandom();
19574
19755
  const $root = isSub ? $el.subchart : $el;
19575
19756
  if (config.point_show && !state.toggling) {
19576
19757
  config.point_radialGradient && $$.updateLinearGradient();
19577
- const circles = $root.main.selectAll(`.${$CIRCLE.circles}`).selectAll(`.${$CIRCLE.circle}`).data((d) => $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : []);
19758
+ const circles = $root.main.selectAll(`.${$CIRCLE.circles}`).selectAll(`.${$CIRCLE.circle}`).data((d) => {
19759
+ const data = $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : [];
19760
+ return $$.filterNullish(data);
19761
+ });
19578
19762
  circles.exit().remove();
19579
19763
  circles.enter().filter(Boolean).append(
19580
19764
  $$.point("create", this, $$.pointR.bind($$), $$.updateCircleColor.bind($$))
@@ -20311,7 +20495,7 @@ const cacheKeyTextWidth = KEY.radarTextWidth;
20311
20495
  const $$ = this;
20312
20496
  const targets = $$.data.targets.filter((d) => $$.isRadarType(d));
20313
20497
  const points = $$.cache.get(cacheKeyPoints);
20314
- const areas = $$.$el.radar.shapes.selectAll("polygon").data(targets);
20498
+ const areas = $$.$el.radar.shapes.selectAll("polygon").data($$.filterNullish(targets));
20315
20499
  const areasEnter = areas.enter().append("g").attr("class", $$.getChartClass("Radar"));
20316
20500
  $$.$T(areas.exit()).remove();
20317
20501
  areasEnter.append("polygon").merge(areas).style("fill", $$.color).style("stroke", $$.color).attr("points", (d) => points[d.id].join(" "));
@@ -20475,7 +20659,7 @@ function getHierachyData(data) {
20475
20659
  const $$ = this;
20476
20660
  const { $el: { treemap } } = $$;
20477
20661
  const treemapData = getHierachyData.call($$, $$.getTreemapData(targets != null ? targets : $$.data.targets));
20478
- treemap.data(treemapData);
20662
+ treemap.data($$.filterNullish(treemapData));
20479
20663
  },
20480
20664
  /**
20481
20665
  * Render treemap
@@ -20899,6 +21083,7 @@ ${percentValue}%`;
20899
21083
  * zerobased: false
20900
21084
  * }
20901
21085
  */
21086
+ bar_connectLine: false,
20902
21087
  bar_front: false,
20903
21088
  bar_indices_removeNull: false,
20904
21089
  bar_label_threshold: 0,
@@ -21906,7 +22091,7 @@ const bb = {
21906
22091
  * bb.version; // "1.0.0"
21907
22092
  * @memberof bb
21908
22093
  */
21909
- version: "3.15.1",
22094
+ version: "3.16.0-next.1",
21910
22095
  /**
21911
22096
  * Generate chart
21912
22097
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.15.1
8
+ * @version 3.16.0-next.1
9
9
  */.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bb path,.bb line{fill:none;stroke:#000}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle,.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{font-size:13px;fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:1em;fill:#fff;white-space:nowrap}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:gray;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{z-index:10;user-select:none}.bb-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;opacity:.9;box-shadow:7px 7px 12px -9px #777;white-space:nowrap}.bb-tooltip tr{border:1px solid #CCC}.bb-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.bb-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{font-size:11px;border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}