billboard.js 3.4.1 → 3.5.0-next.1

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 (53) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +3283 -1110
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +7416 -4949
  6. package/dist/billboard.pkgd.min.js +3 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +29 -13
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +259 -89
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +329 -106
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +223 -71
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +219 -72
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3940 -3793
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4219 -3882
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4392 -3930
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +4187 -3868
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +4195 -3872
  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 +206 -41
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +47 -75
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +66 -85
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +50 -76
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +47 -75
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +47 -75
  34. package/package.json +34 -34
  35. package/src/Chart/api/data.ts +2 -2
  36. package/src/ChartInternal/Axis/AxisRenderer.ts +29 -3
  37. package/src/ChartInternal/ChartInternal.ts +8 -1
  38. package/src/ChartInternal/interactions/zoom.ts +17 -4
  39. package/src/ChartInternal/internals/color.ts +3 -2
  40. package/src/ChartInternal/internals/grid.ts +5 -3
  41. package/src/ChartInternal/internals/redraw.ts +5 -2
  42. package/src/ChartInternal/internals/scale.ts +3 -1
  43. package/src/ChartInternal/internals/size.axis.ts +5 -2
  44. package/src/ChartInternal/internals/text.ts +115 -15
  45. package/src/ChartInternal/shape/bar.ts +12 -5
  46. package/src/Plugin/sparkline/index.ts +22 -11
  47. package/src/Plugin/stanford/index.ts +10 -7
  48. package/src/config/Options/common/main.ts +15 -1
  49. package/src/config/Options/common/tooltip.ts +1 -1
  50. package/src/config/Options/data/data.ts +11 -3
  51. package/src/module/generator.ts +12 -5
  52. package/types/chart.d.ts +2 -2
  53. package/types/options.d.ts +21 -8
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.4.1
8
+ * @version 3.5.0-next.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -90,6 +90,12 @@ __webpack_require__.d(__webpack_exports__, {
90
90
  "default": function() { return /* binding */ Sparkline; }
91
91
  });
92
92
 
93
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/newArrowCheck.js
94
+ function _newArrowCheck(innerThis, boundThis) {
95
+ if (innerThis !== boundThis) {
96
+ throw new TypeError("Cannot instantiate an arrow function");
97
+ }
98
+ }
93
99
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
94
100
  function _assertThisInitialized(self) {
95
101
  if (self === void 0) {
@@ -100,11 +106,10 @@ function _assertThisInitialized(self) {
100
106
  }
101
107
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
102
108
  function _setPrototypeOf(o, p) {
103
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
109
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
104
110
  o.__proto__ = p;
105
111
  return o;
106
112
  };
107
-
108
113
  return _setPrototypeOf(o, p);
109
114
  }
110
115
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
@@ -293,6 +298,8 @@ var $ZOOM = {
293
298
  };
294
299
  /* harmony default export */ var classes = (_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $ZOOM));
295
300
  ;// CONCATENATED MODULE: ./src/Plugin/Plugin.ts
301
+
302
+
296
303
  /**
297
304
  * Copyright (c) 2017 ~ present NAVER Corp.
298
305
  * billboard.js project is licensed under the MIT license
@@ -367,15 +374,17 @@ var Plugin = /*#__PURE__*/function () {
367
374
  var _this = this;
368
375
 
369
376
  Object.keys(this).forEach(function (key) {
370
- _this[key] = null;
371
- delete _this[key];
372
- });
377
+ _newArrowCheck(this, _this);
378
+
379
+ this[key] = null;
380
+ delete this[key];
381
+ }.bind(this));
373
382
  };
374
383
 
375
384
  return Plugin;
376
385
  }();
377
386
 
378
- Plugin.version = "3.4.1";
387
+ Plugin.version = "3.5.0-next.1";
379
388
 
380
389
  ;// CONCATENATED MODULE: ./src/Plugin/sparkline/Options.ts
381
390
  /**
@@ -413,6 +422,10 @@ var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_
413
422
  // EXTERNAL MODULE: external {"commonjs":"d3-brush","commonjs2":"d3-brush","amd":"d3-brush","root":"d3"}
414
423
  var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webpack_require__(3);
415
424
  ;// CONCATENATED MODULE: ./src/module/browser.ts
425
+
426
+
427
+ var _this = undefined;
428
+
416
429
  /**
417
430
  * Copyright (c) 2017 ~ present NAVER Corp.
418
431
  * billboard.js project is licensed under the MIT license
@@ -427,25 +440,34 @@ var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webp
427
440
 
428
441
 
429
442
  var win = function () {
443
+ _newArrowCheck(this, _this);
444
+
430
445
  var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
431
446
  return root || Function("return this")();
432
- }();
447
+ }.bind(undefined)();
433
448
  /* eslint-enable no-new-func, no-undef */
434
449
  // fallback for non-supported environments
435
450
 
436
451
 
437
452
  win.requestIdleCallback = win.requestIdleCallback || function (cb) {
453
+ _newArrowCheck(this, _this);
454
+
438
455
  return setTimeout(cb, 1);
439
- };
456
+ }.bind(undefined);
440
457
 
441
458
  win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
459
+ _newArrowCheck(this, _this);
460
+
442
461
  return clearTimeout(id);
443
- };
462
+ }.bind(undefined);
444
463
 
445
464
  var doc = win == null ? void 0 : win.document;
446
465
  ;// CONCATENATED MODULE: ./src/module/util.ts
447
466
 
448
467
 
468
+
469
+ var util_this = undefined;
470
+
449
471
  function util_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
450
472
 
451
473
  function util_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? util_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -461,50 +483,80 @@ function util_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
461
483
 
462
484
 
463
485
  var isValue = function (v) {
486
+ _newArrowCheck(this, util_this);
487
+
464
488
  return v || v === 0;
465
- },
489
+ }.bind(undefined),
466
490
  isFunction = function (v) {
491
+ _newArrowCheck(this, util_this);
492
+
467
493
  return typeof v === "function";
468
- },
494
+ }.bind(undefined),
469
495
  isString = function (v) {
496
+ _newArrowCheck(this, util_this);
497
+
470
498
  return typeof v === "string";
471
- },
499
+ }.bind(undefined),
472
500
  isNumber = function (v) {
501
+ _newArrowCheck(this, util_this);
502
+
473
503
  return typeof v === "number";
474
- },
504
+ }.bind(undefined),
475
505
  isUndefined = function (v) {
506
+ _newArrowCheck(this, util_this);
507
+
476
508
  return typeof v === "undefined";
477
- },
509
+ }.bind(undefined),
478
510
  isDefined = function (v) {
511
+ _newArrowCheck(this, util_this);
512
+
479
513
  return typeof v !== "undefined";
480
- },
514
+ }.bind(undefined),
481
515
  isboolean = function (v) {
516
+ _newArrowCheck(this, util_this);
517
+
482
518
  return typeof v === "boolean";
483
- },
519
+ }.bind(undefined),
484
520
  ceil10 = function (v) {
521
+ _newArrowCheck(this, util_this);
522
+
485
523
  return Math.ceil(v / 10) * 10;
486
- },
524
+ }.bind(undefined),
487
525
  asHalfPixel = function (n) {
526
+ _newArrowCheck(this, util_this);
527
+
488
528
  return Math.ceil(n) + .5;
489
- },
529
+ }.bind(undefined),
490
530
  diffDomain = function (d) {
531
+ _newArrowCheck(this, util_this);
532
+
491
533
  return d[1] - d[0];
492
- },
534
+ }.bind(undefined),
493
535
  isObjectType = function (v) {
536
+ _newArrowCheck(this, util_this);
537
+
494
538
  return typeof v === "object";
495
- },
539
+ }.bind(undefined),
496
540
  isEmpty = function (o) {
541
+ _newArrowCheck(this, util_this);
542
+
497
543
  return isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
498
- },
544
+ }.bind(undefined),
499
545
  notEmpty = function (o) {
546
+ _newArrowCheck(this, util_this);
547
+
500
548
  return !isEmpty(o);
501
- },
549
+ }.bind(undefined),
502
550
  isArray = function (arr) {
551
+ _newArrowCheck(this, util_this);
552
+
503
553
  return Array.isArray(arr);
504
- },
554
+ }.bind(undefined),
505
555
  isObject = function (obj) {
556
+ _newArrowCheck(this, util_this);
557
+
506
558
  return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
507
- };
559
+ }.bind(undefined);
508
560
 
509
561
  /**
510
562
  * Get specified key value from object
@@ -528,10 +580,14 @@ function getOption(options, key, defaultValue) {
528
580
 
529
581
 
530
582
  function hasValue(dict, value) {
531
- var found = !1;
583
+ var _this2 = this,
584
+ found = !1;
585
+
532
586
  Object.keys(dict).forEach(function (key) {
587
+ _newArrowCheck(this, _this2);
588
+
533
589
  return dict[key] === value && (found = !0);
534
- });
590
+ }.bind(this));
535
591
  return found;
536
592
  }
537
593
  /**
@@ -561,7 +617,8 @@ function callFn(fn, thisArg) {
561
617
 
562
618
 
563
619
  function endall(transition, cb) {
564
- var n = 0,
620
+ var _this3 = this,
621
+ n = 0,
565
622
  end = function () {
566
623
  for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
567
624
  args[_key2] = arguments[_key2];
@@ -573,8 +630,10 @@ function endall(transition, cb) {
573
630
  // if is transition selection
574
631
  if ("duration" in transition) {
575
632
  transition.each(function () {
633
+ _newArrowCheck(this, _this3);
634
+
576
635
  return ++n;
577
- }).on("end", end);
636
+ }.bind(this)).on("end", end);
578
637
  } else {
579
638
  ++n;
580
639
  transition.call(end);
@@ -602,6 +661,8 @@ function sanitise(str) {
602
661
 
603
662
 
604
663
  function setTextValue(node, text, dy, toMiddle) {
664
+ var _this4 = this;
665
+
605
666
  if (dy === void 0) {
606
667
  dy = [-1, 1];
607
668
  }
@@ -618,8 +679,10 @@ function setTextValue(node, text, dy, toMiddle) {
618
679
  node.text(text);
619
680
  } else {
620
681
  var diff = [node.text(), text].map(function (v) {
682
+ _newArrowCheck(this, _this4);
683
+
621
684
  return v.replace(/[\s\n]/g, "");
622
- });
685
+ }.bind(this));
623
686
 
624
687
  if (diff[0] !== diff[1]) {
625
688
  var multiline = text.split("\n"),
@@ -627,8 +690,10 @@ function setTextValue(node, text, dy, toMiddle) {
627
690
  // reset possible text
628
691
  node.html("");
629
692
  multiline.forEach(function (v, i) {
693
+ _newArrowCheck(this, _this4);
694
+
630
695
  node.append("tspan").attr("x", 0).attr("dy", (i === 0 ? dy[0] * len : dy[1]) + "em").text(v);
631
- });
696
+ }.bind(this));
632
697
  }
633
698
  }
634
699
  }
@@ -707,11 +772,14 @@ function getPathBox(path) {
707
772
  function getPointer(event, element) {
708
773
  var _ref,
709
774
  touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
710
- pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
775
+ pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element),
776
+ _this5 = this;
711
777
 
712
778
  return pointer.map(function (v) {
779
+ _newArrowCheck(this, _this5);
780
+
713
781
  return isNaN(v) ? 0 : v;
714
- });
782
+ }.bind(this));
715
783
  }
716
784
  /**
717
785
  * Return brush selection array
@@ -838,7 +906,9 @@ function brushEmpty(ctx) {
838
906
 
839
907
 
840
908
  function deepClone() {
841
- for (var clone = function (v) {
909
+ for (var _this6 = this, clone = function (v) {
910
+ _newArrowCheck(this, _this6);
911
+
842
912
  if (isObject(v) && v.constructor) {
843
913
  var r = new v.constructor();
844
914
 
@@ -850,15 +920,19 @@ function deepClone() {
850
920
  }
851
921
 
852
922
  return v;
853
- }, _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
923
+ }.bind(this), _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
854
924
  objectN[_key3] = arguments[_key3];
855
925
  }
856
926
 
857
927
  return objectN.map(function (v) {
928
+ _newArrowCheck(this, _this6);
929
+
858
930
  return clone(v);
859
- }).reduce(function (a, c) {
931
+ }.bind(this)).reduce(function (a, c) {
932
+ _newArrowCheck(this, _this6);
933
+
860
934
  return util_objectSpread(util_objectSpread({}, a), c);
861
- });
935
+ }.bind(this));
862
936
  }
863
937
  /**
864
938
  * Extend target from source object
@@ -870,14 +944,18 @@ function deepClone() {
870
944
 
871
945
 
872
946
  function extend(target, source) {
947
+ var _this7 = this;
948
+
873
949
  if (target === void 0) {
874
950
  target = {};
875
951
  }
876
952
 
877
953
  if (isArray(source)) {
878
954
  source.forEach(function (v) {
955
+ _newArrowCheck(this, _this7);
956
+
879
957
  return extend(target, v);
880
- });
958
+ }.bind(this));
881
959
  } // exclude name with only numbers
882
960
 
883
961
 
@@ -900,8 +978,10 @@ function extend(target, source) {
900
978
 
901
979
 
902
980
  var capitalize = function (str) {
981
+ _newArrowCheck(this, util_this);
982
+
903
983
  return str.charAt(0).toUpperCase() + str.slice(1);
904
- };
984
+ }.bind(undefined);
905
985
  /**
906
986
  * Camelize from kebob style string
907
987
  * @param {string} str Target string
@@ -912,13 +992,17 @@ var capitalize = function (str) {
912
992
 
913
993
 
914
994
  function camelize(str, separator) {
995
+ var _this8 = this;
996
+
915
997
  if (separator === void 0) {
916
998
  separator = "-";
917
999
  }
918
1000
 
919
1001
  return str.split(separator).map(function (v, i) {
1002
+ _newArrowCheck(this, _this8);
1003
+
920
1004
  return i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase();
921
- }).join("");
1005
+ }.bind(this)).join("");
922
1006
  }
923
1007
  /**
924
1008
  * Convert to array
@@ -929,8 +1013,10 @@ function camelize(str, separator) {
929
1013
 
930
1014
 
931
1015
  var toArray = function (v) {
1016
+ _newArrowCheck(this, util_this);
1017
+
932
1018
  return [].slice.call(v);
933
- };
1019
+ }.bind(undefined);
934
1020
  /**
935
1021
  * Get css rules for specified stylesheets
936
1022
  * @param {Array} styleSheets The stylesheets to get the rules from
@@ -940,8 +1026,12 @@ var toArray = function (v) {
940
1026
 
941
1027
 
942
1028
  function getCssRules(styleSheets) {
943
- var rules = [];
1029
+ var _this9 = this,
1030
+ rules = [];
1031
+
944
1032
  styleSheets.forEach(function (sheet) {
1033
+ _newArrowCheck(this, _this9);
1034
+
945
1035
  try {
946
1036
  if (sheet.cssRules && sheet.cssRules.length) {
947
1037
  rules = rules.concat(toArray(sheet.cssRules));
@@ -949,7 +1039,7 @@ function getCssRules(styleSheets) {
949
1039
  } catch (e) {
950
1040
  console.error("Error while reading rules from " + sheet.href + ": " + e.toString());
951
1041
  }
952
- });
1042
+ }.bind(this));
953
1043
  return rules;
954
1044
  }
955
1045
  /**
@@ -981,13 +1071,19 @@ function getTranslation(node) {
981
1071
 
982
1072
 
983
1073
  function getUnique(data) {
984
- var isDate = data[0] instanceof Date,
1074
+ var _this10 = this,
1075
+ isDate = data[0] instanceof Date,
985
1076
  d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
1077
+ _newArrowCheck(this, _this10);
1078
+
986
1079
  return self.indexOf(v) === i;
987
- });
1080
+ }.bind(this));
1081
+
988
1082
  return isDate ? d.map(function (v) {
1083
+ _newArrowCheck(this, _this10);
1084
+
989
1085
  return new Date(v);
990
- }) : d;
1086
+ }.bind(this)) : d;
991
1087
  }
992
1088
  /**
993
1089
  * Merge array
@@ -998,9 +1094,13 @@ function getUnique(data) {
998
1094
 
999
1095
 
1000
1096
  function mergeArray(arr) {
1097
+ var _this11 = this;
1098
+
1001
1099
  return arr && arr.length ? arr.reduce(function (p, c) {
1100
+ _newArrowCheck(this, _this11);
1101
+
1002
1102
  return p.concat(c);
1003
- }) : [];
1103
+ }.bind(this)) : [];
1004
1104
  }
1005
1105
  /**
1006
1106
  * Merge object returning new object
@@ -1012,7 +1112,7 @@ function mergeArray(arr) {
1012
1112
 
1013
1113
 
1014
1114
  function mergeObj(target) {
1015
- for (var _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1115
+ for (var _this12 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1016
1116
  objectN[_key4 - 1] = arguments[_key4];
1017
1117
  }
1018
1118
 
@@ -1024,6 +1124,8 @@ function mergeObj(target) {
1024
1124
 
1025
1125
  if (isObject(target) && isObject(source)) {
1026
1126
  Object.keys(source).forEach(function (key) {
1127
+ _newArrowCheck(this, _this12);
1128
+
1027
1129
  var value = source[key];
1028
1130
 
1029
1131
  if (isObject(value)) {
@@ -1032,7 +1134,7 @@ function mergeObj(target) {
1032
1134
  } else {
1033
1135
  target[key] = isArray(value) ? value.concat() : value;
1034
1136
  }
1035
- });
1137
+ }.bind(this));
1036
1138
  }
1037
1139
 
1038
1140
  return mergeObj.apply(void 0, [target].concat(objectN));
@@ -1047,6 +1149,8 @@ function mergeObj(target) {
1047
1149
 
1048
1150
 
1049
1151
  function sortValue(data, isAsc) {
1152
+ var _this13 = this;
1153
+
1050
1154
  if (isAsc === void 0) {
1051
1155
  isAsc = !0;
1052
1156
  }
@@ -1055,19 +1159,27 @@ function sortValue(data, isAsc) {
1055
1159
 
1056
1160
  if (data[0] instanceof Date) {
1057
1161
  fn = isAsc ? function (a, b) {
1162
+ _newArrowCheck(this, _this13);
1163
+
1058
1164
  return a - b;
1059
- } : function (a, b) {
1165
+ }.bind(this) : function (a, b) {
1166
+ _newArrowCheck(this, _this13);
1167
+
1060
1168
  return b - a;
1061
- };
1169
+ }.bind(this);
1062
1170
  } else {
1063
1171
  if (isAsc && !data.every(isNaN)) {
1064
1172
  fn = function (a, b) {
1173
+ _newArrowCheck(this, _this13);
1174
+
1065
1175
  return a - b;
1066
- };
1176
+ }.bind(this);
1067
1177
  } else if (!isAsc) {
1068
1178
  fn = function (a, b) {
1179
+ _newArrowCheck(this, _this13);
1180
+
1069
1181
  return a > b && -1 || a < b && 1 || a === b && 0;
1070
- };
1182
+ }.bind(this);
1071
1183
  }
1072
1184
  }
1073
1185
 
@@ -1083,9 +1195,12 @@ function sortValue(data, isAsc) {
1083
1195
 
1084
1196
 
1085
1197
  function getMinMax(type, data) {
1086
- var res = data.filter(function (v) {
1198
+ var _this14 = this,
1199
+ res = data.filter(function (v) {
1200
+ _newArrowCheck(this, _this14);
1201
+
1087
1202
  return notEmpty(v);
1088
- });
1203
+ }.bind(this));
1089
1204
 
1090
1205
  if (res.length) {
1091
1206
  if (isNumber(res[0])) {
@@ -1114,6 +1229,8 @@ var getRange = function (start, end, step) {
1114
1229
  step = 1;
1115
1230
  }
1116
1231
 
1232
+ _newArrowCheck(this, util_this);
1233
+
1117
1234
  var res = [],
1118
1235
  n = Math.max(0, Math.ceil((end - start) / step)) | 0;
1119
1236
 
@@ -1122,10 +1239,16 @@ var getRange = function (start, end, step) {
1122
1239
  }
1123
1240
 
1124
1241
  return res;
1125
- },
1242
+ }.bind(undefined),
1126
1243
  emulateEvent = {
1127
1244
  mouse: function () {
1245
+ var _this15 = this;
1246
+
1247
+ _newArrowCheck(this, util_this);
1248
+
1128
1249
  var getParams = function () {
1250
+ _newArrowCheck(this, _this15);
1251
+
1129
1252
  return {
1130
1253
  bubbles: !1,
1131
1254
  cancelable: !1,
@@ -1134,7 +1257,7 @@ var getRange = function (start, end, step) {
1134
1257
  clientX: 0,
1135
1258
  clientY: 0
1136
1259
  };
1137
- };
1260
+ }.bind(this);
1138
1261
 
1139
1262
  try {
1140
1263
  // eslint-disable-next-line no-new
@@ -1144,8 +1267,10 @@ var getRange = function (start, end, step) {
1144
1267
  params = getParams();
1145
1268
  }
1146
1269
 
1270
+ _newArrowCheck(this, _this15);
1271
+
1147
1272
  el.dispatchEvent(new MouseEvent(eventType, params));
1148
- };
1273
+ }.bind(this);
1149
1274
  } catch (e) {
1150
1275
  // Polyfills DOM4 MouseEvent
1151
1276
  return function (el, eventType, params) {
@@ -1153,15 +1278,19 @@ var getRange = function (start, end, step) {
1153
1278
  params = getParams();
1154
1279
  }
1155
1280
 
1281
+ _newArrowCheck(this, _this15);
1282
+
1156
1283
  var mouseEvent = doc.createEvent("MouseEvent"); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
1157
1284
 
1158
1285
  mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
1159
1286
  params.screenX, params.screenY, params.clientX, params.clientY, !1, !1, !1, !1, 0, null);
1160
1287
  el.dispatchEvent(mouseEvent);
1161
- };
1288
+ }.bind(this);
1162
1289
  }
1163
- }(),
1290
+ }.bind(undefined)(),
1164
1291
  touch: function touch(el, eventType, params) {
1292
+ _newArrowCheck(this, util_this);
1293
+
1165
1294
  var touchObj = new Touch(mergeObj({
1166
1295
  identifier: Date.now(),
1167
1296
  target: el,
@@ -1178,7 +1307,7 @@ var getRange = function (start, end, step) {
1178
1307
  targetTouches: [],
1179
1308
  changedTouches: [touchObj]
1180
1309
  }));
1181
- }
1310
+ }.bind(undefined)
1182
1311
  }; // emulate event
1183
1312
 
1184
1313
 
@@ -1250,7 +1379,8 @@ function isTabVisible() {
1250
1379
 
1251
1380
 
1252
1381
  function convertInputType(mouse, touch) {
1253
- var DocumentTouch = win.DocumentTouch,
1382
+ var _this16 = this,
1383
+ DocumentTouch = win.DocumentTouch,
1254
1384
  matchMedia = win.matchMedia,
1255
1385
  navigator = win.navigator,
1256
1386
  hasTouch = !1;
@@ -1278,12 +1408,16 @@ function convertInputType(mouse, touch) {
1278
1408
 
1279
1409
 
1280
1410
  var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
1411
+ _newArrowCheck(this, _this16);
1412
+
1281
1413
  return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
1282
- }); // fallback to 'mouse' if no input type is detected.
1414
+ }.bind(this)); // fallback to 'mouse' if no input type is detected.
1283
1415
 
1284
1416
  return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
1285
1417
  }
1286
1418
  ;// CONCATENATED MODULE: ./src/config/config.ts
1419
+
1420
+
1287
1421
  /**
1288
1422
  * Copyright (c) 2017 ~ present NAVER Corp.
1289
1423
  * billboard.js project is licensed under the MIT license
@@ -1296,11 +1430,14 @@ function convertInputType(mouse, touch) {
1296
1430
  * @private
1297
1431
  */
1298
1432
  function loadConfig(config) {
1299
- var thisConfig = this.config,
1433
+ var _this = this,
1434
+ thisConfig = this.config,
1300
1435
  target,
1301
1436
  keys,
1302
1437
  read,
1303
1438
  find = function () {
1439
+ _newArrowCheck(this, _this);
1440
+
1304
1441
  var key = keys.shift();
1305
1442
 
1306
1443
  if (key && target && isObjectType(target) && key in target) {
@@ -1311,9 +1448,11 @@ function loadConfig(config) {
1311
1448
  }
1312
1449
 
1313
1450
  return undefined;
1314
- };
1451
+ }.bind(this);
1315
1452
 
1316
1453
  Object.keys(thisConfig).forEach(function (key) {
1454
+ _newArrowCheck(this, _this);
1455
+
1317
1456
  target = config;
1318
1457
  keys = key.split("_");
1319
1458
  read = find();
@@ -1321,12 +1460,13 @@ function loadConfig(config) {
1321
1460
  if (isDefined(read)) {
1322
1461
  thisConfig[key] = read;
1323
1462
  }
1324
- });
1463
+ }.bind(this));
1325
1464
  }
1326
1465
  ;// CONCATENATED MODULE: ./src/Plugin/sparkline/index.ts
1327
1466
 
1328
1467
 
1329
1468
 
1469
+
1330
1470
  /**
1331
1471
  * Copyright (c) 2021 ~ present NAVER Corp.
1332
1472
  * billboard.js project is licensed under the MIT license
@@ -1443,17 +1583,34 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1443
1583
  };
1444
1584
 
1445
1585
  _proto.overrideOptions = function overrideOptions() {
1446
- var config = this.$$.config;
1586
+ var _this2 = this,
1587
+ config = this.$$.config;
1588
+
1447
1589
  config.legend_show = !1;
1448
1590
  config.resize_auto = !1;
1449
- config.axis_x_show = !1;
1450
- config.axis_x_padding = {
1451
- left: 15,
1452
- right: 15,
1453
- unit: "px"
1454
- };
1591
+ config.axis_x_show = !1; // set default axes padding
1592
+
1593
+ if (config.padding !== !1) {
1594
+ var hasOption = function (o) {
1595
+ _newArrowCheck(this, _this2);
1596
+
1597
+ return Object.keys(o || {}).length > 0;
1598
+ }.bind(this);
1599
+
1600
+ if (hasOption(config.axis_x_padding)) {
1601
+ config.axis_x_padding = {
1602
+ left: 15,
1603
+ right: 15,
1604
+ unit: "px"
1605
+ };
1606
+ }
1607
+
1608
+ if (hasOption(config.axis_y_padding)) {
1609
+ config.axis_y_padding = 5;
1610
+ }
1611
+ }
1612
+
1455
1613
  config.axis_y_show = !1;
1456
- config.axis_y_padding = 5;
1457
1614
 
1458
1615
  if (!config.tooltip_position) {
1459
1616
  config.tooltip_position = function (data, width, height) {
@@ -1478,11 +1635,12 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1478
1635
  };
1479
1636
 
1480
1637
  _proto.$init = function $init() {
1481
- var $$ = this.$$,
1482
- $el = $$.$el;
1638
+ var _$el$tooltip,
1639
+ $el = this.$$.$el;
1640
+
1483
1641
  // make disable-ish main chart element
1484
1642
  $el.chart.style("width", "0").style("height", "0").style("pointer-events", "none");
1485
- document.body.appendChild($el.tooltip.node());
1643
+ ((_$el$tooltip = $el.tooltip) == null ? void 0 : _$el$tooltip.node()) && document.body.appendChild($el.tooltip.node());
1486
1644
  };
1487
1645
 
1488
1646
  _proto.$afterInit = function $afterInit() {
@@ -1498,20 +1656,24 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1498
1656
  ;
1499
1657
 
1500
1658
  _proto.bindEvents = function bindEvents(bind) {
1501
- var _this2 = this;
1659
+ var _this3 = this;
1502
1660
 
1503
1661
  if (bind === void 0) {
1504
1662
  bind = !0;
1505
1663
  }
1506
1664
 
1507
- if (this.$$.config.interaction_enabled) {
1665
+ var config = this.$$.config;
1666
+
1667
+ if (config.interaction_enabled && config.tooltip_show) {
1508
1668
  var method = (bind ? "add" : "remove") + "EventListener";
1509
1669
  this.element.forEach(function (el) {
1670
+ _newArrowCheck(this, _this3);
1671
+
1510
1672
  var svg = el.querySelector("svg");
1511
- svg[method]("mouseover", _this2.overHandler);
1512
- svg[method]("mousemove", _this2.moveHandler);
1513
- svg[method]("mouseout", _this2.outHandler);
1514
- });
1673
+ svg[method]("mouseover", this.overHandler);
1674
+ svg[method]("mousemove", this.moveHandler);
1675
+ svg[method]("mouseout", this.outHandler);
1676
+ }.bind(this));
1515
1677
  }
1516
1678
  };
1517
1679
 
@@ -1523,12 +1685,11 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1523
1685
 
1524
1686
  _proto.moveHandler = function moveHandler(e) {
1525
1687
  var _$$$api$data,
1526
- _data,
1527
1688
  _data$values,
1528
1689
  $$ = this.$$,
1529
1690
  index = $$.getDataIndexFromEvent(e),
1530
1691
  data = (_$$$api$data = $$.api.data(e.target.__id)) == null ? void 0 : _$$$api$data[0],
1531
- d = (_data = data) == null ? void 0 : (_data$values = _data.values) == null ? void 0 : _data$values[index];
1692
+ d = data == null ? void 0 : (_data$values = data.values) == null ? void 0 : _data$values[index];
1532
1693
 
1533
1694
  if (d && !d.name) {
1534
1695
  d.name = d.id;
@@ -1552,7 +1713,8 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1552
1713
  $el = $$.$el,
1553
1714
  el = this.element,
1554
1715
  data = $$.api.data(),
1555
- svgWrapper = (_$el$chart$html$match = $el.chart.html().match(/<svg[^>]*>/)) == null ? void 0 : _$el$chart$html$match[0];
1716
+ svgWrapper = (_$el$chart$html$match = $el.chart.html().match(/<svg[^>]*>/)) == null ? void 0 : _$el$chart$html$match[0],
1717
+ _this4 = this;
1556
1718
 
1557
1719
  // append sparkline holder if is less than the data length
1558
1720
  if (el.length < data.length) {
@@ -1567,8 +1729,12 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1567
1729
  }
1568
1730
 
1569
1731
  data.map(function (v) {
1732
+ _newArrowCheck(this, _this4);
1733
+
1570
1734
  return v.id;
1571
- }).forEach(function (id, i) {
1735
+ }.bind(this)).forEach(function (id, i) {
1736
+ _newArrowCheck(this, _this4);
1737
+
1572
1738
  var selector = "." + $COMMON.target + "-" + id,
1573
1739
  shape = $el.main.selectAll(selector),
1574
1740
  svg = el[i].querySelector("svg");
@@ -1586,14 +1752,18 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
1586
1752
  shape.style("fill", "none").style("opacity", null);
1587
1753
  svg.innerHTML = "";
1588
1754
  svg.appendChild(shape.node());
1589
- });
1755
+ }.bind(this));
1590
1756
  };
1591
1757
 
1592
1758
  _proto.$willDestroy = function $willDestroy() {
1759
+ var _this5 = this;
1760
+
1593
1761
  this.bindEvents(!1);
1594
1762
  this.element.forEach(function (el) {
1763
+ _newArrowCheck(this, _this5);
1764
+
1595
1765
  el.innerHTML = "";
1596
- });
1766
+ }.bind(this));
1597
1767
  };
1598
1768
 
1599
1769
  return Sparkline;