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,11 +5,11 @@
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
  * All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
11
- * - @types/d3-selection ^3.0.7
12
- * - @types/d3-transition ^3.0.5
11
+ * - @types/d3-selection ^3.0.8
12
+ * - @types/d3-transition ^3.0.6
13
13
  * - d3-axis ^3.0.0
14
14
  * - d3-brush ^3.0.0
15
15
  * - d3-drag ^3.0.0
@@ -24895,19 +24895,22 @@ let State = function () {
24895
24895
  width: 0,
24896
24896
  height: 0,
24897
24897
  dataMax: 0,
24898
- maxTickWidths: {
24898
+ maxTickSize: {
24899
24899
  x: {
24900
- size: 0,
24900
+ width: 0,
24901
+ height: 0,
24901
24902
  ticks: [],
24902
24903
  clipPath: 0,
24903
24904
  domain: ""
24904
24905
  },
24905
24906
  y: {
24906
- size: 0,
24907
+ width: 0,
24908
+ height: 0,
24907
24909
  domain: ""
24908
24910
  },
24909
24911
  y2: {
24910
- size: 0,
24912
+ width: 0,
24913
+ height: 0,
24911
24914
  domain: ""
24912
24915
  }
24913
24916
  },
@@ -37007,7 +37010,7 @@ let ChartInternal = /*#__PURE__*/function () {
37007
37010
  if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || config.data_labels_backgroundColors) {
37008
37011
  $el.defs = $el.svg.append("defs");
37009
37012
  if (hasAxis) {
37010
- ["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach(function (v) {
37013
+ ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
37011
37014
  _newArrowCheck(this, _this3);
37012
37015
  $$.appendClip($el.defs, state.clip[v]);
37013
37016
  }.bind(this));
@@ -40944,7 +40947,7 @@ let Axis_Axis = /*#__PURE__*/function () {
40944
40947
  id === "x" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing) ? !0 : noTransition);
40945
40948
  }
40946
40949
 
40947
- // called from : getMaxTickWidth()
40950
+ // called from : getMaxTickSize()
40948
40951
  ;
40949
40952
  _proto.getAxis = function getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {
40950
40953
  var _this8 = this;
@@ -41171,7 +41174,8 @@ let Axis_Axis = /*#__PURE__*/function () {
41171
41174
  isRotated = config.axis_rotated,
41172
41175
  isInner = this.getAxisLabelPosition(id).isInner,
41173
41176
  tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
41174
- maxTickWidth = this.getMaxTickWidth(id);
41177
+ _this$getMaxTickSize = this.getMaxTickSize(id),
41178
+ maxTickWidth = _this$getMaxTickSize.width;
41175
41179
  let dy;
41176
41180
  if (id === "x") {
41177
41181
  const xHeight = config.axis_x_height;
@@ -41204,8 +41208,16 @@ let Axis_Axis = /*#__PURE__*/function () {
41204
41208
  }
41205
41209
  }
41206
41210
  return dy;
41207
- };
41208
- _proto.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
41211
+ }
41212
+
41213
+ /**
41214
+ * Get max tick size
41215
+ * @param {string} id axis id string
41216
+ * @param {boolean} withoutRecompute wheather or not to recompute
41217
+ * @returns {object} {width, height}
41218
+ * @private
41219
+ */;
41220
+ _proto.getMaxTickSize = function getMaxTickSize(id, withoutRecompute) {
41209
41221
  var _this11 = this;
41210
41222
  const $$ = this.owner,
41211
41223
  config = $$.config,
@@ -41213,10 +41225,13 @@ let Axis_Axis = /*#__PURE__*/function () {
41213
41225
  _$$$$el2 = $$.$el,
41214
41226
  svg = _$$$$el2.svg,
41215
41227
  chart = _$$$$el2.chart,
41216
- currentTickMax = current.maxTickWidths[id];
41217
- let maxWidth = 0;
41218
- if (withoutRecompute || !config["axis_" + id + "_show"] || currentTickMax.size > 0 && $$.filterTargetsToShow().length === 0) {
41219
- return currentTickMax.size;
41228
+ currentTickMax = current.maxTickSize[id],
41229
+ max = {
41230
+ width: 0,
41231
+ height: 0
41232
+ };
41233
+ if (withoutRecompute || !config["axis_" + id + "_show"] || currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0) {
41234
+ return currentTickMax;
41220
41235
  }
41221
41236
  if (svg) {
41222
41237
  const isYAxis = /^y2?$/.test(id),
@@ -41256,19 +41271,26 @@ let Axis_Axis = /*#__PURE__*/function () {
41256
41271
  const dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
41257
41272
  axis.create(dummy);
41258
41273
  dummy.selectAll("text").each(function (d, i) {
41259
- const currentTextWidth = this.getBoundingClientRect().width;
41260
- maxWidth = Math.max(maxWidth, currentTextWidth);
41274
+ const _this$getBoundingClie = this.getBoundingClientRect(),
41275
+ width = _this$getBoundingClie.width,
41276
+ height = _this$getBoundingClie.height;
41277
+ max.width = Math.max(max.width, width);
41278
+ max.height = Math.max(max.height, height);
41279
+
41261
41280
  // cache tick text width for getXAxisTickTextY2Overflow()
41262
41281
  if (!isYAxis) {
41263
- currentTickMax.ticks[i] = currentTextWidth;
41282
+ currentTickMax.ticks[i] = width;
41264
41283
  }
41265
41284
  });
41266
41285
  dummy.remove();
41267
41286
  }
41268
- if (maxWidth > 0) {
41269
- currentTickMax.size = maxWidth;
41270
- }
41271
- return currentTickMax.size;
41287
+ Object.keys(max).forEach(function (key) {
41288
+ _newArrowCheck(this, _this11);
41289
+ if (max[key] > 0) {
41290
+ currentTickMax[key] = max[key];
41291
+ }
41292
+ }.bind(this));
41293
+ return currentTickMax;
41272
41294
  };
41273
41295
  _proto.getXAxisTickTextY2Overflow = function getXAxisTickTextY2Overflow(defaultPadding) {
41274
41296
  const $$ = this.owner,
@@ -41292,7 +41314,7 @@ let Axis_Axis = /*#__PURE__*/function () {
41292
41314
  config = $$.config,
41293
41315
  state = $$.state,
41294
41316
  isTimeSeries = axis.isTimeSeries(),
41295
- tickTextWidths = state.current.maxTickWidths.x.ticks,
41317
+ tickTextWidths = state.current.maxTickSize.x.ticks,
41296
41318
  tickCount = tickTextWidths.length,
41297
41319
  _state$axis$x$padding = state.axis.x.padding,
41298
41320
  left = _state$axis$x$padding.left,
@@ -41561,7 +41583,7 @@ let Axis_Axis = /*#__PURE__*/function () {
41561
41583
 
41562
41584
  // set/unset x_axis_tick_clippath
41563
41585
  if (type === "x") {
41564
- const clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
41586
+ const clipPath = current.maxTickSize.x.clipPath ? clip.pathXAxisTickTexts : null;
41565
41587
  $el.svg.selectAll("." + $AXIS.axisX + " .tick text").attr("clip-path", clipPath);
41566
41588
  }
41567
41589
  }
@@ -42478,13 +42500,13 @@ const src_linear_linear = function (t) {
42478
42500
  setXAxisTickClipWidth: function setXAxisTickClipWidth() {
42479
42501
  const $$ = this,
42480
42502
  config = $$.config,
42481
- maxTickWidths = $$.state.current.maxTickWidths,
42503
+ maxTickSize = $$.state.current.maxTickSize,
42482
42504
  xAxisTickRotate = $$.getAxisTickRotate("x");
42483
42505
  if (!config.axis_x_tick_multiline && xAxisTickRotate) {
42484
42506
  const sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));
42485
- maxTickWidths.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
42507
+ maxTickSize.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
42486
42508
  } else {
42487
- maxTickWidths.x.clipPath = null;
42509
+ maxTickSize.x.clipPath = null;
42488
42510
  }
42489
42511
  },
42490
42512
  setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
@@ -42494,7 +42516,7 @@ const src_linear_linear = function (t) {
42494
42516
  current = _$$$state5.current,
42495
42517
  svg = $$.$el.svg;
42496
42518
  if (svg) {
42497
- svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickWidths.x.clipPath).attr("height", 30);
42519
+ svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickSize.x.clipPath).attr("height", 30);
42498
42520
  }
42499
42521
  }
42500
42522
  });
@@ -43073,7 +43095,8 @@ function smoothLines(el, type) {
43073
43095
  if ($$.axis) {
43074
43096
  var _$$$axis, _$$$config$padding;
43075
43097
  const position = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.getLabelPositionById(id),
43076
- width = $$.axis.getMaxTickWidth(id, withoutRecompute),
43098
+ _$$$axis$getMaxTickSi = $$.axis.getMaxTickSize(id, withoutRecompute),
43099
+ width = _$$$axis$getMaxTickSi.width,
43077
43100
  gap = width === 0 ? .5 : 0;
43078
43101
  return width + (((_$$$config$padding = $$.config.padding) == null ? void 0 : _$$$config$padding.mode) === "fit" ? position.isInner ? 10 + gap : 10 : position.isInner ? 20 + gap : 40);
43079
43102
  } else {
@@ -43107,16 +43130,18 @@ function smoothLines(el, type) {
43107
43130
  if (id === "y2" && !config.axis_y2_show) {
43108
43131
  return isFitPadding ? 0 : rotatedPadding.top;
43109
43132
  }
43110
- const rotate = $$.getAxisTickRotate(id);
43111
-
43133
+ const maxtickSize = $$.axis.getMaxTickSize(id),
43134
+ rotate = $$.getAxisTickRotate(id);
43112
43135
  // Calculate x/y axis height when tick rotated
43113
43136
  if ((id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate) {
43114
- h = 30 + $$.axis.getMaxTickWidth(id) * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
43137
+ h += maxtickSize.width * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
43115
43138
  if (!config.axis_x_tick_multiline && current.height) {
43116
43139
  if (h > current.height / 2) {
43117
43140
  h = current.height / 2;
43118
43141
  }
43119
43142
  }
43143
+ } else if (maxtickSize.height > 13 && config.legend_show) {
43144
+ h += maxtickSize.height - 13;
43120
43145
  }
43121
43146
  return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
43122
43147
  },
@@ -43145,7 +43170,7 @@ function smoothLines(el, type) {
43145
43170
  const allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
43146
43171
  if (config.axis_x_tick_fit && allowedXAxisTypes) {
43147
43172
  const xTickCount = config.axis_x_tick_count,
43148
- currentXTicksLength = state.current.maxTickWidths.x.ticks.length;
43173
+ currentXTicksLength = state.current.maxTickSize.x.ticks.length;
43149
43174
  let tickCount = 0;
43150
43175
  if (xTickCount) {
43151
43176
  tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;
@@ -43176,9 +43201,10 @@ function smoothLines(el, type) {
43176
43201
  current = _$$$state.current,
43177
43202
  xAxisLength = current.width - $$.getCurrentPaddingByDirection("left") - $$.getCurrentPaddingByDirection("right"),
43178
43203
  tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
43179
- maxTickWidth = $$.axis.getMaxTickWidth("x"),
43204
+ _$$$axis$getMaxTickSi2 = $$.axis.getMaxTickSize("x"),
43205
+ width = _$$$axis$getMaxTickSi2.width,
43180
43206
  tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
43181
- return maxTickWidth > tickLength;
43207
+ return width > tickLength;
43182
43208
  }
43183
43209
  });
43184
43210
  ;// CONCATENATED MODULE: ./src/config/Options/data/axis.ts
@@ -44505,18 +44531,6 @@ function smoothLines(el, type) {
44505
44531
  * y2 Axis config options
44506
44532
  */
44507
44533
  /* harmony default export */ var y2 = ({
44508
- /**
44509
- * Set clip-path attribute for y2 axis element
44510
- * - **NOTE**: `clip-path` attribute for y2 Axis is set only when `axis.y2.inner` option is true.
44511
- * @name axis․y2․clipPath
44512
- * @memberof Options
44513
- * @type {boolean}
44514
- * @default true
44515
- * @example
44516
- * // don't set 'clip-path' attribute
44517
- * clipPath: false
44518
- */
44519
- axis_y2_clipPath: !0,
44520
44534
  /**
44521
44535
  * Show or hide y2 axis.
44522
44536
  * - **NOTE**:
@@ -53612,7 +53626,7 @@ let _defaults = {};
53612
53626
 
53613
53627
  /**
53614
53628
  * @namespace bb
53615
- * @version 3.10.0-next.6
53629
+ * @version 3.10.0
53616
53630
  */
53617
53631
  const bb = {
53618
53632
  /**
@@ -53622,7 +53636,7 @@ const bb = {
53622
53636
  * bb.version; // "1.0.0"
53623
53637
  * @memberof bb
53624
53638
  */
53625
- version: "3.10.0-next.6",
53639
+ version: "3.10.0",
53626
53640
  /**
53627
53641
  * Generate chart
53628
53642
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: