billboard.js 3.10.0-next.6 → 3.10.0

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 (49) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +62 -48
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +64 -50
  6. package/dist/billboard.pkgd.min.js +4 -4
  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 +52 -47
  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 +14 -14
  44. package/src/ChartInternal/Axis/Axis.ts +35 -18
  45. package/src/ChartInternal/ChartInternal.ts +1 -1
  46. package/src/ChartInternal/internals/clip.ts +4 -4
  47. package/src/ChartInternal/internals/size.axis.ts +10 -6
  48. package/src/config/Options/axis/y2.ts +0 -13
  49. package/src/config/Store/State.ts +4 -4
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.10.0-next.6
8
+ * @version 3.10.0
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.10.0-next.6
8
+ * @version 3.10.0
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -1601,19 +1601,22 @@ let State = function () {
1601
1601
  width: 0,
1602
1602
  height: 0,
1603
1603
  dataMax: 0,
1604
- maxTickWidths: {
1604
+ maxTickSize: {
1605
1605
  x: {
1606
- size: 0,
1606
+ width: 0,
1607
+ height: 0,
1607
1608
  ticks: [],
1608
1609
  clipPath: 0,
1609
1610
  domain: ""
1610
1611
  },
1611
1612
  y: {
1612
- size: 0,
1613
+ width: 0,
1614
+ height: 0,
1613
1615
  domain: ""
1614
1616
  },
1615
1617
  y2: {
1616
- size: 0,
1618
+ width: 0,
1619
+ height: 0,
1617
1620
  domain: ""
1618
1621
  }
1619
1622
  },
@@ -10838,7 +10841,7 @@ let ChartInternal = /*#__PURE__*/function () {
10838
10841
  if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
10839
10842
  $el.defs = $el.svg.append("defs");
10840
10843
  if (hasAxis) {
10841
- ["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach(function (v) {
10844
+ ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
10842
10845
  _newArrowCheck(this, _this3);
10843
10846
  $$.appendClip($el.defs, state.clip[v]);
10844
10847
  }.bind(this));
@@ -14641,7 +14644,7 @@ let Axis_Axis = /*#__PURE__*/function () {
14641
14644
  id === "x" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing) ? !0 : noTransition);
14642
14645
  }
14643
14646
 
14644
- // called from : getMaxTickWidth()
14647
+ // called from : getMaxTickSize()
14645
14648
  ;
14646
14649
  _proto.getAxis = function getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {
14647
14650
  var _this8 = this;
@@ -14868,7 +14871,8 @@ let Axis_Axis = /*#__PURE__*/function () {
14868
14871
  isRotated = config.axis_rotated,
14869
14872
  isInner = this.getAxisLabelPosition(id).isInner,
14870
14873
  tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
14871
- maxTickWidth = this.getMaxTickWidth(id);
14874
+ _this$getMaxTickSize = this.getMaxTickSize(id),
14875
+ maxTickWidth = _this$getMaxTickSize.width;
14872
14876
  let dy;
14873
14877
  if (id === "x") {
14874
14878
  const xHeight = config.axis_x_height;
@@ -14901,8 +14905,16 @@ let Axis_Axis = /*#__PURE__*/function () {
14901
14905
  }
14902
14906
  }
14903
14907
  return dy;
14904
- };
14905
- _proto.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
14908
+ }
14909
+
14910
+ /**
14911
+ * Get max tick size
14912
+ * @param {string} id axis id string
14913
+ * @param {boolean} withoutRecompute wheather or not to recompute
14914
+ * @returns {object} {width, height}
14915
+ * @private
14916
+ */;
14917
+ _proto.getMaxTickSize = function getMaxTickSize(id, withoutRecompute) {
14906
14918
  var _this11 = this;
14907
14919
  const $$ = this.owner,
14908
14920
  config = $$.config,
@@ -14910,10 +14922,13 @@ let Axis_Axis = /*#__PURE__*/function () {
14910
14922
  _$$$$el2 = $$.$el,
14911
14923
  svg = _$$$$el2.svg,
14912
14924
  chart = _$$$$el2.chart,
14913
- currentTickMax = current.maxTickWidths[id];
14914
- let maxWidth = 0;
14915
- if (withoutRecompute || !config["axis_" + id + "_show"] || currentTickMax.size > 0 && $$.filterTargetsToShow().length === 0) {
14916
- return currentTickMax.size;
14925
+ currentTickMax = current.maxTickSize[id],
14926
+ max = {
14927
+ width: 0,
14928
+ height: 0
14929
+ };
14930
+ if (withoutRecompute || !config["axis_" + id + "_show"] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
14931
+ return currentTickMax;
14917
14932
  }
14918
14933
  if (svg) {
14919
14934
  const isYAxis = /^y2?$/.test(id),
@@ -14953,19 +14968,26 @@ let Axis_Axis = /*#__PURE__*/function () {
14953
14968
  const dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
14954
14969
  axis.create(dummy);
14955
14970
  dummy.selectAll("text").each(function (d, i) {
14956
- const currentTextWidth = this.getBoundingClientRect().width;
14957
- maxWidth = Math.max(maxWidth, currentTextWidth);
14971
+ const _this$getBoundingClie = this.getBoundingClientRect(),
14972
+ width = _this$getBoundingClie.width,
14973
+ height = _this$getBoundingClie.height;
14974
+ max.width = Math.max(max.width, width);
14975
+ max.height = Math.max(max.height, height);
14976
+
14958
14977
  // cache tick text width for getXAxisTickTextY2Overflow()
14959
14978
  if (!isYAxis) {
14960
- currentTickMax.ticks[i] = currentTextWidth;
14979
+ currentTickMax.ticks[i] = width;
14961
14980
  }
14962
14981
  });
14963
14982
  dummy.remove();
14964
14983
  }
14965
- if (maxWidth > 0) {
14966
- currentTickMax.size = maxWidth;
14967
- }
14968
- return currentTickMax.size;
14984
+ Object.keys(max).forEach(function (key) {
14985
+ _newArrowCheck(this, _this11);
14986
+ if (max[key] > 0) {
14987
+ currentTickMax[key] = max[key];
14988
+ }
14989
+ }.bind(this));
14990
+ return currentTickMax;
14969
14991
  };
14970
14992
  _proto.getXAxisTickTextY2Overflow = function getXAxisTickTextY2Overflow(defaultPadding) {
14971
14993
  const $$ = this.owner,
@@ -14989,7 +15011,7 @@ let Axis_Axis = /*#__PURE__*/function () {
14989
15011
  config = $$.config,
14990
15012
  state = $$.state,
14991
15013
  isTimeSeries = axis.isTimeSeries(),
14992
- tickTextWidths = state.current.maxTickWidths.x.ticks,
15014
+ tickTextWidths = state.current.maxTickSize.x.ticks,
14993
15015
  tickCount = tickTextWidths.length,
14994
15016
  _state$axis$x$padding = state.axis.x.padding,
14995
15017
  left = _state$axis$x$padding.left,
@@ -15258,7 +15280,7 @@ let Axis_Axis = /*#__PURE__*/function () {
15258
15280
 
15259
15281
  // set/unset x_axis_tick_clippath
15260
15282
  if (type === "x") {
15261
- const clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
15283
+ const clipPath = current.maxTickSize.x.clipPath ? clip.pathXAxisTickTexts : null;
15262
15284
  $el.svg.selectAll("." + $AXIS.axisX + " .tick text").attr("clip-path", clipPath);
15263
15285
  }
15264
15286
  }
@@ -16170,13 +16192,13 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
16170
16192
  setXAxisTickClipWidth: function setXAxisTickClipWidth() {
16171
16193
  const $$ = this,
16172
16194
  config = $$.config,
16173
- maxTickWidths = $$.state.current.maxTickWidths,
16195
+ maxTickSize = $$.state.current.maxTickSize,
16174
16196
  xAxisTickRotate = $$.getAxisTickRotate("x");
16175
16197
  if (!config.axis_x_tick_multiline && xAxisTickRotate) {
16176
16198
  const sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));
16177
- maxTickWidths.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
16199
+ maxTickSize.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
16178
16200
  } else {
16179
- maxTickWidths.x.clipPath = null;
16201
+ maxTickSize.x.clipPath = null;
16180
16202
  }
16181
16203
  },
16182
16204
  setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
@@ -16186,7 +16208,7 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
16186
16208
  current = _$$$state5.current,
16187
16209
  svg = $$.$el.svg;
16188
16210
  if (svg) {
16189
- svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickWidths.x.clipPath).attr("height", 30);
16211
+ svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickSize.x.clipPath).attr("height", 30);
16190
16212
  }
16191
16213
  }
16192
16214
  });
@@ -16765,7 +16787,8 @@ function smoothLines(el, type) {
16765
16787
  if ($$.axis) {
16766
16788
  var _$$$axis, _$$$config$padding;
16767
16789
  const position = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.getLabelPositionById(id),
16768
- width = $$.axis.getMaxTickWidth(id, withoutRecompute),
16790
+ _$$$axis$getMaxTickSi = $$.axis.getMaxTickSize(id, withoutRecompute),
16791
+ width = _$$$axis$getMaxTickSi.width,
16769
16792
  gap = width === 0 ? .5 : 0;
16770
16793
  return width + (((_$$$config$padding = $$.config.padding) == null ? void 0 : _$$$config$padding.mode) === "fit" ? position.isInner ? 10 + gap : 10 : position.isInner ? 20 + gap : 40);
16771
16794
  } else {
@@ -16799,16 +16822,18 @@ function smoothLines(el, type) {
16799
16822
  if (id === "y2" && !config.axis_y2_show) {
16800
16823
  return isFitPadding ? 0 : rotatedPadding.top;
16801
16824
  }
16802
- const rotate = $$.getAxisTickRotate(id);
16803
-
16825
+ const maxtickSize = $$.axis.getMaxTickSize(id),
16826
+ rotate = $$.getAxisTickRotate(id);
16804
16827
  // Calculate x/y axis height when tick rotated
16805
16828
  if ((id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate) {
16806
- h = 30 + $$.axis.getMaxTickWidth(id) * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
16829
+ h += maxtickSize.width * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
16807
16830
  if (!config.axis_x_tick_multiline && current.height) {
16808
16831
  if (h > current.height / 2) {
16809
16832
  h = current.height / 2;
16810
16833
  }
16811
16834
  }
16835
+ } else if (maxtickSize.height > 13 && config.legend_show) {
16836
+ h += maxtickSize.height - 13;
16812
16837
  }
16813
16838
  return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
16814
16839
  },
@@ -16837,7 +16862,7 @@ function smoothLines(el, type) {
16837
16862
  const allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
16838
16863
  if (config.axis_x_tick_fit && allowedXAxisTypes) {
16839
16864
  const xTickCount = config.axis_x_tick_count,
16840
- currentXTicksLength = state.current.maxTickWidths.x.ticks.length;
16865
+ currentXTicksLength = state.current.maxTickSize.x.ticks.length;
16841
16866
  let tickCount = 0;
16842
16867
  if (xTickCount) {
16843
16868
  tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;
@@ -16868,9 +16893,10 @@ function smoothLines(el, type) {
16868
16893
  current = _$$$state.current,
16869
16894
  xAxisLength = current.width - $$.getCurrentPaddingByDirection("left") - $$.getCurrentPaddingByDirection("right"),
16870
16895
  tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
16871
- maxTickWidth = $$.axis.getMaxTickWidth("x"),
16896
+ _$$$axis$getMaxTickSi2 = $$.axis.getMaxTickSize("x"),
16897
+ width = _$$$axis$getMaxTickSi2.width,
16872
16898
  tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
16873
- return maxTickWidth > tickLength;
16899
+ return width > tickLength;
16874
16900
  }
16875
16901
  });
16876
16902
  ;// CONCATENATED MODULE: ./src/config/Options/data/axis.ts
@@ -18197,18 +18223,6 @@ function smoothLines(el, type) {
18197
18223
  * y2 Axis config options
18198
18224
  */
18199
18225
  /* harmony default export */ var y2 = ({
18200
- /**
18201
- * Set clip-path attribute for y2 axis element
18202
- * - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
18203
- * @name axis․y2․clipPath
18204
- * @memberof Options
18205
- * @type {boolean}
18206
- * @default true
18207
- * @example
18208
- * // don't set 'clip-path' attribute
18209
- * clipPath: false
18210
- */
18211
- axis_y2_clipPath: !0,
18212
18226
  /**
18213
18227
  * Show or hide y2 axis.
18214
18228
  * - **NOTE**:
@@ -25528,7 +25542,7 @@ let _defaults = {};
25528
25542
 
25529
25543
  /**
25530
25544
  * @namespace bb
25531
- * @version 3.10.0-next.6
25545
+ * @version 3.10.0
25532
25546
  */
25533
25547
  const bb = {
25534
25548
  /**
@@ -25538,7 +25552,7 @@ const bb = {
25538
25552
  * bb.version; // "1.0.0"
25539
25553
  * @memberof bb
25540
25554
  */
25541
- version: "3.10.0-next.6",
25555
+ version: "3.10.0",
25542
25556
  /**
25543
25557
  * Generate chart
25544
25558
  * - **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.10.0-next.6
8
+ * @version 3.10.0
9
9
  */.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value,.bb-chart-arcs .bb-needle{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-axis{shape-rendering:crispEdges}.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:grey;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-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region rect{fill:#4682b4;fill-opacity:.1}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9;white-space:nowrap}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.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{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}