billboard.js 3.11.2 → 3.11.3

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/README.md +1 -1
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +29 -16
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +2 -2
  6. package/dist/billboard.pkgd.js +29 -16
  7. package/dist/billboard.pkgd.min.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
  27. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
  28. package/dist/theme/dark.css +1 -1
  29. package/dist/theme/dark.min.css +1 -1
  30. package/dist/theme/datalab.css +1 -1
  31. package/dist/theme/datalab.min.css +1 -1
  32. package/dist/theme/graph.css +1 -1
  33. package/dist/theme/graph.min.css +1 -1
  34. package/dist/theme/insight.css +1 -1
  35. package/dist/theme/insight.min.css +1 -1
  36. package/dist/theme/modern.css +1 -1
  37. package/dist/theme/modern.min.css +1 -1
  38. package/dist-esm/billboard.js +21 -20
  39. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  44. package/package.json +17 -17
  45. package/src/ChartInternal/data/IData.ts +2 -2
  46. package/src/ChartInternal/internals/clip.ts +1 -6
  47. package/src/ChartInternal/internals/legend.ts +6 -5
  48. package/src/ChartInternal/internals/tooltip.ts +10 -6
  49. package/src/config/Options/common/legend.ts +1 -1
package/README.md CHANGED
@@ -40,7 +40,7 @@ If you have any questions, checkout the previous posts or create a new one at:
40
40
  - [Issue with 'question' label](https://github.com/naver/billboard.js/issues?utf8=%E2%9C%93&q=label%3Aquestion)
41
41
 
42
42
  ## Supported chart types
43
- <img src="https://naver.github.io/billboard.js/img/chart-types.png?v=11" width=800>
43
+ <img src="https://naver.github.io/billboard.js/img/chart-types.png?v=13" width=800>
44
44
 
45
45
  ## Download and Installation
46
46
 
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.11.2
8
+ * @version 3.11.3
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.11.2
8
+ * @version 3.11.3
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -3273,7 +3273,7 @@ var data_this = undefined;
3273
3273
  * - rectangle
3274
3274
  * @property {boolean} [legend.format] Set formatter function for legend text.
3275
3275
  * The argument:<br>
3276
- * - `id`: legend text(which is data id) value
3276
+ * - `id`: legend text value. When `data.names` is specified, will pass from it, otherwise will pass data id.
3277
3277
  * @property {boolean} [legend.tooltip=false] Show full legend text value using system tooltip(via `<title>` element).
3278
3278
  * @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
3279
3279
  * @see [Demo: format](https://naver.github.io/billboard.js/demo/#Legend.LegendFormat)
@@ -6967,13 +6967,17 @@ function getLegendColor(id) {
6967
6967
  /**
6968
6968
  * Get formatted text value
6969
6969
  * @param {string} id Legend text id
6970
+ * @param {boolean} formatted Whether or not to format the text
6970
6971
  * @returns {string} Formatted legend text
6971
6972
  */
6972
- function getFormattedText(id) {
6973
+ function getFormattedText(id, formatted) {
6973
6974
  var _config$data_names$id;
6975
+ if (formatted === void 0) {
6976
+ formatted = !0;
6977
+ }
6974
6978
  const config = this.config;
6975
6979
  let text = (_config$data_names$id = config.data_names[id]) != null ? _config$data_names$id : id;
6976
- if (isFunction(config.legend_format)) {
6980
+ if (formatted && isFunction(config.legend_format)) {
6977
6981
  text = config.legend_format(text);
6978
6982
  }
6979
6983
  return text;
@@ -7478,10 +7482,13 @@ function getFormattedText(id) {
7478
7482
  if (config.legend_tooltip) {
7479
7483
  legend.selectAll("title").data(targetIdz).text(function (id) {
7480
7484
  _newArrowCheck(this, _this4);
7481
- return id;
7485
+ return getFormattedText.bind($$)(id, !1);
7482
7486
  }.bind(this));
7483
7487
  }
7484
- const texts = legend.selectAll("text").data(targetIdz).text(getFormattedText.bind($$)) // MEMO: needed for update
7488
+ const texts = legend.selectAll("text").data(targetIdz).text(function (id) {
7489
+ _newArrowCheck(this, _this4);
7490
+ return getFormattedText.bind($$)(id);
7491
+ }.bind(this)) // MEMO: needed for update
7485
7492
  .each(function (id, i) {
7486
7493
  updatePositions(this, id, i);
7487
7494
  });
@@ -7622,7 +7629,10 @@ function getFormattedText(id) {
7622
7629
  return id;
7623
7630
  }.bind(this));
7624
7631
  }
7625
- l.append("text").text(getFormattedText.bind($$)).each(function (id, i) {
7632
+ l.append("text").text(function (id) {
7633
+ _newArrowCheck(this, _this6);
7634
+ return getFormattedText.bind($$)(id);
7635
+ }.bind(this)).each(function (id, i) {
7626
7636
  updatePositions(this, id, i);
7627
7637
  }).style("pointer-events", $$.getStylePropValue("none")).attr("x", isLegendRightOrInset ? posFn.xText : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yText);
7628
7638
  l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", $$.getStylePropValue("0")).attr("x", isLegendRightOrInset ? posFn.xRect : -200).attr("y", isLegendRightOrInset ? -200 : posFn.yRect);
@@ -10081,11 +10091,11 @@ function getTextXPos(pos, width) {
10081
10091
  width = _state.width,
10082
10092
  height = _state.height,
10083
10093
  current = _state.current,
10094
+ hasRadar = _state.hasRadar,
10095
+ hasTreemap = _state.hasTreemap,
10084
10096
  isLegendRight = _state.isLegendRight,
10085
10097
  inputType = _state.inputType,
10086
10098
  hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
10087
- hasTreemap = state.hasTreemap,
10088
- hasRadar = state.hasRadar,
10089
10099
  isRotated = config.axis_rotated,
10090
10100
  hasArcType = $$.hasArcType(),
10091
10101
  svgLeft = $$.getSvgLeft(!0);
@@ -10099,10 +10109,14 @@ function getTextXPos(pos, width) {
10099
10109
  x += x >= width / 2 ? 15 : -(tWidth + 15);
10100
10110
  y += 15;
10101
10111
  } else if (hasArcType) {
10102
- if (!(inputType === "touch")) {
10103
- var _$$$getTitlePadding;
10112
+ if (inputType !== "touch") {
10113
+ var _$$$getTitlePadding, _config$arc_rangeText;
10114
+ let titlePadding = (_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0;
10115
+ if (titlePadding && hasGauge && (_config$arc_rangeText = config.arc_rangeText_values) != null && _config$arc_rangeText.length) {
10116
+ titlePadding += 10;
10117
+ }
10104
10118
  x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
10105
- y += (hasGauge ? height : height / 2 + tHeight) + ((_$$$getTitlePadding = $$.getTitlePadding == null ? void 0 : $$.getTitlePadding()) != null ? _$$$getTitlePadding : 0);
10119
+ y += (hasGauge ? height : height / 2 + tHeight) + titlePadding;
10106
10120
  }
10107
10121
  } else if (hasTreemap) {
10108
10122
  y += tHeight;
@@ -16334,8 +16348,7 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
16334
16348
  if (!config.clipPath && /-clip$/.test(id) || !config.axis_x_clipPath && /-clip-xaxis$/.test(id) || !config.axis_y_clipPath && /-clip-yaxis$/.test(id)) {
16335
16349
  return null;
16336
16350
  }
16337
- const isIE9 = win.navigator ? win.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0 : !1;
16338
- return "url(" + (isIE9 ? "" : browser_doc.URL.split("#")[0]) + "#" + id + ")";
16351
+ return "url(#" + id + ")";
16339
16352
  },
16340
16353
  appendClip: function appendClip(parent, id) {
16341
16354
  id && parent.append("clipPath").attr("id", id).append("rect");
@@ -26022,7 +26035,7 @@ let _defaults = {};
26022
26035
 
26023
26036
  /**
26024
26037
  * @namespace bb
26025
- * @version 3.11.2
26038
+ * @version 3.11.3
26026
26039
  */
26027
26040
  const bb = {
26028
26041
  /**
@@ -26032,7 +26045,7 @@ const bb = {
26032
26045
  * bb.version; // "1.0.0"
26033
26046
  * @memberof bb
26034
26047
  */
26035
- version: "3.11.2",
26048
+ version: "3.11.3",
26036
26049
  /**
26037
26050
  * Generate chart
26038
26051
  * - **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.11.2
8
+ * @version 3.11.3
9
9
  */.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.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{fill:#4682b4}.bb-brush .extent,.bb-region rect,.bb-zoom-brush{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{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}