scichart 2.0.2186 → 2.0.2228
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.
- package/Charting/ChartModifiers/CursorModifier.d.ts +13 -1
- package/Charting/ChartModifiers/CursorModifier.js +14 -1
- package/Charting/ChartModifiers/RolloverModifier.d.ts +25 -0
- package/Charting/ChartModifiers/RolloverModifier.js +8 -0
- package/Charting/Drawing/BrushCache.d.ts +8 -2
- package/Charting/Drawing/BrushCache.js +16 -8
- package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
- package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
- package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
- package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/Model/OhlcDataSeries.js +10 -10
- package/Charting/Model/XyDataSeries.js +4 -4
- package/Charting/Model/XyyDataSeries.js +6 -6
- package/Charting/Model/XyzDataSeries.js +6 -6
- package/Charting/Services/SciChartRenderer.js +3 -1
- package/Charting/Services/Workers/TextureWorker.js +5 -1
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +1 -0
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +6 -0
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +5 -0
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +12 -1
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +6 -8
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +12 -9
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
- package/Charting/Visuals/Axis/AxisRenderer.js +31 -4
- package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -2
- package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +9 -4
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +10 -3
- package/Charting/Visuals/SciChartSurface.d.ts +4 -4
- package/Charting/Visuals/SciChartSurface.js +18 -13
- package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
- package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
- package/Charting/Visuals/createMaster.d.ts +1 -1
- package/Charting/Visuals/createMaster.js +36 -15
- package/Charting/Visuals/createSingle.d.ts +1 -1
- package/Charting/Visuals/createSingle.js +11 -4
- package/Charting/Visuals/licenseManager2D.js +5 -1
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +18 -12
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
- package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
- package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
- package/Charting3D/Visuals/createMaster3d.js +42 -19
- package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
- package/Charting3D/Visuals/createSingle3d.js +12 -5
- package/Core/BuildStamp.d.ts +4 -0
- package/Core/BuildStamp.js +23 -0
- package/Core/NumberRange.d.ts +1 -0
- package/Core/NumberRange.js +8 -0
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +10 -10
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +12 -12
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/NumberArray.d.ts +1 -0
- package/types/NumberArray.js +5 -1
- package/types/TSciChart.d.ts +1 -0
- package/types/TSciChart3D.d.ts +1 -0
- package/types/TStackedAxisLength.d.ts +4 -0
- package/types/TStackedAxisLength.js +4 -0
- package/utils/performance.d.ts +5 -0
- package/utils/performance.js +11 -0
|
@@ -325,13 +325,14 @@ export declare abstract class SciChartSurfaceBase implements ISciChartSurfaceBas
|
|
|
325
325
|
protected changeMasterCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void;
|
|
326
326
|
protected changeWebGLCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void;
|
|
327
327
|
}
|
|
328
|
-
export declare const createChartDestination: (
|
|
328
|
+
export declare const createChartDestination: (canvas: HTMLCanvasElement) => {
|
|
329
329
|
canvas: HTMLCanvasElement;
|
|
330
330
|
GetHeight(): any;
|
|
331
331
|
GetWidth(): any;
|
|
332
332
|
GetID(): any;
|
|
333
333
|
};
|
|
334
334
|
export declare const getMasterCanvas: () => HTMLCanvasElement;
|
|
335
|
-
export declare
|
|
335
|
+
export declare type TGetDestinationFn = (destinationId: string) => TSciChartDestination;
|
|
336
|
+
export declare const copyToCanvas: (sourceCanvas: HTMLCanvasElement, getDestinationById: TGetDestinationFn) => (destinationId: string) => void;
|
|
336
337
|
/** @ignore */
|
|
337
338
|
export declare const getLocateFile: (sciChartConfig: TSciChartConfig) => (path: string, prefix: string) => string;
|
|
@@ -420,8 +420,7 @@ var SciChartSurfaceBase = /** @class */ (function () {
|
|
|
420
420
|
return SciChartSurfaceBase;
|
|
421
421
|
}());
|
|
422
422
|
exports.SciChartSurfaceBase = SciChartSurfaceBase;
|
|
423
|
-
var createChartDestination = function (
|
|
424
|
-
var canvas = document.querySelector("#".concat(canvasId));
|
|
423
|
+
var createChartDestination = function (canvas) {
|
|
425
424
|
if (!canvas)
|
|
426
425
|
return undefined;
|
|
427
426
|
return {
|
|
@@ -475,8 +474,9 @@ var getMasterCanvas = function () {
|
|
|
475
474
|
return SciChartSurfaceBase.domMasterCanvas;
|
|
476
475
|
};
|
|
477
476
|
exports.getMasterCanvas = getMasterCanvas;
|
|
478
|
-
var copyToCanvas = function (sourceCanvas) { return function (destinationId) {
|
|
479
|
-
var
|
|
477
|
+
var copyToCanvas = function (sourceCanvas, getDestinationById) { return function (destinationId) {
|
|
478
|
+
var destination = getDestinationById(destinationId);
|
|
479
|
+
var destinationCanvas = destination === null || destination === void 0 ? void 0 : destination.sciChartSurface.domCanvas2D;
|
|
480
480
|
if (destinationCanvas) {
|
|
481
481
|
var destinationCanvasContext = destinationCanvas.getContext("2d");
|
|
482
482
|
destinationCanvasContext.clearRect(0, 0, destinationCanvasContext.canvas.width, destinationCanvasContext.canvas.height);
|
|
@@ -2,6 +2,6 @@ import { I2DSurfaceOptions } from "./I2DSurfaceOptions";
|
|
|
2
2
|
import { TWebAssemblyChart } from "./SciChartSurface";
|
|
3
3
|
import { TSciChartDestination } from "./SciChartSurfaceBase";
|
|
4
4
|
/** @ignore */
|
|
5
|
-
export declare const createMultichart: (
|
|
5
|
+
export declare const createMultichart: (divElement: string | HTMLDivElement, options?: I2DSurfaceOptions) => Promise<TWebAssemblyChart>;
|
|
6
6
|
/** @ignore */
|
|
7
7
|
export declare const sciChartDestinations: TSciChartDestination[];
|
|
@@ -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");
|
|
@@ -56,37 +57,49 @@ var sciChartMaster = {
|
|
|
56
57
|
/** @ignore */
|
|
57
58
|
var sciChartMasterPromise;
|
|
58
59
|
/** @ignore */
|
|
59
|
-
var createMultichart = function (
|
|
60
|
-
var canvases, loader, loaderDiv, master, createChildSurface,
|
|
60
|
+
var createMultichart = function (divElement, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var canvases, loader, loaderDiv, master, createChildSurface, wasmContext_1, divElementId, sciChartSurface_1, err_1;
|
|
61
62
|
var _a, _b, _c;
|
|
62
63
|
return __generator(this, function (_d) {
|
|
63
64
|
switch (_d.label) {
|
|
64
65
|
case 0:
|
|
65
|
-
sciChartInitCommon_1.default.checkChartDivExists(
|
|
66
|
-
canvases = sciChartInitCommon_1.default.initCanvas(
|
|
66
|
+
sciChartInitCommon_1.default.checkChartDivExists(divElement);
|
|
67
|
+
canvases = sciChartInitCommon_1.default.initCanvas(divElement, (_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
|
-
|
|
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
|
|
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 =
|
|
81
|
-
case
|
|
82
|
-
createChildSurface = sciChartMaster.createChildSurface,
|
|
83
|
-
|
|
85
|
+
_d.label = 3;
|
|
86
|
+
case 3:
|
|
87
|
+
createChildSurface = sciChartMaster.createChildSurface, wasmContext_1 = sciChartMaster.wasmContext;
|
|
88
|
+
divElementId = canvases.domChartRoot.id;
|
|
89
|
+
sciChartSurface_1 = createChildSurface(divElementId, canvases, options === null || options === void 0 ? void 0 : options.theme);
|
|
84
90
|
return [2 /*return*/, new Promise(function (resolve) {
|
|
85
91
|
setTimeout(function () {
|
|
86
92
|
loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
|
|
87
|
-
resolve({ wasmContext:
|
|
93
|
+
resolve({ wasmContext: wasmContext_1, sciChartSurface: sciChartSurface_1 });
|
|
88
94
|
}, 0);
|
|
89
95
|
})];
|
|
96
|
+
case 4:
|
|
97
|
+
err_1 = _d.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*/];
|
|
90
103
|
}
|
|
91
104
|
});
|
|
92
105
|
}); };
|
|
@@ -135,7 +148,7 @@ var createMaster = function () {
|
|
|
135
148
|
return sciChartSurface;
|
|
136
149
|
};
|
|
137
150
|
var addDestination = function (wasmContext, canvasElementId, sciChartSurface, width, height, chartInitObj) {
|
|
138
|
-
var newDestination = (0, SciChartSurfaceBase_1.createChartDestination)(
|
|
151
|
+
var newDestination = (0, SciChartSurfaceBase_1.createChartDestination)(sciChartSurface.domCanvas2D);
|
|
139
152
|
if (!newDestination) {
|
|
140
153
|
sciChartSurface.delete();
|
|
141
154
|
return;
|
|
@@ -145,12 +158,13 @@ var createMaster = function () {
|
|
|
145
158
|
chartInitObj.SetFPSCounterEnabled(false);
|
|
146
159
|
exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
|
|
147
160
|
};
|
|
148
|
-
return new Promise(function (resolve) {
|
|
161
|
+
return new Promise(function (resolve, reject) {
|
|
149
162
|
// make sure canvas has event listener for context creation error
|
|
150
163
|
var canvas = (0, SciChartSurfaceBase_1.getMasterCanvas)();
|
|
151
164
|
var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChartSurface_1.sciChartConfig);
|
|
152
165
|
// @ts-ignore
|
|
153
|
-
new WasmModule2D({ locateFile: locateFile, noInitialRun: true })
|
|
166
|
+
new WasmModule2D({ locateFile: locateFile, noInitialRun: true })
|
|
167
|
+
.then(function (wasmContext) {
|
|
154
168
|
var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
|
|
155
169
|
// Create of replace child surface
|
|
156
170
|
var createChildSurface = function (divElementId, canvases, theme) {
|
|
@@ -199,12 +213,19 @@ var createMaster = function () {
|
|
|
199
213
|
wasmContext.SCRTSetGlobalSampleChartInterface(chartInitObj);
|
|
200
214
|
/// create an object that native side can trigger the copy to from...
|
|
201
215
|
var canvasCopyObj = wasmContext.SCRTCopyToDestinationInterface.implement({
|
|
202
|
-
CopyToDestination: (0, SciChartSurfaceBase_1.copyToCanvas)(SciChartSurfaceBase_1.SciChartSurfaceBase.domMasterCanvas)
|
|
216
|
+
CopyToDestination: (0, SciChartSurfaceBase_1.copyToCanvas)(SciChartSurfaceBase_1.SciChartSurfaceBase.domMasterCanvas, getDestinationById)
|
|
203
217
|
});
|
|
204
218
|
wasmContext.SCRTSetGlobalCopyToDestinationInterface(canvasCopyObj);
|
|
205
219
|
wasmContext.TSRSetDrawRequestsEnabled(true);
|
|
206
220
|
// @ts-ignore
|
|
207
221
|
wasmContext.callMain();
|
|
222
|
+
})
|
|
223
|
+
.catch(function () {
|
|
224
|
+
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
225
|
});
|
|
209
226
|
});
|
|
210
227
|
};
|
|
228
|
+
/** @ignore */
|
|
229
|
+
var getDestinationById = function (destinationId) {
|
|
230
|
+
return exports.sciChartDestinations.find(function (dest) { return dest.canvasElementId === destinationId; });
|
|
231
|
+
};
|
|
@@ -6,6 +6,6 @@ import { TWebAssemblyChart } from "./SciChartSurface";
|
|
|
6
6
|
import { TSciChartDestination } from "./SciChartSurfaceBase";
|
|
7
7
|
export declare const sciChartSingleDestinations: TSciChartDestination[];
|
|
8
8
|
/** @ignore */
|
|
9
|
-
export declare const createSingleInternal: (
|
|
9
|
+
export declare const createSingleInternal: (divElement: string | HTMLDivElement, options?: I2DSurfaceOptions) => Promise<TWebAssemblyChart>;
|
|
10
10
|
/** @ignore */
|
|
11
11
|
export declare const initDrawEngineSingleChart: (wasmContext: TSciChart, canvases: TSciChartSurfaceCanvases, resolve: (value: TWebAssemblyChart) => void, theme: IThemeProvider) => void;
|
|
@@ -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");
|
|
@@ -14,10 +15,10 @@ var SciChartSurfaceBase_1 = require("./SciChartSurfaceBase");
|
|
|
14
15
|
// Global variables
|
|
15
16
|
exports.sciChartSingleDestinations = [];
|
|
16
17
|
/** @ignore */
|
|
17
|
-
var createSingleInternal = function (
|
|
18
|
-
return new Promise(function (resolve) {
|
|
18
|
+
var createSingleInternal = function (divElement, options) {
|
|
19
|
+
return new Promise(function (resolve, reject) {
|
|
19
20
|
var _a;
|
|
20
|
-
var canvases = sciChartInitCommon_1.default.initCanvas(
|
|
21
|
+
var canvases = sciChartInitCommon_1.default.initCanvas(divElement, 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();
|
|
22
23
|
var loaderDiv = loader.addChartLoader(canvases.domDivContainer, options === null || options === void 0 ? void 0 : options.theme);
|
|
23
24
|
var webGLSupport = WebGlHelper_1.WebGlHelper.getWebGlSupport();
|
|
@@ -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 })
|
|
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 ||
|
|
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");
|
|
@@ -7,10 +7,10 @@ declare enum ECanvasType {
|
|
|
7
7
|
svg = 2
|
|
8
8
|
}
|
|
9
9
|
declare const sciChartInitCommon: {
|
|
10
|
-
checkChartDivExists: (
|
|
10
|
+
checkChartDivExists: (divElement: string | HTMLDivElement) => void;
|
|
11
11
|
ECanvasType: typeof ECanvasType;
|
|
12
12
|
getCanvas2dId: (divElementId: string) => string;
|
|
13
|
-
initCanvas: (
|
|
13
|
+
initCanvas: (divElement: string | HTMLDivElement, aspectWidth: number, aspectHeight: number, activeCanvas?: ECanvasType) => TSciChartSurfaceCanvases;
|
|
14
14
|
subscribeToResize: (chartRoot: HTMLDivElement, aspect: number, sciChartSurface: ISciChartSurfaceBase) => IDeletable;
|
|
15
15
|
};
|
|
16
16
|
export default sciChartInitCommon;
|
|
@@ -37,13 +37,13 @@ var getCanvasSizes = function (divWidth, divHeight, maxHeight, aspectWidth, aspe
|
|
|
37
37
|
return { width: width, height: height, aspectRatio: aspectRatio };
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
var getChartRootDomElement = function (
|
|
41
|
-
var chartRoot = document.querySelector("#".concat(
|
|
40
|
+
var getChartRootDomElement = function (divElement) {
|
|
41
|
+
var chartRoot = typeof divElement === "string" ? document.querySelector("#".concat(divElement)) : divElement;
|
|
42
42
|
if (!chartRoot) {
|
|
43
|
-
throw new Error("Check div element with id \"".concat(
|
|
43
|
+
throw new Error("Check div element with id \"".concat(chartRoot.id, "\" exists"));
|
|
44
44
|
}
|
|
45
45
|
if (chartRoot.nodeName.toLowerCase() !== "div") {
|
|
46
|
-
throw new Error("Element with id \"".concat(
|
|
46
|
+
throw new Error("Element with id \"".concat(chartRoot.id, "\" should be of type div"));
|
|
47
47
|
}
|
|
48
48
|
return chartRoot;
|
|
49
49
|
};
|
|
@@ -68,12 +68,13 @@ var getMaxHeight = function (divElement) {
|
|
|
68
68
|
* @param activeCanvas - ECanvasType.canvasWebGL for sciChartSurface.createSingle, ECanvasType.canvas2D for copy canvas,
|
|
69
69
|
* ECanvasType.svg for SciChartPieSurface
|
|
70
70
|
*/
|
|
71
|
-
var initCanvas = function (
|
|
71
|
+
var initCanvas = function (divElement, aspectWidth, aspectHeight, activeCanvas) {
|
|
72
72
|
if (activeCanvas === void 0) { activeCanvas = ECanvasType.canvasWebGL; }
|
|
73
73
|
WebGlHelper_1.WebGlHelper.initialize();
|
|
74
74
|
DpiHelper_1.DpiHelper.initialize();
|
|
75
|
-
var chartRoot = getChartRootDomElement(
|
|
75
|
+
var chartRoot = getChartRootDomElement(divElement);
|
|
76
76
|
chartRoot.innerHTML = "";
|
|
77
|
+
var divElementId = chartRoot.id;
|
|
77
78
|
var divWidth = chartRoot.offsetWidth, divHeight = chartRoot.offsetHeight;
|
|
78
79
|
var maxHeight = getMaxHeight(chartRoot);
|
|
79
80
|
var _a = getCanvasSizes(divWidth, divHeight, maxHeight, aspectWidth, aspectHeight), width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio;
|
|
@@ -215,13 +216,18 @@ var subscribeToResize = function (chartRoot, aspect, sciChartSurface) {
|
|
|
215
216
|
* Check DOM element with specified ID exists and unique
|
|
216
217
|
* @param divElementId
|
|
217
218
|
*/
|
|
218
|
-
var checkChartDivExists = function (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
var checkChartDivExists = function (divElement) {
|
|
220
|
+
if (typeof divElement === "string") {
|
|
221
|
+
var numberOfElements = document.querySelectorAll("[id=".concat(divElement, "]")).length;
|
|
222
|
+
if (numberOfElements > 1) {
|
|
223
|
+
console.error("Please provide a unique ID for each chart div element, \"".concat(divElement, "\" it is not a unique identifier"));
|
|
224
|
+
}
|
|
225
|
+
else if (numberOfElements === 0) {
|
|
226
|
+
console.error("Chart div element with the ID \"".concat(divElement, "\" is not present in the DOM"));
|
|
227
|
+
}
|
|
222
228
|
}
|
|
223
|
-
else if (
|
|
224
|
-
|
|
229
|
+
else if (!divElement) {
|
|
230
|
+
throw new Error("Provided div element doesn't exist!");
|
|
225
231
|
}
|
|
226
232
|
};
|
|
227
233
|
var sciChartInitCommon = {
|
|
@@ -57,10 +57,10 @@ export interface ISciChart3DSurfaceOptions {
|
|
|
57
57
|
export declare class SciChart3DSurface extends SciChartSurfaceBase {
|
|
58
58
|
/**
|
|
59
59
|
* USED INTERNALLY - performs a similar operation to {@link SciChart3DSurface.create} but used internally for testing
|
|
60
|
-
* @param
|
|
60
|
+
* @param divElement The Div Element ID or reference where the {@link SciChartSurface} will reside
|
|
61
61
|
* @param options Optional parameters of type {@link I2DSurfaceOptions}
|
|
62
62
|
*/
|
|
63
|
-
static createSingle(
|
|
63
|
+
static createSingle(divElement: string | HTMLDivElement, options?: I2DSurfaceOptions): Promise<TWebAssemblyChart3D>;
|
|
64
64
|
/**
|
|
65
65
|
* Allows setting of web URL for Wasm and Data files, in the case you are loading SciChart outside of npm/webpack environment.
|
|
66
66
|
* Note if loading from CDN the version number of data/wasm Urls must match the version number of SciChart.js you are using.
|
|
@@ -113,11 +113,11 @@ var SciChart3DSurface = /** @class */ (function (_super) {
|
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* USED INTERNALLY - performs a similar operation to {@link SciChart3DSurface.create} but used internally for testing
|
|
116
|
-
* @param
|
|
116
|
+
* @param divElement The Div Element ID or reference where the {@link SciChartSurface} will reside
|
|
117
117
|
* @param options Optional parameters of type {@link I2DSurfaceOptions}
|
|
118
118
|
*/
|
|
119
|
-
SciChart3DSurface.createSingle = function (
|
|
120
|
-
return (0, createSingle3d_1.createSingle3dInternal)(
|
|
119
|
+
SciChart3DSurface.createSingle = function (divElement, options) {
|
|
120
|
+
return (0, createSingle3d_1.createSingle3dInternal)(divElement, options);
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
123
|
* Allows setting of web URL for Wasm and Data files, in the case you are loading SciChart outside of npm/webpack environment.
|
|
@@ -2,6 +2,6 @@ import { I2DSurfaceOptions } from "../../Charting/Visuals/I2DSurfaceOptions";
|
|
|
2
2
|
import { TSciChartDestination } from "../../Charting/Visuals/SciChartSurfaceBase";
|
|
3
3
|
import { TWebAssemblyChart3D } from "./SciChart3DSurface";
|
|
4
4
|
/** @ignore */
|
|
5
|
-
export declare const createMultichart3d: (
|
|
5
|
+
export declare const createMultichart3d: (divElement: string | HTMLDivElement, options?: I2DSurfaceOptions) => Promise<TWebAssemblyChart3D>;
|
|
6
6
|
/** @ignore */
|
|
7
7
|
export declare const sciChartDestinations: TSciChartDestination[];
|
|
@@ -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 */
|
|
@@ -54,38 +55,52 @@ var sciChartMaster3D = {
|
|
|
54
55
|
/** @ignore */
|
|
55
56
|
var sciChartMaster3DPromise;
|
|
56
57
|
/** @ignore */
|
|
57
|
-
var createMultichart3d = function (
|
|
58
|
-
var canvases, loader, loaderDiv, master, createChildSurface,
|
|
58
|
+
var createMultichart3d = function (divElement, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
59
|
+
var canvases, loader, loaderDiv, master, createChildSurface, wasmContext_1, divElementId, sciChart3DSurface_1, err_1;
|
|
59
60
|
var _a, _b, _c, _d, _e;
|
|
60
61
|
return __generator(this, function (_f) {
|
|
61
62
|
switch (_f.label) {
|
|
62
63
|
case 0:
|
|
63
64
|
(0, chartBuilder_1.ensureRegistrations)();
|
|
64
|
-
sciChartInitCommon_1.default.checkChartDivExists(
|
|
65
|
-
canvases = sciChartInitCommon_1.default.initCanvas(
|
|
66
|
-
|
|
65
|
+
sciChartInitCommon_1.default.checkChartDivExists(divElement);
|
|
66
|
+
canvases = sciChartInitCommon_1.default.initCanvas(divElement, (_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
|
+
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
|
|
79
|
+
case 2:
|
|
74
80
|
master = _f.sent();
|
|
75
|
-
|
|
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 =
|
|
80
|
-
case
|
|
81
|
-
createChildSurface = sciChartMaster3D.createChildSurface,
|
|
82
|
-
|
|
85
|
+
_f.label = 3;
|
|
86
|
+
case 3:
|
|
87
|
+
createChildSurface = sciChartMaster3D.createChildSurface, wasmContext_1 = sciChartMaster3D.wasmContext;
|
|
88
|
+
divElementId = canvases.domChartRoot.id;
|
|
89
|
+
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
90
|
return [2 /*return*/, new Promise(function (resolve) {
|
|
84
91
|
setTimeout(function () {
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
|
|
93
|
+
sciChart3DSurface_1.setIsInitialized();
|
|
94
|
+
resolve({ wasmContext: wasmContext_1, sciChart3DSurface: sciChart3DSurface_1 });
|
|
87
95
|
}, 0);
|
|
88
96
|
})];
|
|
97
|
+
case 4:
|
|
98
|
+
err_1 = _f.sent();
|
|
99
|
+
console.error(err_1);
|
|
100
|
+
// replace with div with error message
|
|
101
|
+
loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
|
|
102
|
+
return [2 /*return*/, Promise.reject(err_1)];
|
|
103
|
+
case 5: return [2 /*return*/];
|
|
89
104
|
}
|
|
90
105
|
});
|
|
91
106
|
}); };
|
|
@@ -103,7 +118,7 @@ var createMaster = function () {
|
|
|
103
118
|
return sciChart3DSurface;
|
|
104
119
|
};
|
|
105
120
|
var addDestination = function (wasmContext, canvasElementId, sciChartSurface, width, height, chartInitObj3D) {
|
|
106
|
-
var newDestination = (0, SciChartSurfaceBase_1.createChartDestination)(
|
|
121
|
+
var newDestination = (0, SciChartSurfaceBase_1.createChartDestination)(sciChartSurface.domCanvas2D);
|
|
107
122
|
if (!newDestination) {
|
|
108
123
|
sciChartSurface.delete();
|
|
109
124
|
return;
|
|
@@ -112,10 +127,11 @@ var createMaster = function () {
|
|
|
112
127
|
chartInitObj3D.AddDestination(dest);
|
|
113
128
|
exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
|
|
114
129
|
};
|
|
115
|
-
return new Promise(function (resolve) {
|
|
130
|
+
return new Promise(function (resolve, reject) {
|
|
116
131
|
var locateFile3d = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
|
|
117
132
|
// @ts-ignore
|
|
118
|
-
new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
|
|
133
|
+
new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
|
|
134
|
+
.then(function (wasmContext) {
|
|
119
135
|
var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
|
|
120
136
|
// Create of replace child surface
|
|
121
137
|
var createChildSurface = function (divElementId, canvases, theme) {
|
|
@@ -167,12 +183,19 @@ var createMaster = function () {
|
|
|
167
183
|
wasmContext.SCRTSetGlobalSampleChartInterface3D(chartInitObj);
|
|
168
184
|
// create an object that native side can trigger the copy to from...
|
|
169
185
|
var canvasCopyObj = wasmContext.SCRTCopyToDestinationInterface.implement({
|
|
170
|
-
CopyToDestination: (0, SciChartSurfaceBase_1.copyToCanvas)(SciChartSurfaceBase_1.SciChartSurfaceBase.domMasterCanvas)
|
|
186
|
+
CopyToDestination: (0, SciChartSurfaceBase_1.copyToCanvas)(SciChartSurfaceBase_1.SciChartSurfaceBase.domMasterCanvas, getDestinationById)
|
|
171
187
|
});
|
|
172
188
|
wasmContext.SCRTSetGlobalCopyToDestinationInterface(canvasCopyObj);
|
|
173
189
|
wasmContext.TSRSetDrawRequestsEnabled(true);
|
|
174
190
|
// @ts-ignore
|
|
175
191
|
wasmContext.callMain();
|
|
192
|
+
})
|
|
193
|
+
.catch(function () {
|
|
194
|
+
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
195
|
});
|
|
177
196
|
});
|
|
178
197
|
};
|
|
198
|
+
/** @ignore */
|
|
199
|
+
var getDestinationById = function (destinationId) {
|
|
200
|
+
return exports.sciChartDestinations.find(function (dest) { return dest.canvasElementId === destinationId; });
|
|
201
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { I2DSurfaceOptions } from "../../Charting/Visuals/I2DSurfaceOptions";
|
|
2
2
|
import { TWebAssemblyChart3D } from "./SciChart3DSurface";
|
|
3
|
-
export declare const createSingle3dInternal: (
|
|
3
|
+
export declare const createSingle3dInternal: (divElement: string | HTMLDivElement, options?: I2DSurfaceOptions) => Promise<TWebAssemblyChart3D>;
|
|
@@ -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
|
-
var createSingle3dInternal = function (
|
|
15
|
+
var createSingle3dInternal = function (divElement, 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
|
-
var canvases = sciChartInitCommon_1.default.initCanvas(
|
|
19
|
+
var canvases = sciChartInitCommon_1.default.initCanvas(divElement, (_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 })
|
|
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,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkBuildStamp = exports.libraryVersion = void 0;
|
|
4
|
+
var buildStamp = "2022-01-24T00:00:00";
|
|
5
|
+
var result;
|
|
6
|
+
// tslint:disable-next-line:no-var-requires
|
|
7
|
+
exports.libraryVersion = "2.0.2228";
|
|
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;
|
package/Core/NumberRange.d.ts
CHANGED
package/Core/NumberRange.js
CHANGED
|
@@ -117,6 +117,14 @@ var NumberRange = /** @class */ (function () {
|
|
|
117
117
|
NumberRange.prototype.isZero = function () {
|
|
118
118
|
return this.min === this.max;
|
|
119
119
|
};
|
|
120
|
+
NumberRange.areEqual = function (range1, range2) {
|
|
121
|
+
if (range1 === range2)
|
|
122
|
+
return true;
|
|
123
|
+
if (range1) {
|
|
124
|
+
return range1.equals(range2);
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
};
|
|
120
128
|
return NumberRange;
|
|
121
129
|
}());
|
|
122
130
|
exports.NumberRange = NumberRange;
|