scichart 2.0.2228 → 2.1.2273

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 (199) hide show
  1. package/Charting/ChartModifiers/DataPointSelectionModifier.js +0 -1
  2. package/Charting/ChartModifiers/LegendModifier.d.ts +2 -2
  3. package/Charting/ChartModifiers/RolloverModifier.d.ts +5 -3
  4. package/Charting/ChartModifiers/RolloverModifier.js +38 -80
  5. package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
  6. package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
  7. package/Charting/Model/BaseDataSeries.d.ts +42 -15
  8. package/Charting/Model/BaseDataSeries.js +77 -28
  9. package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
  10. package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
  11. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
  12. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
  13. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
  14. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
  15. package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
  16. package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
  17. package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
  18. package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
  19. package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
  20. package/Charting/Model/IDataSeries.d.ts +37 -5
  21. package/Charting/Model/OhlcDataSeries.d.ts +12 -11
  22. package/Charting/Model/OhlcDataSeries.js +37 -34
  23. package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
  24. package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
  25. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
  26. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
  27. package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
  28. package/Charting/Model/PointSeries/IPointSeries.js +2 -0
  29. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
  30. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
  31. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
  32. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
  33. package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
  34. package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
  35. package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
  36. package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
  37. package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
  38. package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
  39. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
  40. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
  41. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
  42. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
  43. package/Charting/Model/XyDataSeries.d.ts +3 -2
  44. package/Charting/Model/XyDataSeries.js +22 -22
  45. package/Charting/Model/XyyDataSeries.d.ts +5 -5
  46. package/Charting/Model/XyyDataSeries.js +24 -21
  47. package/Charting/Model/XyzDataSeries.d.ts +5 -5
  48. package/Charting/Model/XyzDataSeries.js +24 -21
  49. package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
  50. package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
  51. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
  52. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
  53. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
  54. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
  55. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
  56. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +234 -0
  57. package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
  58. package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
  59. package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
  60. package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
  61. package/Charting/Services/RenderPassData.d.ts +6 -1
  62. package/Charting/Services/RenderPassData.js +5 -1
  63. package/Charting/Services/RenderPassInfo.d.ts +18 -0
  64. package/Charting/Services/RenderPassInfo.js +14 -0
  65. package/Charting/Services/SciChartRenderer.d.ts +14 -1
  66. package/Charting/Services/SciChartRenderer.js +125 -31
  67. package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
  68. package/Charting/Visuals/Axis/AxisCore.js +39 -18
  69. package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
  70. package/Charting/Visuals/Axis/AxisRenderer.js +6 -6
  71. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +52 -0
  72. package/Charting/Visuals/Axis/CategoryAxisBase.js +94 -20
  73. package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
  74. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +7 -4
  75. package/Charting/Visuals/Axis/NumericAxis.js +2 -2
  76. package/Charting/Visuals/Axis/constants.d.ts +1 -0
  77. package/Charting/Visuals/Axis/constants.js +1 -0
  78. package/Charting/Visuals/Legend/SciChartLegend.d.ts +6 -0
  79. package/Charting/Visuals/Legend/SciChartLegend.js +30 -13
  80. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +20 -6
  81. package/Charting/Visuals/Legend/SciChartLegendBase.js +22 -4
  82. package/Charting/Visuals/Legend/SciChartPieLegend.d.ts +2 -0
  83. package/Charting/Visuals/Legend/SciChartPieLegend.js +17 -6
  84. package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
  85. package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
  86. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
  87. package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
  88. package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
  89. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
  90. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
  91. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
  92. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
  93. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
  94. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
  95. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
  96. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
  97. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
  98. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +113 -0
  99. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +42 -6
  100. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +129 -21
  101. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
  102. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
  103. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
  104. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
  105. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
  106. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
  107. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
  108. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
  109. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
  110. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +31 -19
  111. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
  112. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
  113. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +6 -12
  114. package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
  115. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
  116. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
  117. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
  118. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
  119. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +11 -2
  120. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +17 -0
  121. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
  122. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
  123. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
  124. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
  125. package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
  126. package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
  127. package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
  128. package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
  129. package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
  130. package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
  131. package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
  132. package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
  133. package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
  134. package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
  135. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
  136. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
  137. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
  138. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
  139. package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
  140. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
  141. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
  142. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
  143. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
  144. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
  145. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
  146. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +2 -7
  147. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
  148. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
  149. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
  150. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
  151. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
  152. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
  153. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
  154. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
  155. package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
  156. package/Charting/Visuals/RenderableSeries/constants.js +3 -0
  157. package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
  158. package/Charting/Visuals/SciChartDefaults.js +9 -1
  159. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +4 -2
  160. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +46 -32
  161. package/Charting/Visuals/licenseManager2D.js +21 -20
  162. package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
  163. package/Charting/Visuals/licenseManager2dState.js +12 -0
  164. package/Charting/Visuals/loader.js +2 -0
  165. package/Charting/Visuals/sciChartInitCommon.js +4 -0
  166. package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
  167. package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
  168. package/Core/BuildStamp.d.ts +1 -1
  169. package/Core/BuildStamp.js +2 -2
  170. package/Core/OneTimePerformanceWarning.d.ts +6 -0
  171. package/Core/OneTimePerformanceWarning.js +19 -0
  172. package/Core/storage/localStorageApi.d.ts +9 -0
  173. package/Core/storage/localStorageApi.js +32 -0
  174. package/README.md +223 -1
  175. package/_wasm/scichart.browser.js +1 -1
  176. package/_wasm/scichart2d.js +12 -12
  177. package/_wasm/scichart2d.wasm +0 -0
  178. package/_wasm/scichart3d.js +13 -13
  179. package/_wasm/scichart3d.wasm +0 -0
  180. package/constants/performanceWarnings.d.ts +5 -0
  181. package/constants/performanceWarnings.js +8 -0
  182. package/package.json +1 -1
  183. package/types/SearchMode.d.ts +21 -0
  184. package/types/SearchMode.js +25 -0
  185. package/types/TSciChart.d.ts +144 -40
  186. package/types/TSciChart3D.d.ts +66 -28
  187. package/utils/array.d.ts +7 -0
  188. package/utils/array.js +19 -1
  189. package/utils/calcAverage.d.ts +2 -2
  190. package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
  191. package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
  192. package/utils/hash.d.ts +7 -0
  193. package/utils/hash.js +35 -0
  194. package/utils/tooltip.d.ts +42 -0
  195. package/utils/tooltip.js +119 -0
  196. package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
  197. package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
  198. package/utils/performance.d.ts +0 -5
  199. package/utils/performance.js +0 -11
@@ -410,7 +410,6 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
410
410
  topYData = yCalc.getDataValue(_this.startPoint.y);
411
411
  }
412
412
  if (rs.dataSeries.type === IDataSeries_1.EDataSeriesType.HeatmapUniform) {
413
- var heatmapSeries = rs.dataSeries;
414
413
  // TODO: Heatmap series
415
414
  }
416
415
  else {
@@ -34,9 +34,9 @@ export interface ILegendModifierOptions extends IChartModifierBaseOptions {
34
34
  */
35
35
  margin?: number;
36
36
  /**
37
- * The parent div element Id, the Legend will be appended to this element
37
+ * The parent div element Id or reference, the Legend will be appended to this element
38
38
  */
39
- placementDivId?: string;
39
+ placementDivId?: string | HTMLDivElement;
40
40
  }
41
41
  /**
42
42
  * The LegendModifier provides interactive legend behavior on a 2D {@link SciChartSurface}
@@ -49,6 +49,7 @@ export declare type TTooltipProps = {
49
49
  isCategoryAxis: boolean;
50
50
  isY1: boolean;
51
51
  height: number;
52
+ width: number;
52
53
  seriesInfo: SeriesInfo;
53
54
  };
54
55
  /**
@@ -237,15 +238,16 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
237
238
  * @param pixelRatio
238
239
  * @param isY1
239
240
  */
240
- export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, rolloverProps: RolloverModifierRenderableSeriesProps, seriesViewRect: Rect, xValue: number, yValue: number, absoluteXCoord: number, absoluteYCoord: number, hitTestInfo: HitTestInfo, pixelRatio: number, isY1?: boolean) => TTooltipProps;
241
+ export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, rolloverProps: RolloverModifierRenderableSeriesProps, seriesViewRect: Rect, xValue: number, yValue: number, absoluteXCoord: number, absoluteYCoord: number, hitTestInfo: HitTestInfo, pixelRatio: number, isY1?: boolean, isVerticalChart?: boolean) => TTooltipProps;
241
242
  /**
242
243
  * @ignore
243
244
  * @description Used internally, calculates tooltip positions to avoid overlapping
244
245
  * @param tooltipArray
245
246
  * @param allowTooltipOverlapping
246
- * @param tooltipPaddingTop
247
+ * @param spacing
247
248
  * @param seriesViewRect
248
249
  * @param pixelRatio
250
+ * @param isVerticalChart
249
251
  */
250
- export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, tooltipPaddingTop: number, seriesViewRect: Rect, pixelRatio: number) => TTooltipProps[];
252
+ export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, spacing: number, seriesViewRect: Rect, pixelRatio: number, isVerticalChart?: boolean) => TTooltipProps[];
251
253
  export {};
@@ -20,6 +20,7 @@ var classFactory_1 = require("../../Builder/classFactory");
20
20
  var BaseType_1 = require("../../types/BaseType");
21
21
  var ChartModifierType_1 = require("../../types/ChartModifierType");
22
22
  var SeriesType_1 = require("../../types/SeriesType");
23
+ var tooltip_1 = require("../../utils/tooltip");
23
24
  var translate_1 = require("../../utils/translate");
24
25
  var AnnotationBase_1 = require("../Visuals/Annotations/AnnotationBase");
25
26
  var LineAnnotation_1 = require("../Visuals/Annotations/LineAnnotation");
@@ -50,7 +51,7 @@ var EMousePosition;
50
51
  EMousePosition["SeriesArea"] = "SeriesArea";
51
52
  })(EMousePosition || (EMousePosition = {}));
52
53
  /** @ignore */
53
- var TOOLTIP_PADDING_TOP = 4;
54
+ var TOOLTIP_SPACING = 4;
54
55
  /**
55
56
  * The RolloverModifier provides tooltip and cursor behavior on a 2D {@link SciChartSurface}
56
57
  * within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
@@ -518,7 +519,7 @@ var RolloverModifier = /** @class */ (function (_super) {
518
519
  if (isVisible) {
519
520
  var absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.yCoord : hitTestInfo.xCoord;
520
521
  var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.yCoord;
521
- var tooltipProps = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO);
522
+ var tooltipProps = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, false, _this.isVerticalChart());
522
523
  if (tooltipProps)
523
524
  tooltipArray.push(tooltipProps);
524
525
  }
@@ -528,7 +529,7 @@ var RolloverModifier = /** @class */ (function (_super) {
528
529
  if (isVisibleY1) {
529
530
  var absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.y1Coord : hitTestInfo.xCoord;
530
531
  var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.y1Coord;
531
- var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps1, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.y1Value, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, true);
532
+ var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps1, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.y1Value, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, true, _this.isVerticalChart());
532
533
  if (tooltipY1Props)
533
534
  tooltipArray.push(tooltipY1Props);
534
535
  }
@@ -538,7 +539,7 @@ var RolloverModifier = /** @class */ (function (_super) {
538
539
  var orderedTooltipArray = tooltipArray.sort(function (a, b) {
539
540
  return a.yCoord > b.yCoord ? 1 : b.yCoord > a.yCoord ? -1 : 0;
540
541
  });
541
- var tooltipPositions = (0, exports.calcTooltipPositions)(orderedTooltipArray, this.allowTooltipOverlapping, TOOLTIP_PADDING_TOP * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.parentSurface.seriesViewRect, DpiHelper_1.DpiHelper.PIXEL_RATIO);
542
+ var tooltipPositions = (0, exports.calcTooltipPositions)(orderedTooltipArray, this.allowTooltipOverlapping, TOOLTIP_SPACING * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.parentSurface.seriesViewRect, DpiHelper_1.DpiHelper.PIXEL_RATIO, this.isVerticalChart());
542
543
  tooltipPositions.forEach(function (el) {
543
544
  var rs = rsList[el.index];
544
545
  var showTooltip = _this.showTooltip && el.seriesInfo.isHit;
@@ -589,8 +590,9 @@ exports.RolloverModifier = RolloverModifier;
589
590
  * @param pixelRatio
590
591
  * @param isY1
591
592
  */
592
- var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValue, yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, pixelRatio, isY1) {
593
+ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValue, yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, pixelRatio, isY1, isVerticalChart) {
593
594
  if (isY1 === void 0) { isY1 = false; }
595
+ if (isVerticalChart === void 0) { isVerticalChart = false; }
594
596
  var visibleRange = rs.yAxis.visibleRange;
595
597
  var isVisible = visibleRange.min <= yValue && yValue <= visibleRange.max;
596
598
  if (isVisible) {
@@ -601,13 +603,21 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
601
603
  var scaledHeight = height * pixelRatio;
602
604
  var distTop = absoluteYCoord;
603
605
  var distBottom = seriesViewRect.height - absoluteYCoord;
606
+ var defaultVerticalShift = 5 * pixelRatio;
604
607
  var xCoordShift = seriesViewRect.width - absoluteXCoord < scaledWidth ? -width : 5;
605
- var yCoordShift = -height / 2;
606
- if (distTop < scaledHeight / 2) {
607
- yCoordShift = -distTop / pixelRatio;
608
+ var yCoordShift = isVerticalChart ? defaultVerticalShift : -height / 2;
609
+ if (isVerticalChart) {
610
+ if (distBottom < scaledHeight + defaultVerticalShift) {
611
+ yCoordShift = ((scaledHeight + defaultVerticalShift) / pixelRatio) * -1;
612
+ }
608
613
  }
609
- else if (distBottom < scaledHeight / 2) {
610
- yCoordShift = -(scaledHeight - distBottom) / pixelRatio;
614
+ else {
615
+ if (distTop < scaledHeight / 2) {
616
+ yCoordShift = -distTop / pixelRatio;
617
+ }
618
+ else if (distBottom < scaledHeight / 2) {
619
+ yCoordShift = -(scaledHeight - distBottom) / pixelRatio;
620
+ }
611
621
  }
612
622
  var newRecord = {
613
623
  index: index,
@@ -621,6 +631,7 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
621
631
  xCoordShift: xCoordShift,
622
632
  yCoordShift: yCoordShift,
623
633
  height: scaledHeight,
634
+ width: scaledWidth,
624
635
  seriesInfo: seriesInfo
625
636
  };
626
637
  return newRecord;
@@ -628,85 +639,32 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
628
639
  return undefined;
629
640
  };
630
641
  exports.calcTooltipProps = calcTooltipProps;
631
- /** @ignore */
632
- var spreadTooltips = function (tooltipArray, totalTooltipsHeight, startY, endY, pixelRatio) {
633
- var currentTotalPadding = endY - startY - totalTooltipsHeight;
634
- var currentPadding = currentTotalPadding / (tooltipArray.length - 1);
635
- tooltipArray.reduce(function (tooltipTopYCoord, tooltip) {
636
- tooltip.yCoordShift = (tooltipTopYCoord - tooltip.yCoord) / pixelRatio;
637
- return tooltipTopYCoord + tooltip.height + currentPadding;
638
- }, startY);
639
- };
640
642
  /**
641
643
  * @ignore
642
644
  * @description Used internally, calculates tooltip positions to avoid overlapping
643
645
  * @param tooltipArray
644
646
  * @param allowTooltipOverlapping
645
- * @param tooltipPaddingTop
647
+ * @param spacing
646
648
  * @param seriesViewRect
647
649
  * @param pixelRatio
650
+ * @param isVerticalChart
648
651
  */
649
- var calcTooltipPositions = function (tooltipArray, allowTooltipOverlapping, tooltipPaddingTop, seriesViewRect, pixelRatio) {
652
+ var calcTooltipPositions = function (tooltipArray, allowTooltipOverlapping, spacing, seriesViewRect, pixelRatio, isVerticalChart) {
653
+ if (isVerticalChart === void 0) { isVerticalChart = false; }
654
+ var positionProperties = (0, tooltip_1.getTooltipPositionProperties)(isVerticalChart);
655
+ var hasOverlap = (0, tooltip_1.checkHasOverlap)(tooltipArray, spacing, pixelRatio, positionProperties);
650
656
  var length = tooltipArray.length;
651
- if (!allowTooltipOverlapping && length >= 2) {
652
- var checkHasOverlap = function () {
653
- for (var i = 0; i < length - 1; i++) {
654
- var tooltip0 = tooltipArray[i];
655
- var scaledHeightTooltip0 = tooltip0.height;
656
- var scaledYShiftTooltip0 = tooltip0.yCoordShift * pixelRatio;
657
- var bottomYTooltip0 = tooltip0.yCoord + scaledHeightTooltip0 + scaledYShiftTooltip0;
658
- var tooltip1 = tooltipArray[i + 1];
659
- var scaledYShiftTooltip1 = tooltip1.yCoordShift * pixelRatio;
660
- var topYTooltip1 = tooltip1.yCoord + scaledYShiftTooltip1;
661
- var diff = topYTooltip1 - bottomYTooltip0;
662
- if (diff < tooltipPaddingTop)
663
- return true;
664
- }
665
- return false;
666
- };
667
- if (checkHasOverlap()) {
668
- var totalTooltipsHeight = tooltipArray.reduce(function (prev, cur) { return prev + cur.height; }, 0);
669
- var totalPadding = (length - 1) * tooltipPaddingTop;
670
- var totalTooltipsHeightWithPadding = totalTooltipsHeight + totalPadding;
671
- var notEnoughViewRectHeight = seriesViewRect.height <= totalTooltipsHeightWithPadding;
672
- if (notEnoughViewRectHeight) {
673
- var deltaYCoord = tooltipArray[length - 1].yCoord - tooltipArray[0].yCoord;
674
- var centerY = tooltipArray[0].yCoord + deltaYCoord / 2;
675
- var initialY_1 = centerY - totalTooltipsHeight / 2;
676
- tooltipArray.reduce(function (prevSum, cur, index, arr) {
677
- var sum = index === 0 ? initialY_1 : prevSum + arr[index - 1].height + tooltipPaddingTop;
678
- // need to get not scaled value
679
- cur.yCoordShift = (sum - cur.yCoord) / pixelRatio;
680
- return sum;
681
- }, 0);
682
- }
683
- else {
684
- var firstTooltip = tooltipArray[0];
685
- var lastTooltip = tooltipArray[length - 1];
686
- var startY = firstTooltip.yCoord + firstTooltip.yCoordShift * pixelRatio;
687
- var endY = lastTooltip.yCoord + lastTooltip.yCoordShift * pixelRatio + lastTooltip.height;
688
- var isEnoughHeight = endY - startY >= totalTooltipsHeightWithPadding;
689
- if (isEnoughHeight) {
690
- spreadTooltips(tooltipArray, totalTooltipsHeight, startY, endY, pixelRatio);
691
- }
692
- else {
693
- var additionalHeightNeeded = totalTooltipsHeightWithPadding - (endY - startY);
694
- var availableHeightFromStart = startY;
695
- var availableHeightFromEnd = seriesViewRect.height - endY;
696
- var newStartY = startY - additionalHeightNeeded / 2;
697
- var newEndY = endY + additionalHeightNeeded / 2;
698
- if (availableHeightFromStart < additionalHeightNeeded / 2) {
699
- newStartY = 0;
700
- newEndY = endY + (additionalHeightNeeded - availableHeightFromStart);
701
- }
702
- else if (availableHeightFromEnd < additionalHeightNeeded / 2) {
703
- newStartY = startY - (additionalHeightNeeded - availableHeightFromEnd);
704
- newEndY = seriesViewRect.height;
705
- }
706
- spreadTooltips(tooltipArray, totalTooltipsHeight, newStartY, newEndY, pixelRatio);
707
- }
708
- }
709
- }
657
+ if (!allowTooltipOverlapping && length >= 2 && hasOverlap) {
658
+ var spreadMap_1 = (0, tooltip_1.spreadTooltips)(tooltipArray, pixelRatio, positionProperties, spacing, seriesViewRect);
659
+ tooltipArray.forEach(function (tooltip) {
660
+ tooltip[positionProperties.shiftPropertyName] = spreadMap_1.get(tooltip.index);
661
+ });
662
+ }
663
+ // centering for vertical charts without overlapping
664
+ if (isVerticalChart && !hasOverlap) {
665
+ tooltipArray.forEach(function (tooltip) {
666
+ return (tooltip[positionProperties.shiftPropertyName] = -(tooltip.width / 2) / pixelRatio);
667
+ });
710
668
  }
711
669
  return tooltipArray;
712
670
  };
@@ -39,6 +39,7 @@ export declare class WebGlRenderContext2D implements IRenderContext2D {
39
39
  private readonly layers;
40
40
  private readonly webAssemblyContext;
41
41
  private readonly effects;
42
+ private nativeContext;
42
43
  /**
43
44
  * Creates an instance of the WebGlRenderContext2D
44
45
  * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing native methods and access to our WebGL2 Engine
@@ -43,7 +43,10 @@ var WebGlRenderContext2D = /** @class */ (function () {
43
43
  * Get the native {@link SCRTRenderContext} for direct access to SciChart's WebAssembly Visual Xccelerator engine
44
44
  */
45
45
  WebGlRenderContext2D.prototype.getNativeContext = function () {
46
- return this.webAssemblyContext.SCRTGetMainRenderContext2D();
46
+ if (!this.nativeContext) {
47
+ this.nativeContext = this.webAssemblyContext.SCRTGetMainRenderContext2D();
48
+ }
49
+ return this.nativeContext;
47
50
  };
48
51
  /**
49
52
  * Draw lines: grid lines, etc.
@@ -1,13 +1,19 @@
1
1
  import { EventHandler } from "../../Core/EventHandler";
2
2
  import { NumberRange } from "../../Core/NumberRange";
3
- import { DoubleVector, TSciChart } from "../../types/TSciChart";
3
+ import { ESearchMode } from "../../types/SearchMode";
4
+ import { SCRTDoubleVector, TSciChart } from "../../types/TSciChart";
4
5
  import { SeriesAnimation } from "../Visuals/RenderableSeries/Animations/SeriesAnimation";
6
+ import { IDataDistributionCalculator } from "./DataDistributionCalculator/IDataDistributionCalculator";
5
7
  import { EDataChangeType, EDataSeriesType, EDataSeriesValueType, IDataChangeArgs, IDataSeries } from "./IDataSeries";
6
8
  import { IMetadataGenerator, IPointMetadata } from "./IPointMetadata";
7
9
  /**
8
10
  * Options to pass to the {@link BaseDataSeries} constructor
9
11
  */
10
12
  export interface IBaseDataSeriesOptions {
13
+ /**
14
+ * A unique Id for the {@link IDataSeries}
15
+ */
16
+ id?: string;
11
17
  /**
12
18
  * The DataSeries name, used in legends, tooltips to identify the chart series
13
19
  */
@@ -19,6 +25,14 @@ export interface IBaseDataSeriesOptions {
19
25
  * algorithms for zooming, panning and ranging and ensure best performance.
20
26
  */
21
27
  dataIsSortedInX?: boolean;
28
+ /**
29
+ * When true, the Data is evenly spaced in X.
30
+ * @remarks
31
+ * The user must specify this flag (defaults to true) in order to choose the correct, and
32
+ * fastest algorithms for drawing, indexing and ranging. If you experience glitches or
33
+ * strange drawing, it may be because you have set data with uneven spacing in X but not set this flag.
34
+ */
35
+ dataEvenlySpacedInX?: boolean;
22
36
  /**
23
37
  * Gets or sets whether the Y data contains NaN values.
24
38
  */
@@ -49,6 +63,10 @@ export declare abstract class BaseDataSeries implements IDataSeries {
49
63
  abstract readonly type: EDataSeriesType;
50
64
  /** @inheritDoc */
51
65
  readonly dataChanged: EventHandler<IDataChangeArgs>;
66
+ /** @inheritDoc */
67
+ readonly id: string;
68
+ /** @inheritDoc */
69
+ readonly dataDistributionCalculator: IDataDistributionCalculator;
52
70
  minXSpacing: number;
53
71
  /**
54
72
  * If set, these will be included in the serialised definition, so that it can be used with sharedData
@@ -61,28 +79,30 @@ export declare abstract class BaseDataSeries implements IDataSeries {
61
79
  /**
62
80
  * X vector with initial animation values
63
81
  */
64
- xInitialAnimationValues: DoubleVector;
82
+ xInitialAnimationValues: SCRTDoubleVector;
65
83
  /**
66
84
  * Y vector with initial animation values
67
85
  */
68
- yInitialAnimationValues: DoubleVector;
86
+ yInitialAnimationValues: SCRTDoubleVector;
69
87
  /**
70
88
  * X vector with final animation values
71
89
  */
72
- xFinalAnimationValues: DoubleVector;
90
+ xFinalAnimationValues: SCRTDoubleVector;
73
91
  /**
74
92
  * Y vector with final animation values
75
93
  */
76
- yFinalAnimationValues: DoubleVector;
77
- protected xValues: DoubleVector;
78
- protected yValues: DoubleVector;
79
- protected indexes: DoubleVector;
94
+ yFinalAnimationValues: SCRTDoubleVector;
95
+ protected xValues: SCRTDoubleVector;
96
+ protected yValues: SCRTDoubleVector;
97
+ protected indexes: SCRTDoubleVector;
80
98
  protected isDeleted: boolean;
81
99
  private dataSeriesNameProperty;
82
100
  private isSortedProperty;
83
101
  private containsNaNProperty;
102
+ private isEvenlySpacedProperty;
84
103
  private metadataProperty;
85
104
  private metadataGeneratorProperty;
105
+ private changeCountProperty;
86
106
  /**
87
107
  * Creates an instance of {@link BaseDataSeries}
88
108
  * @param webAssemblyContext the {@link TSciChart | SciChart WebAssembly Context} containing native methods
@@ -91,7 +111,7 @@ export declare abstract class BaseDataSeries implements IDataSeries {
91
111
  */
92
112
  protected constructor(webAssemblyContext: TSciChart, options?: IBaseDataSeriesOptions);
93
113
  /** @inheritDoc */
94
- abstract clear(): void;
114
+ clear(): void;
95
115
  /** @inheritDoc */
96
116
  get containsNaN(): boolean;
97
117
  /** @inheritDoc */
@@ -101,6 +121,10 @@ export declare abstract class BaseDataSeries implements IDataSeries {
101
121
  /** @inheritDoc */
102
122
  set isSorted(isSorted: boolean);
103
123
  /** @inheritDoc */
124
+ get isEvenlySpaced(): boolean;
125
+ /** @inheritDoc */
126
+ set isEvenlySpaced(isSorted: boolean);
127
+ /** @inheritDoc */
104
128
  get dataSeriesName(): string;
105
129
  /** @inheritDoc */
106
130
  set dataSeriesName(dataSeriesName: string);
@@ -109,11 +133,11 @@ export declare abstract class BaseDataSeries implements IDataSeries {
109
133
  /** @inheritDoc */
110
134
  getIsDeleted(): boolean;
111
135
  /** @inheritDoc */
112
- getNativeIndexes(): DoubleVector;
136
+ getNativeIndexes(): SCRTDoubleVector;
113
137
  /** @inheritDoc */
114
- getNativeXValues(): DoubleVector;
138
+ getNativeXValues(): SCRTDoubleVector;
115
139
  /** @inheritDoc */
116
- getNativeYValues(): DoubleVector;
140
+ getNativeYValues(): SCRTDoubleVector;
117
141
  /** @inheritDoc */
118
142
  delete(): void;
119
143
  /**
@@ -126,7 +150,8 @@ export declare abstract class BaseDataSeries implements IDataSeries {
126
150
  getXRange(dataSeriesValueType?: EDataSeriesValueType): NumberRange;
127
151
  /** @inheritDoc */
128
152
  getWindowedYRange(xRange: NumberRange, getPositiveRange: boolean, isXCategoryAxis?: boolean, dataSeriesValueType?: EDataSeriesValueType): NumberRange;
129
- getIndicesRange(xRange: NumberRange): NumberRange;
153
+ /** @inheritDoc */
154
+ getIndicesRange(xRange: NumberRange, isCategoryData?: boolean, downSearchMode?: ESearchMode, upSearchMode?: ESearchMode): NumberRange;
130
155
  /** @inheritDoc */
131
156
  get hasValues(): boolean;
132
157
  /**
@@ -169,6 +194,8 @@ export declare abstract class BaseDataSeries implements IDataSeries {
169
194
  updateAnimationProperties(progress: number, animation: SeriesAnimation): void;
170
195
  /** @inheritDoc */
171
196
  toJSON(excludeData?: boolean): any;
197
+ /** @inheritDoc */
198
+ get changeCount(): number;
172
199
  protected validateIndex(index: number, message?: string): void;
173
200
  protected setMetadataAt(index: number, metadata: IPointMetadata): void;
174
201
  protected appendMetadata(metadata: IPointMetadata): void;
@@ -178,8 +205,8 @@ export declare abstract class BaseDataSeries implements IDataSeries {
178
205
  protected removeMetadataAt(index: number): void;
179
206
  protected removeMetadataRange(startIndex: number, count: number): void;
180
207
  protected setMetadata(value: IPointMetadata[]): void;
181
- protected getXValues(dataSeriesValueType: EDataSeriesValueType): DoubleVector;
208
+ protected getXValues(dataSeriesValueType: EDataSeriesValueType): SCRTDoubleVector;
182
209
  private fillMetadataIfUndefined;
183
210
  private getYValues;
184
211
  }
185
- export declare const getWindowedYRange: (webAssemblyContext: TSciChart, xValues: DoubleVector, yValues: DoubleVector, xRange: NumberRange, getPositiveRange: boolean, isXCategoryAxis: boolean, isSorted: boolean) => NumberRange;
212
+ export declare const getWindowedYRange: (webAssemblyContext: TSciChart, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, xRange: NumberRange, getPositiveRange: boolean, isXCategoryAxis: boolean, isSorted: boolean) => NumberRange;
@@ -26,9 +26,11 @@ var Deleter_1 = require("../../Core/Deleter");
26
26
  var EventHandler_1 = require("../../Core/EventHandler");
27
27
  var NumberRange_1 = require("../../Core/NumberRange");
28
28
  var BaseType_1 = require("../../types/BaseType");
29
- var fillDoubleVectorFromJsArray_1 = require("../../utils/ccall/fillDoubleVectorFromJsArray");
29
+ var SearchMode_1 = require("../../types/SearchMode");
30
+ var guid_1 = require("../../utils/guid");
30
31
  var isRealNumber_1 = require("../../utils/isRealNumber");
31
32
  var animationHelpers_1 = require("../Visuals/RenderableSeries/Animations/animationHelpers");
33
+ var DataDistributionCalculator_1 = require("./DataDistributionCalculator/DataDistributionCalculator");
32
34
  var IDataSeries_1 = require("./IDataSeries");
33
35
  var IPointMetadata_1 = require("./IPointMetadata");
34
36
  /**
@@ -49,28 +51,34 @@ var BaseDataSeries = /** @class */ (function () {
49
51
  * @param options the {@link IBaseDataSeriesOptions} which can be passed to config the DataSeries at construct time
50
52
  */
51
53
  function BaseDataSeries(webAssemblyContext, options) {
52
- var _a, _b, _c;
54
+ var _a, _b, _c, _d, _e;
53
55
  /** @inheritDoc */
54
56
  this.dataChanged = new EventHandler_1.EventHandler();
57
+ /** @inheritDoc */
58
+ this.dataDistributionCalculator = new DataDistributionCalculator_1.DataDistributionCalculator();
55
59
  this.minXSpacing = 0;
56
- this.isSortedProperty = true;
57
- this.containsNaNProperty = true;
60
+ this.isSortedProperty = undefined;
61
+ this.containsNaNProperty = undefined;
62
+ this.isEvenlySpacedProperty = false;
58
63
  this.metadataGeneratorProperty = undefined;
64
+ this.changeCountProperty = 0;
59
65
  this.webAssemblyContext = webAssemblyContext;
60
- this.xValues = new webAssemblyContext.DoubleVector();
61
- this.yValues = new webAssemblyContext.DoubleVector();
62
- this.indexes = new webAssemblyContext.DoubleVector();
63
- this.xInitialAnimationValues = new webAssemblyContext.DoubleVector();
64
- this.yInitialAnimationValues = new webAssemblyContext.DoubleVector();
65
- this.xFinalAnimationValues = new webAssemblyContext.DoubleVector();
66
- this.yFinalAnimationValues = new webAssemblyContext.DoubleVector();
67
- this.dataSeriesNameProperty = (_a = options === null || options === void 0 ? void 0 : options.dataSeriesName) !== null && _a !== void 0 ? _a : this.dataSeriesNameProperty;
66
+ this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
67
+ this.xValues = new webAssemblyContext.SCRTDoubleVector();
68
+ this.yValues = new webAssemblyContext.SCRTDoubleVector();
69
+ this.indexes = new webAssemblyContext.SCRTDoubleVector();
70
+ this.xInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
71
+ this.yInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
72
+ this.xFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
73
+ this.yFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
74
+ this.dataSeriesNameProperty = (_b = options === null || options === void 0 ? void 0 : options.dataSeriesName) !== null && _b !== void 0 ? _b : this.dataSeriesNameProperty;
68
75
  this.isSorted = (options === null || options === void 0 ? void 0 : options.dataIsSortedInX) !== undefined ? options === null || options === void 0 ? void 0 : options.dataIsSortedInX : this.isSortedProperty;
69
- this.containsNaN = (_b = options === null || options === void 0 ? void 0 : options.containsNaN) !== null && _b !== void 0 ? _b : this.containsNaNProperty;
76
+ this.containsNaN = (_c = options === null || options === void 0 ? void 0 : options.containsNaN) !== null && _c !== void 0 ? _c : this.containsNaNProperty;
77
+ this.isEvenlySpaced = (_d = options === null || options === void 0 ? void 0 : options.dataEvenlySpacedInX) !== null && _d !== void 0 ? _d : this.isEvenlySpacedProperty;
70
78
  if (options === null || options === void 0 ? void 0 : options.metadata) {
71
79
  if ("type" in options.metadata) {
72
80
  this.metadataGeneratorProperty = (0, classFactory_1.createType)(BaseType_1.EBaseType.MetadataGenerator, options.metadata.type, webAssemblyContext, options.metadata.data);
73
- options.metadata = (_c = this.metadataGeneratorProperty) === null || _c === void 0 ? void 0 : _c.getMetadata();
81
+ options.metadata = (_e = this.metadataGeneratorProperty) === null || _e === void 0 ? void 0 : _e.getMetadata();
74
82
  }
75
83
  else if (!Array.isArray(options === null || options === void 0 ? void 0 : options.metadata)) {
76
84
  this.metadataGeneratorProperty = new IPointMetadata_1.TemplateMetadataGenerator(options === null || options === void 0 ? void 0 : options.metadata);
@@ -78,6 +86,12 @@ var BaseDataSeries = /** @class */ (function () {
78
86
  }
79
87
  }
80
88
  }
89
+ /** @inheritDoc */
90
+ BaseDataSeries.prototype.clear = function () {
91
+ var _a;
92
+ (_a = this.indexes) === null || _a === void 0 ? void 0 : _a.clear();
93
+ this.dataDistributionCalculator.clear(this.isSorted, this.containsNaN);
94
+ };
81
95
  Object.defineProperty(BaseDataSeries.prototype, "containsNaN", {
82
96
  /** @inheritDoc */
83
97
  get: function () {
@@ -86,6 +100,9 @@ var BaseDataSeries = /** @class */ (function () {
86
100
  /** @inheritDoc */
87
101
  set: function (containsNaN) {
88
102
  this.containsNaNProperty = containsNaN;
103
+ if (containsNaN !== undefined) {
104
+ this.dataDistributionCalculator.setContainsNaN(containsNaN);
105
+ }
89
106
  this.notifyDataChanged(IDataSeries_1.EDataChangeType.Property, undefined, undefined, "containsNaN");
90
107
  },
91
108
  enumerable: false,
@@ -99,11 +116,27 @@ var BaseDataSeries = /** @class */ (function () {
99
116
  /** @inheritDoc */
100
117
  set: function (isSorted) {
101
118
  this.isSortedProperty = isSorted;
119
+ if (isSorted !== undefined) {
120
+ this.dataDistributionCalculator.setIsSortedAscending(isSorted);
121
+ }
102
122
  this.notifyDataChanged(IDataSeries_1.EDataChangeType.Property, undefined, undefined, "isSorted");
103
123
  },
104
124
  enumerable: false,
105
125
  configurable: true
106
126
  });
127
+ Object.defineProperty(BaseDataSeries.prototype, "isEvenlySpaced", {
128
+ /** @inheritDoc */
129
+ get: function () {
130
+ return this.isEvenlySpacedProperty;
131
+ },
132
+ /** @inheritDoc */
133
+ set: function (isSorted) {
134
+ this.isEvenlySpacedProperty = isSorted;
135
+ this.notifyDataChanged(IDataSeries_1.EDataChangeType.Property, undefined, undefined, "isEvenlySpaced");
136
+ },
137
+ enumerable: false,
138
+ configurable: true
139
+ });
107
140
  Object.defineProperty(BaseDataSeries.prototype, "dataSeriesName", {
108
141
  /** @inheritDoc */
109
142
  get: function () {
@@ -135,9 +168,7 @@ var BaseDataSeries = /** @class */ (function () {
135
168
  }
136
169
  var indexes = this.indexes;
137
170
  if (indexes.size() < this.count()) {
138
- var newIndexesLength = this.count() - indexes.size();
139
- var indexValues = Array.from(Array(newIndexesLength), function (_, i) { return i + indexes.size(); });
140
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, this.indexes, indexValues);
171
+ this.webAssemblyContext.SCRTFillVectorSequential(this.indexes, this.count());
141
172
  }
142
173
  return this.indexes;
143
174
  };
@@ -165,6 +196,7 @@ var BaseDataSeries = /** @class */ (function () {
165
196
  * Call to notify subscribers of {@link dataChanged} that the data has changed and {@link SciChartSurface} needs redrawing
166
197
  */
167
198
  BaseDataSeries.prototype.notifyDataChanged = function (changeType, index, count, name) {
199
+ this.changeCountProperty++;
168
200
  this.dataChanged.raiseEvent({ changeType: changeType, index: index, count: count });
169
201
  };
170
202
  Object.defineProperty(BaseDataSeries.prototype, "xRange", {
@@ -187,14 +219,18 @@ var BaseDataSeries = /** @class */ (function () {
187
219
  else if (this.count() > 1) {
188
220
  var min = xValues.get(0);
189
221
  var max = xValues.get(this.count() - 1);
190
- if (!this.isSorted) {
191
- for (var i = 0; i < this.count(); i++) {
192
- if (xValues.get(i) < min) {
193
- min = xValues.get(i);
194
- }
195
- if (xValues.get(i) > max) {
196
- max = xValues.get(i);
222
+ if (!this.dataDistributionCalculator.isSortedAscending) {
223
+ var minMax = void 0;
224
+ try {
225
+ minMax = this.webAssemblyContext.NumberUtil.MinMax(this.getNativeXValues());
226
+ if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
227
+ return new NumberRange_1.NumberRange(0, 0);
197
228
  }
229
+ min = minMax.minD;
230
+ max = minMax.maxD;
231
+ }
232
+ finally {
233
+ (0, Deleter_1.deleteSafe)(minMax);
198
234
  }
199
235
  }
200
236
  if (min === max) {
@@ -207,7 +243,7 @@ var BaseDataSeries = /** @class */ (function () {
207
243
  }
208
244
  return new NumberRange_1.NumberRange(min, max);
209
245
  }
210
- return new NumberRange_1.NumberRange();
246
+ return new NumberRange_1.NumberRange(0, 0);
211
247
  };
212
248
  /** @inheritDoc */
213
249
  BaseDataSeries.prototype.getWindowedYRange = function (xRange, getPositiveRange, isXCategoryAxis, dataSeriesValueType) {
@@ -215,11 +251,16 @@ var BaseDataSeries = /** @class */ (function () {
215
251
  if (dataSeriesValueType === void 0) { dataSeriesValueType = IDataSeries_1.EDataSeriesValueType.Default; }
216
252
  var xValues = this.getXValues(dataSeriesValueType);
217
253
  var yValues = this.getYValues(dataSeriesValueType);
218
- return (0, exports.getWindowedYRange)(this.webAssemblyContext, xValues, yValues, xRange, getPositiveRange, isXCategoryAxis, this.isSorted);
254
+ return (0, exports.getWindowedYRange)(this.webAssemblyContext, xValues, yValues, xRange, getPositiveRange, isXCategoryAxis, this.dataDistributionCalculator.isSortedAscending);
219
255
  };
220
- BaseDataSeries.prototype.getIndicesRange = function (xRange) {
256
+ /** @inheritDoc */
257
+ BaseDataSeries.prototype.getIndicesRange = function (xRange, isCategoryData, downSearchMode, upSearchMode) {
258
+ if (isCategoryData === void 0) { isCategoryData = false; }
259
+ if (downSearchMode === void 0) { downSearchMode = SearchMode_1.ESearchMode.RoundDown; }
260
+ if (upSearchMode === void 0) { upSearchMode = SearchMode_1.ESearchMode.RoundUp; }
221
261
  // TODO SearchMode downSearchMode = SearchMode.RoundDown, SearchMode upSearchMode = SearchMode.RoundUp
222
- return getIndicesRange(this.webAssemblyContext, this.xValues, xRange, this.isSorted);
262
+ var vector = isCategoryData ? this.getNativeIndexes() : this.xValues;
263
+ return getIndicesRange(this.webAssemblyContext, vector, xRange, this.dataDistributionCalculator.isSortedAscending);
223
264
  };
224
265
  Object.defineProperty(BaseDataSeries.prototype, "hasValues", {
225
266
  /** @inheritDoc */
@@ -329,6 +370,14 @@ var BaseDataSeries = /** @class */ (function () {
329
370
  metadata: this.metadataGeneratorProperty ? this.metadataGeneratorProperty.toJSON() : this.metadataProperty }, this.dataIds);
330
371
  return options;
331
372
  };
373
+ Object.defineProperty(BaseDataSeries.prototype, "changeCount", {
374
+ /** @inheritDoc */
375
+ get: function () {
376
+ return this.changeCountProperty;
377
+ },
378
+ enumerable: false,
379
+ configurable: true
380
+ });
332
381
  BaseDataSeries.prototype.validateIndex = function (index, message) {
333
382
  if (Math.round(index) !== index) {
334
383
  throw Error("Index must be an integer");