billboard.js 3.14.0-next.2 → 3.14.0-next.4

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 (51) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +41 -19
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +7 -7
  5. package/dist/billboard.pkgd.js +41 -19
  6. package/dist/billboard.pkgd.min.js +12 -12
  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 +4 -4
  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 +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 +4 -4
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +7 -7
  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 -20
  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 +4 -4
  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 +10 -10
  44. package/src/ChartInternal/Axis/Axis.ts +1 -1
  45. package/src/ChartInternal/Axis/AxisRenderer.ts +5 -7
  46. package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
  47. package/src/ChartInternal/data/IData.ts +4 -0
  48. package/src/ChartInternal/internals/grid.ts +2 -2
  49. package/src/ChartInternal/internals/scale.ts +4 -7
  50. package/src/ChartInternal/shape/bar.ts +51 -16
  51. package/src/Plugin/stanford/Elements.ts +2 -2
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.14.0-next.2
8
+ * @version 3.14.0-next.4
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.14.0-next.2
8
+ * @version 3.14.0-next.4
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -6427,9 +6427,8 @@ function getScale(type = "linear", min, max) {
6427
6427
  const $$ = this;
6428
6428
  const offset = offsetValue || (() => $$.axis.x.tickOffset());
6429
6429
  const isInverted = $$.config.axis_x_inverted;
6430
- const scale = function(d, raw) {
6431
- const v = scaleValue(d) + offset();
6432
- return raw ? v : Math.ceil(v);
6430
+ const scale = function(d) {
6431
+ return scaleValue(d) + offset();
6433
6432
  };
6434
6433
  for (const key in scaleValue) {
6435
6434
  scale[key] = scaleValue[key];
@@ -6552,13 +6551,13 @@ function getScale(type = "linear", min, max) {
6552
6551
  } else if (axis.isCategorized() && isString(value)) {
6553
6552
  value = config.axis_x_categories.indexOf(value);
6554
6553
  }
6555
- return Math.ceil(fn(value));
6554
+ return fn(value);
6556
6555
  },
6557
6556
  yv(d) {
6558
6557
  const $$ = this;
6559
6558
  const { scale: { y, y2 } } = $$;
6560
6559
  const yScale = d.axis && d.axis === "y2" ? y2 : y;
6561
- return Math.ceil(yScale($$.getBaseValue(d)));
6560
+ return yScale($$.getBaseValue(d));
6562
6561
  },
6563
6562
  subxx(d) {
6564
6563
  return d ? this.scale.subX(d.x) : null;
@@ -12784,7 +12783,7 @@ class AxisRendererHelper {
12784
12783
  return (selection, scale) => {
12785
12784
  selection.attr("transform", (d) => {
12786
12785
  const x = scale(d);
12787
- return isValue(d) ? fn(Math.ceil(x)) : null;
12786
+ return isValue(d) ? fn(x) : null;
12788
12787
  });
12789
12788
  };
12790
12789
  }
@@ -12922,7 +12921,7 @@ class AxisRenderer {
12922
12921
  let scale1 = helper.copyScale();
12923
12922
  $g = g2;
12924
12923
  this.__chart__ = scale1;
12925
- config.tickOffset = params.isCategory ? Math.ceil((scale1(1) - scale1(0)) / 2) : 0;
12924
+ config.tickOffset = params.isCategory ? (scale1(1) - scale1(0)) / 2 : 0;
12926
12925
  const path = g2.selectAll(".domain").data([0]);
12927
12926
  path.enter().append("path").attr("class", "domain").merge(path).attr("d", () => {
12928
12927
  const outerTickSized = config.outerTickSize * sign;
@@ -13097,9 +13096,7 @@ class AxisRenderer {
13097
13096
  }
13098
13097
  let tickWidth = params.tickWidth;
13099
13098
  if (!tickWidth || tickWidth <= 0) {
13100
- tickWidth = isLeftRight ? 95 : params.isCategory ? Math.ceil(
13101
- params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])
13102
- ) - 12 : 110;
13099
+ tickWidth = isLeftRight ? 95 : params.isCategory ? (params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
13103
13100
  }
13104
13101
  function split(splitted2, text) {
13105
13102
  let subtext;
@@ -13775,7 +13772,7 @@ class Axis_Axis {
13775
13772
  left * -1,
13776
13773
  $$.getXDomainMax($$.data.targets) + 1 + right
13777
13774
  ]);
13778
- tickOffset = Math.ceil((scale(1) - scale(0)) / 2);
13775
+ tickOffset = (scale(1) - scale(0)) / 2;
13779
13776
  }
13780
13777
  return maxOverflow + tickOffset;
13781
13778
  }
@@ -14782,7 +14779,7 @@ function smoothLines(el, type) {
14782
14779
  if (type === "grid") {
14783
14780
  el.each(function() {
14784
14781
  const g = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
14785
- ["x1", "x2", "y1", "y2"].forEach((v) => g.attr(v, Math.ceil(+g.attr(v))));
14782
+ ["x1", "x2", "y1", "y2"].forEach((v) => g.attr(v, +g.attr(v)));
14786
14783
  });
14787
14784
  }
14788
14785
  }
@@ -14843,7 +14840,7 @@ function smoothLines(el, type) {
14843
14840
  const $$ = this;
14844
14841
  const { axis, config, scale, state, $el: { grid, main } } = $$;
14845
14842
  const isRotated = config.axis_rotated;
14846
- const pos = (d) => Math.ceil(scale.y(d));
14843
+ const pos = (d) => scale.y(d);
14847
14844
  const gridValues = axis.y.getGeneratedTicks(config.grid_y_ticks) || $$.scale.y.ticks(config.grid_y_ticks);
14848
14845
  grid.y = main.select(`.${$GRID.ygrids}`).selectAll(`.${$GRID.ygrid}`).data(gridValues);
14849
14846
  grid.y.exit().remove();
@@ -18403,7 +18400,7 @@ function getAttrTweenFn(fn) {
18403
18400
  const $$ = this;
18404
18401
  const { bar } = isSub ? $$.$el.subchart : $$.$el;
18405
18402
  return [
18406
- $$.$T(bar, withTransition, getRandom()).attr("d", (d) => (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d)).style("fill", $$.updateBarColor.bind($$)).style("opacity", null)
18403
+ $$.$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)
18407
18404
  ];
18408
18405
  },
18409
18406
  /**
@@ -18442,19 +18439,44 @@ function getAttrTweenFn(fn) {
18442
18439
  const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
18443
18440
  const isNegative = !isInverted && isUnderZero || isInverted && !isUnderZero;
18444
18441
  const pathRadius = ["", ""];
18445
- let radius = 0;
18446
18442
  const isGrouped = $$.isGrouped(d.id);
18447
18443
  const isRadiusData = getRadius && isGrouped ? $$.isStackingRadiusData(d) : false;
18444
+ const init = [
18445
+ points[0][indexX],
18446
+ points[0][indexY]
18447
+ ];
18448
+ let radius = 0;
18449
+ d.clipPath = null;
18448
18450
  if (getRadius) {
18449
18451
  const index = isRotated ? indexY : indexX;
18450
18452
  const barW = points[2][index] - points[0][index];
18451
18453
  radius = !isGrouped || isRadiusData ? getRadius(barW) : 0;
18452
- const arc = `a${radius},${radius} ${isNegative ? `1 0 0` : `0 0 1`} `;
18454
+ const arc = `a${radius} ${radius} ${isNegative ? `1 0 0` : `0 0 1`} `;
18453
18455
  pathRadius[+!isRotated] = `${arc}${radius},${radius}`;
18454
18456
  pathRadius[+isRotated] = `${arc}${[-radius, radius][isRotated ? "sort" : "reverse"]()}`;
18455
18457
  isNegative && pathRadius.reverse();
18456
18458
  }
18457
- const path = isRotated ? `H${points[1][indexX] + (isNegative ? radius : -radius)} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` : `V${points[1][indexY] + (isNegative ? -radius : radius)} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;
18459
+ const pos = isRotated ? points[1][indexX] + (isNegative ? radius : -radius) : points[1][indexY] + (isNegative ? -radius : radius);
18460
+ if (radius) {
18461
+ let clipPath = "";
18462
+ if (isRotated) {
18463
+ if (isNegative && init[0] < pos) {
18464
+ clipPath = `0 ${pos - init[0]}px 0 0`;
18465
+ } else if (!isNegative && init[0] > pos) {
18466
+ clipPath = `0 0 0 ${init[0] - pos}px`;
18467
+ }
18468
+ } else {
18469
+ if (isNegative && init[1] > pos) {
18470
+ clipPath = `${init[1] - pos}px 0 0 0`;
18471
+ } else if (!isNegative && init[1] < pos) {
18472
+ clipPath = `0 0 ${pos - init[1]}px 0`;
18473
+ }
18474
+ }
18475
+ if (clipPath) {
18476
+ d.clipPath = `inset(${clipPath})`;
18477
+ }
18478
+ }
18479
+ 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]}`;
18458
18480
  return `M${points[0][indexX]},${points[0][indexY]}${path}z`;
18459
18481
  };
18460
18482
  },
@@ -21814,7 +21836,7 @@ const bb = {
21814
21836
  * bb.version; // "1.0.0"
21815
21837
  * @memberof bb
21816
21838
  */
21817
- version: "3.14.0-next.2",
21839
+ version: "3.14.0-next.4",
21818
21840
  /**
21819
21841
  * Generate chart
21820
21842
  * - **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.14.0-next.2
8
+ * @version 3.14.0-next.4
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}