scichart 2.0.2204 → 2.1.2267

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 (233) 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/BrushCache.d.ts +8 -2
  6. package/Charting/Drawing/BrushCache.js +16 -8
  7. package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
  8. package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
  9. package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
  10. package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
  11. package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  12. package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
  13. package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
  14. package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  15. package/Charting/Model/BaseDataSeries.d.ts +42 -15
  16. package/Charting/Model/BaseDataSeries.js +77 -28
  17. package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
  18. package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
  19. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
  20. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
  21. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
  22. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
  23. package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
  24. package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
  25. package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
  26. package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
  27. package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
  28. package/Charting/Model/IDataSeries.d.ts +37 -5
  29. package/Charting/Model/OhlcDataSeries.d.ts +12 -11
  30. package/Charting/Model/OhlcDataSeries.js +47 -44
  31. package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
  32. package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
  33. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
  34. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
  35. package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
  36. package/Charting/Model/PointSeries/IPointSeries.js +2 -0
  37. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
  38. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
  39. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
  40. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
  41. package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
  42. package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
  43. package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
  44. package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
  45. package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
  46. package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
  47. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
  48. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
  49. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
  50. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
  51. package/Charting/Model/XyDataSeries.d.ts +3 -2
  52. package/Charting/Model/XyDataSeries.js +26 -26
  53. package/Charting/Model/XyyDataSeries.d.ts +5 -5
  54. package/Charting/Model/XyyDataSeries.js +30 -27
  55. package/Charting/Model/XyzDataSeries.d.ts +5 -5
  56. package/Charting/Model/XyzDataSeries.js +30 -27
  57. package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
  58. package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
  59. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
  60. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
  61. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
  62. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
  63. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
  64. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +234 -0
  65. package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
  66. package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
  67. package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
  68. package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
  69. package/Charting/Services/RenderPassData.d.ts +6 -1
  70. package/Charting/Services/RenderPassData.js +5 -1
  71. package/Charting/Services/RenderPassInfo.d.ts +18 -0
  72. package/Charting/Services/RenderPassInfo.js +14 -0
  73. package/Charting/Services/SciChartRenderer.d.ts +14 -1
  74. package/Charting/Services/SciChartRenderer.js +125 -31
  75. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
  76. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +1 -1
  77. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
  78. package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
  79. package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
  80. package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
  81. package/Charting/Visuals/Axis/AxisCore.js +39 -18
  82. package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
  83. package/Charting/Visuals/Axis/AxisRenderer.js +37 -10
  84. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +51 -0
  85. package/Charting/Visuals/Axis/CategoryAxisBase.js +85 -20
  86. package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
  87. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +7 -4
  88. package/Charting/Visuals/Axis/NumericAxis.js +2 -2
  89. package/Charting/Visuals/Axis/constants.d.ts +1 -0
  90. package/Charting/Visuals/Axis/constants.js +1 -0
  91. package/Charting/Visuals/Legend/SciChartLegend.d.ts +6 -0
  92. package/Charting/Visuals/Legend/SciChartLegend.js +30 -13
  93. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +20 -6
  94. package/Charting/Visuals/Legend/SciChartLegendBase.js +22 -4
  95. package/Charting/Visuals/Legend/SciChartPieLegend.d.ts +2 -0
  96. package/Charting/Visuals/Legend/SciChartPieLegend.js +17 -6
  97. package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
  98. package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
  99. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
  100. package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
  101. package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
  102. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
  103. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
  104. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
  105. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
  106. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
  107. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
  108. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
  109. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
  110. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
  111. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +113 -0
  112. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +42 -6
  113. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +129 -21
  114. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
  115. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
  116. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
  117. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
  118. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
  119. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
  120. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
  121. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
  122. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
  123. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +31 -19
  124. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
  125. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
  126. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -15
  127. package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
  128. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
  129. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
  130. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
  131. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
  132. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +11 -2
  133. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +17 -0
  134. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
  135. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
  136. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
  137. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
  138. package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
  139. package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
  140. package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
  141. package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
  142. package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
  143. package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
  144. package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
  145. package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
  146. package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
  147. package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
  148. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
  149. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
  150. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
  151. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
  152. package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
  153. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
  154. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
  155. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
  156. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
  157. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
  158. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
  159. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +0 -6
  160. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
  161. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
  162. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
  163. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
  164. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
  165. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
  166. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
  167. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
  168. package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
  169. package/Charting/Visuals/RenderableSeries/constants.js +3 -0
  170. package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
  171. package/Charting/Visuals/SciChartDefaults.js +9 -1
  172. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +4 -2
  173. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +46 -32
  174. package/Charting/Visuals/SciChartSurface.d.ts +4 -4
  175. package/Charting/Visuals/SciChartSurface.js +18 -11
  176. package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
  177. package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
  178. package/Charting/Visuals/createMaster.d.ts +1 -1
  179. package/Charting/Visuals/createMaster.js +11 -6
  180. package/Charting/Visuals/createSingle.d.ts +1 -1
  181. package/Charting/Visuals/createSingle.js +2 -2
  182. package/Charting/Visuals/licenseManager2D.js +21 -20
  183. package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
  184. package/Charting/Visuals/licenseManager2dState.js +12 -0
  185. package/Charting/Visuals/loader.js +2 -0
  186. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  187. package/Charting/Visuals/sciChartInitCommon.js +22 -12
  188. package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
  189. package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
  190. package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
  191. package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
  192. package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
  193. package/Charting3D/Visuals/createMaster3d.js +11 -6
  194. package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
  195. package/Charting3D/Visuals/createSingle3d.js +2 -2
  196. package/Core/BuildStamp.d.ts +1 -1
  197. package/Core/BuildStamp.js +2 -2
  198. package/Core/NumberRange.d.ts +1 -0
  199. package/Core/NumberRange.js +8 -0
  200. package/Core/OneTimePerformanceWarning.d.ts +6 -0
  201. package/Core/OneTimePerformanceWarning.js +19 -0
  202. package/Core/storage/localStorageApi.d.ts +9 -0
  203. package/Core/storage/localStorageApi.js +32 -0
  204. package/README.md +223 -1
  205. package/_wasm/scichart.browser.js +1 -1
  206. package/_wasm/scichart2d.js +95 -95
  207. package/_wasm/scichart2d.wasm +0 -0
  208. package/_wasm/scichart3d.js +13 -13
  209. package/_wasm/scichart3d.wasm +0 -0
  210. package/constants/performanceWarnings.d.ts +5 -0
  211. package/constants/performanceWarnings.js +8 -0
  212. package/package.json +1 -1
  213. package/types/NumberArray.d.ts +1 -0
  214. package/types/NumberArray.js +5 -1
  215. package/types/SearchMode.d.ts +21 -0
  216. package/types/SearchMode.js +25 -0
  217. package/types/TSciChart.d.ts +144 -40
  218. package/types/TSciChart3D.d.ts +66 -28
  219. package/types/TStackedAxisLength.d.ts +4 -0
  220. package/types/TStackedAxisLength.js +4 -0
  221. package/utils/array.d.ts +7 -0
  222. package/utils/array.js +19 -1
  223. package/utils/calcAverage.d.ts +2 -2
  224. package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
  225. package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
  226. package/utils/hash.d.ts +7 -0
  227. package/utils/hash.js +35 -0
  228. package/utils/tooltip.d.ts +42 -0
  229. package/utils/tooltip.js +119 -0
  230. package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
  231. package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
  232. package/utils/performance.d.ts +0 -5
  233. package/utils/performance.js +0 -11
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataDistributionCalculator = void 0;
4
+ var performanceWarnings_1 = require("../../../constants/performanceWarnings");
5
+ var array_1 = require("../../../utils/array");
6
+ var DataDistributionCalculator = /** @class */ (function () {
7
+ function DataDistributionCalculator() {
8
+ this.containsNanProperty = false;
9
+ this.isSortedAscendingProperty = true;
10
+ }
11
+ Object.defineProperty(DataDistributionCalculator.prototype, "containsNaN", {
12
+ /** @inheritDoc */
13
+ get: function () {
14
+ return this.containsNanProperty;
15
+ },
16
+ enumerable: false,
17
+ configurable: true
18
+ });
19
+ Object.defineProperty(DataDistributionCalculator.prototype, "isSortedAscending", {
20
+ /** @inheritDoc */
21
+ get: function () {
22
+ return this.isSortedAscendingProperty;
23
+ },
24
+ enumerable: false,
25
+ configurable: true
26
+ });
27
+ /** @inheritDoc */
28
+ DataDistributionCalculator.prototype.onAppend = function (isSorted, containsNaN, currentXValues, newXValues, newYValues) {
29
+ if (containsNaN !== undefined) {
30
+ this.containsNanProperty = containsNaN;
31
+ }
32
+ else {
33
+ if (this.containsNanProperty === false) {
34
+ this.containsNanProperty = newYValues.some(function (y) { return isNaN(y); });
35
+ if (this.containsNanProperty === false)
36
+ performanceWarnings_1.performanceWarnings.dataDistributionFlagNaN.warn();
37
+ }
38
+ }
39
+ if (isSorted !== undefined) {
40
+ this.isSortedAscendingProperty = isSorted;
41
+ }
42
+ else {
43
+ if (this.isSortedAscendingProperty === true) {
44
+ var newSectionSortedAsc = (0, array_1.isArraySorted)(newXValues);
45
+ var oldSectionLength = currentXValues.size();
46
+ var newSectionAfterOldSection = oldSectionLength === 0 || currentXValues.get(oldSectionLength - 1) < newXValues[0];
47
+ this.isSortedAscendingProperty = newSectionSortedAsc && newSectionAfterOldSection;
48
+ if (this.isSortedAscendingProperty === true)
49
+ performanceWarnings_1.performanceWarnings.dataDistributionFlagSortedAscending.warn();
50
+ }
51
+ }
52
+ };
53
+ /** @inheritDoc */
54
+ DataDistributionCalculator.prototype.onInsert = function (isSorted, containsNaN, currentXValues, newXValues, newYValues, indexWhereInserted) {
55
+ if (containsNaN !== undefined) {
56
+ this.containsNanProperty = containsNaN;
57
+ }
58
+ else {
59
+ if (this.containsNanProperty === false) {
60
+ this.containsNanProperty = newYValues.some(function (y) { return isNaN(y); });
61
+ if (this.containsNanProperty === false)
62
+ performanceWarnings_1.performanceWarnings.dataDistributionFlagNaN.warn();
63
+ }
64
+ }
65
+ if (isSorted !== undefined) {
66
+ this.isSortedAscendingProperty = isSorted;
67
+ }
68
+ else {
69
+ if (this.isSortedAscendingProperty === true && newXValues) {
70
+ var newSectionSortedAsc = (0, array_1.isArraySorted)(newXValues);
71
+ var valueOnTheLeftAscending = indexWhereInserted === 0 || currentXValues.get(indexWhereInserted - 1) < newXValues[0];
72
+ var valueOnTheRightAscending = indexWhereInserted >= currentXValues.size() ||
73
+ newXValues[newXValues.length - 1] < currentXValues.get(indexWhereInserted);
74
+ this.isSortedAscendingProperty =
75
+ newSectionSortedAsc && valueOnTheLeftAscending && valueOnTheRightAscending;
76
+ if (this.isSortedAscendingProperty === true)
77
+ performanceWarnings_1.performanceWarnings.dataDistributionFlagSortedAscending.warn();
78
+ }
79
+ }
80
+ };
81
+ /** @inheritDoc */
82
+ DataDistributionCalculator.prototype.onUpdate = function (isSorted, containsNaN, currentXValues, newXValues, newYValues, indexWhereUpdated) {
83
+ if (containsNaN !== undefined) {
84
+ this.containsNanProperty = containsNaN;
85
+ }
86
+ else {
87
+ if (this.containsNanProperty === false) {
88
+ this.containsNanProperty = newYValues.some(function (y) { return isNaN(y); });
89
+ }
90
+ }
91
+ if (isSorted !== undefined) {
92
+ this.isSortedAscendingProperty = isSorted;
93
+ }
94
+ else {
95
+ if (this.isSortedAscendingProperty === true && newXValues) {
96
+ var newSectionSortedAsc = (0, array_1.isArraySorted)(newXValues);
97
+ var valueOnTheLeftAscending = indexWhereUpdated === 0 || currentXValues.get(indexWhereUpdated - 1) < newXValues[0];
98
+ var oldSectionLength = currentXValues.size();
99
+ var rightIndex = indexWhereUpdated + newXValues.length;
100
+ var valueOnTheRightAscending = rightIndex >= oldSectionLength ||
101
+ newXValues[newXValues.length - 1] < currentXValues.get(rightIndex);
102
+ this.isSortedAscendingProperty =
103
+ newSectionSortedAsc && valueOnTheLeftAscending && valueOnTheRightAscending;
104
+ }
105
+ }
106
+ };
107
+ /** @inheritDoc */
108
+ DataDistributionCalculator.prototype.clear = function (isSorted, containsNaN) {
109
+ this.isSortedAscendingProperty = isSorted !== null && isSorted !== void 0 ? isSorted : true;
110
+ this.containsNanProperty = containsNaN !== null && containsNaN !== void 0 ? containsNaN : false;
111
+ };
112
+ /** @inheritDoc */
113
+ DataDistributionCalculator.prototype.setIsSortedAscending = function (value) {
114
+ this.isSortedAscendingProperty = value;
115
+ };
116
+ /** @inheritDoc */
117
+ DataDistributionCalculator.prototype.setContainsNaN = function (value) {
118
+ this.containsNanProperty = value;
119
+ };
120
+ return DataDistributionCalculator;
121
+ }());
122
+ exports.DataDistributionCalculator = DataDistributionCalculator;
@@ -0,0 +1,57 @@
1
+ import { NumberArray } from "../../../types/NumberArray";
2
+ import { SCRTDoubleVector } from "../../../types/TSciChart";
3
+ export interface IDataDistributionCalculator {
4
+ /**
5
+ * isSortedAscending Data Distribution flag
6
+ */
7
+ readonly isSortedAscending: boolean;
8
+ /**
9
+ * containsNaN Data Distribution flag
10
+ */
11
+ readonly containsNaN: boolean;
12
+ /**
13
+ * Called when X Values are appended. Should update the Data Distribution flags
14
+ * @param isSorted
15
+ * @param containsNaN
16
+ * @param currentXValues
17
+ * @param newXValues
18
+ * @param newYValues
19
+ */
20
+ onAppend(isSorted: boolean, containsNaN: boolean, currentXValues: SCRTDoubleVector, newXValues: NumberArray, newYValues: NumberArray): void;
21
+ /**
22
+ * Called when new values are inserted. Should update the Data Distribution flags
23
+ * @param isSorted
24
+ * @param containsNaN
25
+ * @param currentXValues
26
+ * @param newXValues
27
+ * @param newYValues
28
+ * @param indexWhereInserted
29
+ */
30
+ onInsert(isSorted: boolean, containsNaN: boolean, currentXValues: SCRTDoubleVector, newXValues: NumberArray, newYValues: NumberArray, indexWhereInserted: number): void;
31
+ /**
32
+ * Called when yValues are updated. Should update the Data Distribution flags
33
+ * @param isSorted
34
+ * @param containsNaN
35
+ * @param currentXValues
36
+ * @param newXValues
37
+ * @param newYValues
38
+ * @param indexWhereUpdated
39
+ */
40
+ onUpdate(isSorted: boolean, containsNaN: boolean, currentXValues: SCRTDoubleVector, newXValues: NumberArray, newYValues: NumberArray, indexWhereUpdated: number): void;
41
+ /**
42
+ * Clears the DataDistributionCalculator flags
43
+ * @param isSorted
44
+ * @param containsNaN
45
+ */
46
+ clear(isSorted: boolean, containsNaN: boolean): void;
47
+ /**
48
+ * Called to update isSortedAscending flag manually, for example when {@link IDataSeries.isSorted} property changes
49
+ * @param value
50
+ */
51
+ setIsSortedAscending(value: boolean): void;
52
+ /**
53
+ * Called to update containsNaN flag manually, for example when {@link IDataSeries.containsNaN} property changes
54
+ * @param value
55
+ */
56
+ setContainsNaN(value: boolean): void;
57
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { DoubleVector } from "../../../types/TSciChart";
1
+ import { SCRTDoubleVector } from "../../../types/TSciChart";
2
2
  import { BaseDataSeries } from "../BaseDataSeries";
3
3
  import { IDataChangeArgs } from "../IDataSeries";
4
4
  import { IOhlcDataSeriesOptions, OhlcDataSeries } from "../OhlcDataSeries";
@@ -7,7 +7,7 @@ export interface IOhlcFilterOptions extends IOhlcDataSeriesOptions {
7
7
  export declare abstract class OhlcFilterBase extends OhlcDataSeries {
8
8
  readonly originalSeries: BaseDataSeries;
9
9
  constructor(originalSeries: BaseDataSeries, options?: IOhlcFilterOptions);
10
- getOriginalXValues(): DoubleVector;
10
+ getOriginalXValues(): SCRTDoubleVector;
11
11
  getOriginalCount(): number;
12
12
  protected abstract filterAll(): void;
13
13
  protected onOriginalPropertyChanged(name: string): void;
@@ -1,4 +1,4 @@
1
- import { DoubleVector } from "../../../types/TSciChart";
1
+ import { SCRTDoubleVector } from "../../../types/TSciChart";
2
2
  import { BaseDataSeries } from "../BaseDataSeries";
3
3
  import { IDataChangeArgs } from "../IDataSeries";
4
4
  import { OhlcDataSeries } from "../OhlcDataSeries";
@@ -50,11 +50,11 @@ export declare abstract class XyFilterBase extends XyDataSeries {
50
50
  /**
51
51
  * Get the X values of the original series
52
52
  */
53
- getOriginalXValues(): DoubleVector;
53
+ getOriginalXValues(): SCRTDoubleVector;
54
54
  /**
55
55
  * Get the Y values of the original series, according to the field set.
56
56
  */
57
- getOriginalYValues(): DoubleVector;
57
+ getOriginalYValues(): SCRTDoubleVector;
58
58
  /**
59
59
  * Get the length of the original series.
60
60
  */
@@ -44,7 +44,7 @@ var XyMovingAverageFilter = /** @class */ (function (_super) {
44
44
  _this.pointer = -1;
45
45
  _this.bufferTotal = 0;
46
46
  _this.lengthProperty = (_a = options === null || options === void 0 ? void 0 : options.length) !== null && _a !== void 0 ? _a : _this.lengthProperty;
47
- if (!originalSeries.isSorted) {
47
+ if (!originalSeries.dataDistributionCalculator.isSortedAscending) {
48
48
  throw new Error("XyMovingAverageFilter requires original data to be sorted in X");
49
49
  }
50
50
  if (_this.getOriginalCount() > 0) {
@@ -1,4 +1,4 @@
1
- import { DoubleVector } from "../../../types/TSciChart";
1
+ import { SCRTDoubleVector } from "../../../types/TSciChart";
2
2
  import { BaseDataSeries } from "../BaseDataSeries";
3
3
  import { IDataChangeArgs } from "../IDataSeries";
4
4
  import { IXyyDataSeriesOptions, XyyDataSeries } from "../XyyDataSeries";
@@ -12,9 +12,9 @@ export declare abstract class XyyFilterBase extends XyyDataSeries {
12
12
  readonly y1field: EDataSeriesField;
13
13
  readonly originalSeries: BaseDataSeries;
14
14
  constructor(originalSeries: BaseDataSeries, options?: IXyyFilterOptions);
15
- getOriginalXValues(): DoubleVector;
16
- getOriginalYValues(): DoubleVector;
17
- getOriginalY1Values(): DoubleVector;
15
+ getOriginalXValues(): SCRTDoubleVector;
16
+ getOriginalYValues(): SCRTDoubleVector;
17
+ getOriginalY1Values(): SCRTDoubleVector;
18
18
  getOriginalCount(): number;
19
19
  protected abstract filterAll(): void;
20
20
  protected onOriginalPropertyChanged(name: string): void;
@@ -1,4 +1,4 @@
1
- import { DoubleVector } from "../../../types/TSciChart";
1
+ import { SCRTDoubleVector } from "../../../types/TSciChart";
2
2
  import { BaseDataSeries } from "../BaseDataSeries";
3
3
  import { IDataChangeArgs } from "../IDataSeries";
4
4
  import { IXyzDataSeriesOptions, XyzDataSeries } from "../XyzDataSeries";
@@ -12,9 +12,9 @@ export declare abstract class XyzFilterBase extends XyzDataSeries {
12
12
  readonly zfield: EDataSeriesField;
13
13
  readonly originalSeries: BaseDataSeries;
14
14
  constructor(originalSeries: BaseDataSeries, options?: IXyzFilterOptions);
15
- getOriginalXValues(): DoubleVector;
16
- getOriginalYValues(): DoubleVector;
17
- getOriginalZValues(): DoubleVector;
15
+ getOriginalXValues(): SCRTDoubleVector;
16
+ getOriginalYValues(): SCRTDoubleVector;
17
+ getOriginalZValues(): SCRTDoubleVector;
18
18
  getOriginalCount(): number;
19
19
  protected abstract filterAll(): void;
20
20
  protected onOriginalPropertyChanged(name: string): void;
@@ -1,7 +1,9 @@
1
1
  import { EventHandler } from "../../Core/EventHandler";
2
2
  import { IDeletable } from "../../Core/IDeletable";
3
3
  import { NumberRange } from "../../Core/NumberRange";
4
- import { DoubleVector } from "../../types/TSciChart";
4
+ import { ESearchMode } from "../../types/SearchMode";
5
+ import { SCRTDoubleVector } from "../../types/TSciChart";
6
+ import { IDataDistributionCalculator } from "./DataDistributionCalculator/IDataDistributionCalculator";
5
7
  /**
6
8
  * Defines {@link BaseDataSeries | DataSeries} types available within SciChart's
7
9
  * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
@@ -66,10 +68,22 @@ export interface IDataChangeArgs {
66
68
  * See derived types of {@link IRenderableSeries} to find out what 2D JavaScript Chart types are available.
67
69
  */
68
70
  export interface IDataSeries extends IDeletable {
71
+ /**
72
+ * A unique Id for the {@link IDataSeries}
73
+ */
74
+ readonly id: string;
69
75
  /**
70
76
  * Gets the {@link EDataSeriesType} type of the DataSeries
71
77
  */
72
78
  readonly type: EDataSeriesType;
79
+ /**
80
+ * Gets the change count for this data series. Allows to indentify when data series was changed
81
+ */
82
+ readonly changeCount: number;
83
+ /**
84
+ * Gets the {@link IDataDistributionCalculator} instance for this DataSeries. Used when resampling data to determine the correct algorithm
85
+ */
86
+ readonly dataDistributionCalculator: IDataDistributionCalculator;
73
87
  /**
74
88
  * An {@link EventHandler} which is raised when the data changes.
75
89
  * @Remarks
@@ -105,7 +119,7 @@ export interface IDataSeries extends IDeletable {
105
119
  */
106
120
  dataSeriesName: string;
107
121
  /**
108
- * Gets or sets whether the X-values are sorted or not.
122
+ * Gets or sets whether the X-values are sorted ascending or not.
109
123
  * See remarks at {@link IDataSeries.isSorted} for further information
110
124
  * @remarks
111
125
  * The user must specify this flag (defaults to true) in order to choose the correct, and
@@ -113,6 +127,15 @@ export interface IDataSeries extends IDeletable {
113
127
  * strange drawing, it may be because you have set unsorted data but not set this flag.
114
128
  */
115
129
  isSorted: boolean;
130
+ /**
131
+ * Gets or sets whether the X-values are evenly spaced or not.
132
+ * See remarks at {@link IDataSeries.isEvenlySpaced} for further information
133
+ * @remarks
134
+ * The user must specify this flag (defaults to true) in order to choose the correct, and
135
+ * fastest algorithms for drawing, indexing and ranging. If you experience glitches or
136
+ * strange drawing, it may be because you have set data with uneven spacing in X but not set this flag.
137
+ */
138
+ isEvenlySpaced: boolean;
116
139
  /**
117
140
  * Gets or sets whether the Y data contains NaN values.
118
141
  * Set containsNaN = false for the performance optimization when the series has no NaNs
@@ -125,15 +148,15 @@ export interface IDataSeries extends IDeletable {
125
148
  /**
126
149
  * Gets a native / WebAssembly Vector of Indexes in the DataSeries
127
150
  */
128
- getNativeIndexes(): DoubleVector;
151
+ getNativeIndexes(): SCRTDoubleVector;
129
152
  /**
130
153
  * Gets a native / WebAssembly vector of X-values in the DataSeries
131
154
  */
132
- getNativeXValues(): DoubleVector;
155
+ getNativeXValues(): SCRTDoubleVector;
133
156
  /**
134
157
  * Gets a native / WebAssembly vector of Y-values in the DataSeries
135
158
  */
136
- getNativeYValues(): DoubleVector;
159
+ getNativeYValues(): SCRTDoubleVector;
137
160
  /**
138
161
  * Clear all values from the DataSeries
139
162
  */
@@ -162,4 +185,13 @@ export interface IDataSeries extends IDeletable {
162
185
  * @param excludeData if set true, data values will not be included in the json.
163
186
  */
164
187
  toJSON(excludeData?: boolean): any;
188
+ /**
189
+ * Gets the integer indices of the XValues array that are currently in the VisibleRange passed in, and an undefined range otherwise.
190
+ * @param visibleRange The VisibleRange to get the indices range
191
+ * @param isCategoryData If True the renderable series uses {@link CategoryAxis}
192
+ * @param downSearchMode Specifies the search mode used to look for the index of visibleRange.Min
193
+ * @param upSearchMode Specifies the search mode used to look for the index of visibleRange.Max
194
+ * @returns numberRange The indices to the X-Data that are currently in range.
195
+ */
196
+ getIndicesRange(visibleRange: NumberRange, isCategoryData?: boolean, downSearchMode?: ESearchMode, upSearchMode?: ESearchMode): NumberRange;
165
197
  }
@@ -1,6 +1,6 @@
1
1
  import { NumberRange } from "../../Core/NumberRange";
2
2
  import { NumberArray } from "../../types/NumberArray";
3
- import { DoubleVector, TSciChart } from "../../types/TSciChart";
3
+ import { SCRTDoubleVector, TSciChart } from "../../types/TSciChart";
4
4
  import { SeriesAnimation } from "../Visuals/RenderableSeries/Animations/SeriesAnimation";
5
5
  import { BaseDataSeries, IBaseDataSeriesOptions } from "./BaseDataSeries";
6
6
  import { EDataSeriesType, EDataSeriesValueType } from "./IDataSeries";
@@ -50,27 +50,27 @@ export declare class OhlcDataSeries extends BaseDataSeries {
50
50
  /**
51
51
  * Open vector with initial animation values
52
52
  */
53
- openInitialAnimationValues: DoubleVector;
53
+ openInitialAnimationValues: SCRTDoubleVector;
54
54
  /**
55
55
  * Open vector with final animation values
56
56
  */
57
- openFinalAnimationValues: DoubleVector;
57
+ openFinalAnimationValues: SCRTDoubleVector;
58
58
  /**
59
59
  * High vector with initial animation values
60
60
  */
61
- highInitialAnimationValues: DoubleVector;
61
+ highInitialAnimationValues: SCRTDoubleVector;
62
62
  /**
63
63
  * High vector with final animation values
64
64
  */
65
- highFinalAnimationValues: DoubleVector;
65
+ highFinalAnimationValues: SCRTDoubleVector;
66
66
  /**
67
67
  * Low vector with initial animation values
68
68
  */
69
- lowInitialAnimationValues: DoubleVector;
69
+ lowInitialAnimationValues: SCRTDoubleVector;
70
70
  /**
71
71
  * Low vector with final animation values
72
72
  */
73
- lowFinalAnimationValues: DoubleVector;
73
+ lowFinalAnimationValues: SCRTDoubleVector;
74
74
  private openValues;
75
75
  private highValues;
76
76
  private lowValues;
@@ -84,19 +84,19 @@ export declare class OhlcDataSeries extends BaseDataSeries {
84
84
  /**
85
85
  * Gets a native / WebAssembly vector of Open-values in the DataSeries
86
86
  */
87
- getNativeOpenValues(): DoubleVector;
87
+ getNativeOpenValues(): SCRTDoubleVector;
88
88
  /**
89
89
  * Gets a native / WebAssembly vector of High-values in the DataSeries
90
90
  */
91
- getNativeHighValues(): DoubleVector;
91
+ getNativeHighValues(): SCRTDoubleVector;
92
92
  /**
93
93
  * Gets a native / WebAssembly vector of Low-values in the DataSeries
94
94
  */
95
- getNativeLowValues(): DoubleVector;
95
+ getNativeLowValues(): SCRTDoubleVector;
96
96
  /**
97
97
  * Gets a native / WebAssembly vector of Close-values in the DataSeries
98
98
  */
99
- getNativeCloseValues(): DoubleVector;
99
+ getNativeCloseValues(): SCRTDoubleVector;
100
100
  /**
101
101
  * Appends a single X (Date), Open, High, Low, Close point to the DataSeries
102
102
  * @remarks
@@ -147,6 +147,7 @@ export declare class OhlcDataSeries extends BaseDataSeries {
147
147
  * @param high The new High value
148
148
  * @param low The new Low value
149
149
  * @param close The new Close value
150
+ * @param metadata The point metadata
150
151
  */
151
152
  updateXohlc(index: number, x: number, open: number, high: number, low: number, close: number, metadata?: IPointMetadata): void;
152
153
  /**
@@ -20,7 +20,7 @@ var Deleter_1 = require("../../Core/Deleter");
20
20
  var Guard_1 = require("../../Core/Guard");
21
21
  var NumberRange_1 = require("../../Core/NumberRange");
22
22
  var NumberArray_1 = require("../../types/NumberArray");
23
- var fillDoubleVectorFromJsArray_1 = require("../../utils/ccall/fillDoubleVectorFromJsArray");
23
+ var appendDoubleVectorFromJsArray_1 = require("../../utils/ccall/appendDoubleVectorFromJsArray");
24
24
  var animationHelpers_1 = require("../Visuals/RenderableSeries/Animations/animationHelpers");
25
25
  var BaseDataSeries_1 = require("./BaseDataSeries");
26
26
  var IDataSeries_1 = require("./IDataSeries");
@@ -50,15 +50,15 @@ var OhlcDataSeries = /** @class */ (function (_super) {
50
50
  var _this = _super.call(this, webAssemblyContext, options) || this;
51
51
  /** @inheritDoc */
52
52
  _this.type = IDataSeries_1.EDataSeriesType.Ohlc;
53
- _this.openValues = new webAssemblyContext.DoubleVector();
54
- _this.highValues = new webAssemblyContext.DoubleVector();
55
- _this.lowValues = new webAssemblyContext.DoubleVector();
56
- _this.openInitialAnimationValues = new webAssemblyContext.DoubleVector();
57
- _this.highInitialAnimationValues = new webAssemblyContext.DoubleVector();
58
- _this.lowInitialAnimationValues = new webAssemblyContext.DoubleVector();
59
- _this.openFinalAnimationValues = new webAssemblyContext.DoubleVector();
60
- _this.highFinalAnimationValues = new webAssemblyContext.DoubleVector();
61
- _this.lowFinalAnimationValues = new webAssemblyContext.DoubleVector();
53
+ _this.openValues = new webAssemblyContext.SCRTDoubleVector();
54
+ _this.highValues = new webAssemblyContext.SCRTDoubleVector();
55
+ _this.lowValues = new webAssemblyContext.SCRTDoubleVector();
56
+ _this.openInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
57
+ _this.highInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
58
+ _this.lowInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
59
+ _this.openFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
60
+ _this.highFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
61
+ _this.lowFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
62
62
  if (options === null || options === void 0 ? void 0 : options.xValues) {
63
63
  _this.appendRange(options.xValues, options.openValues, options.highValues, options.lowValues, options.closeValues, options.metadata);
64
64
  }
@@ -104,9 +104,11 @@ var OhlcDataSeries = /** @class */ (function (_super) {
104
104
  */
105
105
  OhlcDataSeries.prototype.append = function (x, open, high, low, close, metadata) {
106
106
  if (!this.getIsDeleted()) {
107
+ var nativeX = this.getNativeXValues();
108
+ this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, [x], [close]);
107
109
  // Push metadata should be done before push x values
108
110
  this.appendMetadata(metadata);
109
- this.getNativeXValues().push_back(x);
111
+ nativeX.push_back(x);
110
112
  this.getNativeOpenValues().push_back(open);
111
113
  this.getNativeHighValues().push_back(high);
112
114
  this.getNativeLowValues().push_back(low);
@@ -130,11 +132,11 @@ var OhlcDataSeries = /** @class */ (function (_super) {
130
132
  */
131
133
  OhlcDataSeries.prototype.appendRange = function (xValues, openValues, highValues, lowValues, closeValues, metadata) {
132
134
  if (!this.getIsDeleted()) {
133
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
134
- Guard_1.Guard.isTrue(Array.isArray(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
135
- Guard_1.Guard.isTrue(Array.isArray(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
136
- Guard_1.Guard.isTrue(Array.isArray(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
137
- Guard_1.Guard.isTrue(Array.isArray(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
135
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
136
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
137
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
138
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
139
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
138
140
  Guard_1.Guard.arraysSameLengthArr([
139
141
  { arg: xValues, name: "xValues" },
140
142
  { arg: openValues, name: "openValues" },
@@ -146,19 +148,20 @@ var OhlcDataSeries = /** @class */ (function (_super) {
146
148
  Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
147
149
  Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
148
150
  }
149
- // Push metadata should be done before push x values
150
- this.appendMetadataRange(metadata, xValues.length);
151
151
  var nativeX = this.getNativeXValues();
152
152
  var nativeOpen = this.getNativeOpenValues();
153
153
  var nativeHigh = this.getNativeHighValues();
154
154
  var nativeLow = this.getNativeLowValues();
155
155
  var nativeClose = this.getNativeCloseValues();
156
+ this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, xValues, closeValues);
157
+ // Push metadata should be done before push x values
158
+ this.appendMetadataRange(metadata, xValues.length);
156
159
  // New implementation passing array from JS
157
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, nativeX, xValues);
158
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, nativeOpen, openValues);
159
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, nativeHigh, highValues);
160
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, nativeLow, lowValues);
161
- (0, fillDoubleVectorFromJsArray_1.fillDoubleVectorFromJsArray)(this.webAssemblyContext, nativeClose, closeValues);
160
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeX, xValues);
161
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeOpen, openValues);
162
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeHigh, highValues);
163
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeLow, lowValues);
164
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeClose, closeValues);
162
165
  this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, xValues.length);
163
166
  }
164
167
  };
@@ -175,6 +178,7 @@ var OhlcDataSeries = /** @class */ (function (_super) {
175
178
  OhlcDataSeries.prototype.update = function (index, open, high, low, close, metadata) {
176
179
  if (!this.getIsDeleted()) {
177
180
  this.validateIndex(index);
181
+ this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, undefined, undefined, [close], index);
178
182
  this.getNativeOpenValues().set(index, open);
179
183
  this.getNativeHighValues().set(index, high);
180
184
  this.getNativeLowValues().set(index, low);
@@ -192,10 +196,14 @@ var OhlcDataSeries = /** @class */ (function (_super) {
192
196
  * @param high The new High value
193
197
  * @param low The new Low value
194
198
  * @param close The new Close value
199
+ * @param metadata The point metadata
195
200
  */
196
201
  OhlcDataSeries.prototype.updateXohlc = function (index, x, open, high, low, close, metadata) {
197
202
  if (!this.getIsDeleted()) {
198
- this.getNativeXValues().set(index, x);
203
+ this.validateIndex(index);
204
+ var nativeX = this.getNativeXValues();
205
+ this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, nativeX, [x], [close], index);
206
+ nativeX.set(index, x);
199
207
  this.getNativeOpenValues().set(index, open);
200
208
  this.getNativeHighValues().set(index, high);
201
209
  this.getNativeLowValues().set(index, low);
@@ -218,7 +226,9 @@ var OhlcDataSeries = /** @class */ (function (_super) {
218
226
  OhlcDataSeries.prototype.insert = function (startIndex, x, open, high, low, close, metadata) {
219
227
  if (!this.getIsDeleted()) {
220
228
  this.validateIndex(startIndex, "Start index is out of range");
221
- this.getNativeXValues().insertAt(startIndex, x);
229
+ var nativeX = this.getNativeXValues();
230
+ this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, [x], [close], startIndex);
231
+ nativeX.insertAt(startIndex, x);
222
232
  this.getNativeOpenValues().insertAt(startIndex, open);
223
233
  this.getNativeHighValues().insertAt(startIndex, high);
224
234
  this.getNativeLowValues().insertAt(startIndex, low);
@@ -240,11 +250,11 @@ var OhlcDataSeries = /** @class */ (function (_super) {
240
250
  */
241
251
  OhlcDataSeries.prototype.insertRange = function (startIndex, xValues, openValues, highValues, lowValues, closeValues, metadata) {
242
252
  if (!this.getIsDeleted()) {
243
- Guard_1.Guard.isTrue(Array.isArray(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
244
- Guard_1.Guard.isTrue(Array.isArray(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
245
- Guard_1.Guard.isTrue(Array.isArray(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
246
- Guard_1.Guard.isTrue(Array.isArray(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
247
- Guard_1.Guard.isTrue(Array.isArray(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
253
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
254
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(openValues) || (0, NumberArray_1.isTypedArray)(openValues), "openValues must be an array of numbers");
255
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(highValues) || (0, NumberArray_1.isTypedArray)(highValues), "highValues must be an array of numbers");
256
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lowValues) || (0, NumberArray_1.isTypedArray)(lowValues), "lowValues must be an array of numbers");
257
+ Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(closeValues) || (0, NumberArray_1.isTypedArray)(closeValues), "closeValues must be an array of numbers");
248
258
  this.validateIndex(startIndex, "Start index is out of range");
249
259
  Guard_1.Guard.arraysSameLengthArr([
250
260
  { arg: xValues, name: "xValues" },
@@ -257,20 +267,13 @@ var OhlcDataSeries = /** @class */ (function (_super) {
257
267
  Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
258
268
  Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
259
269
  }
260
- var rangeLength = xValues.length;
261
270
  var nativeX = this.getNativeXValues();
262
- var nativeOpen = this.getNativeOpenValues();
263
- var nativeHigh = this.getNativeHighValues();
264
- var nativeLow = this.getNativeLowValues();
265
- var nativeY = this.getNativeCloseValues();
266
- var tempStartIndex = startIndex;
267
- for (var i = 0; i < rangeLength; i++, tempStartIndex++) {
268
- nativeX.insertAt(tempStartIndex, xValues[i]);
269
- nativeOpen.insertAt(tempStartIndex, openValues[i]);
270
- nativeHigh.insertAt(tempStartIndex, highValues[i]);
271
- nativeLow.insertAt(tempStartIndex, lowValues[i]);
272
- nativeY.insertAt(tempStartIndex, closeValues[i]);
273
- }
271
+ this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, xValues, closeValues, startIndex);
272
+ (0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, xValues, nativeX, startIndex);
273
+ (0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, openValues, this.getNativeOpenValues(), startIndex);
274
+ (0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, highValues, this.getNativeHighValues(), startIndex);
275
+ (0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, lowValues, this.getNativeLowValues(), startIndex);
276
+ (0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, closeValues, this.getNativeCloseValues(), startIndex);
274
277
  this.insertMetadataRange(startIndex, metadata);
275
278
  this.notifyDataChanged(IDataSeries_1.EDataChangeType.Insert, startIndex, xValues.length);
276
279
  }
@@ -320,7 +323,7 @@ var OhlcDataSeries = /** @class */ (function (_super) {
320
323
  */
321
324
  OhlcDataSeries.prototype.clear = function () {
322
325
  if (!this.getIsDeleted()) {
323
- this.getNativeIndexes().clear();
326
+ _super.prototype.clear.call(this);
324
327
  this.getNativeXValues().clear();
325
328
  this.getNativeOpenValues().clear();
326
329
  this.getNativeHighValues().clear();
@@ -0,0 +1,21 @@
1
+ import { IDeletable } from "../../../Core/IDeletable";
2
+ import { NumberRange } from "../../../Core/NumberRange";
3
+ import { IntVector, SCRTDoubleVector, TSciChart } from "../../../types/TSciChart";
4
+ import { IPointSeries, IPointSeriesResampled } from "./IPointSeries";
5
+ export declare abstract class BasePointSeriesResampled implements IPointSeries, IPointSeriesResampled, IDeletable {
6
+ readonly intIndexes: IntVector;
7
+ readonly indexes: SCRTDoubleVector;
8
+ readonly xValues: SCRTDoubleVector;
9
+ readonly yValues: SCRTDoubleVector;
10
+ xRange: NumberRange;
11
+ protected wasmContext: TSciChart;
12
+ constructor(wasmContext: TSciChart, xRange: NumberRange);
13
+ get count(): number;
14
+ delete(): void;
15
+ /**
16
+ * Updates SCRTDoubleVector from IntVector
17
+ */
18
+ updateIndexes(): void;
19
+ clearIntIndexes(): void;
20
+ debugOutputForUnitTests(): void;
21
+ }