scichart 2.1.2294 → 2.2.2378

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 (184) hide show
  1. package/Builder/buildAxis.d.ts +7 -0
  2. package/Builder/buildAxis.js +6 -0
  3. package/Builder/buildDataSeries.d.ts +19 -1
  4. package/Builder/buildDataSeries.js +22 -1
  5. package/Builder/buildModifiers.d.ts +2 -1
  6. package/Builder/buildSeries.d.ts +7 -2
  7. package/Builder/buildSeries.js +5 -1
  8. package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
  9. package/Charting/ChartModifiers/CursorModifier.js +15 -10
  10. package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
  11. package/Charting/ChartModifiers/LegendModifier.js +22 -0
  12. package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
  13. package/Charting/ChartModifiers/RolloverModifier.js +76 -19
  14. package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
  15. package/Charting/LayoutManager/LayoutManager.js +6 -1
  16. package/Charting/Model/BaseHeatmapDataSeries.d.ts +3 -2
  17. package/Charting/Model/BaseHeatmapDataSeries.js +17 -5
  18. package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
  19. package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
  20. package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
  21. package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
  22. package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
  23. package/Charting/Model/Filters/HlcFilterBase.js +141 -0
  24. package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
  25. package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
  26. package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
  27. package/Charting/Model/Filters/XyFilterBase.js +6 -0
  28. package/Charting/Model/Filters/XyyFilterBase.js +9 -0
  29. package/Charting/Model/Filters/XyzFilterBase.js +12 -3
  30. package/Charting/Model/HlcDataSeries.d.ts +189 -0
  31. package/Charting/Model/HlcDataSeries.js +557 -0
  32. package/Charting/Model/IDataSeries.d.ts +5 -1
  33. package/Charting/Model/IDataSeries.js +4 -0
  34. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
  35. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
  36. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
  37. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
  38. package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
  39. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
  40. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
  41. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
  42. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
  43. package/Charting/Services/SciChartRenderer.d.ts +1 -0
  44. package/Charting/Services/SciChartRenderer.js +6 -0
  45. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
  46. package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
  47. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
  48. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
  49. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
  50. package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
  51. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
  52. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
  53. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
  54. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
  55. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
  56. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
  57. package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
  58. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
  59. package/Charting/Visuals/Annotations/constants.d.ts +2 -1
  60. package/Charting/Visuals/Annotations/constants.js +1 -0
  61. package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
  62. package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
  63. package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
  64. package/Charting/Visuals/Axis/AxisCore.js +6 -0
  65. package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
  66. package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
  67. package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
  68. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
  69. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
  70. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
  71. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
  72. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
  73. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
  74. package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
  75. package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
  76. package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
  77. package/Charting/Visuals/Helpers/NativeObject.js +101 -0
  78. package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
  79. package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
  80. package/Charting/Visuals/Helpers/drawBorder.js +2 -2
  81. package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
  82. package/Charting/Visuals/Helpers/drawLabel.js +38 -18
  83. package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
  84. package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
  85. package/Charting/Visuals/Legend/SciChartLegend.js +7 -1
  86. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
  87. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
  88. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
  89. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
  90. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
  91. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
  92. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
  93. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
  94. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
  95. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
  96. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
  97. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +1 -1
  98. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
  99. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
  100. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
  101. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
  102. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
  103. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
  104. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
  105. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
  106. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
  107. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
  108. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
  109. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
  110. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
  111. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
  112. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
  113. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
  114. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
  115. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
  116. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +13 -0
  117. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +23 -3
  118. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  119. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
  120. package/Charting/Visuals/RenderableSeries/constants.d.ts +8 -0
  121. package/Charting/Visuals/RenderableSeries/constants.js +8 -0
  122. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
  123. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
  124. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
  125. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
  126. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
  127. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
  128. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
  129. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
  130. package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
  131. package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
  132. package/Charting/Visuals/SciChartSurface.d.ts +13 -2
  133. package/Charting/Visuals/SciChartSurface.js +39 -3
  134. package/Charting/Visuals/createMaster.js +17 -13
  135. package/Charting/Visuals/createSingle.js +5 -3
  136. package/Charting/Visuals/licenseManager2D.d.ts +6 -0
  137. package/Charting/Visuals/licenseManager2D.js +83 -8
  138. package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
  139. package/Charting/Visuals/licenseManager2dState.js +37 -1
  140. package/Charting/Visuals/loader.js +4 -1
  141. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  142. package/Charting/Visuals/sciChartInitCommon.js +13 -9
  143. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
  144. package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
  145. package/Charting3D/Visuals/createMaster3d.js +20 -14
  146. package/Charting3D/Visuals/createSingle3d.js +3 -4
  147. package/Charting3D/Visuals/licenseManager3D.js +3 -1
  148. package/Core/BuildStamp.d.ts +1 -1
  149. package/Core/BuildStamp.js +2 -2
  150. package/Core/Telemetry.d.ts +7 -0
  151. package/Core/Telemetry.js +106 -0
  152. package/Core/storage/localStorageApi.d.ts +4 -0
  153. package/Core/storage/localStorageApi.js +12 -0
  154. package/_wasm/scichart.browser.js +1 -1
  155. package/_wasm/scichart2d.js +95 -95
  156. package/_wasm/scichart2d.wasm +0 -0
  157. package/_wasm/scichart3d.js +14 -14
  158. package/_wasm/scichart3d.wasm +0 -0
  159. package/package.json +1 -1
  160. package/types/AxisType.d.ts +5 -1
  161. package/types/AxisType.js +4 -0
  162. package/types/Color.d.ts +1 -0
  163. package/types/Color.js +1 -0
  164. package/types/DataFilterType.d.ts +1 -0
  165. package/types/DataFilterType.js +1 -0
  166. package/types/DataPointWidthMode.d.ts +13 -0
  167. package/types/DataPointWidthMode.js +17 -0
  168. package/types/ErrorDirection.d.ts +13 -0
  169. package/types/ErrorDirection.js +17 -0
  170. package/types/ErrorMode.d.ts +17 -0
  171. package/types/ErrorMode.js +21 -0
  172. package/types/LabelPlacement.d.ts +8 -0
  173. package/types/LabelPlacement.js +11 -1
  174. package/types/LabelProviderType.d.ts +5 -1
  175. package/types/LabelProviderType.js +4 -0
  176. package/types/SeriesType.d.ts +3 -1
  177. package/types/SeriesType.js +2 -0
  178. package/types/TSciChart.d.ts +8 -2
  179. package/types/TSciChart3D.d.ts +5 -2
  180. package/types/TSciChartSurfaceCanvases.d.ts +1 -0
  181. package/utils/date.d.ts +1 -0
  182. package/utils/date.js +15 -1
  183. package/utils/guid.d.ts +6 -0
  184. package/utils/guid.js +17 -1
@@ -2,5 +2,11 @@ export declare enum PROPERTY {
2
2
  HOLE_RADIUS = "HOLE_RADIUS",
3
3
  HOLE_RADIUS_SIZING_MODE = "HOLE_RADIUS_SIZING_MODE",
4
4
  PIE_TYPE = "PIE_TYPE",
5
- SERIES_SPACING = "SERIES_SPACING"
5
+ SERIES_SPACING = "SERIES_SPACING",
6
+ PADDING = "PADDING",
7
+ CANVAS_BORDER = "CANVAS_BORDER",
8
+ LABEL_PROVIDER = "LABEL_PROVIDER",
9
+ VALUE_MODE = "VALUE_MODE",
10
+ LABEL_RADIUS = "LABEL_RADIUS",
11
+ TEXT_STYLE = "TEXT_STYLE"
6
12
  }
@@ -7,4 +7,10 @@ var PROPERTY;
7
7
  PROPERTY["HOLE_RADIUS_SIZING_MODE"] = "HOLE_RADIUS_SIZING_MODE";
8
8
  PROPERTY["PIE_TYPE"] = "PIE_TYPE";
9
9
  PROPERTY["SERIES_SPACING"] = "SERIES_SPACING";
10
+ PROPERTY["PADDING"] = "PADDING";
11
+ PROPERTY["CANVAS_BORDER"] = "CANVAS_BORDER";
12
+ PROPERTY["LABEL_PROVIDER"] = "LABEL_PROVIDER";
13
+ PROPERTY["VALUE_MODE"] = "VALUE_MODE";
14
+ PROPERTY["LABEL_RADIUS"] = "LABEL_RADIUS";
15
+ PROPERTY["TEXT_STYLE"] = "TEXT_STYLE";
10
16
  })(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
@@ -69,9 +69,11 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
69
69
  * To use the default CDN, just call SciChart.SciChartSurface.useWasmFromCDN();
70
70
  * @example
71
71
  * ```ts
72
+ * import { libraryVersion } from "scichart/Core/BuildStamp";
73
+ *
72
74
  * SciChart.SciChartSurface.configure({
73
- * dataUrl: "https://cdn.jsdelivr.net/npm/scichart@1.3.1500/_wasm/scichart2d.data",
74
- * wasmUrl: "https://cdn.jsdelivr.net/npm/scichart@1.3.1500/_wasm/scichart2d.wasm"
75
+ * dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.data`,
76
+ * wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.wasm`
75
77
  * });
76
78
  * ```
77
79
  * @param config
@@ -192,6 +194,7 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
192
194
  private solidBrushCacheCanvasBorder;
193
195
  private viewportBorderProperty;
194
196
  private canvasBorderProperty;
197
+ private drawSeriesBehindAxisProperty;
195
198
  /**
196
199
  * Creates an instance of the {@link SciChartSurface}
197
200
  * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
@@ -419,4 +422,12 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
419
422
  private attachAxis;
420
423
  private detachAnnotation;
421
424
  private attachAnnotation;
425
+ /**
426
+ * Gets or sets the boolean flag for switching behaviour of Axises rendering
427
+ */
428
+ get drawSeriesBehindAxis(): boolean;
429
+ /**
430
+ * Gets or sets the boolean flag for switching behaviour of Axises rendering
431
+ */
432
+ set drawSeriesBehindAxis(value: boolean);
422
433
  }
@@ -114,6 +114,7 @@ var SciChartSurface = /** @class */ (function (_super) {
114
114
  color: "#00000000",
115
115
  border: undefined
116
116
  };
117
+ _this.drawSeriesBehindAxisProperty = false;
117
118
  var canvasWidth = (_b = (_a = _this.domCanvas2D) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : app_1.DEFAULT_WIDTH;
118
119
  var canvasHeight = (_d = (_c = _this.domCanvas2D) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : app_1.DEFAULT_HEIGHT;
119
120
  _this.webAssemblyContext2D = webAssemblyContext;
@@ -236,9 +237,11 @@ var SciChartSurface = /** @class */ (function (_super) {
236
237
  * To use the default CDN, just call SciChart.SciChartSurface.useWasmFromCDN();
237
238
  * @example
238
239
  * ```ts
240
+ * import { libraryVersion } from "scichart/Core/BuildStamp";
241
+ *
239
242
  * SciChart.SciChartSurface.configure({
240
- * dataUrl: "https://cdn.jsdelivr.net/npm/scichart@1.3.1500/_wasm/scichart2d.data",
241
- * wasmUrl: "https://cdn.jsdelivr.net/npm/scichart@1.3.1500/_wasm/scichart2d.wasm"
243
+ * dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.data`,
244
+ * wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.wasm`
242
245
  * });
243
246
  * ```
244
247
  * @param config
@@ -425,6 +428,20 @@ var SciChartSurface = /** @class */ (function (_super) {
425
428
  this.watermarkProperties = (0, Deleter_1.deleteSafe)(this.watermarkProperties);
426
429
  this.watermarkPropertyPosition = (0, Deleter_1.deleteSafe)(this.watermarkPropertyPosition);
427
430
  this.chartModifiers.asArray().forEach(function (chm) { return chm.delete(); });
431
+ if (this.domChartRoot) {
432
+ var style = this.domChartRoot.style;
433
+ if (style) {
434
+ style.background = "";
435
+ style.position = "";
436
+ }
437
+ if (this.domChartRoot.hasOwnProperty("replaceChildren")) {
438
+ // @ts-ignore
439
+ this.domChartRoot.replaceChildren();
440
+ }
441
+ else {
442
+ this.domChartRoot.innerHTML = "";
443
+ }
444
+ }
428
445
  };
429
446
  /**
430
447
  * @inheritDoc
@@ -790,6 +807,9 @@ var SciChartSurface = /** @class */ (function (_super) {
790
807
  // @ts-ignore
791
808
  this.loaderJson = options.loader.toJSON();
792
809
  }
810
+ if (options === null || options === void 0 ? void 0 : options.drawSeriesBehindAxis) {
811
+ this.drawSeriesBehindAxisProperty = options.drawSeriesBehindAxis;
812
+ }
793
813
  };
794
814
  /**
795
815
  * @inheritDoc
@@ -894,7 +914,6 @@ var SciChartSurface = /** @class */ (function (_super) {
894
914
  }
895
915
  col.add(renderableSeries);
896
916
  this.renderableSeries.remove(renderableSeries);
897
- return;
898
917
  }
899
918
  renderableSeries.onAttach(this);
900
919
  if (this.themeProviderProperty) {
@@ -943,6 +962,23 @@ var SciChartSurface = /** @class */ (function (_super) {
943
962
  annotation.onAttach(this);
944
963
  this.invalidateElement();
945
964
  };
965
+ Object.defineProperty(SciChartSurface.prototype, "drawSeriesBehindAxis", {
966
+ /**
967
+ * Gets or sets the boolean flag for switching behaviour of Axises rendering
968
+ */
969
+ get: function () {
970
+ return this.drawSeriesBehindAxisProperty;
971
+ },
972
+ /**
973
+ * Gets or sets the boolean flag for switching behaviour of Axises rendering
974
+ */
975
+ set: function (value) {
976
+ this.drawSeriesBehindAxisProperty = value;
977
+ this.invalidateElement();
978
+ },
979
+ enumerable: false,
980
+ configurable: true
981
+ });
946
982
  return SciChartSurface;
947
983
  }(SciChartSurfaceBase_1.SciChartSurfaceBase));
948
984
  exports.SciChartSurface = SciChartSurface;
@@ -64,7 +64,7 @@ var createMultichart = function (divElement, options) { return __awaiter(void 0,
64
64
  switch (_d.label) {
65
65
  case 0:
66
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
+ 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, options === null || options === void 0 ? void 0 : options.disableAspect);
68
68
  loader = (_c = options === null || options === void 0 ? void 0 : options.loader) !== null && _c !== void 0 ? _c : new loader_1.DefaultSciChartLoader();
69
69
  loaderDiv = loader.addChartLoader(canvases.domDivContainer, options === null || options === void 0 ? void 0 : options.theme);
70
70
  _d.label = 1;
@@ -142,7 +142,7 @@ var createMaster = function () {
142
142
  Guard_1.Guard.notNull(theme, "theme");
143
143
  var sciChartSurface = new SciChartSurface_1.SciChartSurface(wasmContext, { canvases: canvases });
144
144
  sciChartSurface.applyTheme(theme);
145
- var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, sciChartSurface);
145
+ var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, sciChartSurface, canvases.disableAspect);
146
146
  sciChartSurface.addDeletable(unsub);
147
147
  sciChartSurface.setDestinations(exports.sciChartDestinations);
148
148
  return sciChartSurface;
@@ -190,17 +190,21 @@ var createMaster = function () {
190
190
  InitializeChart: function () {
191
191
  resolve({ getChildSurfaces: getChildSurfaces, createChildSurface: createChildSurface, wasmContext: wasmContext });
192
192
  },
193
- Draw: function () {
194
- exports.sciChartDestinations.forEach(function (dest, index) {
195
- var canvasElementId = dest.canvasElementId, sciChartSurface = dest.sciChartSurface;
196
- var chart = wasmContext.SCRTGetGlobalSampleChartInterface();
197
- if (chart.GetCurrentDestination()) {
198
- var currDestID = chart.GetCurrentDestination().GetID();
199
- if (currDestID === canvasElementId) {
200
- sciChartSurface.renderSurface.onRenderTimeElapsed();
201
- }
202
- }
203
- });
193
+ Draw: function (canvasId) {
194
+ var dest = exports.sciChartDestinations.find(function (d) { return d.canvasElementId === canvasId; });
195
+ if (dest) {
196
+ dest.sciChartSurface.renderSurface.onRenderTimeElapsed();
197
+ }
198
+ // sciChartDestinations.forEach((dest, index) => {
199
+ // const { canvasElementId, sciChartSurface } = dest;
200
+ // const chart = wasmContext.SCRTGetGlobalSampleChartInterface();
201
+ // if (chart.GetCurrentDestination()) {
202
+ // const currDestID = chart.GetCurrentDestination().GetID();
203
+ // if (currDestID === canvasElementId) {
204
+ // (sciChartSurface as SciChartSurface).renderSurface.onRenderTimeElapsed();
205
+ // }
206
+ // }
207
+ // });
204
208
  },
205
209
  Update: function (deltaTime) {
206
210
  // Logger.log("sciChartInitCommon.ts Update");
@@ -12,13 +12,14 @@ var loader_1 = require("./loader");
12
12
  var sciChartInitCommon_1 = require("./sciChartInitCommon");
13
13
  var SciChartSurface_1 = require("./SciChartSurface");
14
14
  var SciChartSurfaceBase_1 = require("./SciChartSurfaceBase");
15
+ var NativeObject_1 = require("./Helpers/NativeObject");
15
16
  // Global variables
16
17
  exports.sciChartSingleDestinations = [];
17
18
  /** @ignore */
18
19
  var createSingleInternal = function (divElement, options) {
19
20
  return new Promise(function (resolve, reject) {
20
21
  var _a;
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);
22
+ 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, undefined, options === null || options === void 0 ? void 0 : options.disableAspect);
22
23
  var loader = (_a = options === null || options === void 0 ? void 0 : options.loader) !== null && _a !== void 0 ? _a : new loader_1.DefaultSciChartLoader();
23
24
  var loaderDiv = loader.addChartLoader(canvases.domDivContainer, options === null || options === void 0 ? void 0 : options.theme);
24
25
  var webGLSupport = WebGlHelper_1.WebGlHelper.getWebGlSupport();
@@ -68,12 +69,13 @@ var initDrawEngineSingleChart = function (wasmContext, canvases, resolve, theme)
68
69
  setTimeout(function () {
69
70
  scs.invalidateElement();
70
71
  licenseManager2D_1.licenseManager.applyLicense2D(wasmContext, scs, true);
71
- var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, scs);
72
+ var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, scs, canvases.disableAspect);
72
73
  scs.addDeletable(unsub);
74
+ scs.addDeletable((0, NativeObject_1.freeCache)(wasmContext));
73
75
  resolve({ wasmContext: wasmContext, sciChartSurface: scs });
74
76
  }, 0);
75
77
  },
76
- Draw: function () {
78
+ Draw: function (canvasId) {
77
79
  scs.renderSurface.onRenderTimeElapsed();
78
80
  },
79
81
  Update: function (deltaTime) {
@@ -10,6 +10,7 @@ export declare type TLicenseDependencies = {
10
10
  debug: (message: string) => void;
11
11
  };
12
12
  export declare const setDependencies: (dependencies: TLicenseDependencies) => TLicenseDependencies;
13
+ export declare const setIsDebugLicensing: (value: boolean, persist?: boolean) => void;
13
14
  export declare const setLicenseCallback: (callback: (queryString: string) => Promise<Response>) => void;
14
15
  export declare const setRuntimeLicenseKey: (value: string) => void;
15
16
  export declare const setUseLicenseWizard: (value: boolean) => void;
@@ -39,6 +40,7 @@ export declare type TLicenseContext = {
39
40
  GetLicenseType: () => SCRTLicenseType;
40
41
  GetLicenseDaysRemaining: () => number;
41
42
  Dump: () => string;
43
+ HasFeature: (feature: string) => SCRTLicenseType;
42
44
  GetLicenseErrors: () => string;
43
45
  GetAllowDebugging: () => boolean;
44
46
  SetRuntimeLicenseKeyW: (licenseKey: string) => void;
@@ -47,6 +49,9 @@ export declare type TLicenseContext = {
47
49
  ResetRuntimeLicense: () => void;
48
50
  GetLicenseChallenge: () => string;
49
51
  GetOrderId: () => string;
52
+ GetEncryptedOrderId: () => string;
53
+ GetProductCode: () => string;
54
+ GetDeveloperCount: () => number;
50
55
  };
51
56
  SCRTLicenseType: {
52
57
  LICENSE_TYPE_NO_LICENSE: SCRTLicenseType;
@@ -64,6 +69,7 @@ export declare const getLicenseInfo: (licenseContext: TLicenseContext) => ILicen
64
69
  export declare const updateLicenseDisplay: (licenseInfo: ILicenseInfo, sciChartSurface: SciChartSurfaceBase, is2D: boolean, applyToOther: boolean) => void;
65
70
  export declare const licenseManager: {
66
71
  setRuntimeLicenseKey: (value: string) => void;
72
+ setIsDebugLicensing: (value: boolean) => void;
67
73
  setLicenseCallback: (callback: (queryString: string) => Promise<Response>) => void;
68
74
  setServerLicenseEndpoint: (value: string) => void;
69
75
  applyLicense2D: (licenseContext: TLicenseContext, sciChartSurface: SciChartSurfaceBase, isSingle: boolean) => void;
@@ -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
- console.log("license challenge response was invalid: " + token);
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
- console.log("Server rejected the license challenge: " + token);
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
- console.log("Error during license validation: " + response.statusText);
325
- checkStatus = licensingClasses_1.LicenseCheckStatus.FailedToValidateDeveloperLicense;
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,15 +396,21 @@ 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();
@@ -400,6 +441,12 @@ var applyLicense = function (licenseContext) {
400
441
  licenseKey = runtimelicense;
401
442
  }
402
443
  else {
444
+ if (window && ((_a = window.location) === null || _a === void 0 ? void 0 : _a.hostname) && !window.location.hostname.includes("localhost")) {
445
+ console.warn("Runtime license is invalid. Call setIsDebugLicensing(true) for details.");
446
+ }
447
+ else {
448
+ debug("Runtime license is invalid: " + licenseContext.SCRTCredentials.GetLicenseErrors());
449
+ }
403
450
  licenseKey = "";
404
451
  }
405
452
  }
@@ -444,7 +491,7 @@ var applyLicense = function (licenseContext) {
444
491
  (0, cookie_1.deleteCookie)("scLicense");
445
492
  checkStatus = licensingClasses_1.LicenseCheckStatus.DevKeyInRuntimeKey;
446
493
  }
447
- else if (licenseCookie.expiry > new Date()) {
494
+ else if (licenseCookie.expiry > new Date() && licenseCookie.key === licenseKey) {
448
495
  debug("current token in cookie");
449
496
  var expirySeconds = setChallengeResponse(licenseCookie.token);
450
497
  lt = licenseContext.SCRTCredentials.GetLicenseType();
@@ -495,7 +542,9 @@ var openLicenseModal = function () {
495
542
  var setNewLicense = function (keyCode) {
496
543
  var requiresValidation = false;
497
544
  var trialExpired;
498
- licenseModal.style.display = "none";
545
+ if (licenseModal) {
546
+ licenseModal.style.display = "none";
547
+ }
499
548
  isRuntimeKey = false;
500
549
  setLicenseCookie(keyCode, null, null, null);
501
550
  if (licenseContext2D !== undefined) {
@@ -585,7 +634,21 @@ var createLicenseModal = function (message, postFormMessage) {
585
634
  var modalInfo = document.createElement("div");
586
635
  modalInfo.style.padding = "10px 26px 10px 16px";
587
636
  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>";
637
+ var buttonLabel = document.createElement("div");
638
+ modalInfo.innerHTML = "To toggle License debug mode use button below and refresh the page.";
639
+ var toggleDebugModeButton = document.createElement("button");
640
+ toggleDebugModeButton.style.margin = "10px";
641
+ var setDebugModeSwitchLabel = function () {
642
+ toggleDebugModeButton.textContent = isDebug ? "Disable licensing debug mode" : "Enable licensing debug mode";
643
+ };
644
+ setDebugModeSwitchLabel();
645
+ toggleDebugModeButton.onclick = function () {
646
+ (0, exports.setIsDebugLicensing)(!isDebug, true);
647
+ setDebugModeSwitchLabel();
648
+ };
588
649
  modalContentForm.appendChild(modalInfo);
650
+ modalContentForm.appendChild(buttonLabel);
651
+ modalContentForm.appendChild(toggleDebugModeButton);
589
652
  var modalFooter = document.createElement("div");
590
653
  modalFooter.innerHTML = postFormMessage;
591
654
  modalFooter.style.padding = "8px 16px";
@@ -672,6 +735,14 @@ var getLicenseInfo = function (licenseContext) {
672
735
  var sclt = licenseContext.SCRTCredentials.GetLicenseType();
673
736
  var licenseType = convertLicenseType(sclt, licenseContext);
674
737
  var daysRemaining = licenseContext.SCRTCredentials.GetLicenseDaysRemaining();
738
+ if (checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK && licenseManager2dState_1.licenseManager2dState.getLicenseType() !== licenseType) {
739
+ licenseManager2dState_1.licenseManager2dState.setOrderId(licenseContext.SCRTCredentials.GetEncryptedOrderId());
740
+ licenseManager2dState_1.licenseManager2dState.setProductCode(licenseContext.SCRTCredentials.GetProductCode());
741
+ licenseManager2dState_1.licenseManager2dState.setLicenseType(licenseType);
742
+ licenseManager2dState_1.licenseManager2dState.setDevCount(licenseContext.SCRTCredentials.GetDeveloperCount());
743
+ // Telemetry is enabled based on a license feature
744
+ licenseManager2dState_1.licenseManager2dState.setTelemetry(licenseContext.SCRTCredentials.HasFeature("TE") === licenseContext.SCRTLicenseType.LICENSE_TYPE_FULL);
745
+ }
675
746
  if (isDebug) {
676
747
  debug(licenseContext.SCRTCredentials.Dump());
677
748
  }
@@ -821,6 +892,9 @@ var updateLicenseDisplayInternal = function (licenseInfo, sciChartSurface, is2D,
821
892
  }
822
893
  }
823
894
  }
895
+ else {
896
+ (0, Telemetry_1.sendTelemetry)();
897
+ }
824
898
  }
825
899
  updateLicenseMessageDOM(sciChartSurface.domDivContainer, licenseMessageDiv);
826
900
  if (applyToOther) {
@@ -833,6 +907,7 @@ var updateLicenseDisplay = function (licenseInfo, sciChartSurface, is2D, applyTo
833
907
  exports.updateLicenseDisplay = updateLicenseDisplay;
834
908
  exports.licenseManager = {
835
909
  setRuntimeLicenseKey: function (value) { return (0, exports.setRuntimeLicenseKey)(value); },
910
+ setIsDebugLicensing: function (value) { return (0, exports.setIsDebugLicensing)(value); },
836
911
  setLicenseCallback: function (callback) { return (0, exports.setLicenseCallback)(callback); },
837
912
  setServerLicenseEndpoint: function (value) { return setServerLicenseEndpoint(value); },
838
913
  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
- domChartRoot.removeChild(loaderElement);
43
+ try {
44
+ domChartRoot.removeChild(loaderElement);
45
+ }
46
+ catch (_a) { }
44
47
  };
45
48
  DefaultSciChartLoader.prototype.toJSON = function () {
46
49
  return { type: this.type };
@@ -10,7 +10,7 @@ declare const sciChartInitCommon: {
10
10
  checkChartDivExists: (divElement: string | HTMLDivElement) => void;
11
11
  ECanvasType: typeof ECanvasType;
12
12
  getCanvas2dId: (divElementId: string) => string;
13
- initCanvas: (divElement: string | HTMLDivElement, aspectWidth: number, aspectHeight: number, activeCanvas?: ECanvasType) => TSciChartSurfaceCanvases;
14
- subscribeToResize: (chartRoot: HTMLDivElement, aspect: number, sciChartSurface: ISciChartSurfaceBase) => IDeletable;
13
+ initCanvas: (divElement: string | HTMLDivElement, aspectWidth: number, aspectHeight: number, activeCanvas?: ECanvasType, disableAspect?: boolean) => TSciChartSurfaceCanvases;
14
+ subscribeToResize: (chartRoot: HTMLDivElement, aspect: number, sciChartSurface: ISciChartSurfaceBase, disableAspect?: boolean) => IDeletable;
15
15
  };
16
16
  export default sciChartInitCommon;
@@ -68,7 +68,7 @@ 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 (divElement, aspectWidth, aspectHeight, activeCanvas) {
71
+ var initCanvas = function (divElement, aspectWidth, aspectHeight, activeCanvas, disableAspect) {
72
72
  if (activeCanvas === void 0) { activeCanvas = ECanvasType.canvasWebGL; }
73
73
  WebGlHelper_1.WebGlHelper.initialize();
74
74
  DpiHelper_1.DpiHelper.initialize();
@@ -82,6 +82,7 @@ var initCanvas = function (divElement, aspectWidth, aspectHeight, activeCanvas)
82
82
  var divWidth = chartRoot.offsetWidth, divHeight = chartRoot.offsetHeight;
83
83
  var maxHeight = getMaxHeight(chartRoot);
84
84
  var _a = getCanvasSizes(divWidth, divHeight, maxHeight, aspectWidth, aspectHeight), width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio;
85
+ // set canvasSize for parent div because of all children in absolute
85
86
  var canvasWebGL;
86
87
  if (activeCanvas === ECanvasType.canvasWebGL) {
87
88
  // WebGL Canvas
@@ -158,10 +159,11 @@ var initCanvas = function (divElement, aspectWidth, aspectHeight, activeCanvas)
158
159
  domSvgContainer: svgRootElement,
159
160
  domSvgAdornerLayer: svgAdornerLayer,
160
161
  domDivContainer: divRootElement,
161
- aspect: aspectRatio
162
+ aspect: aspectRatio,
163
+ disableAspect: disableAspect
162
164
  };
163
165
  };
164
- var subscribeToResize = function (chartRoot, aspect, sciChartSurface) {
166
+ var subscribeToResize = function (chartRoot, aspect, sciChartSurface, disableAspect) {
165
167
  // @ts-ignore
166
168
  var resizeObserver = new ResizeObserver(function (entries) {
167
169
  var _loop_1 = function (entry) {
@@ -185,12 +187,14 @@ var subscribeToResize = function (chartRoot, aspect, sciChartSurface) {
185
187
  newWidth = 900;
186
188
  }
187
189
  // if aspect ration is defined we use is to calc height
188
- if (aspect) {
189
- newHeight = Math.round(newWidth / aspect);
190
- }
191
- else if (!newHeight) {
192
- // hardcoded aspect ration if newHeight is not defined
193
- newHeight = (newWidth * 2) / 3;
190
+ if (!disableAspect) {
191
+ if (aspect) {
192
+ newHeight = Math.round(newWidth / aspect);
193
+ }
194
+ else if (!newHeight) {
195
+ // hardcoded aspect ration if newHeight is not defined
196
+ newHeight = (newWidth * 2) / 3;
197
+ }
194
198
  }
195
199
  // check max-height
196
200
  var maxHeight = getMaxHeight(chartRoot);
@@ -133,8 +133,12 @@ var ScatterPointsSceneEntity = /** @class */ (function (_super) {
133
133
  // as its implemented as a non-sparse array
134
134
  metadata.forEach(function (meta, index) {
135
135
  if (meta) {
136
- _this.pointColors.set(index, meta.vertexColorAbgr);
137
- _this.pointScales.set(index, meta.pointScale);
136
+ if (meta.vertexColorAbgr) {
137
+ _this.pointColors.set(index, meta.vertexColorAbgr);
138
+ }
139
+ if (meta.pointScale) {
140
+ _this.pointScales.set(index, meta.pointScale);
141
+ }
138
142
  }
139
143
  });
140
144
  return { colors: this.pointColors, scales: this.pointScales };
@@ -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