@eclipse-scout/chart 23.1.1 → 23.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -568,6 +568,8 @@ __webpack_require__.r(__webpack_exports__);
568
568
  /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./src/index.ts");
569
569
  /* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
570
570
  /* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__);
571
+ /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "jquery");
572
+ /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);
571
573
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
572
574
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
573
575
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
@@ -582,6 +584,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
582
584
  */
583
585
 
584
586
 
587
+
585
588
  class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
586
589
  /** @internal */
587
590
 
@@ -609,6 +612,7 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
609
612
  _init(model) {
610
613
  super._init(model);
611
614
  this.setConfig(this.config);
615
+ this._setData(this.data);
612
616
  }
613
617
  _render() {
614
618
  this.$container = this.$parent.appendDiv('chart');
@@ -632,7 +636,7 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
632
636
  }
633
637
  _renderOnAttach() {
634
638
  super._renderOnAttach();
635
- this._updateChartOptsWhileNotAttached.splice(0).forEach(opts => this.updateChart($.extend(true, {}, opts, {
639
+ this._updateChartOptsWhileNotAttached.splice(0).forEach(opts => this.updateChart(jquery__WEBPACK_IMPORTED_MODULE_2___default().extend(true, {}, opts, {
636
640
  debounce: true
637
641
  })));
638
642
  }
@@ -647,6 +651,14 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
647
651
  this.setProperty('data', data);
648
652
  this.setCheckedItems(this.checkedItems);
649
653
  }
654
+ _setData(data) {
655
+ if (data) {
656
+ data = jquery__WEBPACK_IMPORTED_MODULE_2___default().extend({
657
+ axes: []
658
+ }, data);
659
+ }
660
+ this._setProperty('data', data);
661
+ }
650
662
  _renderData() {
651
663
  this.updateChart({
652
664
  requestAnimation: true,
@@ -683,13 +695,13 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
683
695
  }
684
696
  }
685
697
  };
686
- config = $.extend(true, {}, defaultConfig, config);
698
+ config = jquery__WEBPACK_IMPORTED_MODULE_2___default().extend(true, {}, defaultConfig, config);
687
699
  config.options.colorScheme = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.colorSchemes.ensureColorScheme(config.options.colorScheme);
688
700
  if (_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.objects.equalsRecursive(this.config, config)) {
689
701
  return;
690
702
  }
691
703
  // check if only data has changed
692
- let oldConfigWithNewData = $.extend(true, {}, this.config);
704
+ let oldConfigWithNewData = jquery__WEBPACK_IMPORTED_MODULE_2___default().extend(true, {}, this.config);
693
705
  if (config.data) {
694
706
  oldConfigWithNewData.data = config.data;
695
707
  } else {
@@ -909,6 +921,7 @@ _defineProperty(Chart, "Position", {
909
921
  CENTER: 'center'
910
922
  });
911
923
  _defineProperty(Chart, "DEFAULT_ANIMATION_DURATION", 600);
924
+ // ms
912
925
  _defineProperty(Chart, "DEFAULT_DEBOUNCE_TIMEOUT", 100);
913
926
 
914
927
  /***/ }),