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
@@ -43,6 +43,7 @@ var chartBuilder_1 = require("../../Builder/chartBuilder");
43
43
  var loader_1 = require("../../Charting/Visuals/loader");
44
44
  var sciChartInitCommon_1 = require("../../Charting/Visuals/sciChartInitCommon");
45
45
  var SciChartSurfaceBase_1 = require("../../Charting/Visuals/SciChartSurfaceBase");
46
+ var BuildStamp_1 = require("../../Core/BuildStamp");
46
47
  var licenseManager3D_1 = require("./licenseManager3D");
47
48
  var SciChart3DSurface_1 = require("./SciChart3DSurface");
48
49
  /** @ignore */
@@ -55,7 +56,7 @@ var sciChartMaster3D = {
55
56
  var sciChartMaster3DPromise;
56
57
  /** @ignore */
57
58
  var createMultichart3d = function (divElementId, options) { return __awaiter(void 0, void 0, void 0, function () {
58
- var canvases, loader, loaderDiv, master, createChildSurface, wasmContext, sciChart3DSurface;
59
+ var canvases, loader, loaderDiv, master, createChildSurface, wasmContext_1, sciChart3DSurface_1, err_1;
59
60
  var _a, _b, _c, _d, _e;
60
61
  return __generator(this, function (_f) {
61
62
  switch (_f.label) {
@@ -63,29 +64,42 @@ var createMultichart3d = function (divElementId, options) { return __awaiter(voi
63
64
  (0, chartBuilder_1.ensureRegistrations)();
64
65
  sciChartInitCommon_1.default.checkChartDivExists(divElementId);
65
66
  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);
66
- if (!(!sciChartMaster3D.wasmContext || !sciChartMaster3D.createChildSurface || !sciChartMaster3D.getChildSurfaces)) return [3 /*break*/, 2];
67
+ loader = (_c = options === null || options === void 0 ? void 0 : options.loader) !== null && _c !== void 0 ? _c : new loader_1.DefaultSciChartLoader();
68
+ loaderDiv = loader.addChartLoader(canvases.domDivContainer, (_d = options === null || options === void 0 ? void 0 : options.theme) !== null && _d !== void 0 ? _d : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
69
+ _f.label = 1;
70
+ case 1:
71
+ _f.trys.push([1, 4, , 5]);
72
+ if (!(!sciChartMaster3D.wasmContext ||
73
+ !sciChartMaster3D.createChildSurface ||
74
+ !sciChartMaster3D.getChildSurfaces)) return [3 /*break*/, 3];
67
75
  if (!sciChartMaster3DPromise) {
68
76
  sciChartMaster3DPromise = createMaster();
69
77
  }
70
- loader = (_c = options === null || options === void 0 ? void 0 : options.loader) !== null && _c !== void 0 ? _c : new loader_1.DefaultSciChartLoader();
71
- loaderDiv = loader.addChartLoader(canvases.domDivContainer, (_d = options === null || options === void 0 ? void 0 : options.theme) !== null && _d !== void 0 ? _d : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
72
78
  return [4 /*yield*/, sciChartMaster3DPromise];
73
- case 1:
79
+ case 2:
74
80
  master = _f.sent();
75
- loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
81
+ (0, BuildStamp_1.checkBuildStamp)(master.wasmContext);
76
82
  sciChartMaster3D.wasmContext = master.wasmContext;
77
83
  sciChartMaster3D.createChildSurface = master.createChildSurface;
78
84
  sciChartMaster3D.getChildSurfaces = master.getChildSurfaces;
79
- _f.label = 2;
80
- case 2:
81
- createChildSurface = sciChartMaster3D.createChildSurface, wasmContext = sciChartMaster3D.wasmContext;
82
- sciChart3DSurface = createChildSurface(divElementId, canvases, (_e = options === null || options === void 0 ? void 0 : options.theme) !== null && _e !== void 0 ? _e : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
85
+ _f.label = 3;
86
+ case 3:
87
+ createChildSurface = sciChartMaster3D.createChildSurface, wasmContext_1 = sciChartMaster3D.wasmContext;
88
+ sciChart3DSurface_1 = createChildSurface(divElementId, canvases, (_e = options === null || options === void 0 ? void 0 : options.theme) !== null && _e !== void 0 ? _e : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
83
89
  return [2 /*return*/, new Promise(function (resolve) {
84
90
  setTimeout(function () {
85
- sciChart3DSurface.setIsInitialized();
86
- resolve({ wasmContext: wasmContext, sciChart3DSurface: sciChart3DSurface });
91
+ loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
92
+ sciChart3DSurface_1.setIsInitialized();
93
+ resolve({ wasmContext: wasmContext_1, sciChart3DSurface: sciChart3DSurface_1 });
87
94
  }, 0);
88
95
  })];
96
+ case 4:
97
+ err_1 = _f.sent();
98
+ console.error(err_1);
99
+ // replace with div with error message
100
+ loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
101
+ return [2 /*return*/, Promise.reject(err_1)];
102
+ case 5: return [2 /*return*/];
89
103
  }
90
104
  });
91
105
  }); };
@@ -112,10 +126,11 @@ var createMaster = function () {
112
126
  chartInitObj3D.AddDestination(dest);
113
127
  exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
114
128
  };
115
- return new Promise(function (resolve) {
129
+ return new Promise(function (resolve, reject) {
116
130
  var locateFile3d = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
117
131
  // @ts-ignore
118
- new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true }).then(function (wasmContext) {
132
+ new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
133
+ .then(function (wasmContext) {
119
134
  var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
120
135
  // Create of replace child surface
121
136
  var createChildSurface = function (divElementId, canvases, theme) {
@@ -173,6 +188,9 @@ var createMaster = function () {
173
188
  wasmContext.TSRSetDrawRequestsEnabled(true);
174
189
  // @ts-ignore
175
190
  wasmContext.callMain();
191
+ })
192
+ .catch(function () {
193
+ 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");
176
194
  });
177
195
  });
178
196
  };
@@ -7,28 +7,35 @@ var chartBuilder_1 = require("../../Builder/chartBuilder");
7
7
  var loader_1 = require("../../Charting/Visuals/loader");
8
8
  var sciChartInitCommon_1 = require("../../Charting/Visuals/sciChartInitCommon");
9
9
  var SciChartSurfaceBase_1 = require("../../Charting/Visuals/SciChartSurfaceBase");
10
+ var BuildStamp_1 = require("../../Core/BuildStamp");
10
11
  var WebGlHelper_1 = require("../../Core/WebGlHelper");
11
12
  var logger_1 = require("../../utils/logger");
12
13
  var licenseManager3D_1 = require("./licenseManager3D");
13
14
  var SciChart3DSurface_1 = require("./SciChart3DSurface");
14
15
  var createSingle3dInternal = function (divElementId, options) {
15
16
  (0, chartBuilder_1.ensureRegistrations)();
16
- return new Promise(function (resolve) {
17
+ return new Promise(function (resolve, reject) {
17
18
  var _a, _b, _c, _d;
18
19
  var 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);
19
20
  var loader = (_c = options === null || options === void 0 ? void 0 : options.loader) !== null && _c !== void 0 ? _c : new loader_1.DefaultSciChartLoader();
20
21
  var loaderDiv = loader.addChartLoader(canvases.domDivContainer, (_d = options === null || options === void 0 ? void 0 : options.theme) !== null && _d !== void 0 ? _d : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
21
22
  var webGLSupport = WebGlHelper_1.WebGlHelper.getWebGlSupport();
22
- console.log("webGLSupport", webGLSupport);
23
+ // console.log("webGLSupport", webGLSupport);
23
24
  if (webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL2 || webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL1) {
24
25
  var locateFile3d = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
25
26
  // @ts-ignore
26
- new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true }).then(function (wasmContext) {
27
+ new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
28
+ .then(function (wasmContext) {
27
29
  var _a;
28
30
  loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
29
31
  // @ts-ignore
30
32
  wasmContext.doNotCaptureKeyboard = true;
31
33
  initDrawEngineSingleChart(wasmContext, canvases, resolve, (_a = options === null || options === void 0 ? void 0 : options.theme) !== null && _a !== void 0 ? _a : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME);
34
+ (0, BuildStamp_1.checkBuildStamp)(wasmContext);
35
+ })
36
+ .catch(function () {
37
+ loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
38
+ reject("Could not load SciChart WebAssembly module.\n Check your build process and ensure that your scichart3d.wasm, scichart3d.data and scichart3d.js files are from the same version");
32
39
  });
33
40
  }
34
41
  else {
@@ -0,0 +1,4 @@
1
+ import { TSciChart } from "../types/TSciChart";
2
+ import { TSciChart3D } from "../types/TSciChart3D";
3
+ export declare const libraryVersion = "2.0.2204";
4
+ export declare const checkBuildStamp: (wasmContext: TSciChart | TSciChart3D) => boolean;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkBuildStamp = exports.libraryVersion = void 0;
4
+ var buildStamp = "2022-01-11T00:00:00";
5
+ var result;
6
+ // tslint:disable-next-line:no-var-requires
7
+ exports.libraryVersion = "2.0.2204";
8
+ var checkBuildStamp = function (wasmContext) {
9
+ if (result !== undefined)
10
+ return result;
11
+ if (!wasmContext)
12
+ return false;
13
+ if (wasmContext.SCRTCredentials.GetBuildStamp) {
14
+ if (wasmContext.SCRTCredentials.GetBuildStamp() === buildStamp) {
15
+ result = true;
16
+ return result;
17
+ }
18
+ }
19
+ console.warn("The SciChart webassembly module is from a different version than the javascript that is calling it.\n Ensure that your build process is copying the correct wasm and data files.");
20
+ result = false;
21
+ return result;
22
+ };
23
+ exports.checkBuildStamp = checkBuildStamp;