scichart 2.2.2351 → 2.2.2393
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/Builder/buildAxis.d.ts +7 -0
- package/Builder/buildAxis.js +6 -0
- package/Builder/buildDataSeries.d.ts +19 -1
- package/Builder/buildDataSeries.js +22 -1
- package/Builder/buildSeries.d.ts +7 -2
- package/Builder/buildSeries.js +5 -1
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
- package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
- package/Charting/Model/BaseHeatmapDataSeries.js +1 -1
- package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
- package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
- package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
- package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
- package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
- package/Charting/Model/Filters/HlcFilterBase.js +141 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
- package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
- package/Charting/Model/Filters/XyFilterBase.js +6 -0
- package/Charting/Model/Filters/XyyFilterBase.js +9 -0
- package/Charting/Model/Filters/XyzFilterBase.js +12 -3
- package/Charting/Model/HlcDataSeries.d.ts +189 -0
- package/Charting/Model/HlcDataSeries.js +557 -0
- package/Charting/Model/IDataSeries.d.ts +5 -1
- package/Charting/Model/IDataSeries.js +4 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
- package/Charting/Services/SciChartRenderer.d.ts +1 -0
- package/Charting/Services/SciChartRenderer.js +6 -0
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +8 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +1 -1
- package/Charting/Visuals/Axis/AxisBase2D.js +9 -22
- package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
- package/Charting/Visuals/Axis/AxisCore.js +6 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
- package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
- package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +7 -2
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +9 -4
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +18 -2
- package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
- package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
- package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
- package/Charting/Visuals/Helpers/NativeObject.js +101 -0
- package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
- package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
- package/Charting/Visuals/Helpers/drawBorder.js +2 -2
- package/Charting/Visuals/Legend/SciChartLegend.js +1 -1
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
- package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
- package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +9 -2
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +74 -22
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
- package/Charting/Visuals/RenderableSeries/constants.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/constants.js +5 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +5 -0
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +116 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +139 -4
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +4 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +3 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +13 -3
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +114 -74
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +1 -0
- package/Charting/Visuals/createMaster.js +15 -11
- package/Charting/Visuals/createSingle.js +3 -1
- package/Charting/Visuals/licenseManager2D.d.ts +6 -0
- package/Charting/Visuals/licenseManager2D.js +98 -9
- package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
- package/Charting/Visuals/licenseManager2dState.js +37 -1
- package/Charting/Visuals/loader.js +4 -1
- package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
- package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
- package/Charting3D/Visuals/createMaster3d.js +22 -16
- package/Charting3D/Visuals/createSingle3d.js +5 -6
- package/Charting3D/Visuals/licenseManager3D.js +3 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Telemetry.d.ts +7 -0
- package/Core/Telemetry.js +109 -0
- package/Core/storage/localStorageApi.d.ts +4 -0
- package/Core/storage/localStorageApi.js +12 -0
- package/README.md +49 -13
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +10 -10
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +97 -97
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/AxisType.d.ts +5 -1
- package/types/AxisType.js +4 -0
- package/types/DataFilterType.d.ts +1 -0
- package/types/DataFilterType.js +1 -0
- package/types/DataPointWidthMode.d.ts +13 -0
- package/types/DataPointWidthMode.js +17 -0
- package/types/ErrorDirection.d.ts +13 -0
- package/types/ErrorDirection.js +17 -0
- package/types/ErrorMode.d.ts +17 -0
- package/types/ErrorMode.js +21 -0
- package/types/NumericFormat.d.ts +4 -0
- package/types/NumericFormat.js +4 -0
- package/types/SeriesType.d.ts +3 -1
- package/types/SeriesType.js +2 -0
- package/types/TSciChart.d.ts +8 -2
- package/types/TSciChart3D.d.ts +5 -2
- package/utils/date.d.ts +1 -0
- package/utils/date.js +15 -1
- package/utils/guid.d.ts +6 -0
- package/utils/guid.js +17 -1
- package/utils/number.js +15 -2
|
@@ -36,11 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.licenseManager = exports.updateLicenseDisplay = exports.getLicenseInfo = exports.applyLicense = exports.getLicenseCookie = exports.setCallbacks3D = exports.setUseLicenseWizard = exports.setRuntimeLicenseKey = exports.setLicenseCallback = exports.setDependencies = void 0;
|
|
39
|
+
exports.licenseManager = exports.updateLicenseDisplay = exports.getLicenseInfo = exports.applyLicense = exports.getLicenseCookie = exports.setCallbacks3D = exports.setUseLicenseWizard = exports.setRuntimeLicenseKey = exports.setLicenseCallback = exports.setIsDebugLicensing = exports.setDependencies = void 0;
|
|
40
40
|
var app_1 = require("../../constants/app");
|
|
41
41
|
var BuildStamp_1 = require("../../Core/BuildStamp");
|
|
42
42
|
var Dictionary_1 = require("../../Core/Dictionary");
|
|
43
43
|
var localStorageApi_1 = require("../../Core/storage/localStorageApi");
|
|
44
|
+
var Telemetry_1 = require("../../Core/Telemetry");
|
|
44
45
|
var Color_1 = require("../../types/Color");
|
|
45
46
|
var licensingClasses_1 = require("../../types/licensingClasses");
|
|
46
47
|
var cookie_1 = require("../../utils/cookie");
|
|
@@ -103,6 +104,14 @@ var licenseDependencies = {
|
|
|
103
104
|
var setDependencies = function (dependencies) { return (licenseDependencies = dependencies); };
|
|
104
105
|
exports.setDependencies = setDependencies;
|
|
105
106
|
var isDebug = null;
|
|
107
|
+
var setIsDebugLicensing = function (value, persist) {
|
|
108
|
+
if (persist === void 0) { persist = false; }
|
|
109
|
+
isDebug = value;
|
|
110
|
+
if (persist || !value) {
|
|
111
|
+
localStorageApi_1.localStorageApi.setIsLicenseDebug(value);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.setIsDebugLicensing = setIsDebugLicensing;
|
|
106
115
|
var debug = function (message) {
|
|
107
116
|
if (isDebug === null) {
|
|
108
117
|
isDebug = localStorageApi_1.localStorageApi.getIsLicenseDebug();
|
|
@@ -172,6 +181,7 @@ var getlicenseFromWizard = function () { return __awaiter(void 0, void 0, void 0
|
|
|
172
181
|
keyCode = _b.sent();
|
|
173
182
|
_a = setNewLicense(keyCode), requiresValidation = _a.requiresValidation, trialExpired = _a.trialExpired;
|
|
174
183
|
if (requiresValidation) {
|
|
184
|
+
debug("Got a developer license from local license wizard. Validating...");
|
|
175
185
|
checkStatus = licensingClasses_1.LicenseCheckStatus.ValidatingDeveloperLicense;
|
|
176
186
|
dolicenseChallenge();
|
|
177
187
|
}
|
|
@@ -181,6 +191,7 @@ var getlicenseFromWizard = function () { return __awaiter(void 0, void 0, void 0
|
|
|
181
191
|
wizardTimer = setTimeout(function () { return getlicenseFromWizard(); }, retryTime * 1000);
|
|
182
192
|
}
|
|
183
193
|
else {
|
|
194
|
+
debug("Got a valid license from local license wizard.");
|
|
184
195
|
checkStatus = licensingClasses_1.LicenseCheckStatus.LicenseOK;
|
|
185
196
|
}
|
|
186
197
|
return [3 /*break*/, 4];
|
|
@@ -302,6 +313,7 @@ var dolicenseChallenge = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
302
313
|
key = (0, exports.getLicenseCookie)().key;
|
|
303
314
|
timeNow = Math.floor(new Date().getTime() / 1000);
|
|
304
315
|
setLicenseCookie(key, token, expirySeconds, timeNow);
|
|
316
|
+
debug("License validated");
|
|
305
317
|
checkStatus = licensingClasses_1.LicenseCheckStatus.LicenseOK;
|
|
306
318
|
timeToExpiry = expirySeconds - timeNow;
|
|
307
319
|
challengeFailCounts = 0;
|
|
@@ -309,24 +321,47 @@ var dolicenseChallenge = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
309
321
|
}
|
|
310
322
|
else {
|
|
311
323
|
// Something went wrong with the apply
|
|
312
|
-
|
|
324
|
+
debug("license challenge response was invalid: " + token);
|
|
313
325
|
checkStatus = licensingClasses_1.LicenseCheckStatus.FailedToValidateDeveloperLicense;
|
|
314
326
|
}
|
|
315
327
|
}
|
|
316
328
|
else {
|
|
317
329
|
// Challenge rejected by server
|
|
318
|
-
|
|
330
|
+
debug("Server rejected the license challenge: " + token);
|
|
319
331
|
checkStatus = licensingClasses_1.LicenseCheckStatus.FailedToValidateDeveloperLicense;
|
|
320
332
|
}
|
|
321
333
|
return [3 /*break*/, 10];
|
|
322
334
|
case 9:
|
|
323
335
|
// Server error or network failure
|
|
324
|
-
|
|
325
|
-
|
|
336
|
+
if (licenseManager2dState_1.licenseManager2dState.getIsDev()) {
|
|
337
|
+
console.warn("Error during license validation: " + response.statusText);
|
|
338
|
+
checkStatus = licensingClasses_1.LicenseCheckStatus.FailedToValidateDeveloperLicense;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
// switch to license wizard
|
|
342
|
+
throw new Error(response.statusText);
|
|
343
|
+
}
|
|
326
344
|
_b.label = 10;
|
|
327
345
|
case 10: return [3 /*break*/, 12];
|
|
328
346
|
case 11:
|
|
329
347
|
err_4 = _b.sent();
|
|
348
|
+
// switch to license wizard
|
|
349
|
+
if (!licenseManager2dState_1.licenseManager2dState.getIsDev()) {
|
|
350
|
+
console.warn("Server license validation failed. Looking for local developer license");
|
|
351
|
+
runtimeLicenseKey = "";
|
|
352
|
+
checkStatus = licensingClasses_1.LicenseCheckStatus.NoLicense;
|
|
353
|
+
licenseContext2D.SCRTCredentials.ResetRuntimeLicense();
|
|
354
|
+
isRuntimeKey = false;
|
|
355
|
+
(0, exports.applyLicense)(licenseContext2D);
|
|
356
|
+
// licenseManager2dState.setIsDev(true);
|
|
357
|
+
// checkStatus = LicenseCheckStatus.LookingForLicenseWizard;
|
|
358
|
+
// getlicenseFromWizard();
|
|
359
|
+
// if (licenseContext2D !== undefined) {
|
|
360
|
+
// updateLicenseDisplay(getLicenseInfo(licenseContext2D), sciChartSurface2D, true, false);
|
|
361
|
+
// }
|
|
362
|
+
// callbacks3D.updateLicenseDisplay3D();
|
|
363
|
+
return [2 /*return*/];
|
|
364
|
+
}
|
|
330
365
|
// Failed to connect. Retry
|
|
331
366
|
challengeFailCounts += 1;
|
|
332
367
|
if (challengeFailCounts < maxretries) {
|
|
@@ -361,19 +396,28 @@ var sciChartSurface2D;
|
|
|
361
396
|
var isRuntimeKey = false;
|
|
362
397
|
var applyLicense2D = function (licenseContext, sciChartSurface, isSingle) {
|
|
363
398
|
debug("applyLicense 2D");
|
|
399
|
+
sciChartSurface2D = sciChartSurface;
|
|
364
400
|
if (isSingle || shouldApplyLicense2D) {
|
|
365
401
|
licenseContext2D = licenseContext;
|
|
366
|
-
sciChartSurface2D = sciChartSurface;
|
|
367
402
|
(0, exports.applyLicense)(licenseContext);
|
|
368
403
|
}
|
|
404
|
+
else {
|
|
405
|
+
if (checkStatus !== licensingClasses_1.LicenseCheckStatus.LicenseOK) {
|
|
406
|
+
(0, exports.updateLicenseDisplay)((0, exports.getLicenseInfo)(licenseContext2D), sciChartSurface2D, true, false);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
369
409
|
if (!isSingle)
|
|
370
410
|
shouldApplyLicense2D = false;
|
|
371
411
|
};
|
|
372
412
|
var applyLicense = function (licenseContext) {
|
|
413
|
+
var _a;
|
|
373
414
|
debug("applyLicense running");
|
|
374
415
|
var licenseKey = "";
|
|
375
416
|
var lt = licenseContext.SCRTCredentials.GetLicenseType();
|
|
376
417
|
debug("Initial license status is " + licensingClasses_1.LicenseType[convertLicenseType(lt, licenseContext)]);
|
|
418
|
+
if (window.location.hostname.includes(".csb.app") || window.location.hostname.includes(".codesandbox.io")) {
|
|
419
|
+
runtimeLicenseKey = "csb";
|
|
420
|
+
}
|
|
377
421
|
// Get from global store
|
|
378
422
|
var runtimelicense = getRuntimeLicenseKey();
|
|
379
423
|
if ((checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense ||
|
|
@@ -400,6 +444,19 @@ var applyLicense = function (licenseContext) {
|
|
|
400
444
|
licenseKey = runtimelicense;
|
|
401
445
|
}
|
|
402
446
|
else {
|
|
447
|
+
var errorMsg = licenseContext.SCRTCredentials.GetLicenseErrors();
|
|
448
|
+
if ((window && ((_a = window.location) === null || _a === void 0 ? void 0 : _a.hostname) && !window.location.hostname.includes("localhost")) ||
|
|
449
|
+
!errorMsg.startsWith("License is not valid for this domain")) {
|
|
450
|
+
if (isDebug) {
|
|
451
|
+
debug("Runtime license is invalid: " + errorMsg);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
console.warn("Runtime license is invalid. Call setIsDebugLicensing(true) for details.");
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
debug("Runtime license is invalid: " + errorMsg);
|
|
459
|
+
}
|
|
403
460
|
licenseKey = "";
|
|
404
461
|
}
|
|
405
462
|
}
|
|
@@ -415,7 +472,7 @@ var applyLicense = function (licenseContext) {
|
|
|
415
472
|
if (!(lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_FULL ||
|
|
416
473
|
lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_TRIAL ||
|
|
417
474
|
lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_REQUIRES_VALIDATION)) {
|
|
418
|
-
debug("License cookie is invalid.
|
|
475
|
+
debug("License cookie is invalid. " + licenseContext.SCRTCredentials.GetLicenseErrors());
|
|
419
476
|
(0, cookie_1.deleteCookie)("scLicense");
|
|
420
477
|
licenseKey = "";
|
|
421
478
|
lt = licenseContext.SCRTLicenseType.LICENSE_TYPE_NO_LICENSE;
|
|
@@ -444,7 +501,7 @@ var applyLicense = function (licenseContext) {
|
|
|
444
501
|
(0, cookie_1.deleteCookie)("scLicense");
|
|
445
502
|
checkStatus = licensingClasses_1.LicenseCheckStatus.DevKeyInRuntimeKey;
|
|
446
503
|
}
|
|
447
|
-
else if (licenseCookie.expiry > new Date()) {
|
|
504
|
+
else if (licenseCookie.expiry > new Date() && licenseCookie.key === licenseKey) {
|
|
448
505
|
debug("current token in cookie");
|
|
449
506
|
var expirySeconds = setChallengeResponse(licenseCookie.token);
|
|
450
507
|
lt = licenseContext.SCRTCredentials.GetLicenseType();
|
|
@@ -495,7 +552,9 @@ var openLicenseModal = function () {
|
|
|
495
552
|
var setNewLicense = function (keyCode) {
|
|
496
553
|
var requiresValidation = false;
|
|
497
554
|
var trialExpired;
|
|
498
|
-
licenseModal
|
|
555
|
+
if (licenseModal) {
|
|
556
|
+
licenseModal.style.display = "none";
|
|
557
|
+
}
|
|
499
558
|
isRuntimeKey = false;
|
|
500
559
|
setLicenseCookie(keyCode, null, null, null);
|
|
501
560
|
if (licenseContext2D !== undefined) {
|
|
@@ -585,7 +644,21 @@ var createLicenseModal = function (message, postFormMessage) {
|
|
|
585
644
|
var modalInfo = document.createElement("div");
|
|
586
645
|
modalInfo.style.padding = "10px 26px 10px 16px";
|
|
587
646
|
modalInfo.innerHTML = "<ol><li>If you have not done so already, download the SciChart Cross Platform Licensing Wizard for\n <a href=\"https://github.com/ABTSoftware/SciChart.LicenseWizard/releases/latest/download/SciChart-Licensing-Wizard.exe\" download> Windows</a> or\n <a href=\"https://github.com/ABTSoftware/SciChart.LicenseWizard/releases/latest/download/SciChart-Licensing-Wizard.dmg\" download> macOS</a></li>\n <li>Install it and sign in with your SciChart username and password</li>\n <li>Start a trial for SciChart Web</li>\n <li>This web page should pick up your license from the wizard in a few seconds, or refresh the page</li>";
|
|
647
|
+
var buttonLabel = document.createElement("div");
|
|
648
|
+
modalInfo.innerHTML = "To toggle License debug mode use button below and refresh the page.";
|
|
649
|
+
var toggleDebugModeButton = document.createElement("button");
|
|
650
|
+
toggleDebugModeButton.style.margin = "10px";
|
|
651
|
+
var setDebugModeSwitchLabel = function () {
|
|
652
|
+
toggleDebugModeButton.textContent = isDebug ? "Disable licensing debug mode" : "Enable licensing debug mode";
|
|
653
|
+
};
|
|
654
|
+
setDebugModeSwitchLabel();
|
|
655
|
+
toggleDebugModeButton.onclick = function () {
|
|
656
|
+
(0, exports.setIsDebugLicensing)(!isDebug, true);
|
|
657
|
+
setDebugModeSwitchLabel();
|
|
658
|
+
};
|
|
588
659
|
modalContentForm.appendChild(modalInfo);
|
|
660
|
+
modalContentForm.appendChild(buttonLabel);
|
|
661
|
+
modalContentForm.appendChild(toggleDebugModeButton);
|
|
589
662
|
var modalFooter = document.createElement("div");
|
|
590
663
|
modalFooter.innerHTML = postFormMessage;
|
|
591
664
|
modalFooter.style.padding = "8px 16px";
|
|
@@ -672,6 +745,16 @@ var getLicenseInfo = function (licenseContext) {
|
|
|
672
745
|
var sclt = licenseContext.SCRTCredentials.GetLicenseType();
|
|
673
746
|
var licenseType = convertLicenseType(sclt, licenseContext);
|
|
674
747
|
var daysRemaining = licenseContext.SCRTCredentials.GetLicenseDaysRemaining();
|
|
748
|
+
if (checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK && licenseManager2dState_1.licenseManager2dState.getLicenseType() !== licenseType) {
|
|
749
|
+
licenseManager2dState_1.licenseManager2dState.setOrderId(licenseContext.SCRTCredentials.GetEncryptedOrderId());
|
|
750
|
+
licenseManager2dState_1.licenseManager2dState.setProductCode(licenseContext.SCRTCredentials.GetProductCode());
|
|
751
|
+
licenseManager2dState_1.licenseManager2dState.setLicenseType(licenseType);
|
|
752
|
+
licenseManager2dState_1.licenseManager2dState.setDevCount(licenseContext.SCRTCredentials.GetDeveloperCount());
|
|
753
|
+
// Telemetry is enabled based on a license feature
|
|
754
|
+
var teFeature = licenseContext.SCRTCredentials.HasFeature("TE");
|
|
755
|
+
licenseManager2dState_1.licenseManager2dState.setTelemetry(teFeature === licenseContext.SCRTLicenseType.LICENSE_TYPE_FULL ||
|
|
756
|
+
teFeature === licenseContext.SCRTLicenseType.LICENSE_TYPE_TRIAL);
|
|
757
|
+
}
|
|
675
758
|
if (isDebug) {
|
|
676
759
|
debug(licenseContext.SCRTCredentials.Dump());
|
|
677
760
|
}
|
|
@@ -718,6 +801,8 @@ var updateLicenseDisplayInternal = function (licenseInfo, sciChartSurface, is2D,
|
|
|
718
801
|
else if (licenseType === licensingClasses_1.LicenseType.Invalid) {
|
|
719
802
|
if (error.startsWith("License is not valid for this domain"))
|
|
720
803
|
premsg = "Sorry! Your license key is invalid for this domain</br>Please ".concat(contactSupportLink, " with your OrderID if you believe this to be incorrect.");
|
|
804
|
+
else if (error.startsWith("This version of SciChart can no longer be trialed"))
|
|
805
|
+
premsg = "Sorry! This version of SciChart is too old to be trialed. Please update to the latest version";
|
|
721
806
|
else
|
|
722
807
|
premsg = "Sorry! Your license key appears to be invalid</br>Please ".concat(contactSupportLink, " with your OrderID if you believe this to be incorrect.");
|
|
723
808
|
postMsg = "Instructions can be seen at ".concat(licensingLink);
|
|
@@ -821,6 +906,9 @@ var updateLicenseDisplayInternal = function (licenseInfo, sciChartSurface, is2D,
|
|
|
821
906
|
}
|
|
822
907
|
}
|
|
823
908
|
}
|
|
909
|
+
else {
|
|
910
|
+
(0, Telemetry_1.sendTelemetry)();
|
|
911
|
+
}
|
|
824
912
|
}
|
|
825
913
|
updateLicenseMessageDOM(sciChartSurface.domDivContainer, licenseMessageDiv);
|
|
826
914
|
if (applyToOther) {
|
|
@@ -833,6 +921,7 @@ var updateLicenseDisplay = function (licenseInfo, sciChartSurface, is2D, applyTo
|
|
|
833
921
|
exports.updateLicenseDisplay = updateLicenseDisplay;
|
|
834
922
|
exports.licenseManager = {
|
|
835
923
|
setRuntimeLicenseKey: function (value) { return (0, exports.setRuntimeLicenseKey)(value); },
|
|
924
|
+
setIsDebugLicensing: function (value) { return (0, exports.setIsDebugLicensing)(value); },
|
|
836
925
|
setLicenseCallback: function (callback) { return (0, exports.setLicenseCallback)(callback); },
|
|
837
926
|
setServerLicenseEndpoint: function (value) { return setServerLicenseEndpoint(value); },
|
|
838
927
|
applyLicense2D: function (licenseContext, sciChartSurface, isSingle) {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { LicenseType } from "../../types/licensingClasses";
|
|
1
2
|
export declare const licenseManager2dState: {
|
|
2
3
|
getIsDev: () => boolean;
|
|
3
4
|
setIsDev: (value: boolean) => void;
|
|
5
|
+
getOrderId: () => string;
|
|
6
|
+
setOrderId: (value: string) => void;
|
|
7
|
+
getProductCode: () => string;
|
|
8
|
+
setProductCode: (value: string) => void;
|
|
9
|
+
getLicenseType: () => LicenseType;
|
|
10
|
+
setLicenseType: (value: LicenseType) => void;
|
|
11
|
+
getDevCount: () => number;
|
|
12
|
+
setDevCount: (value: number) => void;
|
|
13
|
+
getTelemetry: () => boolean;
|
|
14
|
+
setTelemetry: (value: boolean) => void;
|
|
4
15
|
};
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.licenseManager2dState = void 0;
|
|
4
|
+
var licensingClasses_1 = require("../../types/licensingClasses");
|
|
4
5
|
var isDev = false;
|
|
5
6
|
var getIsDev = function () { return isDev; };
|
|
6
7
|
var setIsDev = function (value) {
|
|
7
8
|
isDev = value;
|
|
8
9
|
};
|
|
10
|
+
var orderId = "";
|
|
11
|
+
var getOrderId = function () { return orderId; };
|
|
12
|
+
var setOrderId = function (value) {
|
|
13
|
+
orderId = value;
|
|
14
|
+
};
|
|
15
|
+
var productCode = "";
|
|
16
|
+
var getProductCode = function () { return productCode; };
|
|
17
|
+
var setProductCode = function (value) {
|
|
18
|
+
productCode = value;
|
|
19
|
+
};
|
|
20
|
+
var devCount = 1;
|
|
21
|
+
var getDevCount = function () { return devCount; };
|
|
22
|
+
var setDevCount = function (value) {
|
|
23
|
+
devCount = value;
|
|
24
|
+
};
|
|
25
|
+
var licenseType = licensingClasses_1.LicenseType.NoLicense;
|
|
26
|
+
var getLicenseType = function () { return licenseType; };
|
|
27
|
+
var setLicenseType = function (value) {
|
|
28
|
+
licenseType = value;
|
|
29
|
+
};
|
|
30
|
+
var telemetryEnabled = false;
|
|
31
|
+
var getTelemetry = function () { return telemetryEnabled; };
|
|
32
|
+
var setTelemetry = function (value) {
|
|
33
|
+
telemetryEnabled = value;
|
|
34
|
+
};
|
|
9
35
|
exports.licenseManager2dState = {
|
|
10
36
|
getIsDev: getIsDev,
|
|
11
|
-
setIsDev: setIsDev
|
|
37
|
+
setIsDev: setIsDev,
|
|
38
|
+
getOrderId: getOrderId,
|
|
39
|
+
setOrderId: setOrderId,
|
|
40
|
+
getProductCode: getProductCode,
|
|
41
|
+
setProductCode: setProductCode,
|
|
42
|
+
getLicenseType: getLicenseType,
|
|
43
|
+
setLicenseType: setLicenseType,
|
|
44
|
+
getDevCount: getDevCount,
|
|
45
|
+
setDevCount: setDevCount,
|
|
46
|
+
getTelemetry: getTelemetry,
|
|
47
|
+
setTelemetry: setTelemetry
|
|
12
48
|
};
|
|
@@ -40,7 +40,10 @@ var DefaultSciChartLoader = /** @class */ (function () {
|
|
|
40
40
|
* @inheritDoc
|
|
41
41
|
*/
|
|
42
42
|
DefaultSciChartLoader.prototype.removeChartLoader = function (domChartRoot, loaderElement) {
|
|
43
|
-
|
|
43
|
+
try {
|
|
44
|
+
domChartRoot.removeChild(loaderElement);
|
|
45
|
+
}
|
|
46
|
+
catch (_a) { }
|
|
44
47
|
};
|
|
45
48
|
DefaultSciChartLoader.prototype.toJSON = function () {
|
|
46
49
|
return { type: this.type };
|
|
@@ -64,7 +64,7 @@ var SciChart3DRenderer = /** @class */ (function () {
|
|
|
64
64
|
* The main render loop
|
|
65
65
|
*/
|
|
66
66
|
SciChart3DRenderer.prototype.render = function () {
|
|
67
|
-
if (this.scs.isDeleted) {
|
|
67
|
+
if (this.scs.isDeleted || !this.scs.isInitialized) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
// Step 1: Sanity checks
|
|
@@ -66,14 +66,19 @@ export declare class SciChart3DSurface extends SciChartSurfaceBase {
|
|
|
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.
|
|
67
67
|
* @example
|
|
68
68
|
* ```ts
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
69
|
+
* // 3D Charts
|
|
70
|
+
* SciChart.SciChart3DSurface.configure({
|
|
71
|
+
* dataUrl: "https://cdn.jsdelivr.net/npm/scichart@2.2.2378/_wasm/scichart3d.data",
|
|
72
|
+
* wasmUrl: "https://cdn.jsdelivr.net/npm/scichart@2.2.2378/_wasm/scichart3d.wasm"
|
|
72
73
|
* });
|
|
73
74
|
* ```
|
|
74
75
|
* @param config
|
|
75
76
|
*/
|
|
76
77
|
static configure(config: TSciChartConfig): void;
|
|
78
|
+
/**
|
|
79
|
+
* Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.
|
|
80
|
+
*/
|
|
81
|
+
static useWasmFromCDN(): void;
|
|
77
82
|
/**
|
|
78
83
|
* Creates a {@link SciChart3DSurface} and {@link TSciChart3D | WebAssembly Context} to occupy the div by element ID in your DOM.
|
|
79
84
|
* @remarks This method is async and must be awaited
|
|
@@ -31,6 +31,7 @@ var DefaultViewportManager3D_1 = require("./DefaultViewportManager3D");
|
|
|
31
31
|
var GizmoEntity_1 = require("./GizmoEntity");
|
|
32
32
|
var RootSceneEntity_1 = require("./RootSceneEntity");
|
|
33
33
|
var SciChart3DRenderer_1 = require("./SciChart3DRenderer");
|
|
34
|
+
var BuildStamp_1 = require("../../Core/BuildStamp");
|
|
34
35
|
exports.sciChartConfig3D = {};
|
|
35
36
|
/**
|
|
36
37
|
* @summary The {@link SciChart3DSurface} is the root 3D Chart control in SciChart's High Performance Real-time
|
|
@@ -124,9 +125,10 @@ var SciChart3DSurface = /** @class */ (function (_super) {
|
|
|
124
125
|
* Note if loading from CDN the version number of data/wasm Urls must match the version number of SciChart.js you are using.
|
|
125
126
|
* @example
|
|
126
127
|
* ```ts
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
128
|
+
* // 3D Charts
|
|
129
|
+
* SciChart.SciChart3DSurface.configure({
|
|
130
|
+
* dataUrl: "https://cdn.jsdelivr.net/npm/scichart@2.2.2378/_wasm/scichart3d.data",
|
|
131
|
+
* wasmUrl: "https://cdn.jsdelivr.net/npm/scichart@2.2.2378/_wasm/scichart3d.wasm"
|
|
130
132
|
* });
|
|
131
133
|
* ```
|
|
132
134
|
* @param config
|
|
@@ -136,6 +138,13 @@ var SciChart3DSurface = /** @class */ (function (_super) {
|
|
|
136
138
|
exports.sciChartConfig3D.dataUrl = (_a = config === null || config === void 0 ? void 0 : config.dataUrl) !== null && _a !== void 0 ? _a : undefined;
|
|
137
139
|
exports.sciChartConfig3D.wasmUrl = (_b = config === null || config === void 0 ? void 0 : config.wasmUrl) !== null && _b !== void 0 ? _b : undefined;
|
|
138
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.
|
|
143
|
+
*/
|
|
144
|
+
SciChart3DSurface.useWasmFromCDN = function () {
|
|
145
|
+
exports.sciChartConfig3D.dataUrl = "https://cdn.jsdelivr.net/npm/scichart@".concat(BuildStamp_1.libraryVersion, "/_wasm/scichart3d.data");
|
|
146
|
+
exports.sciChartConfig3D.wasmUrl = "https://cdn.jsdelivr.net/npm/scichart@".concat(BuildStamp_1.libraryVersion, "/_wasm/scichart3d.wasm");
|
|
147
|
+
};
|
|
139
148
|
/**
|
|
140
149
|
* Creates a {@link SciChart3DSurface} and {@link TSciChart3D | WebAssembly Context} to occupy the div by element ID in your DOM.
|
|
141
150
|
* @remarks This method is async and must be awaited
|
|
@@ -128,9 +128,9 @@ var createMaster = function () {
|
|
|
128
128
|
exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
|
|
129
129
|
};
|
|
130
130
|
return new Promise(function (resolve, reject) {
|
|
131
|
-
var
|
|
131
|
+
var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
|
|
132
132
|
// @ts-ignore
|
|
133
|
-
new WasmModule3D({
|
|
133
|
+
new WasmModule3D({ locateFile: locateFile, noInitialRun: true })
|
|
134
134
|
.then(function (wasmContext) {
|
|
135
135
|
var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
|
|
136
136
|
// Create of replace child surface
|
|
@@ -156,20 +156,26 @@ var createMaster = function () {
|
|
|
156
156
|
InitializeChart: function () {
|
|
157
157
|
resolve({ getChildSurfaces: getChildSurfaces, createChildSurface: createChildSurface, wasmContext: wasmContext });
|
|
158
158
|
},
|
|
159
|
-
Draw: function () {
|
|
160
|
-
exports.sciChartDestinations.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
159
|
+
Draw: function (canvasId) {
|
|
160
|
+
var dest = exports.sciChartDestinations.find(function (d) { return d.canvasElementId === canvasId; });
|
|
161
|
+
if (dest) {
|
|
162
|
+
dest.sciChartSurface.doDrawingLoop();
|
|
163
|
+
}
|
|
164
|
+
// sciChartDestinations.forEach(dest => {
|
|
165
|
+
// const { canvasElementId, sciChartSurface } = dest;
|
|
166
|
+
// const chart = wasmContext.SCRTGetGlobalSampleChartInterface3D();
|
|
167
|
+
// // TODO
|
|
168
|
+
// if (chart.GetCurrentDestination()) {
|
|
169
|
+
// const currDestID = chart.GetCurrentDestination().GetID();
|
|
170
|
+
// if (
|
|
171
|
+
// currDestID === canvasElementId &&
|
|
172
|
+
// sciChartSurface.isInitialized &&
|
|
173
|
+
// !sciChartSurface.isDeleted
|
|
174
|
+
// ) {
|
|
175
|
+
// (sciChartSurface as SciChart3DSurface).doDrawingLoop();
|
|
176
|
+
// }
|
|
177
|
+
// }
|
|
178
|
+
// });
|
|
173
179
|
},
|
|
174
180
|
Update: function (deltaTime) {
|
|
175
181
|
// console.log("Update");
|
|
@@ -9,7 +9,6 @@ var sciChartInitCommon_1 = require("../../Charting/Visuals/sciChartInitCommon");
|
|
|
9
9
|
var SciChartSurfaceBase_1 = require("../../Charting/Visuals/SciChartSurfaceBase");
|
|
10
10
|
var BuildStamp_1 = require("../../Core/BuildStamp");
|
|
11
11
|
var WebGlHelper_1 = require("../../Core/WebGlHelper");
|
|
12
|
-
var logger_1 = require("../../utils/logger");
|
|
13
12
|
var licenseManager3D_1 = require("./licenseManager3D");
|
|
14
13
|
var SciChart3DSurface_1 = require("./SciChart3DSurface");
|
|
15
14
|
var createSingle3dInternal = function (divElement, options) {
|
|
@@ -22,9 +21,9 @@ var createSingle3dInternal = function (divElement, options) {
|
|
|
22
21
|
var webGLSupport = WebGlHelper_1.WebGlHelper.getWebGlSupport();
|
|
23
22
|
// console.log("webGLSupport", webGLSupport);
|
|
24
23
|
if (webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL2 || webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL1) {
|
|
25
|
-
var
|
|
24
|
+
var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
|
|
26
25
|
// @ts-ignore
|
|
27
|
-
new WasmModule3D({
|
|
26
|
+
new WasmModule3D({ locateFile: locateFile, noInitialRun: true })
|
|
28
27
|
.then(function (wasmContext) {
|
|
29
28
|
var _a;
|
|
30
29
|
loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
|
|
@@ -67,16 +66,16 @@ var initDrawEngineSingleChart = function (wasmContext, canvases, resolve, theme)
|
|
|
67
66
|
}, 0);
|
|
68
67
|
resolve({ wasmContext: wasmContext, sciChart3DSurface: scs });
|
|
69
68
|
},
|
|
70
|
-
Draw: function () {
|
|
69
|
+
Draw: function (canvasId) {
|
|
71
70
|
if (scs.isInitialized) {
|
|
72
71
|
scs.doDrawingLoop();
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
74
|
Update: function (deltaTime) {
|
|
76
|
-
|
|
75
|
+
//Logger.log("SciChart3DSurface.ts Update()");
|
|
77
76
|
},
|
|
78
77
|
ShutDownChart: function () {
|
|
79
|
-
|
|
78
|
+
//Logger.log("SciChart3DSurface.ts ShutDownChart");
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
81
|
var chartInitObj = wasmContext.SCRTSampleChartInterface3D.implement(chartInitializer);
|
|
@@ -34,7 +34,9 @@ var applyLicense3D = function (licenseContext, sciChartSurface, isSingle) {
|
|
|
34
34
|
(0, licenseManager2D_1.setCallbacks3D)(callbacks3D);
|
|
35
35
|
(0, licenseManager2D_1.applyLicense)(licenseContext);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
else {
|
|
38
|
+
(0, licenseManager2D_1.updateLicenseDisplay)((0, licenseManager2D_1.getLicenseInfo)(licenseContext), sciChartSurface, false, false);
|
|
39
|
+
}
|
|
38
40
|
if (!isSingle)
|
|
39
41
|
shouldApplyLicense3D = false;
|
|
40
42
|
};
|
package/Core/BuildStamp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TSciChart } from "../types/TSciChart";
|
|
2
2
|
import { TSciChart3D } from "../types/TSciChart3D";
|
|
3
|
-
export declare const libraryVersion = "2.2.
|
|
3
|
+
export declare const libraryVersion = "2.2.2393";
|
|
4
4
|
export declare const checkBuildStamp: (wasmContext: TSciChart | TSciChart3D) => boolean;
|
package/Core/BuildStamp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkBuildStamp = exports.libraryVersion = void 0;
|
|
4
|
-
var buildStamp = "2022-
|
|
4
|
+
var buildStamp = "2022-06-10T00:00:00";
|
|
5
5
|
var result;
|
|
6
6
|
// tslint:disable-next-line:no-var-requires
|
|
7
|
-
exports.libraryVersion = "2.2.
|
|
7
|
+
exports.libraryVersion = "2.2.2393";
|
|
8
8
|
var checkBuildStamp = function (wasmContext) {
|
|
9
9
|
if (result !== undefined)
|
|
10
10
|
return result;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendTelemetry = exports.shouldSendTelemetry = exports.getUserCookie = void 0;
|
|
4
|
+
var licenseManager2dState_1 = require("../Charting/Visuals/licenseManager2dState");
|
|
5
|
+
var cookie_1 = require("../utils/cookie");
|
|
6
|
+
var BuildStamp_1 = require("./BuildStamp");
|
|
7
|
+
var app_1 = require("../constants/app");
|
|
8
|
+
var guid_1 = require("../utils/guid");
|
|
9
|
+
var sessionTime = 60 * 60 * 1000;
|
|
10
|
+
var hasSent = false;
|
|
11
|
+
var setUserCookie = function (userId, sessionId, sessionStart) {
|
|
12
|
+
var cookieVal = "".concat(userId, ",").concat(sessionId, ",").concat(sessionStart);
|
|
13
|
+
return (0, cookie_1.setCookie)("scUser", cookieVal, 365);
|
|
14
|
+
};
|
|
15
|
+
var getUserCookie = function () {
|
|
16
|
+
var cookie = (0, cookie_1.getCookie)("scUser");
|
|
17
|
+
if (cookie) {
|
|
18
|
+
var parts = cookie.split(",");
|
|
19
|
+
if (parts.length === 3)
|
|
20
|
+
return {
|
|
21
|
+
userId: parts[0],
|
|
22
|
+
sessionId: parts[1],
|
|
23
|
+
sessionStart: Number.parseInt(parts[2], 10)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
userId: (0, guid_1.base64Id)(),
|
|
28
|
+
sessionId: (0, guid_1.base64Id)(),
|
|
29
|
+
sessionStart: 0
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.getUserCookie = getUserCookie;
|
|
33
|
+
var shouldSendTelemetry = function () {
|
|
34
|
+
// Not in test
|
|
35
|
+
if (app_1.IS_TEST_ENV)
|
|
36
|
+
return false;
|
|
37
|
+
// Not if we've already done it
|
|
38
|
+
if (hasSent)
|
|
39
|
+
return false;
|
|
40
|
+
// not if the license is not dev
|
|
41
|
+
if (!licenseManager2dState_1.licenseManager2dState.getIsDev())
|
|
42
|
+
return false;
|
|
43
|
+
// not if telemetry not enabled
|
|
44
|
+
if (!licenseManager2dState_1.licenseManager2dState.getTelemetry())
|
|
45
|
+
return false;
|
|
46
|
+
// not if not online
|
|
47
|
+
if (window && !window.navigator.onLine)
|
|
48
|
+
return false;
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
exports.shouldSendTelemetry = shouldSendTelemetry;
|
|
52
|
+
var sendTelemetry = function () {
|
|
53
|
+
if (!(0, exports.shouldSendTelemetry)())
|
|
54
|
+
return;
|
|
55
|
+
var user = (0, exports.getUserCookie)();
|
|
56
|
+
var timeStamp = new Date().toISOString();
|
|
57
|
+
// New sessionId if previous has expired
|
|
58
|
+
if (Date.now() - user.sessionStart < sessionTime) {
|
|
59
|
+
// Don't send more than once per session.
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Reset the session time. Sessions expire 30 minutes after the last use in the session.
|
|
63
|
+
// Session tracking is more relevant once we start collecting more detailed per-chart data
|
|
64
|
+
user.sessionId = (0, guid_1.base64Id)();
|
|
65
|
+
user.sessionStart = Date.now();
|
|
66
|
+
setUserCookie(user.userId, user.sessionId, user.sessionStart);
|
|
67
|
+
var eventData = {
|
|
68
|
+
time: timeStamp,
|
|
69
|
+
iKey: "210b4d64-8147-471e-b6cb-244a2c939455",
|
|
70
|
+
name: "Microsoft.ApplicationInsights.210b4d648147471eb6cb244a2c939455.Event",
|
|
71
|
+
tags: {
|
|
72
|
+
"ai.user.id": user.userId,
|
|
73
|
+
"ai.session.id": user.sessionId,
|
|
74
|
+
"ai.device.id": "browser",
|
|
75
|
+
"ai.device.type": "Browser"
|
|
76
|
+
},
|
|
77
|
+
data: {
|
|
78
|
+
baseType: "EventData",
|
|
79
|
+
baseData: {
|
|
80
|
+
ver: 2,
|
|
81
|
+
name: "LicenseSet",
|
|
82
|
+
properties: {
|
|
83
|
+
platform: "JS",
|
|
84
|
+
licenseType: licenseManager2dState_1.licenseManager2dState.getLicenseType(),
|
|
85
|
+
orderId: licenseManager2dState_1.licenseManager2dState.getOrderId(),
|
|
86
|
+
productCode: licenseManager2dState_1.licenseManager2dState.getProductCode(),
|
|
87
|
+
isDev: licenseManager2dState_1.licenseManager2dState.getIsDev(),
|
|
88
|
+
devCount: licenseManager2dState_1.licenseManager2dState.getDevCount(),
|
|
89
|
+
sciChartVersion: BuildStamp_1.libraryVersion
|
|
90
|
+
},
|
|
91
|
+
measurements: {}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
if (window.location.hostname.includes(".csb.app") || window.location.hostname.includes(".codesandbox.io")) {
|
|
96
|
+
eventData.data.baseData.properties.url = window.location.href;
|
|
97
|
+
}
|
|
98
|
+
var endPointUrl = "https://dc.services.visualstudio.com/v2/track";
|
|
99
|
+
var body = JSON.stringify([eventData]);
|
|
100
|
+
fetch(endPointUrl, {
|
|
101
|
+
method: "POST",
|
|
102
|
+
headers: {
|
|
103
|
+
"Content-Type": "application/json"
|
|
104
|
+
},
|
|
105
|
+
body: body
|
|
106
|
+
}).catch();
|
|
107
|
+
hasSent = true;
|
|
108
|
+
};
|
|
109
|
+
exports.sendTelemetry = sendTelemetry;
|