billboard.js 3.4.1 → 3.5.0

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 (75) hide show
  1. package/README.md +4 -1
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +3942 -1467
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +2 -2
  6. package/dist/billboard.pkgd.js +8372 -5306
  7. package/dist/billboard.pkgd.min.js +3 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +29 -13
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +375 -91
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.js +445 -108
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +339 -73
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +335 -74
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +4236 -3792
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4637 -3889
  20. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4804 -3931
  21. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +4595 -3865
  22. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +4607 -3873
  23. package/dist/theme/datalab.css +1 -1
  24. package/dist/theme/datalab.min.css +1 -1
  25. package/dist/theme/graph.css +1 -1
  26. package/dist/theme/graph.min.css +1 -1
  27. package/dist/theme/insight.css +1 -1
  28. package/dist/theme/insight.min.css +1 -1
  29. package/dist-esm/billboard.js +837 -403
  30. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +47 -75
  31. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +68 -86
  32. package/dist-esm/plugin/billboardjs-plugin-stanford.js +52 -77
  33. package/dist-esm/plugin/billboardjs-plugin-tableview.js +49 -76
  34. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +49 -76
  35. package/package.json +39 -39
  36. package/src/Chart/api/chart.ts +4 -1
  37. package/src/Chart/api/data.ts +2 -2
  38. package/src/Chart/api/flow.ts +125 -115
  39. package/src/ChartInternal/Axis/AxisRenderer.ts +29 -3
  40. package/src/ChartInternal/ChartInternal.ts +46 -18
  41. package/src/ChartInternal/data/IData.ts +2 -2
  42. package/src/ChartInternal/data/convert.helper.ts +226 -0
  43. package/src/ChartInternal/data/convert.ts +43 -210
  44. package/src/ChartInternal/data/load.ts +5 -4
  45. package/src/ChartInternal/interactions/zoom.ts +17 -4
  46. package/src/ChartInternal/internals/class.ts +1 -1
  47. package/src/ChartInternal/internals/color.ts +41 -42
  48. package/src/ChartInternal/internals/grid.ts +5 -3
  49. package/src/ChartInternal/internals/legend.ts +21 -6
  50. package/src/ChartInternal/internals/redraw.ts +5 -2
  51. package/src/ChartInternal/internals/scale.ts +3 -1
  52. package/src/ChartInternal/internals/size.axis.ts +5 -2
  53. package/src/ChartInternal/internals/style.ts +54 -0
  54. package/src/ChartInternal/internals/text.ts +118 -18
  55. package/src/ChartInternal/shape/arc.ts +4 -3
  56. package/src/ChartInternal/shape/area.ts +14 -7
  57. package/src/ChartInternal/shape/bar.ts +22 -12
  58. package/src/ChartInternal/shape/line.ts +3 -2
  59. package/src/ChartInternal/shape/point.ts +15 -9
  60. package/src/ChartInternal/shape/polar.ts +1 -1
  61. package/src/Plugin/sparkline/index.ts +22 -11
  62. package/src/Plugin/stanford/index.ts +10 -7
  63. package/src/Plugin/textoverlap/index.ts +4 -1
  64. package/src/config/Options/Options.ts +2 -0
  65. package/src/config/Options/common/boost.ts +31 -0
  66. package/src/config/Options/common/main.ts +15 -1
  67. package/src/config/Options/common/tooltip.ts +1 -1
  68. package/src/config/Options/data/data.ts +11 -3
  69. package/src/config/Options/shape/area.ts +6 -1
  70. package/src/config/Store/State.ts +3 -0
  71. package/src/module/browser.ts +2 -1
  72. package/src/module/generator.ts +18 -16
  73. package/src/module/util.ts +113 -0
  74. package/types/chart.d.ts +2 -2
  75. package/types/options.d.ts +45 -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
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -105,6 +105,12 @@ function _defineProperty(obj, key, value) {
105
105
 
106
106
  return obj;
107
107
  }
108
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/newArrowCheck.js
109
+ function _newArrowCheck(innerThis, boundThis) {
110
+ if (innerThis !== boundThis) {
111
+ throw new TypeError("Cannot instantiate an arrow function");
112
+ }
113
+ }
108
114
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
109
115
  function _assertThisInitialized(self) {
110
116
  if (self === void 0) {
@@ -115,11 +121,10 @@ function _assertThisInitialized(self) {
115
121
  }
116
122
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
117
123
  function _setPrototypeOf(o, p) {
118
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
124
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
119
125
  o.__proto__ = p;
120
126
  return o;
121
127
  };
122
-
123
128
  return _setPrototypeOf(o, p);
124
129
  }
125
130
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
@@ -130,6 +135,8 @@ function _inheritsLoose(subClass, superClass) {
130
135
  _setPrototypeOf(subClass, superClass);
131
136
  }
132
137
  ;// CONCATENATED MODULE: ./src/Plugin/Plugin.ts
138
+
139
+
133
140
  /**
134
141
  * Copyright (c) 2017 ~ present NAVER Corp.
135
142
  * billboard.js project is licensed under the MIT license
@@ -204,15 +211,17 @@ var Plugin = /*#__PURE__*/function () {
204
211
  var _this = this;
205
212
 
206
213
  Object.keys(this).forEach(function (key) {
207
- _this[key] = null;
208
- delete _this[key];
209
- });
214
+ _newArrowCheck(this, _this);
215
+
216
+ this[key] = null;
217
+ delete this[key];
218
+ }.bind(this));
210
219
  };
211
220
 
212
221
  return Plugin;
213
222
  }();
214
223
 
215
- Plugin.version = "3.4.1";
224
+ Plugin.version = "3.5.0";
216
225
 
217
226
  ;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
218
227
  /**
@@ -350,6 +359,10 @@ var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_
350
359
  // EXTERNAL MODULE: external {"commonjs":"d3-brush","commonjs2":"d3-brush","amd":"d3-brush","root":"d3"}
351
360
  var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webpack_require__(3);
352
361
  ;// CONCATENATED MODULE: ./src/module/browser.ts
362
+
363
+
364
+ var _this = undefined;
365
+
353
366
  /**
354
367
  * Copyright (c) 2017 ~ present NAVER Corp.
355
368
  * billboard.js project is licensed under the MIT license
@@ -364,25 +377,35 @@ var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webp
364
377
 
365
378
 
366
379
  var win = function () {
380
+ _newArrowCheck(this, _this);
381
+
367
382
  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;
368
383
  return root || Function("return this")();
369
- }();
384
+ }.bind(undefined)();
370
385
  /* eslint-enable no-new-func, no-undef */
371
386
  // fallback for non-supported environments
372
387
 
373
388
 
374
389
  win.requestIdleCallback = win.requestIdleCallback || function (cb) {
390
+ _newArrowCheck(this, _this);
391
+
375
392
  return setTimeout(cb, 1);
376
- };
393
+ }.bind(undefined); // win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
377
394
 
378
- win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
379
- return clearTimeout(id);
380
- };
395
+
396
+ win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
397
+ _newArrowCheck(this, _this);
398
+
399
+ return setTimeout(cb, 1);
400
+ }.bind(undefined);
381
401
 
382
402
  var doc = win == null ? void 0 : win.document;
383
403
  ;// CONCATENATED MODULE: ./src/module/util.ts
384
404
 
385
405
 
406
+
407
+ var util_this = undefined;
408
+
386
409
  function 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; }
387
410
 
388
411
  function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -398,50 +421,80 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
398
421
 
399
422
 
400
423
  var isValue = function (v) {
424
+ _newArrowCheck(this, util_this);
425
+
401
426
  return v || v === 0;
402
- },
427
+ }.bind(undefined),
403
428
  isFunction = function (v) {
429
+ _newArrowCheck(this, util_this);
430
+
404
431
  return typeof v === "function";
405
- },
432
+ }.bind(undefined),
406
433
  isString = function (v) {
434
+ _newArrowCheck(this, util_this);
435
+
407
436
  return typeof v === "string";
408
- },
437
+ }.bind(undefined),
409
438
  isNumber = function (v) {
439
+ _newArrowCheck(this, util_this);
440
+
410
441
  return typeof v === "number";
411
- },
442
+ }.bind(undefined),
412
443
  isUndefined = function (v) {
444
+ _newArrowCheck(this, util_this);
445
+
413
446
  return typeof v === "undefined";
414
- },
447
+ }.bind(undefined),
415
448
  isDefined = function (v) {
449
+ _newArrowCheck(this, util_this);
450
+
416
451
  return typeof v !== "undefined";
417
- },
452
+ }.bind(undefined),
418
453
  isboolean = function (v) {
454
+ _newArrowCheck(this, util_this);
455
+
419
456
  return typeof v === "boolean";
420
- },
457
+ }.bind(undefined),
421
458
  ceil10 = function (v) {
459
+ _newArrowCheck(this, util_this);
460
+
422
461
  return Math.ceil(v / 10) * 10;
423
- },
462
+ }.bind(undefined),
424
463
  asHalfPixel = function (n) {
464
+ _newArrowCheck(this, util_this);
465
+
425
466
  return Math.ceil(n) + .5;
426
- },
467
+ }.bind(undefined),
427
468
  diffDomain = function (d) {
469
+ _newArrowCheck(this, util_this);
470
+
428
471
  return d[1] - d[0];
429
- },
472
+ }.bind(undefined),
430
473
  isObjectType = function (v) {
474
+ _newArrowCheck(this, util_this);
475
+
431
476
  return typeof v === "object";
432
- },
477
+ }.bind(undefined),
433
478
  isEmpty = function (o) {
479
+ _newArrowCheck(this, util_this);
480
+
434
481
  return isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
435
- },
482
+ }.bind(undefined),
436
483
  notEmpty = function (o) {
484
+ _newArrowCheck(this, util_this);
485
+
437
486
  return !isEmpty(o);
438
- },
487
+ }.bind(undefined),
439
488
  isArray = function (arr) {
489
+ _newArrowCheck(this, util_this);
490
+
440
491
  return Array.isArray(arr);
441
- },
492
+ }.bind(undefined),
442
493
  isObject = function (obj) {
494
+ _newArrowCheck(this, util_this);
495
+
443
496
  return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
444
- };
497
+ }.bind(undefined);
445
498
 
446
499
  /**
447
500
  * Get specified key value from object
@@ -465,10 +518,14 @@ function getOption(options, key, defaultValue) {
465
518
 
466
519
 
467
520
  function hasValue(dict, value) {
468
- var found = !1;
521
+ var _this2 = this,
522
+ found = !1;
523
+
469
524
  Object.keys(dict).forEach(function (key) {
525
+ _newArrowCheck(this, _this2);
526
+
470
527
  return dict[key] === value && (found = !0);
471
- });
528
+ }.bind(this));
472
529
  return found;
473
530
  }
474
531
  /**
@@ -498,7 +555,8 @@ function callFn(fn, thisArg) {
498
555
 
499
556
 
500
557
  function endall(transition, cb) {
501
- var n = 0,
558
+ var _this3 = this,
559
+ n = 0,
502
560
  end = function () {
503
561
  for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
504
562
  args[_key2] = arguments[_key2];
@@ -510,8 +568,10 @@ function endall(transition, cb) {
510
568
  // if is transition selection
511
569
  if ("duration" in transition) {
512
570
  transition.each(function () {
571
+ _newArrowCheck(this, _this3);
572
+
513
573
  return ++n;
514
- }).on("end", end);
574
+ }.bind(this)).on("end", end);
515
575
  } else {
516
576
  ++n;
517
577
  transition.call(end);
@@ -539,6 +599,8 @@ function sanitise(str) {
539
599
 
540
600
 
541
601
  function setTextValue(node, text, dy, toMiddle) {
602
+ var _this4 = this;
603
+
542
604
  if (dy === void 0) {
543
605
  dy = [-1, 1];
544
606
  }
@@ -555,8 +617,10 @@ function setTextValue(node, text, dy, toMiddle) {
555
617
  node.text(text);
556
618
  } else {
557
619
  var diff = [node.text(), text].map(function (v) {
620
+ _newArrowCheck(this, _this4);
621
+
558
622
  return v.replace(/[\s\n]/g, "");
559
- });
623
+ }.bind(this));
560
624
 
561
625
  if (diff[0] !== diff[1]) {
562
626
  var multiline = text.split("\n"),
@@ -564,8 +628,10 @@ function setTextValue(node, text, dy, toMiddle) {
564
628
  // reset possible text
565
629
  node.html("");
566
630
  multiline.forEach(function (v, i) {
631
+ _newArrowCheck(this, _this4);
632
+
567
633
  node.append("tspan").attr("x", 0).attr("dy", (i === 0 ? dy[0] * len : dy[1]) + "em").text(v);
568
- });
634
+ }.bind(this));
569
635
  }
570
636
  }
571
637
  }
@@ -644,11 +710,14 @@ function getPathBox(path) {
644
710
  function getPointer(event, element) {
645
711
  var _ref,
646
712
  touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
647
- pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
713
+ pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element),
714
+ _this5 = this;
648
715
 
649
716
  return pointer.map(function (v) {
717
+ _newArrowCheck(this, _this5);
718
+
650
719
  return isNaN(v) ? 0 : v;
651
- });
720
+ }.bind(this));
652
721
  }
653
722
  /**
654
723
  * Return brush selection array
@@ -775,7 +844,9 @@ function brushEmpty(ctx) {
775
844
 
776
845
 
777
846
  function deepClone() {
778
- for (var clone = function (v) {
847
+ for (var _this6 = this, clone = function (v) {
848
+ _newArrowCheck(this, _this6);
849
+
779
850
  if (isObject(v) && v.constructor) {
780
851
  var r = new v.constructor();
781
852
 
@@ -787,15 +858,19 @@ function deepClone() {
787
858
  }
788
859
 
789
860
  return v;
790
- }, _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
861
+ }.bind(this), _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
791
862
  objectN[_key3] = arguments[_key3];
792
863
  }
793
864
 
794
865
  return objectN.map(function (v) {
866
+ _newArrowCheck(this, _this6);
867
+
795
868
  return clone(v);
796
- }).reduce(function (a, c) {
869
+ }.bind(this)).reduce(function (a, c) {
870
+ _newArrowCheck(this, _this6);
871
+
797
872
  return _objectSpread(_objectSpread({}, a), c);
798
- });
873
+ }.bind(this));
799
874
  }
800
875
  /**
801
876
  * Extend target from source object
@@ -807,14 +882,18 @@ function deepClone() {
807
882
 
808
883
 
809
884
  function extend(target, source) {
885
+ var _this7 = this;
886
+
810
887
  if (target === void 0) {
811
888
  target = {};
812
889
  }
813
890
 
814
891
  if (isArray(source)) {
815
892
  source.forEach(function (v) {
893
+ _newArrowCheck(this, _this7);
894
+
816
895
  return extend(target, v);
817
- });
896
+ }.bind(this));
818
897
  } // exclude name with only numbers
819
898
 
820
899
 
@@ -837,8 +916,10 @@ function extend(target, source) {
837
916
 
838
917
 
839
918
  var capitalize = function (str) {
919
+ _newArrowCheck(this, util_this);
920
+
840
921
  return str.charAt(0).toUpperCase() + str.slice(1);
841
- };
922
+ }.bind(undefined);
842
923
  /**
843
924
  * Camelize from kebob style string
844
925
  * @param {string} str Target string
@@ -849,13 +930,17 @@ var capitalize = function (str) {
849
930
 
850
931
 
851
932
  function camelize(str, separator) {
933
+ var _this8 = this;
934
+
852
935
  if (separator === void 0) {
853
936
  separator = "-";
854
937
  }
855
938
 
856
939
  return str.split(separator).map(function (v, i) {
940
+ _newArrowCheck(this, _this8);
941
+
857
942
  return i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase();
858
- }).join("");
943
+ }.bind(this)).join("");
859
944
  }
860
945
  /**
861
946
  * Convert to array
@@ -866,8 +951,33 @@ function camelize(str, separator) {
866
951
 
867
952
 
868
953
  var toArray = function (v) {
954
+ _newArrowCheck(this, util_this);
955
+
869
956
  return [].slice.call(v);
870
- };
957
+ }.bind(undefined);
958
+ /**
959
+ * Add CSS rules
960
+ * @param {object} style Style object
961
+ * @param {string} selector Selector string
962
+ * @param {Array} prop Prps arrary
963
+ * @returns {number} Newely added rule index
964
+ * @private
965
+ */
966
+
967
+
968
+ function addCssRules(style, selector, prop) {
969
+ var _this9 = this,
970
+ rootSelctor = style.rootSelctor,
971
+ sheet = style.sheet,
972
+ getSelector = function (s) {
973
+ _newArrowCheck(this, _this9);
974
+
975
+ return s.replace(/\s?(bb-)/g, ".$1").replace(/\.+/g, ".");
976
+ }.bind(this),
977
+ rule = rootSelctor + " " + getSelector(selector) + " {" + prop.join(";") + "}";
978
+
979
+ return sheet[sheet.insertRule ? "insertRule" : "addRule"](rule, sheet.cssRules.length);
980
+ }
871
981
  /**
872
982
  * Get css rules for specified stylesheets
873
983
  * @param {Array} styleSheets The stylesheets to get the rules from
@@ -877,8 +987,12 @@ var toArray = function (v) {
877
987
 
878
988
 
879
989
  function getCssRules(styleSheets) {
880
- var rules = [];
990
+ var _this10 = this,
991
+ rules = [];
992
+
881
993
  styleSheets.forEach(function (sheet) {
994
+ _newArrowCheck(this, _this10);
995
+
882
996
  try {
883
997
  if (sheet.cssRules && sheet.cssRules.length) {
884
998
  rules = rules.concat(toArray(sheet.cssRules));
@@ -886,7 +1000,7 @@ function getCssRules(styleSheets) {
886
1000
  } catch (e) {
887
1001
  console.error("Error while reading rules from " + sheet.href + ": " + e.toString());
888
1002
  }
889
- });
1003
+ }.bind(this));
890
1004
  return rules;
891
1005
  }
892
1006
  /**
@@ -918,13 +1032,19 @@ function getTranslation(node) {
918
1032
 
919
1033
 
920
1034
  function getUnique(data) {
921
- var isDate = data[0] instanceof Date,
1035
+ var _this11 = this,
1036
+ isDate = data[0] instanceof Date,
922
1037
  d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
1038
+ _newArrowCheck(this, _this11);
1039
+
923
1040
  return self.indexOf(v) === i;
924
- });
1041
+ }.bind(this));
1042
+
925
1043
  return isDate ? d.map(function (v) {
1044
+ _newArrowCheck(this, _this11);
1045
+
926
1046
  return new Date(v);
927
- }) : d;
1047
+ }.bind(this)) : d;
928
1048
  }
929
1049
  /**
930
1050
  * Merge array
@@ -935,9 +1055,13 @@ function getUnique(data) {
935
1055
 
936
1056
 
937
1057
  function mergeArray(arr) {
1058
+ var _this12 = this;
1059
+
938
1060
  return arr && arr.length ? arr.reduce(function (p, c) {
1061
+ _newArrowCheck(this, _this12);
1062
+
939
1063
  return p.concat(c);
940
- }) : [];
1064
+ }.bind(this)) : [];
941
1065
  }
942
1066
  /**
943
1067
  * Merge object returning new object
@@ -949,7 +1073,7 @@ function mergeArray(arr) {
949
1073
 
950
1074
 
951
1075
  function mergeObj(target) {
952
- for (var _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1076
+ for (var _this13 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
953
1077
  objectN[_key4 - 1] = arguments[_key4];
954
1078
  }
955
1079
 
@@ -961,6 +1085,8 @@ function mergeObj(target) {
961
1085
 
962
1086
  if (isObject(target) && isObject(source)) {
963
1087
  Object.keys(source).forEach(function (key) {
1088
+ _newArrowCheck(this, _this13);
1089
+
964
1090
  var value = source[key];
965
1091
 
966
1092
  if (isObject(value)) {
@@ -969,7 +1095,7 @@ function mergeObj(target) {
969
1095
  } else {
970
1096
  target[key] = isArray(value) ? value.concat() : value;
971
1097
  }
972
- });
1098
+ }.bind(this));
973
1099
  }
974
1100
 
975
1101
  return mergeObj.apply(void 0, [target].concat(objectN));
@@ -984,6 +1110,8 @@ function mergeObj(target) {
984
1110
 
985
1111
 
986
1112
  function sortValue(data, isAsc) {
1113
+ var _this14 = this;
1114
+
987
1115
  if (isAsc === void 0) {
988
1116
  isAsc = !0;
989
1117
  }
@@ -992,19 +1120,27 @@ function sortValue(data, isAsc) {
992
1120
 
993
1121
  if (data[0] instanceof Date) {
994
1122
  fn = isAsc ? function (a, b) {
1123
+ _newArrowCheck(this, _this14);
1124
+
995
1125
  return a - b;
996
- } : function (a, b) {
1126
+ }.bind(this) : function (a, b) {
1127
+ _newArrowCheck(this, _this14);
1128
+
997
1129
  return b - a;
998
- };
1130
+ }.bind(this);
999
1131
  } else {
1000
1132
  if (isAsc && !data.every(isNaN)) {
1001
1133
  fn = function (a, b) {
1134
+ _newArrowCheck(this, _this14);
1135
+
1002
1136
  return a - b;
1003
- };
1137
+ }.bind(this);
1004
1138
  } else if (!isAsc) {
1005
1139
  fn = function (a, b) {
1140
+ _newArrowCheck(this, _this14);
1141
+
1006
1142
  return a > b && -1 || a < b && 1 || a === b && 0;
1007
- };
1143
+ }.bind(this);
1008
1144
  }
1009
1145
  }
1010
1146
 
@@ -1020,9 +1156,12 @@ function sortValue(data, isAsc) {
1020
1156
 
1021
1157
 
1022
1158
  function getMinMax(type, data) {
1023
- var res = data.filter(function (v) {
1159
+ var _this15 = this,
1160
+ res = data.filter(function (v) {
1161
+ _newArrowCheck(this, _this15);
1162
+
1024
1163
  return notEmpty(v);
1025
- });
1164
+ }.bind(this));
1026
1165
 
1027
1166
  if (res.length) {
1028
1167
  if (isNumber(res[0])) {
@@ -1051,6 +1190,8 @@ var getRange = function (start, end, step) {
1051
1190
  step = 1;
1052
1191
  }
1053
1192
 
1193
+ _newArrowCheck(this, util_this);
1194
+
1054
1195
  var res = [],
1055
1196
  n = Math.max(0, Math.ceil((end - start) / step)) | 0;
1056
1197
 
@@ -1059,10 +1200,16 @@ var getRange = function (start, end, step) {
1059
1200
  }
1060
1201
 
1061
1202
  return res;
1062
- },
1203
+ }.bind(undefined),
1063
1204
  emulateEvent = {
1064
1205
  mouse: function () {
1206
+ var _this16 = this;
1207
+
1208
+ _newArrowCheck(this, util_this);
1209
+
1065
1210
  var getParams = function () {
1211
+ _newArrowCheck(this, _this16);
1212
+
1066
1213
  return {
1067
1214
  bubbles: !1,
1068
1215
  cancelable: !1,
@@ -1071,7 +1218,7 @@ var getRange = function (start, end, step) {
1071
1218
  clientX: 0,
1072
1219
  clientY: 0
1073
1220
  };
1074
- };
1221
+ }.bind(this);
1075
1222
 
1076
1223
  try {
1077
1224
  // eslint-disable-next-line no-new
@@ -1081,8 +1228,10 @@ var getRange = function (start, end, step) {
1081
1228
  params = getParams();
1082
1229
  }
1083
1230
 
1231
+ _newArrowCheck(this, _this16);
1232
+
1084
1233
  el.dispatchEvent(new MouseEvent(eventType, params));
1085
- };
1234
+ }.bind(this);
1086
1235
  } catch (e) {
1087
1236
  // Polyfills DOM4 MouseEvent
1088
1237
  return function (el, eventType, params) {
@@ -1090,15 +1239,19 @@ var getRange = function (start, end, step) {
1090
1239
  params = getParams();
1091
1240
  }
1092
1241
 
1242
+ _newArrowCheck(this, _this16);
1243
+
1093
1244
  var mouseEvent = doc.createEvent("MouseEvent"); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
1094
1245
 
1095
1246
  mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
1096
1247
  params.screenX, params.screenY, params.clientX, params.clientY, !1, !1, !1, !1, 0, null);
1097
1248
  el.dispatchEvent(mouseEvent);
1098
- };
1249
+ }.bind(this);
1099
1250
  }
1100
- }(),
1251
+ }.bind(undefined)(),
1101
1252
  touch: function touch(el, eventType, params) {
1253
+ _newArrowCheck(this, util_this);
1254
+
1102
1255
  var touchObj = new Touch(mergeObj({
1103
1256
  identifier: Date.now(),
1104
1257
  target: el,
@@ -1115,7 +1268,7 @@ var getRange = function (start, end, step) {
1115
1268
  targetTouches: [],
1116
1269
  changedTouches: [touchObj]
1117
1270
  }));
1118
- }
1271
+ }.bind(undefined)
1119
1272
  }; // emulate event
1120
1273
 
1121
1274
 
@@ -1187,7 +1340,8 @@ function isTabVisible() {
1187
1340
 
1188
1341
 
1189
1342
  function convertInputType(mouse, touch) {
1190
- var DocumentTouch = win.DocumentTouch,
1343
+ var _this17 = this,
1344
+ DocumentTouch = win.DocumentTouch,
1191
1345
  matchMedia = win.matchMedia,
1192
1346
  navigator = win.navigator,
1193
1347
  hasTouch = !1;
@@ -1215,12 +1369,106 @@ function convertInputType(mouse, touch) {
1215
1369
 
1216
1370
 
1217
1371
  var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
1372
+ _newArrowCheck(this, _this17);
1373
+
1218
1374
  return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
1219
- }); // fallback to 'mouse' if no input type is detected.
1375
+ }.bind(this)); // fallback to 'mouse' if no input type is detected.
1220
1376
 
1221
1377
  return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
1222
1378
  }
1379
+ /**
1380
+ * Create and run on Web Worker
1381
+ * @param {boolean} useWorker Use Web Worker
1382
+ * @param {Function} fn Function to be executed in worker
1383
+ * @param {Function} callback Callback function to receive result from worker
1384
+ * @param {Array} depsFn Dependency functions to run given function(fn).
1385
+ * @returns {object}
1386
+ * @example
1387
+ * const worker = runWorker(function(arg) {
1388
+ * // do some tasks...
1389
+ * console.log("param:", A(arg));
1390
+ *
1391
+ * return 1234;
1392
+ * }, function(data) {
1393
+ * // callback after worker is done
1394
+ * console.log("result:", data);
1395
+ * },
1396
+ * [function A(){}]
1397
+ * );
1398
+ *
1399
+ * worker(11111);
1400
+ * @private
1401
+ */
1402
+
1403
+
1404
+ function runWorker(useWorker, fn, callback, depsFn) {
1405
+ if (useWorker === void 0) {
1406
+ useWorker = !0;
1407
+ }
1408
+
1409
+ var runFn;
1410
+
1411
+ if (win.Worker && useWorker) {
1412
+ var _depsFn$map$join,
1413
+ blob = new Blob([((_depsFn$map$join = depsFn == null ? void 0 : depsFn.map(String).join(";")) != null ? _depsFn$map$join : "") + "\n\n\t\t\tself.onmessage=function({data}) {\n\t\t\t\tconst result = (" + fn.toString() + ").apply(null, data);\n\t\t\t\tself.postMessage(result);\n\t\t\t};"], {
1414
+ type: "text/javascript"
1415
+ }),
1416
+ worker = new Worker(URL.createObjectURL(blob));
1417
+
1418
+ runFn = function () {
1419
+ for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1420
+ args[_key5] = arguments[_key5];
1421
+ }
1422
+
1423
+ // trigger worker
1424
+ worker.postMessage(args); // listen worker
1425
+
1426
+ worker.onmessage = function (e) {
1427
+ return callback(e.data);
1428
+ }; // handle error
1429
+
1430
+
1431
+ worker.onerror = function (e) {
1432
+ console.error(e);
1433
+ }; // return new Promise((resolve, reject) => {
1434
+ // worker.onmessage = ({data}) => resolve(data);
1435
+ // worker.onerror = reject;
1436
+ // });
1437
+
1438
+ };
1439
+ } else {
1440
+ runFn = function () {
1441
+ var res = fn.apply(void 0, arguments);
1442
+ callback(res);
1443
+ };
1444
+ }
1445
+
1446
+ return runFn;
1447
+ }
1448
+ /**
1449
+ * Run function until given condition function return true
1450
+ * @param {Function} fn Function to be executed when condition is true
1451
+ * @param {Function} conditionFn Condition function to check if condition is true
1452
+ * @private
1453
+ */
1454
+
1455
+
1456
+ function runUntil(fn, conditionFn) {
1457
+ var _this18 = this;
1458
+
1459
+ if (conditionFn() === !1) {
1460
+ win.requestAnimationFrame(function () {
1461
+ _newArrowCheck(this, _this18);
1462
+
1463
+ return runUntil(fn, conditionFn);
1464
+ }.bind(this));
1465
+ } else {
1466
+ fn();
1467
+ }
1468
+ }
1223
1469
  ;// CONCATENATED MODULE: ./src/config/config.ts
1470
+
1471
+
1224
1472
  /**
1225
1473
  * Copyright (c) 2017 ~ present NAVER Corp.
1226
1474
  * billboard.js project is licensed under the MIT license
@@ -1233,11 +1481,14 @@ function convertInputType(mouse, touch) {
1233
1481
  * @private
1234
1482
  */
1235
1483
  function loadConfig(config) {
1236
- var thisConfig = this.config,
1484
+ var _this = this,
1485
+ thisConfig = this.config,
1237
1486
  target,
1238
1487
  keys,
1239
1488
  read,
1240
1489
  find = function () {
1490
+ _newArrowCheck(this, _this);
1491
+
1241
1492
  var key = keys.shift();
1242
1493
 
1243
1494
  if (key && target && isObjectType(target) && key in target) {
@@ -1248,9 +1499,11 @@ function loadConfig(config) {
1248
1499
  }
1249
1500
 
1250
1501
  return undefined;
1251
- };
1502
+ }.bind(this);
1252
1503
 
1253
1504
  Object.keys(thisConfig).forEach(function (key) {
1505
+ _newArrowCheck(this, _this);
1506
+
1254
1507
  target = config;
1255
1508
  keys = key.split("_");
1256
1509
  read = find();
@@ -1258,13 +1511,14 @@ function loadConfig(config) {
1258
1511
  if (isDefined(read)) {
1259
1512
  thisConfig[key] = read;
1260
1513
  }
1261
- });
1514
+ }.bind(this));
1262
1515
  }
1263
1516
  ;// CONCATENATED MODULE: ./src/Plugin/tableview/index.ts
1264
1517
 
1265
1518
 
1266
1519
 
1267
1520
 
1521
+
1268
1522
  function tableview_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; }
1269
1523
 
1270
1524
  function tableview_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? tableview_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : tableview_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -1391,25 +1645,37 @@ var TableView = /*#__PURE__*/function (_Plugin) {
1391
1645
  rows = [];
1392
1646
 
1393
1647
  dataToShow.forEach(function (v) {
1648
+ var _this3 = this;
1649
+
1650
+ _newArrowCheck(this, _this2);
1651
+
1394
1652
  thead += tplProcess(tpl.thead, {
1395
1653
  title: v.id
1396
1654
  }); // make up value rows
1397
1655
 
1398
1656
  v.values.forEach(function (d, i) {
1657
+ _newArrowCheck(this, _this3);
1658
+
1399
1659
  if (!rows[i]) {
1400
1660
  rows[i] = [d.x];
1401
1661
  }
1402
1662
 
1403
1663
  rows[i].push(d.value);
1404
- });
1405
- });
1664
+ }.bind(this));
1665
+ }.bind(this));
1406
1666
  rows.forEach(function (v) {
1667
+ var _this4 = this;
1668
+
1669
+ _newArrowCheck(this, _this2);
1670
+
1407
1671
  tbody += "<tr>" + v.map(function (d, i) {
1672
+ _newArrowCheck(this, _this4);
1673
+
1408
1674
  return tplProcess(i ? tpl.tbody : tpl.tbodyHeader, {
1409
- value: i === 0 ? config.categoryFormat.bind(_this2)(d) : isNumber(d) ? d.toLocaleString() : ""
1675
+ value: i === 0 ? config.categoryFormat.bind(this)(d) : isNumber(d) ? d.toLocaleString() : ""
1410
1676
  });
1411
- }).join("") + "</tr>";
1412
- });
1677
+ }.bind(this)).join("") + "</tr>";
1678
+ }.bind(this));
1413
1679
  var r = tplProcess(tpl.body, tableview_objectSpread(tableview_objectSpread({}, config), {}, {
1414
1680
  title: config.title || $$.config.title_text || "",
1415
1681
  thead: thead,