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
  * All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
11
11
  * - @types/d3-selection ^3.0.4
@@ -26370,11 +26370,12 @@ function getDataKeyForJson(keysParam, config) {
26370
26370
  }.bind(this))).map(function (v) {
26371
26371
  _newArrowCheck(this, _this14);
26372
26372
  return v.value;
26373
- }.bind(this)).reduce(function (p, c) {
26373
+ }.bind(this));
26374
+ total = sum.length ? sum.reduce(function (p, c) {
26374
26375
  _newArrowCheck(this, _this14);
26375
26376
  return p + c;
26376
- }.bind(this));
26377
- $$.cache.add(cacheKey, total = sum);
26377
+ }.bind(this)) : 0;
26378
+ $$.cache.add(cacheKey, total);
26378
26379
  }
26379
26380
  if (subtractHidden) {
26380
26381
  total -= $$.getHiddenTotalDataSum();
@@ -29667,14 +29668,14 @@ function getLegendColor(id) {
29667
29668
  $$.updateCircleY && ($$.circleY = $$.updateCircleY());
29668
29669
  }
29669
29670
 
29671
+ // Data empty label positioning and text.
29672
+ 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);
29673
+
29670
29674
  // update axis
29671
29675
  if (state.hasAxis) {
29672
29676
  // @TODO: Make 'init' state to be accessible everywhere not passing as argument.
29673
29677
  $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);
29674
29678
 
29675
- // Data empty label positioning and text.
29676
- 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);
29677
-
29678
29679
  // grid
29679
29680
  $$.hasGrid() && $$.updateGrid();
29680
29681
 
@@ -43963,6 +43964,7 @@ function getAttrTweenFn(fn) {
43963
43964
  state = $$.state,
43964
43965
  hasMultiArcGauge = $$.hasMultiArcGauge(),
43965
43966
  isFullCircle = config.gauge_fullCircle,
43967
+ showEmptyTextLabel = $$.filterTargetsToShow($$.data.targets).length === 0 && !!config.data_empty_label_text,
43966
43968
  startAngle = $$.getStartAngle(),
43967
43969
  endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
43968
43970
  backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + $ARC.chartArcsBackground);
@@ -43975,7 +43977,7 @@ function getAttrTweenFn(fn) {
43975
43977
  }.bind(this)).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
43976
43978
  var id = _ref2.id;
43977
43979
  _newArrowCheck(this, _this14);
43978
- if (state.hiddenTargetIds.indexOf(id) >= 0) {
43980
+ if (showEmptyTextLabel || state.hiddenTargetIds.indexOf(id) >= 0) {
43979
43981
  return "M 0 0";
43980
43982
  }
43981
43983
  var d = {
@@ -43990,7 +43992,7 @@ function getAttrTweenFn(fn) {
43990
43992
  }.bind(this));
43991
43993
  backgroundArc.exit().remove();
43992
43994
  } else {
43993
- backgroundArc.attr("d", function () {
43995
+ backgroundArc.attr("d", showEmptyTextLabel ? "M 0 0" : function () {
43994
43996
  _newArrowCheck(this, _this14);
43995
43997
  var d = {
43996
43998
  data: [{
@@ -50895,7 +50897,7 @@ var _defaults = {};
50895
50897
 
50896
50898
  /**
50897
50899
  * @namespace bb
50898
- * @version 3.7.3
50900
+ * @version 3.7.4
50899
50901
  */
50900
50902
  var bb = {
50901
50903
  /**
@@ -50905,7 +50907,7 @@ var bb = {
50905
50907
  * bb.version; // "1.0.0"
50906
50908
  * @memberof bb
50907
50909
  */
50908
- version: "3.7.3",
50910
+ version: "3.7.4",
50909
50911
  /**
50910
50912
  * Generate chart
50911
50913
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: