@eclipse-scout/chart 22.0.0-beta.5 → 22.0.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.
@@ -13,7 +13,7 @@ __webpack_require__.r(__webpack_exports__);
13
13
  /* harmony export */ "default": () => (/* binding */ AbstractChartRenderer)
14
14
  /* harmony export */ });
15
15
  /*
16
- * Copyright (c) 2010-2020 BSI Business Systems Integration AG.
16
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
17
17
  * All rights reserved. This program and the accompanying materials
18
18
  * are made available under the terms of the Eclipse Public License v1.0
19
19
  * which accompanies this distribution, and is available at
@@ -119,14 +119,6 @@ class AbstractChartRenderer {
119
119
  _render() {// Override in subclasses
120
120
  }
121
121
 
122
- checkCompletlyRendered() {
123
- if (this.rendered || !this.chart.data) {
124
- return;
125
- }
126
-
127
- this.render();
128
- }
129
-
130
122
  renderCheckedItems() {
131
123
  if (this.rendered) {
132
124
  this._renderCheckedItems();
@@ -669,7 +661,7 @@ __webpack_require__.r(__webpack_exports__);
669
661
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
670
662
 
671
663
  /*
672
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
664
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
673
665
  * All rights reserved. This program and the accompanying materials
674
666
  * are made available under the terms of the Eclipse Public License v1.0
675
667
  * which accompanies this distribution, and is available at
@@ -712,6 +704,7 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
712
704
  this.checkedItems = [];
713
705
  this._updateChartTimeoutId = null;
714
706
  this._updateChartOpts = null;
707
+ this._updateChartOptsWhileNotAttached = [];
715
708
  this.updatedOnce = false;
716
709
  }
717
710
 
@@ -747,6 +740,14 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
747
740
  });
748
741
  }
749
742
 
743
+ _renderOnAttach() {
744
+ super._renderOnAttach();
745
+
746
+ this._updateChartOptsWhileNotAttached.splice(0).forEach(opts => this.updateChart($.extend(true, {}, opts, {
747
+ debounce: true
748
+ })));
749
+ }
750
+
750
751
  _remove() {
751
752
  if (this.chartRenderer) {
752
753
  this.chartRenderer.remove(false);
@@ -945,7 +946,8 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
945
946
 
946
947
 
947
948
  updateChart(opts) {
948
- opts = opts || {}; // Cancel previously scheduled update and merge opts
949
+ opts = opts || {};
950
+ opts.enforceRerender = !opts.onlyUpdateData && !opts.onlyRefresh; // Cancel previously scheduled update and merge opts
949
951
 
950
952
  if (this._updateChartTimeoutId) {
951
953
  clearTimeout(this._updateChartTimeoutId);
@@ -953,6 +955,9 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
953
955
  if (this._updateChartOpts) {
954
956
  // Inherit 'true' values from previously scheduled updates
955
957
  opts.requestAnimation = opts.requestAnimation || this._updateChartOpts.requestAnimation;
958
+ opts.onlyUpdateData = opts.onlyUpdateData || this._updateChartOpts.onlyUpdateData;
959
+ opts.onlyRefresh = opts.onlyRefresh || this._updateChartOpts.onlyRefresh;
960
+ opts.enforceRerender = opts.enforceRerender || this._updateChartOpts.enforceRerender;
956
961
  }
957
962
 
958
963
  this._updateChartTimeoutId = null;
@@ -979,11 +984,19 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
979
984
  this._updateChartTimeoutId = null;
980
985
  this._updateChartOpts = null;
981
986
 
982
- if (opts.onlyUpdateData && this.chartRenderer && this.chartRenderer.isDataUpdatable()) {
983
- this.chartRenderer.updateData(opts.requestAnimation);
984
- } else if (opts.onlyRefresh && this.chartRenderer) {
985
- this.chartRenderer.refresh();
986
- } else if (this.chartRenderer) {
987
+ if (!this.$container || !this.$container.isAttached()) {
988
+ this._updateChartOptsWhileNotAttached.push(opts);
989
+
990
+ return;
991
+ }
992
+
993
+ this.updatedOnce = true;
994
+
995
+ if (!this.chartRenderer) {
996
+ return; // nothing to render when there is no renderer.
997
+ }
998
+
999
+ if (opts.enforceRerender) {
987
1000
  this.chartRenderer.remove(this.chartRenderer.shouldAnimateRemoveOnUpdate(opts), chartAnimationStopping => {
988
1001
  if (this.removing || chartAnimationStopping) {
989
1002
  // prevent exceptions trying to render after navigated away, and do not update/render while a running animation is being stopped
@@ -993,9 +1006,11 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
993
1006
  this.chartRenderer.render(opts.requestAnimation);
994
1007
  this.trigger('chartRender');
995
1008
  });
1009
+ } else if (opts.onlyUpdateData && this.chartRenderer.isDataUpdatable()) {
1010
+ this.chartRenderer.updateData(opts.requestAnimation);
1011
+ } else if (opts.onlyRefresh) {
1012
+ this.chartRenderer.refresh();
996
1013
  }
997
-
998
- this.updatedOnce = true;
999
1014
  }
1000
1015
  }
1001
1016
 
@@ -5434,7 +5449,7 @@ __webpack_require__.r(__webpack_exports__);
5434
5449
  /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ "jquery");
5435
5450
  /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
5436
5451
  /*
5437
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
5452
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
5438
5453
  * All rights reserved. This program and the accompanying materials
5439
5454
  * are made available under the terms of the Eclipse Public License v1.0
5440
5455
  * which accompanies this distribution, and is available at
@@ -5546,14 +5561,6 @@ class VennChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractSvgC
5546
5561
  }
5547
5562
  }
5548
5563
 
5549
- checkCompletlyRendered() {
5550
- if (this.readyToDraw) {
5551
- this._draw(false, true);
5552
- } else {
5553
- super.checkCompletlyRendered();
5554
- }
5555
- }
5556
-
5557
5564
  remove(requestAnimation, afterRemoveFunc) {
5558
5565
  this._cancelAsync3Calculator();
5559
5566
 
@@ -6004,7 +6011,7 @@ __webpack_require__.r(__webpack_exports__);
6004
6011
  /* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
6005
6012
  /* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__);
6006
6013
  /*
6007
- * Copyright (c) 2010-2020 BSI Business Systems Integration AG.
6014
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
6008
6015
  * All rights reserved. This program and the accompanying materials
6009
6016
  * are made available under the terms of the Eclipse Public License v1.0
6010
6017
  * which accompanies this distribution, and is available at
@@ -6043,14 +6050,6 @@ class ChartField extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.FormFi
6043
6050
  this._removeField();
6044
6051
  }
6045
6052
 
6046
- _renderOnAttach() {
6047
- super._renderOnAttach();
6048
-
6049
- if (this.chart && this.chart.chartRenderer) {
6050
- this.chart.chartRenderer.checkCompletlyRendered();
6051
- }
6052
- }
6053
-
6054
6053
  }
6055
6054
 
6056
6055
  /***/ }),