scichart 2.0.2185 → 2.0.2204

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 (33) hide show
  1. package/Charting/ChartModifiers/CursorModifier.d.ts +13 -1
  2. package/Charting/ChartModifiers/CursorModifier.js +20 -7
  3. package/Charting/ChartModifiers/RolloverModifier.d.ts +25 -0
  4. package/Charting/ChartModifiers/RolloverModifier.js +8 -0
  5. package/Charting/Services/SciChartRenderer.js +3 -1
  6. package/Charting/Services/Workers/TextureWorker.js +5 -1
  7. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +1 -0
  8. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +6 -0
  9. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +5 -0
  10. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +11 -0
  11. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +6 -8
  12. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +12 -9
  13. package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -2
  14. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +9 -4
  15. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +2 -1
  16. package/Charting/Visuals/SciChartSurface.js +0 -2
  17. package/Charting/Visuals/createMaster.js +26 -10
  18. package/Charting/Visuals/createSingle.js +9 -2
  19. package/Charting/Visuals/licenseManager2D.js +5 -1
  20. package/Charting3D/Visuals/createMaster3d.js +32 -14
  21. package/Charting3D/Visuals/createSingle3d.js +10 -3
  22. package/Core/BuildStamp.d.ts +4 -0
  23. package/Core/BuildStamp.js +23 -0
  24. package/_wasm/scichart.browser.js +1 -1
  25. package/_wasm/scichart2d.js +10 -10
  26. package/_wasm/scichart2d.wasm +0 -0
  27. package/_wasm/scichart3d.js +12 -12
  28. package/_wasm/scichart3d.wasm +0 -0
  29. package/package.json +1 -1
  30. package/types/TSciChart.d.ts +1 -0
  31. package/types/TSciChart3D.d.ts +1 -0
  32. package/utils/performance.d.ts +5 -0
  33. package/utils/performance.js +11 -0
@@ -1,6 +1,7 @@
1
1
  import { IIncludeSeries } from "../../Core/IIncludeSeries";
2
2
  import { Point } from "../../Core/Point";
3
3
  import { EChart2DModifierType } from "../../types/ChartModifierType";
4
+ import { EMousePosition } from "../../types/MousePosition";
4
5
  import { SeriesInfo } from "../Model/ChartData/SeriesInfo";
5
6
  import { IThemeProvider } from "../Themes/IThemeProvider";
6
7
  import { CursorTooltipSvgAnnotation } from "../Visuals/Annotations/CursorTooltipSvgAnnotation";
@@ -117,7 +118,10 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
117
118
  private tooltipDataTemplateProperty?;
118
119
  private includedSeriesMap;
119
120
  /**
120
- * Creates an instance of the RolloverModifier
121
+ * Creates an instance of the CursorModifier
122
+ *
123
+ * If number of renderable series is more then 10 and showTooltip enabled consider passing {@link TCursorTooltipDataTemplate} or {@link TCursorTooltipSvgTemplate} to reduce the output for the tooltip
124
+ *
121
125
  * @param options Optional parameters {@link ICursorModifierOptions} used to configure the modifier
122
126
  */
123
127
  constructor(options?: ICursorModifierOptions);
@@ -173,6 +177,9 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
173
177
  * @inheritDoc
174
178
  */
175
179
  getIncludedRenderableSeries(): IRenderableSeries[];
180
+ /**
181
+ * Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
182
+ */
176
183
  get tooltipDataTemplate(): TCursorTooltipDataTemplate;
177
184
  set tooltipDataTemplate(value: TCursorTooltipDataTemplate);
178
185
  /**
@@ -181,6 +188,11 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
181
188
  * @param mousePoint
182
189
  */
183
190
  hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
191
+ /**
192
+ * Returns current mouse position
193
+ */
194
+ getMousePosition(): EMousePosition;
195
+ /** @inheritDoc */
184
196
  toJSON(): {
185
197
  type: string;
186
198
  options: Required<Omit<IChartModifierBaseOptions, never>>;
@@ -44,7 +44,10 @@ var constants_1 = require("./constants");
44
44
  var CursorModifier = /** @class */ (function (_super) {
45
45
  __extends(CursorModifier, _super);
46
46
  /**
47
- * Creates an instance of the RolloverModifier
47
+ * Creates an instance of the CursorModifier
48
+ *
49
+ * If number of renderable series is more then 10 and showTooltip enabled consider passing {@link TCursorTooltipDataTemplate} or {@link TCursorTooltipSvgTemplate} to reduce the output for the tooltip
50
+ *
48
51
  * @param options Optional parameters {@link ICursorModifierOptions} used to configure the modifier
49
52
  */
50
53
  function CursorModifier(options) {
@@ -87,19 +90,19 @@ var CursorModifier = /** @class */ (function (_super) {
87
90
  /**
88
91
  * Gets or sets the xAxis label text color as an HTML Color code
89
92
  */
90
- _this.xAxisLabelStroke = "#fff";
93
+ _this.xAxisLabelStroke = undefined;
91
94
  /**
92
95
  * Gets or sets the xAxis label fill as an HTML Color code.
93
96
  */
94
- _this.xAxisLabelFill = "#228B22";
97
+ _this.xAxisLabelFill = undefined;
95
98
  /**
96
99
  * Gets or sets the xAxis label text color as an HTML Color code
97
100
  */
98
- _this.yAxisLabelStroke = "#fff";
101
+ _this.yAxisLabelStroke = undefined;
99
102
  /**
100
103
  * Gets or sets the xAxis label fill as an HTML Color code.
101
104
  */
102
- _this.yAxisLabelFill = "#228B22";
105
+ _this.yAxisLabelFill = undefined;
103
106
  /**
104
107
  * Gets or sets the legend X offset
105
108
  */
@@ -172,8 +175,8 @@ var CursorModifier = /** @class */ (function (_super) {
172
175
  var yAxisLabelFill = this.yAxisLabelFill ? this.yAxisLabelFill : this.axisLabelFill;
173
176
  var xAxisLabelStroke = this.xAxisLabelStroke ? this.xAxisLabelStroke : this.axisLabelStroke;
174
177
  var yAxisLabelStroke = this.yAxisLabelStroke ? this.yAxisLabelStroke : this.axisLabelStroke;
175
- this.xLineAnnotation = this.newLineAnnotation(xAxisLabelFill, yAxisLabelFill);
176
- this.yLineAnnotation = this.newLineAnnotation(xAxisLabelStroke, yAxisLabelStroke);
178
+ this.xLineAnnotation = this.newLineAnnotation(xAxisLabelFill, xAxisLabelStroke);
179
+ this.yLineAnnotation = this.newLineAnnotation(yAxisLabelFill, yAxisLabelStroke);
177
180
  this.tooltipAnnotation = new CursorTooltipSvgAnnotation_1.CursorTooltipSvgAnnotation({
178
181
  cursorModifier: this,
179
182
  xCoordinateMode: AnnotationBase_1.ECoordinateMode.Pixel,
@@ -297,6 +300,9 @@ var CursorModifier = /** @class */ (function (_super) {
297
300
  return allSeries;
298
301
  };
299
302
  Object.defineProperty(CursorModifier.prototype, "tooltipDataTemplate", {
303
+ /**
304
+ * Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
305
+ */
300
306
  get: function () {
301
307
  return this.tooltipDataTemplateProperty;
302
308
  },
@@ -318,6 +324,13 @@ var CursorModifier = /** @class */ (function (_super) {
318
324
  }
319
325
  return rs.hitTestProvider.hitTestXSlice(mousePoint.x, mousePoint.y);
320
326
  };
327
+ /**
328
+ * Returns current mouse position
329
+ */
330
+ CursorModifier.prototype.getMousePosition = function () {
331
+ return this.mousePosition;
332
+ };
333
+ /** @inheritDoc */
321
334
  CursorModifier.prototype.toJSON = function () {
322
335
  var json = _super.prototype.toJSON.call(this);
323
336
  var options = {
@@ -51,6 +51,24 @@ export declare type TTooltipProps = {
51
51
  height: number;
52
52
  seriesInfo: SeriesInfo;
53
53
  };
54
+ /**
55
+ * @ignore
56
+ * Defines the MousePosition enum constants, used by the {@link RolloverModifier}
57
+ */
58
+ declare enum EMousePosition {
59
+ /**
60
+ * The mouse position is outside the main canvas
61
+ */
62
+ OutOfCanvas = "OutOfCanvas",
63
+ /**
64
+ * The mouse position is in the Axis area
65
+ */
66
+ AxisArea = "AxisArea",
67
+ /**
68
+ * The mouse position is in the Series area
69
+ */
70
+ SeriesArea = "SeriesArea"
71
+ }
54
72
  /**
55
73
  * Optional parameters used to configure a {@link RolloverModifier} at construct time
56
74
  */
@@ -173,10 +191,16 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
173
191
  * @param mousePoint
174
192
  */
175
193
  hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
194
+ /**
195
+ * Returns current mouse position
196
+ */
197
+ getMousePosition(): EMousePosition;
198
+ /** @inheritDoc */
176
199
  toJSON(): {
177
200
  type: string;
178
201
  options: Required<Omit<IChartModifierBaseOptions, never>>;
179
202
  };
203
+ /** @inheritDoc */
180
204
  protected notifyPropertyChanged(propertyName: string): void;
181
205
  private isVerticalChart;
182
206
  private removeSeriesAnnotationsFromParentSurface;
@@ -224,3 +248,4 @@ export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, ro
224
248
  * @param pixelRatio
225
249
  */
226
250
  export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, tooltipPaddingTop: number, seriesViewRect: Rect, pixelRatio: number) => TTooltipProps[];
251
+ export {};
@@ -346,6 +346,13 @@ var RolloverModifier = /** @class */ (function (_super) {
346
346
  }
347
347
  return rs.hitTestProvider.hitTestXSlice(mousePoint.x, mousePoint.y);
348
348
  };
349
+ /**
350
+ * Returns current mouse position
351
+ */
352
+ RolloverModifier.prototype.getMousePosition = function () {
353
+ return this.mousePosition;
354
+ };
355
+ /** @inheritDoc */
349
356
  RolloverModifier.prototype.toJSON = function () {
350
357
  var json = _super.prototype.toJSON.call(this);
351
358
  var options = {
@@ -361,6 +368,7 @@ var RolloverModifier = /** @class */ (function (_super) {
361
368
  Object.assign(json.options, options);
362
369
  return json;
363
370
  };
371
+ /** @inheritDoc */
364
372
  RolloverModifier.prototype.notifyPropertyChanged = function (propertyName) {
365
373
  _super.prototype.notifyPropertyChanged.call(this, propertyName);
366
374
  if (propertyName === constants_1.PROPERTY.X_AXIS_ID) {
@@ -80,7 +80,9 @@ var SciChartRenderer = /** @class */ (function () {
80
80
  el.type === IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation ||
81
81
  el.type === IAnnotation_1.EAnnotationType.RenderContextAxisMarkerAnnotation);
82
82
  });
83
- this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
83
+ renderContext.enqueueLayeredDraw(function () {
84
+ _this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
85
+ }, RenderLayer_1.ERenderLayer.Third);
84
86
  // queue series rendering after grid lines and bands, but before the axes
85
87
  renderContext.enqueueLayeredDraw(function () { return _this.drawSeries(_this.sciChartSurface, _this.sciChartSurface.renderableSeries.asArray(), renderContext); }, RenderLayer_1.ERenderLayer.Third);
86
88
  // Execute rendering of queued elements
@@ -87,7 +87,11 @@ var TextureWorkerWrapper = /** @class */ (function () {
87
87
  var _this = this;
88
88
  this.timeout = 200;
89
89
  this.isActiveProperty = true;
90
- if (!app_1.IS_TEST_ENV && typeof window !== "undefined" && !!window.Worker) {
90
+ if (!app_1.IS_TEST_ENV &&
91
+ typeof window !== "undefined" &&
92
+ !!window.Worker &&
93
+ // @ts-ignore
94
+ typeof OffscreenCanvas !== "undefined") {
91
95
  this.worker = this.makeWorker(); // new Worker("./TextureWorkerSource.ts", { type: "module" });
92
96
  this.worker.onmessage = handleMsg;
93
97
  this.worker.onerror = function (ev) {
@@ -30,6 +30,7 @@ export declare class CursorTooltipSvgAnnotation extends SvgAnnotationBase {
30
30
  private tooltipLegendOffsetXProperty;
31
31
  private tooltipLegendOffsetYProperty;
32
32
  private svgLegend;
33
+ private previousMousePosition;
33
34
  /**
34
35
  * Creates an instance of the {@link CursorTooltipSvgAnnotation}
35
36
  * @param options
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CursorTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var constants_1 = require("./constants");
20
21
  var IAnnotation_1 = require("./IAnnotation");
21
22
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
@@ -164,6 +165,11 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
164
165
  * @inheritDoc
165
166
  */
166
167
  CursorTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
168
+ var currentMousePosition = this.cursorModifier.getMousePosition();
169
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
170
+ return;
171
+ }
172
+ this.previousMousePosition = this.cursorModifier.getMousePosition();
167
173
  if (this.svg) {
168
174
  this.delete();
169
175
  }
@@ -1,3 +1,4 @@
1
+ import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
1
2
  import { RolloverModifierRenderableSeriesProps } from "../RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps";
2
3
  import { EAnnotationType } from "./IAnnotation";
3
4
  import { SvgAnnotationBase } from "./SvgAnnotationBase";
@@ -5,6 +6,10 @@ export declare class RolloverMarkerSvgAnnotation extends SvgAnnotationBase {
5
6
  /** @inheritDoc */
6
7
  readonly type = EAnnotationType.SVG;
7
8
  private tooltipProps;
9
+ private previousMousePosition;
8
10
  constructor(renderableSeriesProps: RolloverModifierRenderableSeriesProps);
11
+ /** @inheritDoc */
12
+ update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
13
+ /** @inheritDoc */
9
14
  protected create(): void;
10
15
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverMarkerSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IAnnotation_1 = require("./IAnnotation");
20
21
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
21
22
  var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
@@ -32,6 +33,16 @@ var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
32
33
  _this.yCoordShift = -4;
33
34
  return _this;
34
35
  }
36
+ /** @inheritDoc */
37
+ RolloverMarkerSvgAnnotation.prototype.update = function (xCalc, yCalc) {
38
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
39
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
40
+ return;
41
+ }
42
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
43
+ _super.prototype.update.call(this, xCalc, yCalc);
44
+ };
45
+ /** @inheritDoc */
35
46
  RolloverMarkerSvgAnnotation.prototype.create = function () {
36
47
  if (this.svg) {
37
48
  this.delete();
@@ -19,6 +19,7 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
19
19
  height: number;
20
20
  private svgLegend;
21
21
  private seriesInfoProperty;
22
+ private previousMousePosition;
22
23
  /**
23
24
  * Creates an instance of the {@link RolloverTooltipSvgAnnotation}
24
25
  * @param renderableSeriesProps The {@link RolloverModifierRenderableSeriesProps | props} pass
@@ -33,18 +34,15 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
33
34
  * Gets or sets seriesInfo {@link SeriesInfo} value on the tooltip
34
35
  */
35
36
  set seriesInfo(value: SeriesInfo);
36
- /**
37
- * @inheritDoc
38
- */
37
+ /** @inheritDoc */
39
38
  delete(): void;
40
- /**
41
- * @inheritDoc
42
- */
39
+ /** @inheritDoc */
43
40
  update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
44
- updateSize(width: number, height: number): void;
45
41
  /**
46
- * @inheritDoc
42
+ * Updates size of the tooltip
47
43
  */
44
+ updateSize(width: number, height: number): void;
45
+ /** @inheritDoc */
48
46
  protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
49
47
  private updateLegendTooltip;
50
48
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IDataSeries_1 = require("../../Model/IDataSeries");
20
21
  var AnnotationBase_1 = require("./AnnotationBase");
21
22
  var constants_1 = require("./constants");
@@ -64,9 +65,7 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
64
65
  enumerable: false,
65
66
  configurable: true
66
67
  });
67
- /**
68
- * @inheritDoc
69
- */
68
+ /** @inheritDoc */
70
69
  RolloverTooltipSvgAnnotation.prototype.delete = function () {
71
70
  var _a;
72
71
  if (!this.parentSurface || this.parentSurface.isDeleted)
@@ -76,23 +75,27 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
76
75
  this.svgRoot.removeChild(this.svgLegend);
77
76
  }
78
77
  };
79
- /**
80
- * @inheritDoc
81
- */
78
+ /** @inheritDoc */
82
79
  RolloverTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
80
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
81
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
82
+ return;
83
+ }
84
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
83
85
  if (this.svg) {
84
86
  this.delete();
85
87
  }
86
88
  _super.prototype.update.call(this, xCalc, yCalc);
87
89
  this.updateLegendTooltip();
88
90
  };
91
+ /**
92
+ * Updates size of the tooltip
93
+ */
89
94
  RolloverTooltipSvgAnnotation.prototype.updateSize = function (width, height) {
90
95
  this.width = width;
91
96
  this.height = height;
92
97
  };
93
- /**
94
- * @inheritDoc
95
- */
98
+ /** @inheritDoc */
96
99
  RolloverTooltipSvgAnnotation.prototype.create = function (xCalc, yCalc) {
97
100
  var _a;
98
101
  var svgString;
@@ -72,7 +72,7 @@ var clearCacheByStyle = function (styleId) {
72
72
  }
73
73
  }
74
74
  };
75
- var maxSize = 100;
75
+ var maxSize = 200;
76
76
  var minAge = 1000 * 60;
77
77
  var lastUsed = 0;
78
78
  var getMaxSize = function () { return maxSize; };
@@ -88,7 +88,7 @@ var pruneCache = function () {
88
88
  if (labelCacheByTextAndStyle.size > maxSize && lastUsed < latest) {
89
89
  try {
90
90
  // remove more than we need so we do this less.
91
- var toRemove = (labelCacheByTextAndStyle.size - maxSize) * 2;
91
+ var toRemove = Math.min(Math.floor(labelCacheByTextAndStyle.size / 2), (labelCacheByTextAndStyle.size - maxSize) * 2);
92
92
  // Sort the items by LastUsed ascending
93
93
  var labels = Array.from(labelCacheByTextAndStyle.entries());
94
94
  labels.sort(function (a, b) { return a[1].lastUsed - b[1].lastUsed; });
@@ -148,11 +148,16 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
148
148
  var cachedLabel = void 0;
149
149
  if (cachedLabelText) {
150
150
  cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
151
- labels.push(cachedLabelText);
151
+ if (cachedLabel) {
152
+ labels.push(cachedLabelText);
153
+ }
152
154
  }
153
- else {
154
- var text = this.formatLabel(tick);
155
- this.tickToText.set(tick, text);
155
+ if (!cachedLabel) {
156
+ var text = cachedLabelText;
157
+ if (!cachedLabelText) {
158
+ text = this.formatLabel(tick);
159
+ this.tickToText.set(tick, text);
160
+ }
156
161
  var texture = this.getCachedLabelTexture(text, axis.axisRenderer.textureManager, axis.dpiAdjustedLabelStyle);
157
162
  if (texture.textureWidth !== null) {
158
163
  cachedLabel = new LabelInfo(tick, text, texture.bitmapTexture, texture.textureHeight, texture.textureWidth);
@@ -512,7 +512,8 @@ var BaseRenderableSeries = /** @class */ (function () {
512
512
  };
513
513
  /** @inheritDoc */
514
514
  BaseRenderableSeries.prototype.getDataSeriesName = function () {
515
- return this.dataSeries.dataSeriesName;
515
+ var _a;
516
+ return (_a = this.dataSeries) === null || _a === void 0 ? void 0 : _a.dataSeriesName;
516
517
  };
517
518
  /** @inheritDoc */
518
519
  BaseRenderableSeries.prototype.getNativeXValues = function () {
@@ -662,8 +662,6 @@ var SciChartSurface = /** @class */ (function (_super) {
662
662
  if (!animation.isComplete) {
663
663
  animation.update(timeElapsed);
664
664
  if (!animation.isComplete) {
665
- // Request another draw to advance animation
666
- this.invalidateElement();
667
665
  remainingAnimations.push(animation);
668
666
  }
669
667
  }
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.sciChartDestinations = exports.createMultichart = void 0;
40
40
  // @ts-ignore
41
41
  var WasmModule2D = require("../../_wasm/scichart2d");
42
+ var BuildStamp_1 = require("../../Core/BuildStamp");
42
43
  var Guard_1 = require("../../Core/Guard");
43
44
  var WebGlRenderContext2D_1 = require("../Drawing/WebGlRenderContext2D");
44
45
  var licenseManager2D_1 = require("./licenseManager2D");
@@ -57,7 +58,7 @@ var sciChartMaster = {
57
58
  var sciChartMasterPromise;
58
59
  /** @ignore */
59
60
  var createMultichart = function (divElementId, options) { return __awaiter(void 0, void 0, void 0, function () {
60
- var canvases, loader, loaderDiv, master, createChildSurface, wasmContext, sciChartSurface;
61
+ var canvases, loader, loaderDiv, master, createChildSurface, wasmContext_1, sciChartSurface_1, err_1;
61
62
  var _a, _b, _c;
62
63
  return __generator(this, function (_d) {
63
64
  switch (_d.label) {
@@ -66,27 +67,38 @@ var createMultichart = function (divElementId, options) { return __awaiter(void
66
67
  canvases = sciChartInitCommon_1.default.initCanvas(divElementId, (_a = options === null || options === void 0 ? void 0 : options.widthAspect) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.heightAspect) !== null && _b !== void 0 ? _b : 0, sciChartInitCommon_1.default.ECanvasType.canvas2D);
67
68
  loader = (_c = options === null || options === void 0 ? void 0 : options.loader) !== null && _c !== void 0 ? _c : new loader_1.DefaultSciChartLoader();
68
69
  loaderDiv = loader.addChartLoader(canvases.domDivContainer, options === null || options === void 0 ? void 0 : options.theme);
69
- if (!(!sciChartMaster.wasmContext || !sciChartMaster.createChildSurface || !sciChartMaster.getChildSurfaces)) return [3 /*break*/, 2];
70
+ _d.label = 1;
71
+ case 1:
72
+ _d.trys.push([1, 4, , 5]);
73
+ if (!(!sciChartMaster.wasmContext || !sciChartMaster.createChildSurface || !sciChartMaster.getChildSurfaces)) return [3 /*break*/, 3];
70
74
  if (!sciChartMasterPromise) {
71
75
  sciChartMasterPromise = createMaster();
72
76
  }
73
77
  return [4 /*yield*/, sciChartMasterPromise];
74
- case 1:
78
+ case 2:
75
79
  master = _d.sent();
76
80
  sciChartMaster.wasmContext = master.wasmContext;
81
+ (0, BuildStamp_1.checkBuildStamp)(master.wasmContext);
77
82
  sciChartMaster.createChildSurface = master.createChildSurface;
78
83
  sciChartMaster.getChildSurfaces = master.getChildSurfaces;
79
84
  monitorWebGL(sciChartMaster);
80
- _d.label = 2;
81
- case 2:
82
- createChildSurface = sciChartMaster.createChildSurface, wasmContext = sciChartMaster.wasmContext;
83
- sciChartSurface = createChildSurface(divElementId, canvases, options === null || options === void 0 ? void 0 : options.theme);
85
+ _d.label = 3;
86
+ case 3:
87
+ createChildSurface = sciChartMaster.createChildSurface, wasmContext_1 = sciChartMaster.wasmContext;
88
+ sciChartSurface_1 = createChildSurface(divElementId, canvases, options === null || options === void 0 ? void 0 : options.theme);
84
89
  return [2 /*return*/, new Promise(function (resolve) {
85
90
  setTimeout(function () {
86
91
  loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
87
- resolve({ wasmContext: wasmContext, sciChartSurface: sciChartSurface });
92
+ resolve({ wasmContext: wasmContext_1, sciChartSurface: sciChartSurface_1 });
88
93
  }, 0);
89
94
  })];
95
+ case 4:
96
+ err_1 = _d.sent();
97
+ console.error(err_1);
98
+ // replace with div with error message
99
+ loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
100
+ return [2 /*return*/, Promise.reject(err_1)];
101
+ case 5: return [2 /*return*/];
90
102
  }
91
103
  });
92
104
  }); };
@@ -145,12 +157,13 @@ var createMaster = function () {
145
157
  chartInitObj.SetFPSCounterEnabled(false);
146
158
  exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
147
159
  };
148
- return new Promise(function (resolve) {
160
+ return new Promise(function (resolve, reject) {
149
161
  // make sure canvas has event listener for context creation error
150
162
  var canvas = (0, SciChartSurfaceBase_1.getMasterCanvas)();
151
163
  var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChartSurface_1.sciChartConfig);
152
164
  // @ts-ignore
153
- new WasmModule2D({ locateFile: locateFile, noInitialRun: true }).then(function (wasmContext) {
165
+ new WasmModule2D({ locateFile: locateFile, noInitialRun: true })
166
+ .then(function (wasmContext) {
154
167
  var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
155
168
  // Create of replace child surface
156
169
  var createChildSurface = function (divElementId, canvases, theme) {
@@ -205,6 +218,9 @@ var createMaster = function () {
205
218
  wasmContext.TSRSetDrawRequestsEnabled(true);
206
219
  // @ts-ignore
207
220
  wasmContext.callMain();
221
+ })
222
+ .catch(function () {
223
+ reject("Could not load SciChart WebAssembly module.\n Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version");
208
224
  });
209
225
  });
210
226
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initDrawEngineSingleChart = exports.createSingleInternal = exports.sciChartSingleDestinations = void 0;
4
4
  // @ts-ignore
5
5
  var WasmModule2D = require("../../_wasm/scichart2d");
6
+ var BuildStamp_1 = require("../../Core/BuildStamp");
6
7
  var Guard_1 = require("../../Core/Guard");
7
8
  var WebGlHelper_1 = require("../../Core/WebGlHelper");
8
9
  var logger_1 = require("../../utils/logger");
@@ -15,7 +16,7 @@ var SciChartSurfaceBase_1 = require("./SciChartSurfaceBase");
15
16
  exports.sciChartSingleDestinations = [];
16
17
  /** @ignore */
17
18
  var createSingleInternal = function (divElementId, options) {
18
- return new Promise(function (resolve) {
19
+ return new Promise(function (resolve, reject) {
19
20
  var _a;
20
21
  var canvases = sciChartInitCommon_1.default.initCanvas(divElementId, options === null || options === void 0 ? void 0 : options.widthAspect, options === null || options === void 0 ? void 0 : options.heightAspect);
21
22
  var loader = (_a = options === null || options === void 0 ? void 0 : options.loader) !== null && _a !== void 0 ? _a : new loader_1.DefaultSciChartLoader();
@@ -25,11 +26,17 @@ var createSingleInternal = function (divElementId, options) {
25
26
  if (webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL2 || webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL1) {
26
27
  var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChartSurface_1.sciChartConfig);
27
28
  // @ts-ignore
28
- new WasmModule2D({ locateFile: locateFile, noInitialRun: true }).then(function (wasmContext) {
29
+ new WasmModule2D({ locateFile: locateFile, noInitialRun: true })
30
+ .then(function (wasmContext) {
29
31
  loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
30
32
  // @ts-ignore
31
33
  wasmContext.doNotCaptureKeyboard = true;
32
34
  (0, exports.initDrawEngineSingleChart)(wasmContext, canvases, resolve, options === null || options === void 0 ? void 0 : options.theme);
35
+ (0, BuildStamp_1.checkBuildStamp)(wasmContext);
36
+ })
37
+ .catch(function () {
38
+ loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
39
+ reject("Could not load SciChart WebAssembly module.\n Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version");
33
40
  });
34
41
  }
35
42
  else {
@@ -38,6 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.licenseManager = exports.updateLicenseDisplay = exports.getLicenseInfo = exports.applyLicense = exports.getLicenseCookie = exports.setCallbacks3D = exports.setUseLicenseWizard = exports.setRuntimeLicenseKey = exports.setLicenseCallback = exports.setDependencies = void 0;
40
40
  var app_1 = require("../../constants/app");
41
+ var BuildStamp_1 = require("../../Core/BuildStamp");
41
42
  var Dictionary_1 = require("../../Core/Dictionary");
42
43
  var Color_1 = require("../../types/Color");
43
44
  var licensingClasses_1 = require("../../types/licensingClasses");
@@ -110,6 +111,7 @@ var debug = function (message) {
110
111
  licenseDependencies.debug(message);
111
112
  }
112
113
  };
114
+ debug("SciChart version " + BuildStamp_1.libraryVersion);
113
115
  // tslint:disable: no-console
114
116
  var licenseCallback;
115
117
  var setLicenseCallback = function (callback) {
@@ -375,7 +377,9 @@ var applyLicense = function (licenseContext) {
375
377
  debug("Initial license status is " + licensingClasses_1.LicenseType[convertLicenseType(lt, licenseContext)]);
376
378
  // Get from global store
377
379
  var runtimelicense = getRuntimeLicenseKey();
378
- if ((checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense || checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK) &&
380
+ if ((checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense ||
381
+ checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK ||
382
+ checkStatus === licensingClasses_1.LicenseCheckStatus.LookingForLicenseWizard) &&
379
383
  lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_NO_LICENSE &&
380
384
  runtimelicense) {
381
385
  debug("Runtime license found");