scichart 3.2.0-beta → 3.2.434

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 (111) hide show
  1. package/Builder/buildSurface.d.ts +2 -2
  2. package/Builder/chartBuilder.d.ts +4 -4
  3. package/Charting/ChartModifiers/ChartModifierBase.d.ts +5 -5
  4. package/Charting/ChartModifiers/ChartModifierBase.js +2 -3
  5. package/Charting/ChartModifiers/CursorModifier.d.ts +9 -9
  6. package/Charting/ChartModifiers/CursorModifier.js +1 -1
  7. package/Charting/ChartModifiers/DataPointSelectionModifier.d.ts +1 -0
  8. package/Charting/ChartModifiers/DataPointSelectionModifier.js +6 -1
  9. package/Charting/ChartModifiers/LegendModifier.d.ts +9 -24
  10. package/Charting/ChartModifiers/LegendModifier.js +9 -21
  11. package/Charting/ChartModifiers/MouseWheelZoomModifier.js +20 -11
  12. package/Charting/ChartModifiers/OverviewRangeSelectionModifier.d.ts +5 -5
  13. package/Charting/ChartModifiers/PinchZoomModifier.js +9 -9
  14. package/Charting/ChartModifiers/RubberBandXyZoomModifier.d.ts +4 -7
  15. package/Charting/ChartModifiers/RubberBandXyZoomModifier.js +6 -8
  16. package/Charting/ChartModifiers/SeriesSelectionModifier.js +10 -8
  17. package/Charting/ChartModifiers/XAxisDragModifier.d.ts +1 -1
  18. package/Charting/ChartModifiers/XAxisDragModifier.js +3 -3
  19. package/Charting/ChartModifiers/YAxisDragModifier.d.ts +2 -4
  20. package/Charting/ChartModifiers/YAxisDragModifier.js +7 -8
  21. package/Charting/Drawing/BaseCache.js +13 -8
  22. package/Charting/Model/BaseDataSeries.d.ts +2 -2
  23. package/Charting/Model/Filters/HlcFilterBase.d.ts +6 -2
  24. package/Charting/Model/Filters/HlcFilterBase.js +17 -1
  25. package/Charting/Model/Filters/IFilterBase.d.ts +24 -0
  26. package/Charting/Model/Filters/IFilterBase.js +2 -0
  27. package/Charting/Model/Filters/OhlcFilterBase.d.ts +6 -2
  28. package/Charting/Model/Filters/OhlcFilterBase.js +17 -1
  29. package/Charting/Model/Filters/XyFilterBase.d.ts +6 -5
  30. package/Charting/Model/Filters/XyFilterBase.js +17 -1
  31. package/Charting/Model/Filters/XyyFilterBase.d.ts +6 -2
  32. package/Charting/Model/Filters/XyyFilterBase.js +17 -1
  33. package/Charting/Model/Filters/XyzFilterBase.d.ts +6 -2
  34. package/Charting/Model/Filters/XyzFilterBase.js +17 -1
  35. package/Charting/Model/XyyDataSeries.js +15 -16
  36. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +0 -4
  37. package/Charting/Visuals/Annotations/NativeTextAnnotation.js +4 -0
  38. package/Charting/Visuals/Axis/AxisBase2D.d.ts +3 -3
  39. package/Charting/Visuals/Axis/AxisCore.d.ts +2 -2
  40. package/Charting/Visuals/Legend/ManualLegend.d.ts +56 -0
  41. package/Charting/Visuals/Legend/ManualLegend.js +138 -0
  42. package/Charting/Visuals/Legend/SciChartLegend.js +4 -3
  43. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +62 -3
  44. package/Charting/Visuals/Legend/SciChartLegendBase.js +78 -11
  45. package/Charting/Visuals/PointMarkers/BasePointMarker.js +13 -8
  46. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +1 -1
  47. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +3 -3
  48. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -3
  49. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +3 -3
  50. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +8 -0
  51. package/Charting/Visuals/RenderableSeries/HoveredChangedArgs.d.ts +6 -1
  52. package/Charting/Visuals/RenderableSeries/HoveredChangedArgs.js +2 -1
  53. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +1 -1
  54. package/Charting/Visuals/RenderableSeries/SelectionChangedArgs.d.ts +6 -1
  55. package/Charting/Visuals/RenderableSeries/SelectionChangedArgs.js +2 -1
  56. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +43 -1
  57. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +6 -1
  58. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +6 -1
  59. package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.d.ts +4 -0
  60. package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.js +8 -2
  61. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +6 -0
  62. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +7 -0
  63. package/Charting/Visuals/SciChartSurface.d.ts +0 -5
  64. package/Charting/Visuals/SciChartSurface.js +11 -12
  65. package/Charting/Visuals/SciChartSurfaceBase.d.ts +19 -1
  66. package/Charting/Visuals/SciChartSurfaceBase.js +45 -23
  67. package/Charting/Visuals/createMaster.d.ts +3 -0
  68. package/Charting/Visuals/createMaster.js +54 -23
  69. package/Charting/Visuals/createSingle.js +2 -2
  70. package/Charting/Visuals/licenseManager2D.js +2 -2
  71. package/Charting3D/ChartModifiers/ResetCamera3DModifier.d.ts +1 -1
  72. package/Charting3D/ChartModifiers/ResetCamera3DModifier.js +1 -2
  73. package/Charting3D/ChartModifiers/TooltipModifier3D.d.ts +35 -0
  74. package/Charting3D/ChartModifiers/TooltipModifier3D.js +41 -5
  75. package/Charting3D/Model/DataSeries/BaseGridDataSeries3D.d.ts +1 -1
  76. package/Charting3D/Model/DataSeries/BaseGridDataSeries3D.js +2 -2
  77. package/Charting3D/Model/DataSeries/IPointMetadata3D.d.ts +7 -2
  78. package/Charting3D/Visuals/Axis/AxisBase3D.d.ts +8 -1
  79. package/Charting3D/Visuals/Axis/AxisBase3D.js +0 -2
  80. package/Charting3D/Visuals/Axis/NumericAxis3D.d.ts +3 -2
  81. package/Charting3D/Visuals/Axis/NumericAxis3D.js +7 -3
  82. package/Charting3D/Visuals/Primitives/PointLine3DSceneEntity.js +4 -2
  83. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +5 -2
  84. package/Charting3D/Visuals/Primitives/SurfaceMeshSceneEntity.js +2 -1
  85. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.d.ts +5 -0
  86. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.js +19 -5
  87. package/Charting3D/Visuals/SciChart3DRenderer.d.ts +0 -1
  88. package/Charting3D/Visuals/SciChart3DRenderer.js +3 -26
  89. package/Charting3D/Visuals/SciChart3DSurface.d.ts +12 -5
  90. package/Charting3D/Visuals/SciChart3DSurface.js +35 -6
  91. package/Charting3D/Visuals/createMaster3d.js +9 -4
  92. package/Core/BuildStamp.d.ts +1 -1
  93. package/Core/BuildStamp.js +2 -2
  94. package/Core/DeletableEntity.d.ts +11 -5
  95. package/Core/DeletableEntity.js +42 -45
  96. package/Core/Mouse/MouseManager.js +6 -0
  97. package/_wasm/scichart.browser.js +1 -1
  98. package/_wasm/scichart2d.js +1 -1
  99. package/_wasm/scichart2d.wasm +0 -0
  100. package/_wasm/scichart3d.js +1 -1
  101. package/_wasm/scichart3d.wasm +0 -0
  102. package/index.d.ts +5 -6
  103. package/index.dev.js +68876 -0
  104. package/index.js +13 -21
  105. package/index.min.js +1 -1
  106. package/package.json +1 -1
  107. package/utils/MemoryUsageHelper.d.ts +55 -8
  108. package/utils/MemoryUsageHelper.js +64 -14
  109. package/utils/colorUtil.d.ts +7 -0
  110. package/utils/colorUtil.js +13 -1
  111. package/utils/parseColor.js +19 -4
@@ -12,10 +12,11 @@ var SelectionChangedArgs = /** @class */ (function () {
12
12
  * @param selectedSeries
13
13
  * @param allSeries
14
14
  */
15
- function SelectionChangedArgs(source, selectedSeries, allSeries) {
15
+ function SelectionChangedArgs(source, selectedSeries, allSeries, hitTestInfo) {
16
16
  this.source = source;
17
17
  this.selectedSeries = selectedSeries;
18
18
  this.allSeries = allSeries;
19
+ this.hitTestInfo = hitTestInfo;
19
20
  }
20
21
  return SelectionChangedArgs;
21
22
  }());
@@ -17,8 +17,11 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.SplineBandRenderableSeries = void 0;
19
19
  var Deleter_1 = require("../../../Core/Deleter");
20
+ var NumberRange_1 = require("../../../Core/NumberRange");
20
21
  var SeriesType_1 = require("../../../types/SeriesType");
21
22
  var copyVector_1 = require("../../../utils/copyVector");
23
+ var isRealNumber_1 = require("../../../utils/isRealNumber");
24
+ var BaseDataSeries_1 = require("../../Model/BaseDataSeries");
22
25
  var animationHelpers_1 = require("./Animations/animationHelpers");
23
26
  var BaseBandRenderableSeries_1 = require("./BaseBandRenderableSeries");
24
27
  var constants_1 = require("./constants");
@@ -144,8 +147,47 @@ var SplineBandRenderableSeries = /** @class */ (function (_super) {
144
147
  };
145
148
  /** @inheritDoc */
146
149
  SplineBandRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
150
+ var _a;
147
151
  if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
148
- return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
152
+ if (this.isRunningAnimation) {
153
+ return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
154
+ }
155
+ this.updateSplineValues();
156
+ var xValues = this.xSplineValues;
157
+ var yValues = this.ySplineValues;
158
+ var y1Values = this.y1SplineValues;
159
+ // TODO: getPositiveRange
160
+ // if one point
161
+ if (xValues.size() === 1) {
162
+ var min = Math.min(yValues.get(0), y1Values.get(0));
163
+ var max = Math.max(yValues.get(0), y1Values.get(0));
164
+ return new NumberRange_1.NumberRange(min, max);
165
+ }
166
+ var indicesRange = isXCategoryAxis
167
+ ? xVisibleRange
168
+ : (0, BaseDataSeries_1.getIndicesRange)(this.webAssemblyContext, xValues, xVisibleRange, (_a = this.dataSeries) === null || _a === void 0 ? void 0 : _a.dataDistributionCalculator.isSortedAscending);
169
+ var iMin = Math.max(Math.floor(indicesRange.min), 0);
170
+ var iMax = Math.min(Math.ceil(indicesRange.max), xValues.size() - 1);
171
+ if (iMax < iMin) {
172
+ return undefined;
173
+ }
174
+ var minMax;
175
+ var minMaxy1;
176
+ try {
177
+ minMax = this.webAssemblyContext.NumberUtil.MinMaxWithIndex(yValues, iMin, iMax - iMin + 1);
178
+ if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
179
+ return undefined;
180
+ }
181
+ minMaxy1 = this.webAssemblyContext.NumberUtil.MinMaxWithIndex(y1Values, iMin, iMax - iMin + 1);
182
+ if (!(0, isRealNumber_1.isRealNumber)(minMaxy1.minD) || !(0, isRealNumber_1.isRealNumber)(minMaxy1.maxD)) {
183
+ return undefined;
184
+ }
185
+ return new NumberRange_1.NumberRange(Math.min(minMax.minD, minMaxy1.minD), Math.max(minMax.maxD, minMaxy1.maxD));
186
+ }
187
+ finally {
188
+ (0, Deleter_1.deleteSafe)(minMax);
189
+ (0, Deleter_1.deleteSafe)(minMaxy1);
190
+ }
149
191
  };
150
192
  /** @inheritDoc */
151
193
  SplineBandRenderableSeries.prototype.toJSON = function (excludeData) {
@@ -19,6 +19,7 @@ exports.SplineLineRenderableSeries = void 0;
19
19
  var Deleter_1 = require("../../../Core/Deleter");
20
20
  var SeriesType_1 = require("../../../types/SeriesType");
21
21
  var copyVector_1 = require("../../../utils/copyVector");
22
+ var BaseDataSeries_1 = require("../../Model/BaseDataSeries");
22
23
  var animationHelpers_1 = require("./Animations/animationHelpers");
23
24
  var BaseLineRenderableSeries_1 = require("./BaseLineRenderableSeries");
24
25
  var constants_1 = require("./constants");
@@ -136,7 +137,11 @@ var SplineLineRenderableSeries = /** @class */ (function (_super) {
136
137
  /** @inheritDoc */
137
138
  SplineLineRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
138
139
  if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
139
- return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
140
+ if (this.isRunningAnimation) {
141
+ return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
142
+ }
143
+ this.updateSplineValues();
144
+ return (0, BaseDataSeries_1.getWindowedYRange)(this.webAssemblyContext, this.xSplineValues, this.ySplineValues, xVisibleRange, true, isXCategoryAxis, this.dataSeries.dataDistributionCalculator.isSortedAscending);
140
145
  };
141
146
  /** @inheritDoc */
142
147
  SplineLineRenderableSeries.prototype.toJSON = function (excludeData) {
@@ -19,6 +19,7 @@ exports.SplineMountainRenderableSeries = void 0;
19
19
  var Deleter_1 = require("../../../Core/Deleter");
20
20
  var SeriesType_1 = require("../../../types/SeriesType");
21
21
  var copyVector_1 = require("../../../utils/copyVector");
22
+ var BaseDataSeries_1 = require("../../Model/BaseDataSeries");
22
23
  var animationHelpers_1 = require("./Animations/animationHelpers");
23
24
  var BaseMountainRenderableSeries_1 = require("./BaseMountainRenderableSeries");
24
25
  var constants_1 = require("./constants");
@@ -136,7 +137,11 @@ var SplineMountainRenderableSeries = /** @class */ (function (_super) {
136
137
  /** @inheritDoc */
137
138
  SplineMountainRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
138
139
  if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
139
- return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
140
+ if (this.isRunningAnimation) {
141
+ return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
142
+ }
143
+ this.updateSplineValues();
144
+ return (0, BaseDataSeries_1.getWindowedYRange)(this.webAssemblyContext, this.xSplineValues, this.ySplineValues, xVisibleRange, true, isXCategoryAxis, this.dataSeries.dataDistributionCalculator.isSortedAscending);
140
145
  };
141
146
  /** @inheritDoc */
142
147
  SplineMountainRenderableSeries.prototype.toJSON = function (excludeData) {
@@ -53,6 +53,10 @@ export declare class RubberBandSvgRect extends DeletableEntity implements IDelet
53
53
  * Sets isHidden property
54
54
  */
55
55
  set isHidden(value: boolean);
56
+ /**
57
+ * Clear the rect svg
58
+ */
59
+ clear(): void;
56
60
  /**
57
61
  * Deletes the rect
58
62
  */
@@ -121,16 +121,22 @@ var RubberBandSvgRect = /** @class */ (function (_super) {
121
121
  enumerable: false,
122
122
  configurable: true
123
123
  });
124
+ /**
125
+ * Clear the rect svg
126
+ */
127
+ RubberBandSvgRect.prototype.clear = function () {
128
+ this.svgRoot.removeChild(this.svg);
129
+ };
124
130
  /**
125
131
  * Deletes the rect
126
132
  */
127
133
  RubberBandSvgRect.prototype.delete = function () {
128
- this.svgRoot.removeChild(this.svg);
134
+ this.clear();
129
135
  };
130
136
  // PRIVATE
131
137
  RubberBandSvgRect.prototype.create = function (fill, stroke, strokeThickness) {
132
138
  if (this.svg) {
133
- this.delete();
139
+ this.clear();
134
140
  }
135
141
  if (this.svgRoot) {
136
142
  var svgString = this.svgTemplate(fill, stroke, strokeThickness, 0, 0);
@@ -1,5 +1,6 @@
1
1
  import { ISciChartPieDefinition } from "../../../Builder/buildSurface";
2
2
  import { DeletableEntity } from "../../../Core/DeletableEntity";
3
+ import { EventHandler } from "../../../Core/EventHandler";
3
4
  import { IDeletable } from "../../../Core/IDeletable";
4
5
  import { ObservableArray } from "../../../Core/ObservableArray";
5
6
  import { Thickness } from "../../../Core/Thickness";
@@ -77,6 +78,11 @@ export declare class SciChartPieSurface extends DeletableEntity implements ISciC
77
78
  legend: SciChartPieLegend;
78
79
  onCreatedName: string;
79
80
  id: string;
81
+ /**
82
+ * An event handler which notifies its subscribers when a render operation has finished. Use this
83
+ * to time render performance, or to update elements of the chart or your UI on redraw.
84
+ */
85
+ rendered: EventHandler<void>;
80
86
  protected widthAspect: number;
81
87
  protected heightAspect: number;
82
88
  protected labelProviderProperty: PieLabelProvider;
@@ -42,6 +42,7 @@ var app_1 = require("../../../constants/app");
42
42
  var EasingFunctions_1 = require("../../../Core/Animations/EasingFunctions");
43
43
  var DeletableEntity_1 = require("../../../Core/DeletableEntity");
44
44
  var Deleter_1 = require("../../../Core/Deleter");
45
+ var EventHandler_1 = require("../../../Core/EventHandler");
45
46
  var Globals_1 = require("../../../Core/Globals");
46
47
  var ObservableArray_1 = require("../../../Core/ObservableArray");
47
48
  var Rect_1 = require("../../../Core/Rect");
@@ -106,6 +107,11 @@ var SciChartPieSurface = /** @class */ (function (_super) {
106
107
  _this.animate = true;
107
108
  /* The number of frames for the animation. Default 30. A frame will be trigged every 20ms. */
108
109
  _this.animationFrames = 30;
110
+ /**
111
+ * An event handler which notifies its subscribers when a render operation has finished. Use this
112
+ * to time render performance, or to update elements of the chart or your UI on redraw.
113
+ */
114
+ _this.rendered = new EventHandler_1.EventHandler();
109
115
  _this.pieTypeProperty = EPieType.Pie;
110
116
  _this.holeRadiusProperty = 0.5;
111
117
  _this.holeRadiusSizingModeProperty = ESizingMode.Relative;
@@ -690,6 +696,7 @@ var SciChartPieSurface = /** @class */ (function (_super) {
690
696
  }
691
697
  });
692
698
  }
699
+ this.rendered.raiseEvent();
693
700
  };
694
701
  /**
695
702
  * @description Draws pie chart itself
@@ -159,11 +159,6 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
159
159
  /**
160
160
  * Used internally - the {@link RenderContext2D} for drawing
161
161
  */
162
- /**
163
- * An event handler which notifies its subscribers when a render operation has finished. Use this
164
- * to time render performance, or to update elements of the chart or your UI on redraw.
165
- */
166
- rendered: EventHandler<void>;
167
162
  /**
168
163
  * An event handler which notifies its subscribers when a render operation starts. Use this
169
164
  * to update elements of the chart for the current render. Any updates made here will not trigger a subsequent render.
@@ -148,11 +148,6 @@ var SciChartSurface = /** @class */ (function (_super) {
148
148
  * Used internally - the {@link RenderContext2D} for drawing
149
149
  */
150
150
  //public renderContext2D: RenderContext2D;
151
- /**
152
- * An event handler which notifies its subscribers when a render operation has finished. Use this
153
- * to time render performance, or to update elements of the chart or your UI on redraw.
154
- */
155
- _this.rendered = new EventHandler_1.EventHandler();
156
151
  /**
157
152
  * An event handler which notifies its subscribers when a render operation starts. Use this
158
153
  * to update elements of the chart for the current render. Any updates made here will not trigger a subsequent render.
@@ -639,7 +634,7 @@ var SciChartSurface = /** @class */ (function (_super) {
639
634
  * @inheritDoc
640
635
  */
641
636
  SciChartSurface.prototype.changeViewportSize = function (pixelWidth, pixelHeight) {
642
- if (!pixelWidth || !pixelHeight) {
637
+ if (!pixelWidth || !pixelHeight || this.isDeleted) {
643
638
  return;
644
639
  }
645
640
  // Changing the viewportSize
@@ -683,6 +678,8 @@ var SciChartSurface = /** @class */ (function (_super) {
683
678
  };
684
679
  // Step_5: Get context and pass drawing to SciChartRenderer
685
680
  SciChartSurface.prototype.doDrawingLoop = function (context) {
681
+ if (this.isDeleted)
682
+ return;
686
683
  context = context !== null && context !== void 0 ? context : this.renderSurface.getRenderContext();
687
684
  this.currentWebGlRenderContextProperty = context;
688
685
  try {
@@ -717,10 +714,7 @@ var SciChartSurface = /** @class */ (function (_super) {
717
714
  (0, NativeObject_1.freeCache)(this.webAssemblyContext2D).delete();
718
715
  }
719
716
  else if (this.domChartRoot) {
720
- console.error("Error from chart in div ".concat(this.domChartRoot.id), err);
721
- if (typeof err !== "string" && (err === null || err === void 0 ? void 0 : err.message)) {
722
- console.error(err === null || err === void 0 ? void 0 : err.message);
723
- }
717
+ console.error("Error from chart in div ".concat(this.domChartRoot.id, ":"), err);
724
718
  }
725
719
  else {
726
720
  // Surface the error for tests
@@ -734,8 +728,13 @@ var SciChartSurface = /** @class */ (function (_super) {
734
728
  SciChartSurface.prototype.delete = function (clearHtml) {
735
729
  if (clearHtml === void 0) { clearHtml = true; }
736
730
  if (this.isDeleted) {
737
- if (process.env.NODE_ENV !== "production") {
738
- console.warn("Trying to delete the surface with ID = \"".concat(this.id, ")\", which has already been deleted!"));
731
+ try {
732
+ if (process.env.NODE_ENV !== "production") {
733
+ console.warn("Trying to delete the surface with ID = \"".concat(this.id, ")\", which has already been deleted!"));
734
+ }
735
+ }
736
+ catch (err) {
737
+ console.warn(err);
739
738
  }
740
739
  return;
741
740
  }
@@ -5,6 +5,7 @@ import { MouseManager } from "../../Core/Mouse/MouseManager";
5
5
  import { ObservableArray } from "../../Core/ObservableArray";
6
6
  import { PropertyChangedEventArgs } from "../../Core/PropertyChangedEventArgs";
7
7
  import { Rect } from "../../Core/Rect";
8
+ import { Thickness } from "../../Core/Thickness";
8
9
  import { EThemeProviderType } from "../../types/ThemeProviderType";
9
10
  import { TSciChart } from "../../types/TSciChart";
10
11
  import { TSciChart3D } from "../../types/TSciChart3D";
@@ -105,6 +106,11 @@ export interface ISciChartSurfaceBase extends IDeletable, IThemeable {
105
106
  addDeletable(deletable: IDeletable): void;
106
107
  invalidateElement(): void;
107
108
  delete(clearHtml?: boolean): void;
109
+ /**
110
+ * An event handler which notifies its subscribers when a render operation has finished. Use this
111
+ * to time render performance, or to update elements of the chart or your UI on redraw.
112
+ */
113
+ rendered: EventHandler<void>;
108
114
  }
109
115
  /**
110
116
  * Enum constants to specify SciChartSurface type
@@ -143,10 +149,16 @@ export declare abstract class SciChartSurfaceBase extends DeletableEntity implem
143
149
  * chart parts are automatically anti-aliased
144
150
  */
145
151
  static AntiAliasWebGlBackbuffer: boolean;
152
+ /**
153
+ * Defines a delay of the shared wasmContext auto-dispose if {@link autoDisposeWasmContext} is enabled.
154
+ */
146
155
  static wasmContextDisposeTimeout: number;
156
+ /**
157
+ * Defines if the shared wasmContext ({@link TSciChart | WebAssembly Context}) should be deleted after all of the surfaces that use it are deleted.
158
+ */
147
159
  static autoDisposeWasmContext: boolean;
148
160
  /**
149
- * Deletes a {@link TSciChart | WebAssembly Context} used by the charts instantiated with wasmContext {@link SciChartSurface.create}.
161
+ * Deletes the shared wasmContext ({@link TSciChart | WebAssembly Context}) used by the charts instantiated with {@link SciChartSurface.create} or {@link SciChart3DSurface.create}.
150
162
  */
151
163
  static disposeSharedWasmContext(): void;
152
164
  /**
@@ -245,6 +257,11 @@ export declare abstract class SciChartSurfaceBase extends DeletableEntity implem
245
257
  */
246
258
  readonly modifierAnnotations: ObservableArray<IAnnotation>;
247
259
  adornerLayer: AdornerLayer;
260
+ /**
261
+ * An event handler which notifies its subscribers when a render operation has finished. Use this
262
+ * to time render performance, or to update elements of the chart or your UI on redraw.
263
+ */
264
+ rendered: EventHandler<void>;
248
265
  protected destinations: TSciChartDestination[];
249
266
  protected themeProviderProperty: IThemeProvider;
250
267
  protected previousThemeProviderProperty: IThemeProvider;
@@ -352,6 +369,7 @@ export declare abstract class SciChartSurfaceBase extends DeletableEntity implem
352
369
  * engine will schedule a redraw a the next time the renderer is free.
353
370
  */
354
371
  abstract invalidateElement(): void;
372
+ abstract getSeriesViewRectPadding(scaled: boolean): Thickness;
355
373
  getMainCanvas(): HTMLCanvasElement;
356
374
  /**
357
375
  * Sets the Series View {@link Rect}, a rectangle relative to the entire size of the {@link SciChartSurfaceBase}
@@ -68,6 +68,11 @@ var SciChartSurfaceBase = /** @class */ (function (_super) {
68
68
  function SciChartSurfaceBase(webAssemblyContext, canvases) {
69
69
  if (canvases === void 0) { canvases = {}; }
70
70
  var _this = _super.call(this) || this;
71
+ /**
72
+ * An event handler which notifies its subscribers when a render operation has finished. Use this
73
+ * to time render performance, or to update elements of the chart or your UI on redraw.
74
+ */
75
+ _this.rendered = new EventHandler_1.EventHandler();
71
76
  _this.themeProviderProperty = SciChartSurfaceBase.DEFAULT_THEME;
72
77
  _this.previousThemeProviderProperty = SciChartSurfaceBase.DEFAULT_THEME;
73
78
  _this.isInitializedProperty = false;
@@ -123,39 +128,50 @@ var SciChartSurfaceBase = /** @class */ (function (_super) {
123
128
  // Setup Dpi change listeners
124
129
  _this.onDpiChanged = _this.onDpiChanged.bind(_this);
125
130
  DpiHelper_1.DpiHelper.dpiChanged.subscribe(_this.onDpiChanged);
126
- if (process.env.NODE_ENV !== "production") {
127
- if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
128
- var rootContainer = document.body;
129
- var observer_1 = new MutationObserver(function () {
130
- var isInDom = _this.domChartRoot.isConnected;
131
- if (!isInDom && !_this.isDeleted) {
132
- console.warn("The chart root element \"".concat(_this.domChartRoot.id, "\" was detached before the surface ").concat(_this.id, " was properly disposed! Make sure to call \"delete\" method on the surface when it is not longer needed."));
133
- }
134
- });
135
- observer_1.observe(rootContainer, { childList: true, subtree: true });
136
- _this.addDeletable({
137
- delete: function () { return observer_1.disconnect(); }
138
- });
131
+ try {
132
+ if (process.env.NODE_ENV !== "production") {
133
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
134
+ var rootContainer = document.body;
135
+ var observer_1 = new MutationObserver(function () {
136
+ var isInDom = _this.domChartRoot.isConnected;
137
+ if (!isInDom && !_this.isDeleted) {
138
+ console.warn("The chart root element \"".concat(_this.domChartRoot.id, "\" was detached before the surface ").concat(_this.id, " was properly disposed! Make sure to call \"delete\" method on the surface when it is not longer needed."));
139
+ }
140
+ });
141
+ observer_1.observe(rootContainer, { childList: true, subtree: true });
142
+ _this.addDeletable({
143
+ delete: function () { return observer_1.disconnect(); }
144
+ });
145
+ }
139
146
  }
140
147
  }
148
+ catch (err) {
149
+ console.warn(err);
150
+ }
141
151
  return _this;
142
152
  }
143
153
  /**
144
- * Deletes a {@link TSciChart | WebAssembly Context} used by the charts instantiated with wasmContext {@link SciChartSurface.create}.
154
+ * Deletes the shared wasmContext ({@link TSciChart | WebAssembly Context}) used by the charts instantiated with {@link SciChartSurface.create} or {@link SciChart3DSurface.create}.
145
155
  */
146
156
  SciChartSurfaceBase.disposeSharedWasmContext = function () {
147
157
  if (Globals_1.sciChart3DDestinations.length === 0 && Globals_1.sciChartDestinations.length === 0) {
148
- document.body.removeChild(SciChartSurfaceBase.domMasterCanvas);
149
- SciChartSurfaceBase.domMasterCanvas = undefined;
150
- }
151
- if (process.env.NODE_ENV !== "production") {
152
- if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
153
- // @ts-ignore
154
- window.gc && window.gc();
155
- // TODO add warning if there are undeleted or uncollected entities instead
156
- // MemoryUsageHelper.objectRegistry.log();
158
+ if (SciChartSurfaceBase.domMasterCanvas) {
159
+ document.body.removeChild(SciChartSurfaceBase.domMasterCanvas);
160
+ SciChartSurfaceBase.domMasterCanvas = undefined;
157
161
  }
158
162
  }
163
+ // try {
164
+ // if (process.env.NODE_ENV !== "production") {
165
+ // if (MemoryUsageHelper.isMemoryUsageDebugEnabled) {
166
+ // // @ts-ignore
167
+ // window.gc && window.gc();
168
+ // // TODO add warning if there are undeleted or uncollected entities instead
169
+ // // MemoryUsageHelper.objectRegistry.log();
170
+ // }
171
+ // }
172
+ // } catch (err) {
173
+ // console.warn(err);
174
+ // }
159
175
  };
160
176
  /**
161
177
  * Sets the runtime license key. Use for full licenses or trials only, not developer licenses.
@@ -570,7 +586,13 @@ var SciChartSurfaceBase = /** @class */ (function (_super) {
570
586
  * chart parts are automatically anti-aliased
571
587
  */
572
588
  SciChartSurfaceBase.AntiAliasWebGlBackbuffer = false;
589
+ /**
590
+ * Defines a delay of the shared wasmContext auto-dispose if {@link autoDisposeWasmContext} is enabled.
591
+ */
573
592
  SciChartSurfaceBase.wasmContextDisposeTimeout = 0;
593
+ /**
594
+ * Defines if the shared wasmContext ({@link TSciChart | WebAssembly Context}) should be deleted after all of the surfaces that use it are deleted.
595
+ */
574
596
  SciChartSurfaceBase.autoDisposeWasmContext = false;
575
597
  return SciChartSurfaceBase;
576
598
  }(DeletableEntity_1.DeletableEntity));
@@ -4,6 +4,9 @@ import { TWebAssemblyChart } from "./SciChartSurface";
4
4
  /** @ignore */
5
5
  export declare const createMultichart: (divElement: string | HTMLDivElement, options?: I2DSurfaceOptions) => Promise<TWebAssemblyChart>;
6
6
  /** @ignore */
7
+ declare const initializeChartEngine: () => Promise<void>;
8
+ /** @ignore */
7
9
  export declare const disposeMultiChart: () => void;
8
10
  /** @ignore */
9
11
  export declare const monitorWebGL: (wasmContext: TSciChart) => void;
12
+ export { initializeChartEngine as initializeChartEngine2D };
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.monitorWebGL = exports.disposeMultiChart = exports.createMultichart = void 0;
39
+ exports.initializeChartEngine2D = exports.monitorWebGL = exports.disposeMultiChart = exports.createMultichart = void 0;
40
40
  // @ts-ignore
41
41
  var WasmModule2D = require("../../_wasm/scichart2d");
42
42
  var BuildStamp_1 = require("../../Core/BuildStamp");
@@ -53,6 +53,7 @@ var DeletableEntity_1 = require("../../Core/DeletableEntity");
53
53
  var NativeObject_1 = require("./Helpers/NativeObject");
54
54
  var LabelCache_1 = require("./Axis/LabelProvider/LabelCache");
55
55
  var MemoryUsageHelper_1 = require("../../utils/MemoryUsageHelper");
56
+ var WebGlHelper_1 = require("../../Core/WebGlHelper");
56
57
  // Global variables
57
58
  /** @ignore */
58
59
  var sciChartMaster = {
@@ -64,7 +65,7 @@ var sciChartMaster = {
64
65
  var sciChartMasterPromise;
65
66
  /** @ignore */
66
67
  var createMultichart = function (divElement, options) { return __awaiter(void 0, void 0, void 0, function () {
67
- var canvases, loader, loaderDiv, master, createChildSurface, wasmContext_1, divElementId, sciChartSurface_1, err_1;
68
+ var canvases, loader, loaderDiv, createChildSurface, wasmContext_1, divElementId, sciChartSurface_1, err_1;
68
69
  var _a, _b, _c;
69
70
  return __generator(this, function (_d) {
70
71
  switch (_d.label) {
@@ -75,21 +76,10 @@ var createMultichart = function (divElement, options) { return __awaiter(void 0,
75
76
  loaderDiv = loader.addChartLoader(canvases.domDivContainer, options === null || options === void 0 ? void 0 : options.theme);
76
77
  _d.label = 1;
77
78
  case 1:
78
- _d.trys.push([1, 4, , 5]);
79
- if (!(!sciChartMaster.wasmContext || !sciChartMaster.createChildSurface || !sciChartMaster.getChildSurfaces)) return [3 /*break*/, 3];
80
- if (!sciChartMasterPromise) {
81
- sciChartMasterPromise = createMaster();
82
- }
83
- return [4 /*yield*/, sciChartMasterPromise];
79
+ _d.trys.push([1, 3, , 4]);
80
+ return [4 /*yield*/, initializeChartEngine()];
84
81
  case 2:
85
- master = _d.sent();
86
- sciChartMaster.wasmContext = master.wasmContext;
87
- (0, BuildStamp_1.checkBuildStamp)(master.wasmContext);
88
- sciChartMaster.createChildSurface = master.createChildSurface;
89
- sciChartMaster.getChildSurfaces = master.getChildSurfaces;
90
- (0, exports.monitorWebGL)(master.wasmContext);
91
- _d.label = 3;
92
- case 3:
82
+ _d.sent();
93
83
  createChildSurface = sciChartMaster.createChildSurface, wasmContext_1 = sciChartMaster.wasmContext;
94
84
  divElementId = canvases.domChartRoot.id;
95
85
  sciChartSurface_1 = createChildSurface(divElementId, canvases, options === null || options === void 0 ? void 0 : options.theme);
@@ -100,18 +90,43 @@ var createMultichart = function (divElement, options) { return __awaiter(void 0,
100
90
  resolve({ wasmContext: wasmContext_1, sciChartSurface: sciChartSurface_1 });
101
91
  }, 0);
102
92
  })];
103
- case 4:
93
+ case 3:
104
94
  err_1 = _d.sent();
105
95
  console.error(err_1);
106
96
  // replace with div with error message
107
97
  loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
108
98
  loaderDiv = undefined;
109
99
  return [2 /*return*/, Promise.reject(err_1)];
110
- case 5: return [2 /*return*/];
100
+ case 4: return [2 /*return*/];
111
101
  }
112
102
  });
113
103
  }); };
114
104
  exports.createMultichart = createMultichart;
105
+ /** @ignore */
106
+ var initializeChartEngine = function () { return __awaiter(void 0, void 0, void 0, function () {
107
+ var master;
108
+ return __generator(this, function (_a) {
109
+ switch (_a.label) {
110
+ case 0:
111
+ WebGlHelper_1.WebGlHelper.initialize();
112
+ if (!(!sciChartMaster.wasmContext || !sciChartMaster.createChildSurface || !sciChartMaster.getChildSurfaces)) return [3 /*break*/, 2];
113
+ if (!sciChartMasterPromise) {
114
+ sciChartMasterPromise = createMaster();
115
+ }
116
+ return [4 /*yield*/, sciChartMasterPromise];
117
+ case 1:
118
+ master = _a.sent();
119
+ sciChartMaster.wasmContext = master.wasmContext;
120
+ (0, BuildStamp_1.checkBuildStamp)(master.wasmContext);
121
+ sciChartMaster.createChildSurface = master.createChildSurface;
122
+ sciChartMaster.getChildSurfaces = master.getChildSurfaces;
123
+ (0, exports.monitorWebGL)(master.wasmContext);
124
+ _a.label = 2;
125
+ case 2: return [2 /*return*/];
126
+ }
127
+ });
128
+ }); };
129
+ exports.initializeChartEngine2D = initializeChartEngine;
115
130
  var cleanupWasmContext;
116
131
  /** @ignore */
117
132
  var disposeMultiChart = function () {
@@ -212,8 +227,18 @@ var createMaster = function () {
212
227
  var createChildSurface = function (divElementId, canvases, theme) {
213
228
  Guard_1.Guard.notNull(theme, "theme");
214
229
  var canvas2dId = sciChartInitCommon_1.default.getCanvas2dId(divElementId);
230
+ // TODO check other destinations
215
231
  var sameIdDestinations = Globals_1.sciChartDestinations.filter(function (el) { return el.canvasElementId === canvas2dId; });
216
- sameIdDestinations.forEach(function (el) { return el.sciChartSurface.delete(false); });
232
+ try {
233
+ if (process.env.NODE_ENV !== "production") {
234
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled && sameIdDestinations.length > 0) {
235
+ console.warn("Trying to create a SciChartSurface on a root element (".concat(divElementId, ") of another surface before it was deleted ! This will automatically delete the previous surface."));
236
+ }
237
+ }
238
+ }
239
+ catch (err) {
240
+ console.warn(err);
241
+ }
217
242
  var otherDestinations = Globals_1.sciChartDestinations.filter(function (el) { return el.canvasElementId !== canvas2dId; });
218
243
  chartInitObj.ClearDestinations();
219
244
  while (Globals_1.sciChartDestinations.length > 0) {
@@ -238,16 +263,22 @@ var createMaster = function () {
238
263
  }
239
264
  }
240
265
  else {
241
- if (process.env.NODE_ENV !== "production") {
242
- if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled &&
243
- sciChartSurface.otherSurfaces.length === 0) {
244
- console.warn("SciChartSurface.autoDisposeWasmContext is disabled, thus wasmContext should be disposed explicitly using \"SciChartSurface.disposeSharedWasmContext()\".");
266
+ try {
267
+ if (process.env.NODE_ENV !== "production") {
268
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled &&
269
+ sciChartSurface.otherSurfaces.length === 0) {
270
+ console.warn("SciChartSurface.autoDisposeWasmContext is disabled, thus wasmContext should be disposed explicitly using \"SciChartSurface.disposeSharedWasmContext()\".");
271
+ }
245
272
  }
246
273
  }
274
+ catch (err) {
275
+ console.warn(err);
276
+ }
247
277
  }
248
278
  }
249
279
  });
250
280
  addDestination(wasmContext, canvas2dId, sciChartSurface, canvases.domCanvas2D.width, canvases.domCanvas2D.height, chartInitObj);
281
+ sameIdDestinations.forEach(function (el) { return el.sciChartSurface.delete(false); });
251
282
  licenseManager2D_1.licenseManager.applyLicense2D(wasmContext, sciChartSurface, false);
252
283
  return sciChartSurface;
253
284
  };
@@ -114,10 +114,10 @@ var initDrawEngineSingleChart = function (wasmContext, canvases, resolve, theme)
114
114
  scs.renderSurface.onRenderTimeElapsed();
115
115
  },
116
116
  Update: function (deltaTime) {
117
- logger_1.Logger.log("sciChartInitCommon.ts Update");
117
+ // Logger.debug("sciChartInitCommon.ts Update");
118
118
  },
119
119
  ShutDownChart: function () {
120
- logger_1.Logger.log("sciChartInitCommon.ts ShutDownChart");
120
+ // Logger.debug("sciChartInitCommon.ts ShutDownChart");
121
121
  }
122
122
  };
123
123
  var chartInitObj = wasmContext.SCRTSampleChartInterface.implement(chartInitializer);
@@ -559,11 +559,11 @@ var applyLicense = function (licenseContext, sciChartSurface) {
559
559
  debug("checkstatus: " + licensingClasses_1.LicenseCheckStatus[checkStatus]);
560
560
  if (checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense) {
561
561
  if (lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_COMMUNITY && !communityNotice) {
562
- console.log("Defaulting to SciChart Community Edition. Usage constitutes acceptance of EULA at https://scichart.com/JSCommunityEULA. See https://store.scichart.com for commercial licensing options.");
562
+ console.log("Defaulting to SciChart Community Edition. Usage constitutes acceptance of our EULA and terms at https://www.scichart.com/community-licensing. See https://store.scichart.com for commercial licensing options.");
563
563
  var daysRemaining = licenseContext.SCRTCredentials.GetLicenseDaysRemaining();
564
564
  console.log("The community license is valid for 6 months from the date the version in use was released. This version ".concat(BuildStamp_1.libraryVersion, " has ").concat(daysRemaining, " day").concat(daysRemaining === 1 ? "" : "s", " remaining"));
565
565
  if (!app_1.IS_TEST_ENV && ((_b = document === null || document === void 0 ? void 0 : document.location) === null || _b === void 0 ? void 0 : _b.hostname.startsWith("localhost")) && useLicenseWizard) {
566
- console.log("Looking for paid developer activation from licensing wizard... To disable this call SciChartSurface.UseCommunityLicense()");
566
+ console.log("SciChart is looking for a paid developer activation from the scichart licensing wizard... To disable this call SciChartSurface.UseCommunityLicense()");
567
567
  }
568
568
  communityNotice = true;
569
569
  }
@@ -40,7 +40,7 @@ export declare type TCameraState = {
40
40
  *
41
41
  * ```ts
42
42
  * const sciChartS3Durface: SciChart3DSurface;
43
- * sciChart3DSurface.chartModifiers.add(new ZoomExtentsModifier3D());
43
+ * sciChart3DSurface.chartModifiers.add(new ResetCamera3DModifier());
44
44
  * ```
45
45
  *
46
46
  */