billboard.js 3.3.1 → 3.3.2

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 (40) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +54 -25
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +520 -363
  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 +19 -11
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +18 -10
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +19 -11
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +19 -11
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +468 -340
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +485 -349
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +486 -350
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +487 -351
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +488 -352
  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 +50 -28
  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 +21 -21
  35. package/src/Chart/api/chart.ts +1 -1
  36. package/src/Chart/api/subchart.ts +8 -8
  37. package/src/ChartInternal/internals/format.ts +9 -4
  38. package/src/ChartInternal/internals/redraw.ts +3 -2
  39. package/src/config/Options/common/tooltip.ts +10 -1
  40. package/src/module/util.ts +16 -9
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
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.3.1
8
+ * @version 3.3.2
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -1107,19 +1107,27 @@ function isTabVisible() {
1107
1107
 
1108
1108
 
1109
1109
  function convertInputType(mouse, touch) {
1110
- var isMobile = !1; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop
1110
+ var hasTouch = !1;
1111
1111
 
1112
- if (/Mobi/.test(win.navigator.userAgent) && touch) {
1112
+ if (touch) {
1113
1113
  // Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
1114
- var hasTouchPoints = win.navigator && "maxTouchPoints" in win.navigator && win.navigator.maxTouchPoints > 0,
1115
- hasTouch = "ontouchmove" in win || win.DocumentTouch && browser_doc instanceof win.DocumentTouch; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
1116
- // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
1114
+ if (win.navigator && "maxTouchPoints" in win.navigator) {
1115
+ hasTouch = win.navigator.maxTouchPoints > 0; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
1116
+ // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
1117
+ } else if ("ontouchmove" in win || win.DocumentTouch && browser_doc instanceof win.DocumentTouch) {
1118
+ hasTouch = !0;
1119
+ } else {
1120
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
1121
+ var mQ = win.matchMedia && matchMedia("(pointer:coarse)");
1117
1122
 
1118
- isMobile = hasTouchPoints || hasTouch;
1123
+ if (mQ && mQ.media === "(pointer:coarse)") {
1124
+ hasTouch = !!mQ.matches;
1125
+ }
1126
+ }
1119
1127
  }
1120
1128
 
1121
- var hasMouse = mouse && !isMobile ? "onmouseover" in win : !1;
1122
- return hasMouse && "mouse" || isMobile && "touch" || null;
1129
+ var hasMouse = mouse && !hasTouch ? "onmouseover" in win : !1;
1130
+ return hasMouse && "mouse" || hasTouch && "touch" || null;
1123
1131
  }
1124
1132
  ;// CONCATENATED MODULE: ./src/module/error.ts
1125
1133
 
@@ -3147,7 +3155,16 @@ var Store = /*#__PURE__*/function () {
3147
3155
  * - `element {SVGElement}`: Tooltip event bound element
3148
3156
  * - `pos {object}`: Current position of the tooltip.
3149
3157
  * @property {Function|object} [tooltip.contents] Set custom HTML for the tooltip.<br>
3150
- * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points.
3158
+ * If tooltip.grouped is true, data includes multiple data points.<br><br>
3159
+ * Specified function receives `data` array and `defaultTitleFormat`, `defaultValueFormat` and `color` functions of the data point to show.
3160
+ * - **Note:**
3161
+ * - defaultTitleFormat:
3162
+ * - if `axis.x.tick.format` option will be used if set.
3163
+ * - otherwise, will return funciton based on tick format type(category, timeseries).
3164
+ * - defaultValueFormat:
3165
+ * - for Arc type (except gauge, radar), the function will return value from `(ratio * 100).toFixed(1)`.
3166
+ * - for Axis based types, will be used `axis.[y|y2].tick.format` option value if is set.
3167
+ * - otherwise, will parse value and return as number.
3151
3168
  * @property {string|HTMLElement} [tooltip.contents.bindto=undefined] Set CSS selector or element reference to bind tooltip.
3152
3169
  * - **NOTE:** When is specified, will not be updating tooltip's position.
3153
3170
  * @property {string} [tooltip.contents.template=undefined] Set tooltip's template.<br><br>
@@ -6098,8 +6115,14 @@ function getFormat($$, typeValue, v) {
6098
6115
  */
6099
6116
  getDefaultValueFormat: function getDefaultValueFormat() {
6100
6117
  var $$ = this,
6101
- hasArc = $$.hasArcType();
6102
- return hasArc && !$$.hasType("gauge") ? $$.defaultArcValueFormat : $$.defaultValueFormat;
6118
+ defaultArcValueFormat = $$.defaultArcValueFormat,
6119
+ yFormat = $$.yFormat,
6120
+ y2Format = $$.y2Format,
6121
+ hasArc = $$.hasArcType(null, ["gauge", "radar"]);
6122
+ return function (v, ratio, id) {
6123
+ var format = hasArc ? defaultArcValueFormat : $$.axis && $$.axis.getId(id) === "y2" ? y2Format : yFormat;
6124
+ return format.call($$, v, ratio);
6125
+ };
6103
6126
  },
6104
6127
  defaultValueFormat: function defaultValueFormat(v) {
6105
6128
  return isValue(v) ? +v : "";
@@ -7027,7 +7050,8 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
7027
7050
  redrawWithoutRescale: function redrawWithoutRescale() {
7028
7051
  this.redraw({
7029
7052
  withY: !1,
7030
- withLegend: !0,
7053
+ withDimension: !1,
7054
+ withLegend: !1,
7031
7055
  withSubchart: !1,
7032
7056
  withEventRect: !1,
7033
7057
  withTransitionForAxis: !1
@@ -10224,7 +10248,7 @@ function loadConfig(config) {
10224
10248
  config.size_width = size ? size.width : null;
10225
10249
  config.size_height = size ? size.height : null;
10226
10250
  state.resizing = !0;
10227
- this.flush(!1, !0);
10251
+ this.flush(!1);
10228
10252
  $$.resizeFunction();
10229
10253
  }
10230
10254
  },
@@ -21345,6 +21369,8 @@ var _area = function area() {
21345
21369
  show = config.subchart_show;
21346
21370
 
21347
21371
  if (!show) {
21372
+ var _$target, _subchart$main2;
21373
+
21348
21374
  // unbind zoom event bound to chart rect area
21349
21375
  $$.unbindZoomEvent();
21350
21376
  config.subchart_show = !show;
@@ -21352,14 +21378,16 @@ var _area = function area() {
21352
21378
  var $target = subchart.main.selectAll("." + $COMMON.target); // need to cover when new data has been loaded
21353
21379
 
21354
21380
  if ($$.data.targets.length !== $target.size()) {
21381
+ var _subchart$main;
21382
+
21355
21383
  $$.updateSizes();
21356
21384
  $$.updateTargetsForSubchart($$.data.targets);
21357
- $target = subchart.main.selectAll("." + $COMMON.target);
21385
+ $target = (_subchart$main = subchart.main) == null ? void 0 : _subchart$main.selectAll("." + $COMMON.target);
21358
21386
  }
21359
21387
 
21360
- $target.style("opacity", null);
21361
- subchart.main.style("display", null);
21362
- this.flush();
21388
+ (_$target = $target) == null ? void 0 : _$target.style("opacity", null);
21389
+ (_subchart$main2 = subchart.main) == null ? void 0 : _subchart$main2.style("display", null);
21390
+ this.resize();
21363
21391
  }
21364
21392
  },
21365
21393
 
@@ -21373,14 +21401,15 @@ var _area = function area() {
21373
21401
  * chart.subchart.hide();
21374
21402
  */
21375
21403
  hide: function hide() {
21376
- var $$ = this.internal,
21377
- subchart = $$.$el.subchart,
21404
+ var _main,
21405
+ $$ = this.internal,
21406
+ main = $$.$el.subchart.main,
21378
21407
  config = $$.config;
21379
21408
 
21380
- if (config.subchart_show && subchart.main.style("display") !== "none") {
21409
+ if (config.subchart_show && ((_main = main) == null ? void 0 : _main.style("display")) !== "none") {
21381
21410
  config.subchart_show = !1;
21382
- subchart.main.style("display", "none");
21383
- this.flush();
21411
+ main.style("display", "none");
21412
+ this.resize();
21384
21413
  }
21385
21414
  },
21386
21415
 
@@ -23006,7 +23035,7 @@ var _defaults = {},
23006
23035
  * bb.version; // "1.0.0"
23007
23036
  * @memberof bb
23008
23037
  */
23009
- version: "3.3.0",
23038
+ version: "3.3.1",
23010
23039
 
23011
23040
  /**
23012
23041
  * Generate chart
@@ -23140,7 +23169,7 @@ var _defaults = {},
23140
23169
  };
23141
23170
  /**
23142
23171
  * @namespace bb
23143
- * @version 3.3.0
23172
+ * @version 3.3.1
23144
23173
  */
23145
23174
  ;// CONCATENATED MODULE: ./src/index.ts
23146
23175
  /**
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.1
8
+ * @version 3.3.2
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-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-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}