scichart 2.0.2195 → 2.1.2261

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 (232) hide show
  1. package/Charting/ChartModifiers/CursorModifier.d.ts +9 -0
  2. package/Charting/ChartModifiers/CursorModifier.js +10 -0
  3. package/Charting/ChartModifiers/DataPointSelectionModifier.js +0 -1
  4. package/Charting/ChartModifiers/RolloverModifier.d.ts +30 -3
  5. package/Charting/ChartModifiers/RolloverModifier.js +46 -80
  6. package/Charting/Drawing/BrushCache.d.ts +8 -2
  7. package/Charting/Drawing/BrushCache.js +16 -8
  8. package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
  9. package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
  10. package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
  11. package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
  12. package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  13. package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
  14. package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
  15. package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  16. package/Charting/Model/BaseDataSeries.d.ts +42 -15
  17. package/Charting/Model/BaseDataSeries.js +77 -28
  18. package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
  19. package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
  20. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
  21. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
  22. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
  23. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
  24. package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
  25. package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
  26. package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
  27. package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
  28. package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
  29. package/Charting/Model/IDataSeries.d.ts +37 -5
  30. package/Charting/Model/OhlcDataSeries.d.ts +12 -11
  31. package/Charting/Model/OhlcDataSeries.js +47 -44
  32. package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
  33. package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
  34. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
  35. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
  36. package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
  37. package/Charting/Model/PointSeries/IPointSeries.js +2 -0
  38. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
  39. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
  40. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
  41. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
  42. package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
  43. package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
  44. package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
  45. package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
  46. package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
  47. package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
  48. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
  49. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
  50. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
  51. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
  52. package/Charting/Model/XyDataSeries.d.ts +3 -2
  53. package/Charting/Model/XyDataSeries.js +26 -26
  54. package/Charting/Model/XyyDataSeries.d.ts +5 -5
  55. package/Charting/Model/XyyDataSeries.js +30 -27
  56. package/Charting/Model/XyzDataSeries.d.ts +5 -5
  57. package/Charting/Model/XyzDataSeries.js +30 -27
  58. package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
  59. package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
  60. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
  61. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
  62. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
  63. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
  64. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
  65. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +234 -0
  66. package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
  67. package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
  68. package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
  69. package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
  70. package/Charting/Services/RenderPassData.d.ts +6 -1
  71. package/Charting/Services/RenderPassData.js +5 -1
  72. package/Charting/Services/RenderPassInfo.d.ts +18 -0
  73. package/Charting/Services/RenderPassInfo.js +14 -0
  74. package/Charting/Services/SciChartRenderer.d.ts +14 -1
  75. package/Charting/Services/SciChartRenderer.js +127 -31
  76. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
  77. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +1 -0
  78. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +6 -0
  79. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +5 -0
  80. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +12 -1
  81. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +6 -8
  82. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +12 -9
  83. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
  84. package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
  85. package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
  86. package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
  87. package/Charting/Visuals/Axis/AxisCore.js +39 -18
  88. package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
  89. package/Charting/Visuals/Axis/AxisRenderer.js +37 -10
  90. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +51 -0
  91. package/Charting/Visuals/Axis/CategoryAxisBase.js +85 -20
  92. package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
  93. package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -2
  94. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +9 -4
  95. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +7 -4
  96. package/Charting/Visuals/Axis/NumericAxis.js +2 -2
  97. package/Charting/Visuals/Axis/constants.d.ts +1 -0
  98. package/Charting/Visuals/Axis/constants.js +1 -0
  99. package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
  100. package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
  101. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
  102. package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
  103. package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
  104. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
  105. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
  106. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
  107. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
  108. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
  109. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
  110. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
  111. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
  112. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
  113. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +113 -0
  114. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +42 -6
  115. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +131 -22
  116. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
  117. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
  118. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
  119. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
  120. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
  121. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
  122. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
  123. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
  124. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
  125. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +31 -19
  126. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
  127. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
  128. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -15
  129. package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
  130. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
  131. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
  132. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
  133. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
  134. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +11 -2
  135. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +17 -0
  136. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
  137. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
  138. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
  139. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
  140. package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
  141. package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
  142. package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
  143. package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
  144. package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
  145. package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
  146. package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
  147. package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
  148. package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
  149. package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
  150. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
  151. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
  152. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
  153. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
  154. package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
  155. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
  156. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
  157. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
  158. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
  159. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
  160. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
  161. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +0 -6
  162. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
  163. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
  164. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
  165. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
  166. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
  167. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
  168. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
  169. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
  170. package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
  171. package/Charting/Visuals/RenderableSeries/constants.js +3 -0
  172. package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
  173. package/Charting/Visuals/SciChartDefaults.js +9 -1
  174. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +1 -0
  175. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +7 -2
  176. package/Charting/Visuals/SciChartSurface.d.ts +4 -4
  177. package/Charting/Visuals/SciChartSurface.js +18 -11
  178. package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
  179. package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
  180. package/Charting/Visuals/createMaster.d.ts +1 -1
  181. package/Charting/Visuals/createMaster.js +11 -6
  182. package/Charting/Visuals/createSingle.d.ts +1 -1
  183. package/Charting/Visuals/createSingle.js +2 -2
  184. package/Charting/Visuals/licenseManager2D.js +24 -21
  185. package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
  186. package/Charting/Visuals/licenseManager2dState.js +12 -0
  187. package/Charting/Visuals/loader.js +2 -0
  188. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  189. package/Charting/Visuals/sciChartInitCommon.js +22 -12
  190. package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
  191. package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
  192. package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
  193. package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
  194. package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
  195. package/Charting3D/Visuals/createMaster3d.js +11 -6
  196. package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
  197. package/Charting3D/Visuals/createSingle3d.js +2 -2
  198. package/Core/BuildStamp.d.ts +1 -1
  199. package/Core/BuildStamp.js +2 -2
  200. package/Core/NumberRange.d.ts +1 -0
  201. package/Core/NumberRange.js +8 -0
  202. package/Core/OneTimePerformanceWarning.d.ts +6 -0
  203. package/Core/OneTimePerformanceWarning.js +19 -0
  204. package/Core/storage/localStorageApi.d.ts +9 -0
  205. package/Core/storage/localStorageApi.js +32 -0
  206. package/_wasm/scichart.browser.js +1 -1
  207. package/_wasm/scichart2d.js +95 -95
  208. package/_wasm/scichart2d.wasm +0 -0
  209. package/_wasm/scichart3d.js +96 -96
  210. package/_wasm/scichart3d.wasm +0 -0
  211. package/constants/performanceWarnings.d.ts +5 -0
  212. package/constants/performanceWarnings.js +8 -0
  213. package/package.json +1 -1
  214. package/types/NumberArray.d.ts +1 -0
  215. package/types/NumberArray.js +5 -1
  216. package/types/SearchMode.d.ts +21 -0
  217. package/types/SearchMode.js +25 -0
  218. package/types/TSciChart.d.ts +144 -40
  219. package/types/TSciChart3D.d.ts +66 -28
  220. package/types/TStackedAxisLength.d.ts +4 -0
  221. package/types/TStackedAxisLength.js +4 -0
  222. package/utils/array.d.ts +7 -0
  223. package/utils/array.js +19 -1
  224. package/utils/calcAverage.d.ts +2 -2
  225. package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
  226. package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
  227. package/utils/hash.d.ts +7 -0
  228. package/utils/hash.js +35 -0
  229. package/utils/tooltip.d.ts +42 -0
  230. package/utils/tooltip.js +119 -0
  231. package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
  232. package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
@@ -100,7 +100,7 @@ var AxisBase2D = /** @class */ (function (_super) {
100
100
  * @param options Optional parameters of type {@link IAxisBase2dOptions} used to configure the axis at instantiation time
101
101
  */
102
102
  function AxisBase2D(webAssemblyContext, options) {
103
- var _a, _b, _c, _d, _e, _f, _g;
103
+ var _a, _b, _c, _d, _e, _f, _g, _h;
104
104
  var _this = _super.call(this, options) || this;
105
105
  /**
106
106
  * Gets the {@link AxisLayoutState} class which manages layout
@@ -149,6 +149,7 @@ var AxisBase2D = /** @class */ (function (_super) {
149
149
  _this.labelStyle = __assign(__assign({}, _this.labelStyle), options === null || options === void 0 ? void 0 : options.labelStyle);
150
150
  _this.axisBorder = __assign(__assign({}, _this.axisBorder), options === null || options === void 0 ? void 0 : options.axisBorder);
151
151
  _this.isInnerAxis = (_g = options === null || options === void 0 ? void 0 : options.isInnerAxis) !== null && _g !== void 0 ? _g : _this.isInnerAxis;
152
+ _this.stackedAxisLength = (_h = options === null || options === void 0 ? void 0 : options.stackedAxisLength) !== null && _h !== void 0 ? _h : _this.stackedAxisLength;
152
153
  _this.solidBrushCacheBorder = new SolidBrushCache_1.SolidBrushCache(webAssemblyContext);
153
154
  if (options === null || options === void 0 ? void 0 : options.labelProvider) {
154
155
  if (!("getLabels" in (options === null || options === void 0 ? void 0 : options.labelProvider))) {
@@ -232,8 +233,10 @@ var AxisBase2D = /** @class */ (function (_super) {
232
233
  * SciChart also supports XAxis on the left and YAxis on the top to rotate / create vertical charts.
233
234
  */
234
235
  set: function (axisAlignment) {
235
- this.axisAlignmentProperty = axisAlignment;
236
- this.notifyPropertyChanged(constants_1.PROPERTY.AXIS_ALIGNMENT);
236
+ if (this.axisAlignmentProperty !== axisAlignment) {
237
+ this.axisAlignmentProperty = axisAlignment;
238
+ this.notifyPropertyChanged(constants_1.PROPERTY.AXIS_ALIGNMENT);
239
+ }
237
240
  },
238
241
  enumerable: false,
239
242
  configurable: true
@@ -249,8 +252,10 @@ var AxisBase2D = /** @class */ (function (_super) {
249
252
  * Gets or sets a property which limits {@link AxisCore.visibleRange}, meaning the chart cannot autorange outside that range
250
253
  */
251
254
  set: function (visibleRangeLimit) {
252
- this.visibleRangeLimitProperty = visibleRangeLimit;
253
- this.notifyPropertyChanged(constants_1.PROPERTY.VISIBLE_RANGE_LIMIT);
255
+ if (!NumberRange_1.NumberRange.areEqual(this.visibleRangeLimitProperty, visibleRangeLimit)) {
256
+ this.visibleRangeLimitProperty = visibleRangeLimit;
257
+ this.notifyPropertyChanged(constants_1.PROPERTY.VISIBLE_RANGE_LIMIT);
258
+ }
254
259
  },
255
260
  enumerable: false,
256
261
  configurable: true
@@ -266,8 +271,10 @@ var AxisBase2D = /** @class */ (function (_super) {
266
271
  * Gets or sets a property which, if it is set, will be used as the range when zooming extents, rather than the data max range
267
272
  */
268
273
  set: function (zoomExtentsRange) {
269
- this.zoomExtentsRangeProperty = zoomExtentsRange;
270
- this.notifyPropertyChanged(constants_1.PROPERTY.ZOOMEXTENTS_RANGE);
274
+ if (!NumberRange_1.NumberRange.areEqual(this.zoomExtentsRangeProperty, zoomExtentsRange)) {
275
+ this.zoomExtentsRangeProperty = zoomExtentsRange;
276
+ this.notifyPropertyChanged(constants_1.PROPERTY.ZOOMEXTENTS_RANGE);
277
+ }
271
278
  },
272
279
  enumerable: false,
273
280
  configurable: true
@@ -285,8 +292,10 @@ var AxisBase2D = /** @class */ (function (_super) {
285
292
  * @remarks Center axis uses inner layout strategy
286
293
  */
287
294
  set: function (value) {
288
- this.isInnerAxisProperty = value;
289
- this.notifyPropertyChanged(constants_1.PROPERTY.IS_INNER_AXIS);
295
+ if (this.isInnerAxisProperty !== value) {
296
+ this.isInnerAxisProperty = value;
297
+ this.notifyPropertyChanged(constants_1.PROPERTY.IS_INNER_AXIS);
298
+ }
290
299
  },
291
300
  enumerable: false,
292
301
  configurable: true
@@ -307,15 +316,17 @@ var AxisBase2D = /** @class */ (function (_super) {
307
316
  */
308
317
  set: function (value) {
309
318
  var _this = this;
310
- this.isPrimaryAxisProperty = value;
311
- this.notifyPropertyChanged(constants_1.PROPERTY.IS_PRIMARY_AXIS);
312
- if (value && !this.isStackedAxis) {
313
- var axes = this.isXAxis ? this.parentSurface.xAxes : this.parentSurface.yAxes;
314
- axes.asArray().forEach(function (a) {
315
- if (a !== _this && !a.isStackedAxis) {
316
- a.isPrimaryAxis = false;
317
- }
318
- });
319
+ if (this.isPrimaryAxisProperty !== value) {
320
+ this.isPrimaryAxisProperty = value;
321
+ this.notifyPropertyChanged(constants_1.PROPERTY.IS_PRIMARY_AXIS);
322
+ if (value && !this.isStackedAxis) {
323
+ var axes = this.isXAxis ? this.parentSurface.xAxes : this.parentSurface.yAxes;
324
+ axes.asArray().forEach(function (a) {
325
+ if (a !== _this && !a.isStackedAxis) {
326
+ a.isPrimaryAxis = false;
327
+ }
328
+ });
329
+ }
319
330
  }
320
331
  },
321
332
  enumerable: false,
@@ -337,6 +348,31 @@ var AxisBase2D = /** @class */ (function (_super) {
337
348
  enumerable: false,
338
349
  configurable: true
339
350
  });
351
+ Object.defineProperty(AxisBase2D.prototype, "stackedAxisLength", {
352
+ /** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
353
+ * A plain number will be interpreted as a number of pixels.
354
+ * A number with % will take that percentage of the total length.
355
+ * Stacked axes without a defined length will have the remaining unreserved spaced split between them.
356
+ * @remarks The axis length doesn't include border sizes
357
+ */
358
+ get: function () {
359
+ return this.stackedAxisLengthProperty;
360
+ },
361
+ /** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
362
+ * A plain number will be interpreted as a number of pixels.
363
+ * A number with % will take that percentage of the total length.
364
+ * Stacked axes without a defined length will have the remaining unreserved spaced split between them.
365
+ * @remarks The axis length doesn't include border sizes
366
+ */
367
+ set: function (value) {
368
+ if (this.stackedAxisLengthProperty !== value) {
369
+ this.stackedAxisLengthProperty = value;
370
+ this.notifyPropertyChanged(constants_1.PROPERTY.AXIS_LENGTH);
371
+ }
372
+ },
373
+ enumerable: false,
374
+ configurable: true
375
+ });
340
376
  Object.defineProperty(AxisBase2D.prototype, "axisLength", {
341
377
  /**
342
378
  * Called internally - Gets or sets the length the current Axis. E.g. width of horizontal axis or height of vertical axis.
@@ -351,8 +387,10 @@ var AxisBase2D = /** @class */ (function (_super) {
351
387
  return (_b = this.axisLengthProperty) !== null && _b !== void 0 ? _b : defaultAxisLength;
352
388
  },
353
389
  set: function (value) {
354
- this.axisLengthProperty = value;
355
- this.notifyPropertyChanged(constants_1.PROPERTY.AXIS_LENGTH);
390
+ if (this.axisLengthProperty !== value) {
391
+ this.axisLengthProperty = value;
392
+ this.notifyPropertyChanged(constants_1.PROPERTY.AXIS_LENGTH);
393
+ }
356
394
  },
357
395
  enumerable: false,
358
396
  configurable: true
@@ -369,8 +407,10 @@ var AxisBase2D = /** @class */ (function (_super) {
369
407
  * Gets or sets the offset of the axis position
370
408
  */
371
409
  set: function (value) {
372
- this.offsetProperty = value;
373
- this.notifyPropertyChanged(constants_1.PROPERTY.OFFSET);
410
+ if (this.offsetProperty !== value) {
411
+ this.offsetProperty = value;
412
+ this.notifyPropertyChanged(constants_1.PROPERTY.OFFSET);
413
+ }
374
414
  },
375
415
  enumerable: false,
376
416
  configurable: true
@@ -676,8 +716,15 @@ var AxisBase2D = /** @class */ (function (_super) {
676
716
  }
677
717
  var translatedRange = this.getCurrentCoordinateCalculator().translateBy(pixelsToScroll, startVisibleRange);
678
718
  if (this.visibleRangeLimit) {
679
- if (translatedRange.min < this.visibleRangeLimit.min || translatedRange.max > this.visibleRangeLimit.max) {
680
- return false;
719
+ var limitDelta = 0;
720
+ if (translatedRange.min < this.visibleRangeLimit.min) {
721
+ limitDelta = this.visibleRangeLimit.min - translatedRange.min;
722
+ }
723
+ else if (this.visibleRangeLimit.max < translatedRange.max) {
724
+ limitDelta = this.visibleRangeLimit.max - translatedRange.max;
725
+ }
726
+ if (limitDelta) {
727
+ translatedRange = new NumberRange_1.NumberRange(translatedRange.min + limitDelta, translatedRange.max + limitDelta);
681
728
  }
682
729
  }
683
730
  this.visibleRange = translatedRange;
@@ -275,6 +275,7 @@ export declare abstract class AxisCore implements IAxisParams, IDeletable {
275
275
  protected maxAutoTicksProperty: number;
276
276
  protected visibleRangeAnimationToken: IGenericAnimation;
277
277
  protected readonly defaultVisibleRange: NumberRange;
278
+ protected allowFastMathProperty: boolean;
278
279
  /**
279
280
  * Creates an instance of an {@link AxisCore}
280
281
  * @param options Optional parameters of type {@link IAxisCoreOptions} used to define properties at instantiation time
@@ -290,6 +291,16 @@ export declare abstract class AxisCore implements IAxisParams, IDeletable {
290
291
  * See {@link AxisBase2D.axisAlignment} if you want to set a 2D Axis alignment to the left, right, top or bottom
291
292
  */
292
293
  get isXAxis(): boolean;
294
+ /**
295
+ * When true, 32-bit faster paths for coordinate calculation maths are used. This improves performance in
296
+ * edge-cases where every CPU cycle counts.
297
+ */
298
+ get allowFastMath(): boolean;
299
+ /**
300
+ * When true, 32-bit faster paths for coordinate calculation maths are used. This improves performance in
301
+ * edge-cases where every CPU cycle counts.
302
+ */
303
+ set allowFastMath(allowFastMath: boolean);
293
304
  /**
294
305
  * When true, the axis has a valid {@link AxisCore.visibleRange} which can be drawn
295
306
  * @remarks
@@ -44,7 +44,7 @@ var AxisCore = /** @class */ (function () {
44
44
  * @param options Optional parameters of type {@link IAxisCoreOptions} used to define properties at instantiation time
45
45
  */
46
46
  function AxisCore(options) {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
48
48
  /**
49
49
  * An {@link EventHandler} which fires a callback when the {@link AxisCore.visibleRange} property changes.
50
50
  * @desc
@@ -161,6 +161,7 @@ var AxisCore = /** @class */ (function () {
161
161
  */
162
162
  this.maxAutoTicksProperty = 10;
163
163
  this.defaultVisibleRange = new NumberRange_1.NumberRange(0, 10);
164
+ this.allowFastMathProperty = false;
164
165
  this.visibleRange = (options === null || options === void 0 ? void 0 : options.visibleRange) || this.defaultVisibleRange;
165
166
  this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : this.id;
166
167
  this.growBy = (_b = options === null || options === void 0 ? void 0 : options.growBy) !== null && _b !== void 0 ? _b : this.growBy;
@@ -168,23 +169,24 @@ var AxisCore = /** @class */ (function () {
168
169
  this.isVisible = (_d = options === null || options === void 0 ? void 0 : options.isVisible) !== null && _d !== void 0 ? _d : this.isVisible;
169
170
  this.axisTitle = (_e = options === null || options === void 0 ? void 0 : options.axisTitle) !== null && _e !== void 0 ? _e : this.axisTitle;
170
171
  this.axisTitleStyle = (_f = options === null || options === void 0 ? void 0 : options.axisTitleStyle) !== null && _f !== void 0 ? _f : this.axisTitleStyle;
171
- this.autoTicksProperty = (_g = options === null || options === void 0 ? void 0 : options.autoTicks) !== null && _g !== void 0 ? _g : this.autoTicksProperty;
172
- this.maxAutoTicksProperty = (_h = options === null || options === void 0 ? void 0 : options.maxAutoTicks) !== null && _h !== void 0 ? _h : this.maxAutoTicksProperty;
173
- this.minorsPerMajorProperty = (_j = options === null || options === void 0 ? void 0 : options.minorsPerMajor) !== null && _j !== void 0 ? _j : this.minorsPerMajorProperty;
174
- this.majorDeltaProperty = (_k = options === null || options === void 0 ? void 0 : options.majorDelta) !== null && _k !== void 0 ? _k : this.majorDeltaProperty;
175
- this.minorDeltaProperty = (_l = options === null || options === void 0 ? void 0 : options.minorDelta) !== null && _l !== void 0 ? _l : this.minorDeltaProperty;
176
- this.drawLabelsProperty = (_m = options === null || options === void 0 ? void 0 : options.drawLabels) !== null && _m !== void 0 ? _m : this.drawLabelsProperty;
177
- this.drawMajorTickLinesProperty = (_o = options === null || options === void 0 ? void 0 : options.drawMajorTickLines) !== null && _o !== void 0 ? _o : this.drawMajorTickLinesProperty;
178
- this.drawMinorTickLinesProperty = (_p = options === null || options === void 0 ? void 0 : options.drawMinorTickLines) !== null && _p !== void 0 ? _p : this.drawMinorTickLinesProperty;
179
- this.drawMinorGridLinesProperty = (_q = options === null || options === void 0 ? void 0 : options.drawMinorGridLines) !== null && _q !== void 0 ? _q : this.drawMinorGridLinesProperty;
180
- this.drawMajorGridLinesProperty = (_r = options === null || options === void 0 ? void 0 : options.drawMajorGridLines) !== null && _r !== void 0 ? _r : this.drawMajorGridLinesProperty;
181
- this.majorGridLineStyleProperty = (_s = options === null || options === void 0 ? void 0 : options.majorGridLineStyle) !== null && _s !== void 0 ? _s : this.majorGridLineStyleProperty;
182
- this.minorGridLineStyleProperty = (_t = options === null || options === void 0 ? void 0 : options.minorGridLineStyle) !== null && _t !== void 0 ? _t : this.minorGridLineStyleProperty;
183
- this.majorTickLineStyleProperty = (_u = options === null || options === void 0 ? void 0 : options.majorTickLineStyle) !== null && _u !== void 0 ? _u : this.majorTickLineStyleProperty;
184
- this.minorTickLineStyleProperty = (_v = options === null || options === void 0 ? void 0 : options.minorTickLineStyle) !== null && _v !== void 0 ? _v : this.minorTickLineStyleProperty;
185
- this.drawMajorBandsProperty = (_w = options === null || options === void 0 ? void 0 : options.drawMajorBands) !== null && _w !== void 0 ? _w : this.drawMajorBandsProperty;
186
- this.axisBandsFillProperty = (_x = options === null || options === void 0 ? void 0 : options.axisBandsFill) !== null && _x !== void 0 ? _x : this.axisBandsFillProperty;
187
- this.flippedCoordinatesProperty = (_y = options === null || options === void 0 ? void 0 : options.flippedCoordinates) !== null && _y !== void 0 ? _y : this.flippedCoordinatesProperty;
172
+ this.allowFastMath = (_g = options === null || options === void 0 ? void 0 : options.allowFastMath) !== null && _g !== void 0 ? _g : this.allowFastMathProperty;
173
+ this.autoTicksProperty = (_h = options === null || options === void 0 ? void 0 : options.autoTicks) !== null && _h !== void 0 ? _h : this.autoTicksProperty;
174
+ this.maxAutoTicksProperty = (_j = options === null || options === void 0 ? void 0 : options.maxAutoTicks) !== null && _j !== void 0 ? _j : this.maxAutoTicksProperty;
175
+ this.minorsPerMajorProperty = (_k = options === null || options === void 0 ? void 0 : options.minorsPerMajor) !== null && _k !== void 0 ? _k : this.minorsPerMajorProperty;
176
+ this.majorDeltaProperty = (_l = options === null || options === void 0 ? void 0 : options.majorDelta) !== null && _l !== void 0 ? _l : this.majorDeltaProperty;
177
+ this.minorDeltaProperty = (_m = options === null || options === void 0 ? void 0 : options.minorDelta) !== null && _m !== void 0 ? _m : this.minorDeltaProperty;
178
+ this.drawLabelsProperty = (_o = options === null || options === void 0 ? void 0 : options.drawLabels) !== null && _o !== void 0 ? _o : this.drawLabelsProperty;
179
+ this.drawMajorTickLinesProperty = (_p = options === null || options === void 0 ? void 0 : options.drawMajorTickLines) !== null && _p !== void 0 ? _p : this.drawMajorTickLinesProperty;
180
+ this.drawMinorTickLinesProperty = (_q = options === null || options === void 0 ? void 0 : options.drawMinorTickLines) !== null && _q !== void 0 ? _q : this.drawMinorTickLinesProperty;
181
+ this.drawMinorGridLinesProperty = (_r = options === null || options === void 0 ? void 0 : options.drawMinorGridLines) !== null && _r !== void 0 ? _r : this.drawMinorGridLinesProperty;
182
+ this.drawMajorGridLinesProperty = (_s = options === null || options === void 0 ? void 0 : options.drawMajorGridLines) !== null && _s !== void 0 ? _s : this.drawMajorGridLinesProperty;
183
+ this.majorGridLineStyleProperty = (_t = options === null || options === void 0 ? void 0 : options.majorGridLineStyle) !== null && _t !== void 0 ? _t : this.majorGridLineStyleProperty;
184
+ this.minorGridLineStyleProperty = (_u = options === null || options === void 0 ? void 0 : options.minorGridLineStyle) !== null && _u !== void 0 ? _u : this.minorGridLineStyleProperty;
185
+ this.majorTickLineStyleProperty = (_v = options === null || options === void 0 ? void 0 : options.majorTickLineStyle) !== null && _v !== void 0 ? _v : this.majorTickLineStyleProperty;
186
+ this.minorTickLineStyleProperty = (_w = options === null || options === void 0 ? void 0 : options.minorTickLineStyle) !== null && _w !== void 0 ? _w : this.minorTickLineStyleProperty;
187
+ this.drawMajorBandsProperty = (_x = options === null || options === void 0 ? void 0 : options.drawMajorBands) !== null && _x !== void 0 ? _x : this.drawMajorBandsProperty;
188
+ this.axisBandsFillProperty = (_y = options === null || options === void 0 ? void 0 : options.axisBandsFill) !== null && _y !== void 0 ? _y : this.axisBandsFillProperty;
189
+ this.flippedCoordinatesProperty = (_z = options === null || options === void 0 ? void 0 : options.flippedCoordinates) !== null && _z !== void 0 ? _z : this.flippedCoordinatesProperty;
188
190
  }
189
191
  Object.defineProperty(AxisCore.prototype, "isCategoryAxis", {
190
192
  /**
@@ -208,6 +210,25 @@ var AxisCore = /** @class */ (function () {
208
210
  enumerable: false,
209
211
  configurable: true
210
212
  });
213
+ Object.defineProperty(AxisCore.prototype, "allowFastMath", {
214
+ /**
215
+ * When true, 32-bit faster paths for coordinate calculation maths are used. This improves performance in
216
+ * edge-cases where every CPU cycle counts.
217
+ */
218
+ get: function () {
219
+ return this.allowFastMathProperty;
220
+ },
221
+ /**
222
+ * When true, 32-bit faster paths for coordinate calculation maths are used. This improves performance in
223
+ * edge-cases where every CPU cycle counts.
224
+ */
225
+ set: function (allowFastMath) {
226
+ this.allowFastMathProperty = allowFastMath;
227
+ this.notifyPropertyChanged(constants_1.PROPERTY.ALLOW_FAST_MATH);
228
+ },
229
+ enumerable: false,
230
+ configurable: true
231
+ });
211
232
  /**
212
233
  * When true, the axis has a valid {@link AxisCore.visibleRange} which can be drawn
213
234
  * @remarks
@@ -25,6 +25,7 @@ export declare class AxisRenderer implements IDeletable {
25
25
  private measureTextCanvas;
26
26
  private keepLabelsWithinAxisProperty;
27
27
  private hideOverlappingLabelsProperty;
28
+ private vertices;
28
29
  /**
29
30
  * Creates an instance of a {@link AxisRenderer}
30
31
  * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
@@ -45,6 +45,7 @@ var AxisRenderer = /** @class */ (function () {
45
45
  this.hideOverlappingLabelsProperty = true;
46
46
  this.webAssemblyContext = webAssemblyContext;
47
47
  this.textureManager = new TextureManager_1.TextureManager(webAssemblyContext);
48
+ this.vertices = new webAssemblyContext.VectorColorVertex();
48
49
  if (!app_1.IS_TEST_ENV) {
49
50
  this.measureTextCanvas = document.createElement("canvas");
50
51
  this.measureTextCanvas.width = 1;
@@ -55,6 +56,7 @@ var AxisRenderer = /** @class */ (function () {
55
56
  AxisRenderer.prototype.delete = function () {
56
57
  this.measureTextCanvas = undefined;
57
58
  this.textureManager = (0, Deleter_1.deleteSafe)(this.textureManager);
59
+ this.vertices = (0, Deleter_1.deleteSafe)(this.vertices);
58
60
  };
59
61
  /**
60
62
  * Called when the {@link AxisRenderer} is attached to an {@link AxisBase2D | Axis}
@@ -311,7 +313,6 @@ var AxisRenderer = /** @class */ (function () {
311
313
  return;
312
314
  var viewRect = this.viewRect;
313
315
  var tickSize = tickStyle.tickSize;
314
- var vertices = new this.webAssemblyContext.VectorColorVertex();
315
316
  var isHorizontal = (0, AxisAlignment_1.getIsHorizontal)(axisAlignment);
316
317
  if (isHorizontal === undefined) {
317
318
  return;
@@ -347,17 +348,16 @@ var AxisRenderer = /** @class */ (function () {
347
348
  }
348
349
  }
349
350
  var vertex = new _this.webAssemblyContext.SCRTColorVertex(x1, y1);
350
- vertices.push_back(vertex);
351
+ _this.vertices.push_back(vertex);
351
352
  vertex.delete();
352
353
  var vertex2 = new _this.webAssemblyContext.SCRTColorVertex(x2, y2);
353
- vertices.push_back(vertex2);
354
+ _this.vertices.push_back(vertex2);
354
355
  vertex2.delete();
355
356
  });
356
357
  var leftOffset = viewRect.left - (isHorizontal ? axisOffset : 0);
357
358
  var topOffset = viewRect.top - (isHorizontal ? 0 : axisOffset);
358
- renderContext.drawLinesNative(vertices, pen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, leftOffset, topOffset);
359
- vertices.clear();
360
- vertices.delete();
359
+ renderContext.drawLinesNative(this.vertices, pen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, leftOffset, topOffset);
360
+ this.vertices.clear();
361
361
  };
362
362
  /**
363
363
  * Called internally - draws axis labels when needed, for example for line annotations
@@ -367,22 +367,49 @@ var AxisRenderer = /** @class */ (function () {
367
367
  return undefined;
368
368
  var nativeContext = renderContext.getNativeContext();
369
369
  var _a = this.textureManager.createSimpleTextTexture(displayValue, __assign(__assign({}, textStyle), { padding: new Thickness_1.Thickness(2, 2, 2, 2) }), fill), bitmapTexture = _a.bitmapTexture, textureHeight = _a.textureHeight, textureWidth = _a.textureWidth;
370
+ var canvas = {
371
+ height: this.parentAxis.parentSurface.domCanvas2D.height,
372
+ width: this.parentAxis.parentSurface.domCanvas2D.width
373
+ };
374
+ var getPosition = function (viewRectSize, coord, canvasSize, textureSize$) {
375
+ if (viewRectSize + coord < textureSize$ / 2) {
376
+ return 0;
377
+ }
378
+ else if (viewRectSize + coord > canvasSize - textureSize$ / 2) {
379
+ return canvasSize - textureSize$;
380
+ }
381
+ else {
382
+ return viewRectSize + coord - textureSize$ / 2;
383
+ }
384
+ };
370
385
  var xPosition, yPosition;
371
386
  if (axisAlignment === AxisAlignment_1.EAxisAlignment.Bottom) {
372
- xPosition = this.viewRect.x + coord - textureWidth / 2;
387
+ xPosition = getPosition(this.viewRect.x, coord, canvas.width, textureWidth);
373
388
  yPosition = this.viewRect.y;
389
+ if (canvas.height - yPosition < textureHeight) {
390
+ yPosition = canvas.height - textureHeight;
391
+ }
374
392
  }
375
393
  else if (axisAlignment === AxisAlignment_1.EAxisAlignment.Top) {
376
- xPosition = this.viewRect.x + coord - textureWidth / 2;
394
+ xPosition = getPosition(this.viewRect.x, coord, canvas.width, textureWidth);
377
395
  yPosition = this.viewRect.y + this.viewRect.height - textureHeight;
396
+ if (this.parentAxis.axisLayoutState.axisSize < textureHeight) {
397
+ yPosition = 0;
398
+ }
378
399
  }
379
400
  else if (axisAlignment === AxisAlignment_1.EAxisAlignment.Left) {
380
401
  xPosition = this.viewRect.x + this.viewRect.width - textureWidth;
381
- yPosition = this.viewRect.y + coord - textureHeight / 2;
402
+ yPosition = getPosition(this.viewRect.y, coord, canvas.height, textureHeight);
403
+ if (this.parentAxis.axisLayoutState.axisSize < textureWidth) {
404
+ xPosition = 0;
405
+ }
382
406
  }
383
407
  else if (axisAlignment === AxisAlignment_1.EAxisAlignment.Right) {
384
408
  xPosition = this.viewRect.x;
385
- yPosition = this.viewRect.y + coord - textureHeight / 2;
409
+ yPosition = getPosition(this.viewRect.y, coord, canvas.height, textureHeight);
410
+ if (canvas.width - xPosition < textureWidth) {
411
+ xPosition = canvas.width - textureWidth;
412
+ }
386
413
  }
387
414
  nativeContext.DrawTexture(bitmapTexture, Math.round(xPosition), Math.round(yPosition), textureWidth, textureHeight);
388
415
  bitmapTexture.delete();
@@ -6,11 +6,30 @@ import { AxisBase2D, IAxisBase2dOptions } from "./AxisBase2D";
6
6
  import { ILabel2DOptions } from "./LabelProvider/LabelProviderBase2D";
7
7
  export declare type TCategoryCoordCalc = CategoryCoordinateCalculator | FlippedCategoryCoordinateCalculator;
8
8
  export interface ICategoryAxisBaseOptions extends IAxisBase2dOptions, ILabel2DOptions {
9
+ /**
10
+ * The default x values to use if no series or data is added to the chart.
11
+ * The tick values shown will depend on the visible range, which for category axis is by index, not by value.
12
+ * eg if you want default values [10, 20, 30, 40] you would need to set visibleRange: new NumberRange(0,3)
13
+ * By default it will start at 0 and increment by 1, up to the size of the visible range.
14
+ * To change the start and step set defaultXStart and defaultXStep
15
+ */
16
+ defaultXValues?: number[];
17
+ /**
18
+ * The starting value for default x values. See defaultXValues
19
+ */
20
+ defaultXStart?: number;
21
+ /**
22
+ * The step size for default x values. See defaultXValues
23
+ */
24
+ defaultXStep?: number;
9
25
  }
10
26
  /**
11
27
  * @summary A 2D Chart Category Axis Base type
12
28
  */
13
29
  export declare abstract class CategoryAxisBase extends AxisBase2D {
30
+ private defaultXValuesProperty;
31
+ private defaultXStartProperty;
32
+ private defaultXStepProperty;
14
33
  /**
15
34
  * Creates an instance of a {@link CategoryAxisBase}
16
35
  * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
@@ -22,6 +41,38 @@ export declare abstract class CategoryAxisBase extends AxisBase2D {
22
41
  * @inheritDoc
23
42
  */
24
43
  get isCategoryAxis(): boolean;
44
+ /**
45
+ * The default x values to use if no series or data is added to the chart.
46
+ * The tick values shown will depend on the visible range, which for category axis is by index, not by value.
47
+ * eg if you want default values [10, 20, 30, 40] you would need to set visibleRange: new NumberRange(0,3)
48
+ * By default it will start at 0 and increment by 1, up to the size of the visible range.
49
+ * To change the start and step set defaultXStart and defaultXStep
50
+ */
51
+ get defaultXValues(): number[];
52
+ /**
53
+ * The default x values to use if no series or data is added to the chart.
54
+ * The tick values shown will depend on the visible range, which for category axis is by index, not by value.
55
+ * eg if you want default values [10, 20, 30, 40] you would need to set visibleRange: new NumberRange(0,3)
56
+ * By default it will start at 0 and increment by 1, up to the size of the visible range.
57
+ * To change the start and step set defaultXStart and defaultXStep
58
+ */
59
+ set defaultXValues(values: number[]);
60
+ /**
61
+ * The starting value for default x values. See defaultXValues
62
+ */
63
+ get defaultXStart(): number;
64
+ /**
65
+ * The starting value for default x values. See defaultXValues
66
+ */
67
+ set defaultXStart(value: number);
68
+ /**
69
+ * The step size for default x values. See defaultXValues
70
+ */
71
+ get defaultXStep(): number;
72
+ /**
73
+ * The step size for default x values. See defaultXValues
74
+ */
75
+ set defaultXStep(value: number);
25
76
  /**
26
77
  * @inheritDoc
27
78
  */
@@ -19,6 +19,7 @@ exports.CategoryAxisBase = void 0;
19
19
  var Deleter_1 = require("../../../Core/Deleter");
20
20
  var NumberRange_1 = require("../../../Core/NumberRange");
21
21
  var SeriesType_1 = require("../../../types/SeriesType");
22
+ var appendDoubleVectorFromJsArray_1 = require("../../../utils/ccall/appendDoubleVectorFromJsArray");
22
23
  var CategoryCoordinateCalculator_1 = require("../../Numerics/CoordinateCalculators/CategoryCoordinateCalculator");
23
24
  var FlippedCategoryCoordinateCalculator_1 = require("../../Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator");
24
25
  var NumericTickProvider_1 = require("../../Numerics/TickProviders/NumericTickProvider");
@@ -36,7 +37,14 @@ var CategoryAxisBase = /** @class */ (function (_super) {
36
37
  * @param options Optional parameters of type {@link ICategoryAxisBaseOptions} used to configure the axis at instantiation time
37
38
  */
38
39
  function CategoryAxisBase(webAssemblyContext, options) {
40
+ var _a, _b, _c;
39
41
  var _this = _super.call(this, webAssemblyContext, options) || this;
42
+ _this.defaultXValuesProperty = [];
43
+ _this.defaultXStartProperty = 0;
44
+ _this.defaultXStepProperty = 1;
45
+ _this.defaultXValuesProperty = (_a = options === null || options === void 0 ? void 0 : options.defaultXValues) !== null && _a !== void 0 ? _a : _this.defaultXValuesProperty;
46
+ _this.defaultXStartProperty = (_b = options === null || options === void 0 ? void 0 : options.defaultXStart) !== null && _b !== void 0 ? _b : _this.defaultXStartProperty;
47
+ _this.defaultXStepProperty = (_c = options === null || options === void 0 ? void 0 : options.defaultXStep) !== null && _c !== void 0 ? _c : _this.defaultXStepProperty;
40
48
  _this.tickProvider = new NumericTickProvider_1.NumericTickProvider(_this.webAssemblyContext2D);
41
49
  _this.deltaCalculator = new CategoryDeltaCalculator_1.CategoryDeltaCalculator(_this.webAssemblyContext2D);
42
50
  return _this;
@@ -51,6 +59,68 @@ var CategoryAxisBase = /** @class */ (function (_super) {
51
59
  enumerable: false,
52
60
  configurable: true
53
61
  });
62
+ Object.defineProperty(CategoryAxisBase.prototype, "defaultXValues", {
63
+ /**
64
+ * The default x values to use if no series or data is added to the chart.
65
+ * The tick values shown will depend on the visible range, which for category axis is by index, not by value.
66
+ * eg if you want default values [10, 20, 30, 40] you would need to set visibleRange: new NumberRange(0,3)
67
+ * By default it will start at 0 and increment by 1, up to the size of the visible range.
68
+ * To change the start and step set defaultXStart and defaultXStep
69
+ */
70
+ get: function () {
71
+ return this.defaultXValuesProperty;
72
+ },
73
+ /**
74
+ * The default x values to use if no series or data is added to the chart.
75
+ * The tick values shown will depend on the visible range, which for category axis is by index, not by value.
76
+ * eg if you want default values [10, 20, 30, 40] you would need to set visibleRange: new NumberRange(0,3)
77
+ * By default it will start at 0 and increment by 1, up to the size of the visible range.
78
+ * To change the start and step set defaultXStart and defaultXStep
79
+ */
80
+ set: function (values) {
81
+ this.defaultXValuesProperty = values;
82
+ if (this.invalidateParentCallback)
83
+ this.invalidateParentCallback();
84
+ },
85
+ enumerable: false,
86
+ configurable: true
87
+ });
88
+ Object.defineProperty(CategoryAxisBase.prototype, "defaultXStart", {
89
+ /**
90
+ * The starting value for default x values. See defaultXValues
91
+ */
92
+ get: function () {
93
+ return this.defaultXStartProperty;
94
+ },
95
+ /**
96
+ * The starting value for default x values. See defaultXValues
97
+ */
98
+ set: function (value) {
99
+ this.defaultXStartProperty = value;
100
+ if (this.invalidateParentCallback)
101
+ this.invalidateParentCallback();
102
+ },
103
+ enumerable: false,
104
+ configurable: true
105
+ });
106
+ Object.defineProperty(CategoryAxisBase.prototype, "defaultXStep", {
107
+ /**
108
+ * The step size for default x values. See defaultXValues
109
+ */
110
+ get: function () {
111
+ return this.defaultXStepProperty;
112
+ },
113
+ /**
114
+ * The step size for default x values. See defaultXValues
115
+ */
116
+ set: function (value) {
117
+ this.defaultXStepProperty = value;
118
+ if (this.invalidateParentCallback)
119
+ this.invalidateParentCallback();
120
+ },
121
+ enumerable: false,
122
+ configurable: true
123
+ });
54
124
  /**
55
125
  * @inheritDoc
56
126
  */
@@ -60,16 +130,6 @@ var CategoryAxisBase = /** @class */ (function (_super) {
60
130
  var coordCalc = this.getCurrentCoordinateCalculatorInternal();
61
131
  var scs = this.parentSurface;
62
132
  var renderableSeries = scs.renderableSeries.asArray().find(function (rs) { return rs.xAxisId === _this.id; });
63
- if (!renderableSeries) {
64
- throw new Error("category x axis with id=".concat(this.id, " should have renderable series"));
65
- }
66
- if (!renderableSeries.hasDataSeries()) {
67
- throw new Error("category x axis with id=".concat(this.id, " should have data series"));
68
- }
69
- var dataSeriesLength = renderableSeries.getDataSeriesValuesCount();
70
- if (dataSeriesLength === 0) {
71
- throw new Error("category x axis with id=".concat(this.id, " should have data series count > 0"));
72
- }
73
133
  this.setBaseXValues(coordCalc, renderableSeries);
74
134
  this.coordCalcCache = coordCalc;
75
135
  };
@@ -84,16 +144,6 @@ var CategoryAxisBase = /** @class */ (function (_super) {
84
144
  var shouldFlip = !(this.isXAxis !== this.flippedCoordinates);
85
145
  var scs = this.parentSurface;
86
146
  var renderableSeries = scs.renderableSeries.asArray().find(function (rs) { return rs.xAxisId === _this.id; });
87
- if (!renderableSeries) {
88
- throw new Error("category x axis with id=".concat(this.id, " should have renderable series"));
89
- }
90
- if (!renderableSeries.hasDataSeries()) {
91
- throw new Error("category x axis with id=".concat(this.id, " should have data series"));
92
- }
93
- var dataSeriesLength = renderableSeries.getDataSeriesValuesCount();
94
- if (dataSeriesLength === 0) {
95
- throw new Error("category x axis with id=".concat(this.id, " should have data series count > 0"));
96
- }
97
147
  var coordCalc = shouldFlip
98
148
  ? new FlippedCategoryCoordinateCalculator_1.FlippedCategoryCoordinateCalculator(this.webAssemblyContext2D, size, 0, 0, min, max, this.offset)
99
149
  : new CategoryCoordinateCalculator_1.CategoryCoordinateCalculator(this.webAssemblyContext2D, size, 0, 0, min, max, this.offset);
@@ -128,6 +178,21 @@ var CategoryAxisBase = /** @class */ (function (_super) {
128
178
  return Math.min(Math.max(1, this.maxAutoTicks), coordCalc.baseXValues.size());
129
179
  };
130
180
  CategoryAxisBase.prototype.setBaseXValues = function (coordCalc, renderableSeries) {
181
+ var _this = this;
182
+ if (!(renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.dataSeries)) {
183
+ if (!coordCalc.baseXValues) {
184
+ var defaultBaseXValues = new this.webAssemblyContext2D.SCRTDoubleVector();
185
+ if (this.defaultXValues && this.defaultXValues.length > 0) {
186
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, defaultBaseXValues, this.defaultXValues);
187
+ }
188
+ else {
189
+ var xValues = Array.from(Array(this.visibleRange.diff), function (_, i) { return _this.defaultXStart + i * _this.defaultXStep; });
190
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, defaultBaseXValues, xValues);
191
+ }
192
+ coordCalc.baseXValues = defaultBaseXValues;
193
+ }
194
+ return;
195
+ }
131
196
  if (renderableSeries.type === SeriesType_1.ESeriesType.UniformHeatmapSeries) {
132
197
  throw Error("Category Axis is not supported for UniformHeatmapRenderableSeries");
133
198
  }
@@ -5,6 +5,11 @@ import { TGridLineStyle, TTextStyle, TTickLineStyle } from "./AxisCore";
5
5
  * Optional parameters passed to {@link AxisCore} constructor to set defaults at construction time
6
6
  */
7
7
  export interface IAxisCoreOptions {
8
+ /**
9
+ * When true, 32-bit faster paths for coordinate calculation maths are used. This improves performance in
10
+ * edge-cases where every CPU cycle counts.
11
+ */
12
+ allowFastMath?: boolean;
8
13
  /**
9
14
  * The VisibleRange is the range of the Axis (min to max).
10
15
  * @description
@@ -72,7 +72,7 @@ var clearCacheByStyle = function (styleId) {
72
72
  }
73
73
  }
74
74
  };
75
- var maxSize = 100;
75
+ var maxSize = 200;
76
76
  var minAge = 1000 * 60;
77
77
  var lastUsed = 0;
78
78
  var getMaxSize = function () { return maxSize; };
@@ -88,7 +88,7 @@ var pruneCache = function () {
88
88
  if (labelCacheByTextAndStyle.size > maxSize && lastUsed < latest) {
89
89
  try {
90
90
  // remove more than we need so we do this less.
91
- var toRemove = (labelCacheByTextAndStyle.size - maxSize) * 2;
91
+ var toRemove = Math.min(Math.floor(labelCacheByTextAndStyle.size / 2), (labelCacheByTextAndStyle.size - maxSize) * 2);
92
92
  // Sort the items by LastUsed ascending
93
93
  var labels = Array.from(labelCacheByTextAndStyle.entries());
94
94
  labels.sort(function (a, b) { return a[1].lastUsed - b[1].lastUsed; });