billboard.js 3.7.3 → 3.7.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 (37) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +13 -11
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +13 -11
  6. package/dist/billboard.pkgd.min.js +2 -2
  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.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2 -2
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +16 -14
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  34. package/package.json +7 -7
  35. package/src/ChartInternal/data/data.ts +4 -3
  36. package/src/ChartInternal/internals/redraw.ts +7 -7
  37. package/src/ChartInternal/shape/arc.ts +4 -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.7.3
8
+ * @version 3.7.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.7.3
8
+ * @version 3.7.4
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -4618,11 +4618,12 @@ function getDataKeyForJson(keysParam, config) {
4618
4618
  }.bind(this))).map(function (v) {
4619
4619
  _newArrowCheck(this, _this14);
4620
4620
  return v.value;
4621
- }.bind(this)).reduce(function (p, c) {
4621
+ }.bind(this));
4622
+ total = sum.length ? sum.reduce(function (p, c) {
4622
4623
  _newArrowCheck(this, _this14);
4623
4624
  return p + c;
4624
- }.bind(this));
4625
- $$.cache.add(cacheKey, total = sum);
4625
+ }.bind(this)) : 0;
4626
+ $$.cache.add(cacheKey, total);
4626
4627
  }
4627
4628
  if (subtractHidden) {
4628
4629
  total -= $$.getHiddenTotalDataSum();
@@ -7382,14 +7383,14 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
7382
7383
  $$.updateCircleY && ($$.circleY = $$.updateCircleY());
7383
7384
  }
7384
7385
 
7386
+ // Data empty label positioning and text.
7387
+ config.data_empty_label_text && main.select("text." + $TEXT.text + "." + $COMMON.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null);
7388
+
7385
7389
  // update axis
7386
7390
  if (state.hasAxis) {
7387
7391
  // @TODO: Make 'init' state to be accessible everywhere not passing as argument.
7388
7392
  $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
7389
7393
 
7390
- // Data empty label positioning and text.
7391
- config.data_empty_label_text && main.select("text." + $TEXT.text + "." + $COMMON.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null);
7392
-
7393
7394
  // grid
7394
7395
  $$.hasGrid() && $$.updateGrid();
7395
7396
 
@@ -18826,6 +18827,7 @@ function getAttrTweenFn(fn) {
18826
18827
  state = $$.state,
18827
18828
  hasMultiArcGauge = $$.hasMultiArcGauge(),
18828
18829
  isFullCircle = config.gauge_fullCircle,
18830
+ showEmptyTextLabel = $$.filterTargetsToShow($$.data.targets).length === 0 && !!config.data_empty_label_text,
18829
18831
  startAngle = $$.getStartAngle(),
18830
18832
  endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
18831
18833
  backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + $ARC.chartArcsBackground);
@@ -18838,7 +18840,7 @@ function getAttrTweenFn(fn) {
18838
18840
  }.bind(this)).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
18839
18841
  var id = _ref2.id;
18840
18842
  _newArrowCheck(this, _this14);
18841
- if (state.hiddenTargetIds.indexOf(id) >= 0) {
18843
+ if (showEmptyTextLabel || state.hiddenTargetIds.indexOf(id) >= 0) {
18842
18844
  return "M 0 0";
18843
18845
  }
18844
18846
  var d = {
@@ -18853,7 +18855,7 @@ function getAttrTweenFn(fn) {
18853
18855
  }.bind(this));
18854
18856
  backgroundArc.exit().remove();
18855
18857
  } else {
18856
- backgroundArc.attr("d", function () {
18858
+ backgroundArc.attr("d", showEmptyTextLabel ? "M 0 0" : function () {
18857
18859
  _newArrowCheck(this, _this14);
18858
18860
  var d = {
18859
18861
  data: [{
@@ -24504,7 +24506,7 @@ var _defaults = {};
24504
24506
 
24505
24507
  /**
24506
24508
  * @namespace bb
24507
- * @version 3.7.3
24509
+ * @version 3.7.4
24508
24510
  */
24509
24511
  var bb = {
24510
24512
  /**
@@ -24514,7 +24516,7 @@ var bb = {
24514
24516
  * bb.version; // "1.0.0"
24515
24517
  * @memberof bb
24516
24518
  */
24517
- version: "3.7.3",
24519
+ version: "3.7.4",
24518
24520
  /**
24519
24521
  * Generate chart
24520
24522
  * - **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.7.3
8
+ * @version 3.7.4
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-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.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-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{fill:#4682b4}.bb-brush .extent,.bb-region,.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;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.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}