scichart 2.0.2194 → 2.1.0-beta.40

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 (223) hide show
  1. package/Charting/ChartModifiers/CursorModifier.d.ts +9 -0
  2. package/Charting/ChartModifiers/CursorModifier.js +10 -0
  3. package/Charting/ChartModifiers/DataPointSelectionModifier.js +0 -1
  4. package/Charting/ChartModifiers/RolloverModifier.d.ts +25 -0
  5. package/Charting/ChartModifiers/RolloverModifier.js +8 -0
  6. package/Charting/Drawing/BrushCache.d.ts +8 -2
  7. package/Charting/Drawing/BrushCache.js +16 -8
  8. package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
  9. package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
  10. package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
  11. package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
  12. package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  13. package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
  14. package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
  15. package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
  16. package/Charting/Model/BaseDataSeries.d.ts +42 -15
  17. package/Charting/Model/BaseDataSeries.js +77 -28
  18. package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
  19. package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
  20. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
  21. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
  22. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
  23. package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
  24. package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
  25. package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
  26. package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
  27. package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
  28. package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
  29. package/Charting/Model/IDataSeries.d.ts +37 -5
  30. package/Charting/Model/OhlcDataSeries.d.ts +12 -11
  31. package/Charting/Model/OhlcDataSeries.js +47 -44
  32. package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
  33. package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
  34. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
  35. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
  36. package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
  37. package/Charting/Model/PointSeries/IPointSeries.js +2 -0
  38. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
  39. package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
  40. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
  41. package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
  42. package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
  43. package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
  44. package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
  45. package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
  46. package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
  47. package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
  48. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
  49. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
  50. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
  51. package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
  52. package/Charting/Model/XyDataSeries.d.ts +3 -2
  53. package/Charting/Model/XyDataSeries.js +26 -26
  54. package/Charting/Model/XyyDataSeries.d.ts +5 -5
  55. package/Charting/Model/XyyDataSeries.js +30 -27
  56. package/Charting/Model/XyzDataSeries.d.ts +5 -5
  57. package/Charting/Model/XyzDataSeries.js +30 -27
  58. package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
  59. package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
  60. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
  61. package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
  62. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
  63. package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
  64. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
  65. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +232 -0
  66. package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
  67. package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
  68. package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
  69. package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
  70. package/Charting/Services/RenderPassData.d.ts +6 -1
  71. package/Charting/Services/RenderPassData.js +5 -1
  72. package/Charting/Services/RenderPassInfo.d.ts +18 -0
  73. package/Charting/Services/RenderPassInfo.js +14 -0
  74. package/Charting/Services/SciChartRenderer.d.ts +14 -1
  75. package/Charting/Services/SciChartRenderer.js +124 -31
  76. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
  77. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +1 -0
  78. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +6 -0
  79. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +5 -0
  80. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +12 -1
  81. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +6 -8
  82. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +12 -9
  83. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
  84. package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
  85. package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
  86. package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
  87. package/Charting/Visuals/Axis/AxisCore.js +39 -18
  88. package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
  89. package/Charting/Visuals/Axis/AxisRenderer.js +37 -10
  90. package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
  91. package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -2
  92. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +9 -4
  93. package/Charting/Visuals/Axis/NumericAxis.js +2 -2
  94. package/Charting/Visuals/Axis/constants.d.ts +1 -0
  95. package/Charting/Visuals/Axis/constants.js +1 -0
  96. package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
  97. package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
  98. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
  99. package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
  100. package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
  101. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
  102. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
  103. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
  104. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
  105. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
  106. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
  107. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
  108. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
  109. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
  110. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +59 -0
  111. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +40 -5
  112. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +116 -11
  113. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
  114. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
  115. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
  116. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
  117. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
  118. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
  119. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
  120. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
  121. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +4 -11
  122. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
  123. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
  124. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -15
  125. package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
  126. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
  127. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
  128. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
  129. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
  130. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +6 -2
  131. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +5 -0
  132. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
  133. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
  134. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
  135. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
  136. package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
  137. package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
  138. package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
  139. package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
  140. package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
  141. package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
  142. package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
  143. package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
  144. package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
  145. package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
  146. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
  147. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
  148. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
  149. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
  150. package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
  151. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
  152. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
  153. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
  154. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
  155. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
  156. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
  157. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +0 -6
  158. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
  159. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
  160. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
  161. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
  162. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
  163. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
  164. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
  165. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
  166. package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
  167. package/Charting/Visuals/RenderableSeries/constants.js +3 -0
  168. package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
  169. package/Charting/Visuals/SciChartDefaults.js +9 -1
  170. package/Charting/Visuals/SciChartSurface.d.ts +4 -4
  171. package/Charting/Visuals/SciChartSurface.js +18 -11
  172. package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
  173. package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
  174. package/Charting/Visuals/createMaster.d.ts +1 -1
  175. package/Charting/Visuals/createMaster.js +11 -6
  176. package/Charting/Visuals/createSingle.d.ts +1 -1
  177. package/Charting/Visuals/createSingle.js +2 -2
  178. package/Charting/Visuals/licenseManager2D.js +22 -21
  179. package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
  180. package/Charting/Visuals/licenseManager2dState.js +12 -0
  181. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  182. package/Charting/Visuals/sciChartInitCommon.js +18 -12
  183. package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
  184. package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
  185. package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
  186. package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
  187. package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
  188. package/Charting3D/Visuals/createMaster3d.js +11 -6
  189. package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
  190. package/Charting3D/Visuals/createSingle3d.js +2 -2
  191. package/Core/BuildStamp.d.ts +1 -1
  192. package/Core/BuildStamp.js +2 -2
  193. package/Core/NumberRange.d.ts +1 -0
  194. package/Core/NumberRange.js +8 -0
  195. package/Core/OneTimePerformanceWarning.d.ts +6 -0
  196. package/Core/OneTimePerformanceWarning.js +19 -0
  197. package/Core/storage/localStorageApi.d.ts +9 -0
  198. package/Core/storage/localStorageApi.js +32 -0
  199. package/_wasm/scichart.browser.js +1 -1
  200. package/_wasm/scichart2d.js +12 -12
  201. package/_wasm/scichart2d.wasm +0 -0
  202. package/_wasm/scichart3d.js +96 -96
  203. package/_wasm/scichart3d.wasm +0 -0
  204. package/constants/performanceWarnings.d.ts +5 -0
  205. package/constants/performanceWarnings.js +8 -0
  206. package/package.json +1 -1
  207. package/types/NumberArray.d.ts +1 -0
  208. package/types/NumberArray.js +5 -1
  209. package/types/SearchMode.d.ts +21 -0
  210. package/types/SearchMode.js +25 -0
  211. package/types/TSciChart.d.ts +143 -40
  212. package/types/TSciChart3D.d.ts +66 -28
  213. package/types/TStackedAxisLength.d.ts +4 -0
  214. package/types/TStackedAxisLength.js +4 -0
  215. package/utils/array.d.ts +7 -0
  216. package/utils/array.js +19 -1
  217. package/utils/calcAverage.d.ts +2 -2
  218. package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
  219. package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
  220. package/utils/hash.d.ts +7 -0
  221. package/utils/hash.js +35 -0
  222. package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
  223. package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResamplingParams = void 0;
4
+ var AutoRange_1 = require("../../../types/AutoRange");
5
+ var ResamplingParams = /** @class */ (function () {
6
+ function ResamplingParams(seriesViewRect, rs, xAxis) {
7
+ this.zeroLineY = 0;
8
+ this.precision = 0;
9
+ this.enableExperimentalResampling = false;
10
+ this.dataIsFifo = false;
11
+ this.fifoCapacity = 0;
12
+ this.viewportRect = seriesViewRect;
13
+ if (rs) {
14
+ var dataSeries = rs.dataSeries;
15
+ this.resamplingMode = rs.resamplingMode;
16
+ this.precision = rs.resamplingPrecision;
17
+ if (xAxis) {
18
+ this.indexesRange = rs.getIndicesRange(xAxis.visibleRange, xAxis.isCategoryAxis);
19
+ // console.log("visible range", xAxis.visibleRange.min, xAxis.visibleRange.max);
20
+ // console.log("indexes range", this.indexesRange.min, this.indexesRange.max);
21
+ this.isCategoryAxis = xAxis.isCategoryAxis;
22
+ this.isXAxisAutoRanged = xAxis.autoRange === AutoRange_1.EAutoRange.Always;
23
+ this.xVisibleRange = xAxis.visibleRange;
24
+ }
25
+ if (dataSeries) {
26
+ this.dataHasNaN = dataSeries === null || dataSeries === void 0 ? void 0 : dataSeries.dataDistributionCalculator.containsNaN;
27
+ this.dataEvenlySpaced = dataSeries === null || dataSeries === void 0 ? void 0 : dataSeries.isEvenlySpaced;
28
+ }
29
+ }
30
+ }
31
+ ResamplingParams.prototype.clone = function (options) {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
33
+ var rp = new ResamplingParams(undefined, undefined, undefined);
34
+ rp.zeroLineY = (_a = options === null || options === void 0 ? void 0 : options.zeroLineY) !== null && _a !== void 0 ? _a : this.zeroLineY;
35
+ rp.precision = (_b = options === null || options === void 0 ? void 0 : options.precision) !== null && _b !== void 0 ? _b : this.precision;
36
+ rp.xVisibleRange = (_c = options === null || options === void 0 ? void 0 : options.xVisibleRange) !== null && _c !== void 0 ? _c : this.xVisibleRange;
37
+ rp.indexesRange = (_d = options === null || options === void 0 ? void 0 : options.indicesRange) !== null && _d !== void 0 ? _d : this.indexesRange;
38
+ rp.viewportRect = (_e = options === null || options === void 0 ? void 0 : options.viewportRect) !== null && _e !== void 0 ? _e : this.viewportRect;
39
+ rp.isCategoryAxis = (_f = options === null || options === void 0 ? void 0 : options.isCategoryAxis) !== null && _f !== void 0 ? _f : this.isCategoryAxis;
40
+ rp.isXAxisAutoRanged = (_g = options === null || options === void 0 ? void 0 : options.isXAxisAutoRanged) !== null && _g !== void 0 ? _g : this.isXAxisAutoRanged;
41
+ rp.resamplingMode = (_h = options === null || options === void 0 ? void 0 : options.resamplingMode) !== null && _h !== void 0 ? _h : this.resamplingMode;
42
+ rp.renderableSeriesHash = (_j = options === null || options === void 0 ? void 0 : options.renderableSeriesHash) !== null && _j !== void 0 ? _j : this.renderableSeriesHash;
43
+ rp.enableExperimentalResampling = (_k = options === null || options === void 0 ? void 0 : options.enableExperimentalResampling) !== null && _k !== void 0 ? _k : this.enableExperimentalResampling;
44
+ rp.dataHasNaN = (_l = options === null || options === void 0 ? void 0 : options.dataHasNaN) !== null && _l !== void 0 ? _l : this.dataHasNaN;
45
+ rp.dataIsFifo = (_m = options === null || options === void 0 ? void 0 : options.dataIsFifo) !== null && _m !== void 0 ? _m : this.dataIsFifo;
46
+ rp.fifoCapacity = (_o = options === null || options === void 0 ? void 0 : options.fifoCapacity) !== null && _o !== void 0 ? _o : this.fifoCapacity;
47
+ rp.dataEvenlySpaced = (_p = options === null || options === void 0 ? void 0 : options.dataEvenlySpaced) !== null && _p !== void 0 ? _p : this.dataEvenlySpaced;
48
+ return rp;
49
+ };
50
+ return ResamplingParams;
51
+ }());
52
+ exports.ResamplingParams = ResamplingParams;
@@ -1,4 +1,5 @@
1
1
  import { NumberRange } from "../../Core/NumberRange";
2
+ import { IPointSeries } from "../Model/PointSeries/IPointSeries";
2
3
  import { CoordinateCalculatorBase } from "../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
3
4
  /**
4
5
  * @summary RenderPassData contains properties which are passed to {@link BaseRenderableSeries} at the time of drawing
@@ -8,6 +9,8 @@ export declare class RenderPassData {
8
9
  readonly xCoordinateCalculator: CoordinateCalculatorBase;
9
10
  readonly yCoordinateCalculator: CoordinateCalculatorBase;
10
11
  readonly isVerticalChart: boolean;
12
+ readonly pointSeries?: IPointSeries;
13
+ readonly resamplingHash?: number;
11
14
  /**
12
15
  * Creates an instance of RenderPassData
13
16
  * @param indexRange The min and max index to data-range currently visible on the {@link SciChartSurface}
@@ -16,6 +19,8 @@ export declare class RenderPassData {
16
19
  * @param yCoordinateCalculator The YAxis {@link CoordinateCalculatorBase | Coordinate Calculator},
17
20
  * used to transform between pixel and data-coordinates
18
21
  * @param isVerticalChart A flag indicating if the chart is currently vertically arranged (XAxis on the left, YAxis on the top/bottom)
22
+ * @param pointSeries The point series
23
+ * @param resamplingHash The resampling hash value, used for caching
19
24
  */
20
- constructor(indexRange: NumberRange, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, isVerticalChart: boolean);
25
+ constructor(indexRange: NumberRange, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, isVerticalChart: boolean, pointSeries?: IPointSeries, resamplingHash?: number);
21
26
  }
@@ -13,12 +13,16 @@ var RenderPassData = /** @class */ (function () {
13
13
  * @param yCoordinateCalculator The YAxis {@link CoordinateCalculatorBase | Coordinate Calculator},
14
14
  * used to transform between pixel and data-coordinates
15
15
  * @param isVerticalChart A flag indicating if the chart is currently vertically arranged (XAxis on the left, YAxis on the top/bottom)
16
+ * @param pointSeries The point series
17
+ * @param resamplingHash The resampling hash value, used for caching
16
18
  */
17
- function RenderPassData(indexRange, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart) {
19
+ function RenderPassData(indexRange, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, pointSeries, resamplingHash) {
18
20
  this.indexRange = indexRange;
19
21
  this.xCoordinateCalculator = xCoordinateCalculator;
20
22
  this.yCoordinateCalculator = yCoordinateCalculator;
21
23
  this.isVerticalChart = isVerticalChart;
24
+ this.pointSeries = pointSeries;
25
+ this.resamplingHash = resamplingHash;
22
26
  }
23
27
  return RenderPassData;
24
28
  }());
@@ -0,0 +1,18 @@
1
+ import { NumberRange } from "../../Core/NumberRange";
2
+ import { Rect } from "../../Core/Rect";
3
+ import { IPointSeries } from "../Model/PointSeries/IPointSeries";
4
+ import { IRenderableSeries } from "../Visuals/RenderableSeries/IRenderableSeries";
5
+ export declare type TSeriesRenderPassInfo = {
6
+ pointSeries: IPointSeries;
7
+ renderableSeries: IRenderableSeries;
8
+ indicesRange: NumberRange;
9
+ resamplingHash: number;
10
+ };
11
+ export declare class RenderPassInfo {
12
+ pointSeriesArray: IPointSeries[];
13
+ renderableSeriesArray: IRenderableSeries[];
14
+ indicesRanges: NumberRange[];
15
+ resamplingHashes: number[];
16
+ seriesViewRect: Rect;
17
+ constructor(seriesCount: number, seriesViewRect: Rect);
18
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenderPassInfo = void 0;
4
+ var RenderPassInfo = /** @class */ (function () {
5
+ function RenderPassInfo(seriesCount, seriesViewRect) {
6
+ this.pointSeriesArray = [];
7
+ this.renderableSeriesArray = [];
8
+ this.indicesRanges = [];
9
+ this.resamplingHashes = [];
10
+ this.seriesViewRect = seriesViewRect;
11
+ }
12
+ return RenderPassInfo;
13
+ }());
14
+ exports.RenderPassInfo = RenderPassInfo;
@@ -1,9 +1,21 @@
1
+ import { Rect } from "../../Core/Rect";
1
2
  import { WebGlRenderContext2D } from "../Drawing/WebGlRenderContext2D";
3
+ import { AxisBase2D } from "../Visuals/Axis/AxisBase2D";
4
+ import { IRenderableSeries } from "../Visuals/RenderableSeries/IRenderableSeries";
2
5
  import { SciChartSurface } from "../Visuals/SciChartSurface";
6
+ import { TSeriesRenderPassInfo } from "./RenderPassInfo";
3
7
  /**
4
8
  * A class used internally in SciChart to perform layout, arrangement, data-preparation and rendering on the Cartesian 2D {@link SciChartSurface}
5
9
  */
6
10
  export declare class SciChartRenderer {
11
+ /**
12
+ * Used internally
13
+ * @param xAxis
14
+ * @param rs
15
+ * @param seriesViewRect
16
+ */
17
+ static resampleSeries(xAxis: AxisBase2D, rs: IRenderableSeries, seriesViewRect: Rect): TSeriesRenderPassInfo;
18
+ private static calculateResamplingHash;
7
19
  private sciChartSurface;
8
20
  private previousTime;
9
21
  /**
@@ -20,7 +32,8 @@ export declare class SciChartRenderer {
20
32
  private drawSvgAnnotations;
21
33
  private validate;
22
34
  private updateSvgCanvasSize;
23
- private prepareRenderData;
35
+ private prepareAxesRenderData;
36
+ private prepareSeriesRenderData;
24
37
  private drawAxes;
25
38
  private drawSeries;
26
39
  private drawDebugAxes;
@@ -11,15 +11,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SciChartRenderer = void 0;
13
13
  var Dictionary_1 = require("../../Core/Dictionary");
14
- var NumberRange_1 = require("../../Core/NumberRange");
15
14
  var Rect_1 = require("../../Core/Rect");
16
15
  var AutoRange_1 = require("../../types/AutoRange");
17
16
  var AxisAlignment_1 = require("../../types/AxisAlignment");
18
17
  var RenderLayer_1 = require("../../types/RenderLayer");
18
+ var hash_1 = require("../../utils/hash");
19
+ var ResamplingParams_1 = require("../Numerics/Resamplers/ResamplingParams");
19
20
  var IAnnotation_1 = require("../Visuals/Annotations/IAnnotation");
20
21
  var SciChartSurfaceBase_1 = require("../Visuals/SciChartSurfaceBase");
21
22
  var DpiHelper_1 = require("../Visuals/TextureManager/DpiHelper");
22
23
  var RenderPassData_1 = require("./RenderPassData");
24
+ var RenderPassInfo_1 = require("./RenderPassInfo");
23
25
  /**
24
26
  * A class used internally in SciChart to perform layout, arrangement, data-preparation and rendering on the Cartesian 2D {@link SciChartSurface}
25
27
  */
@@ -31,6 +33,66 @@ var SciChartRenderer = /** @class */ (function () {
31
33
  function SciChartRenderer(sciChartSurface) {
32
34
  this.sciChartSurface = sciChartSurface;
33
35
  }
36
+ /**
37
+ * Used internally
38
+ * @param xAxis
39
+ * @param rs
40
+ * @param seriesViewRect
41
+ */
42
+ SciChartRenderer.resampleSeries = function (xAxis, rs, seriesViewRect) {
43
+ /**
44
+ * Stacked series and Heatmap do not support resampling
45
+ * If a series does not support resampling, the pointSeries is not used in the drawing provider.
46
+ * For example, UniformHeatmapDrawingProvider does not use renderPassData.pointSeries,
47
+ * but LineSeriesDrawingProvider use renderPassData.pointSeries in the draw() method!
48
+ */
49
+ if (!rs.supportsResampling)
50
+ return {
51
+ pointSeries: rs.toPointSeries(),
52
+ renderableSeries: rs,
53
+ indicesRange: undefined,
54
+ resamplingHash: undefined
55
+ };
56
+ var rp = new ResamplingParams_1.ResamplingParams(seriesViewRect, rs, xAxis);
57
+ if (!rs.needsResampling(rp))
58
+ return {
59
+ pointSeries: rs.toPointSeries(),
60
+ renderableSeries: rs,
61
+ indicesRange: undefined,
62
+ resamplingHash: undefined
63
+ };
64
+ var resamplingHash = SciChartRenderer.calculateResamplingHash(rs, rp);
65
+ var prevRPD = rs.getCurrentRenderPassData();
66
+ var useFromCache = Boolean(prevRPD && prevRPD.resamplingHash === resamplingHash);
67
+ // console.log("resampling ...");
68
+ // console.log("useFromCache", useFromCache);
69
+ var pointSeries = useFromCache ? prevRPD.pointSeries : rs.toPointSeries(rp);
70
+ return {
71
+ pointSeries: pointSeries,
72
+ renderableSeries: rs,
73
+ indicesRange: rp.indexesRange,
74
+ resamplingHash: resamplingHash
75
+ };
76
+ };
77
+ SciChartRenderer.calculateResamplingHash = function (rs, rp) {
78
+ var hashes = [];
79
+ var enableDrawingOptimizationsHash = hash_1.hashUtils.generateBooleanHash(rs.enableDrawingOptimisations);
80
+ hashes.push(enableDrawingOptimizationsHash);
81
+ var dataSeries = rs.dataSeries;
82
+ if (dataSeries) {
83
+ var dataSeriesHash = hash_1.hashUtils.generateHash(dataSeries.id);
84
+ hashes.push(dataSeriesHash);
85
+ var dataSeriesCountHash = hash_1.hashUtils.generateNumberHash(dataSeries.count());
86
+ hashes.push(dataSeriesCountHash);
87
+ var dataSeriesSortedHash = hash_1.hashUtils.generateBooleanHash(dataSeries.dataDistributionCalculator.isSortedAscending);
88
+ hashes.push(dataSeriesSortedHash);
89
+ var dataSeriesChangeCountHash = hash_1.hashUtils.generateNumberHash(dataSeries.changeCount);
90
+ hashes.push(dataSeriesChangeCountHash);
91
+ }
92
+ var resamplingParamsHash = hash_1.hashUtils.generateObjectHash(rp);
93
+ hashes.push(resamplingParamsHash);
94
+ return hash_1.hashUtils.generateCombinedHash(hashes);
95
+ };
34
96
  /**
35
97
  * Render loop for the current {@SciChartSurface}
36
98
  * @param renderContext the {@WebGLRenderContext2D} used for drawing
@@ -61,7 +123,8 @@ var SciChartRenderer = /** @class */ (function () {
61
123
  var seriesViewRect = this.sciChartSurface.layoutManager.layoutChart(renderContext.viewportSize);
62
124
  this.updateSvgCanvasSize(seriesViewRect);
63
125
  // Step 4 prepare render data
64
- var xyAxesById = this.prepareRenderData();
126
+ var _a = this.prepareAxesRenderData(), xAxesById = _a.xAxesById, yAxesById = _a.yAxesById;
127
+ var renderPassInfo = this.prepareSeriesRenderData(seriesViewRect, xAxesById);
65
128
  // Draw seriesViewRect border
66
129
  this.sciChartSurface.drawBorder(renderContext);
67
130
  // Step 5 Draw X, Y axis and gridlines
@@ -80,21 +143,22 @@ var SciChartRenderer = /** @class */ (function () {
80
143
  el.type === IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation ||
81
144
  el.type === IAnnotation_1.EAnnotationType.RenderContextAxisMarkerAnnotation);
82
145
  });
83
- this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
84
- // queue series rendering after grid lines and bands, but before the axes
85
- renderContext.enqueueLayeredDraw(function () { return _this.drawSeries(_this.sciChartSurface, _this.sciChartSurface.renderableSeries.asArray(), renderContext); }, RenderLayer_1.ERenderLayer.Third);
146
+ renderContext.enqueueLayeredDraw(function () {
147
+ _this.drawRenderContextAnnotations(renderContextAnnotations, xAxesById, yAxesById, IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
148
+ }, RenderLayer_1.ERenderLayer.Third);
149
+ // Step 7 Draw series. Queue series rendering after grid lines and bands, but before the axes
150
+ renderContext.enqueueLayeredDraw(function () { return _this.drawSeries(_this.sciChartSurface, renderPassInfo, renderContext); }, RenderLayer_1.ERenderLayer.Third);
86
151
  // Execute rendering of queued elements
87
152
  renderContext.drawLayers();
88
- // Step 7 Draw series
89
153
  // Step 8 Draw annotations above the series
90
- this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.AboveChart, renderContext, seriesViewRect);
154
+ this.drawRenderContextAnnotations(renderContextAnnotations, xAxesById, yAxesById, IAnnotation_1.EAnnotationLayer.AboveChart, renderContext, seriesViewRect);
91
155
  // Step 9 Draw SVG or Html Overlays
92
156
  var svgAnnotations = annotations.filter(function (el) {
93
157
  return el.type === IAnnotation_1.EAnnotationType.SVG ||
94
158
  el.type === IAnnotation_1.EAnnotationType.SVGTextAnnotation ||
95
159
  el.type === IAnnotation_1.EAnnotationType.SVGCustomAnnotation;
96
160
  });
97
- this.drawSvgAnnotations(svgAnnotations, xyAxesById[0], xyAxesById[1]);
161
+ this.drawSvgAnnotations(svgAnnotations, xAxesById, yAxesById);
98
162
  // Update watermark
99
163
  this.updateWatermark(renderContext, seriesViewRect);
100
164
  // Step 10 Call OnParentSurfaceRendered
@@ -173,7 +237,7 @@ var SciChartRenderer = /** @class */ (function () {
173
237
  svgRootElement.currentScale = 1;
174
238
  }
175
239
  };
176
- SciChartRenderer.prototype.prepareRenderData = function () {
240
+ SciChartRenderer.prototype.prepareAxesRenderData = function () {
177
241
  var xAxesById = new Dictionary_1.Dictionary();
178
242
  var yAxesById = new Dictionary_1.Dictionary();
179
243
  // Prepare XAxes
@@ -186,7 +250,23 @@ var SciChartRenderer = /** @class */ (function () {
186
250
  yAxesById.add(yAxis.id, yAxis);
187
251
  yAxis.prepareRenderData();
188
252
  });
189
- return [xAxesById, yAxesById];
253
+ return { xAxesById: xAxesById, yAxesById: yAxesById };
254
+ };
255
+ SciChartRenderer.prototype.prepareSeriesRenderData = function (seriesViewRect, xAxesById) {
256
+ var seriesCount = this.sciChartSurface.renderableSeries.size();
257
+ var renderPassInfo = new RenderPassInfo_1.RenderPassInfo(seriesCount, seriesViewRect);
258
+ // TODO: Calculate XRange before resample but YRange after resample for faster autorange on large datasets
259
+ for (var i = 0; i < this.sciChartSurface.renderableSeries.size(); i++) {
260
+ var series = this.sciChartSurface.renderableSeries.get(i);
261
+ // TODO: Do resampling, store result for use in drawing
262
+ var xAxis = xAxesById.item(series.xAxisId);
263
+ var seriesRenderPassInfo = SciChartRenderer.resampleSeries(xAxis, series, seriesViewRect);
264
+ renderPassInfo.renderableSeriesArray.push(seriesRenderPassInfo.renderableSeries);
265
+ renderPassInfo.pointSeriesArray.push(seriesRenderPassInfo.pointSeries);
266
+ renderPassInfo.indicesRanges.push(seriesRenderPassInfo.indicesRange);
267
+ renderPassInfo.resamplingHashes.push(seriesRenderPassInfo.resamplingHash);
268
+ }
269
+ return renderPassInfo;
190
270
  };
191
271
  SciChartRenderer.prototype.drawAxes = function (scs, renderContext) {
192
272
  scs.xAxes.asArray().forEach(function (xAxis) {
@@ -196,31 +276,30 @@ var SciChartRenderer = /** @class */ (function () {
196
276
  yAxis.draw(renderContext);
197
277
  });
198
278
  };
199
- SciChartRenderer.prototype.drawSeries = function (scs, renderableSeries, renderContext) {
200
- var drawSeriesImpl = function (series) {
201
- var indexRange = new NumberRange_1.NumberRange(0, 0);
202
- var xAxis = scs.xAxes.asArray().find(function (a) { return a.id === series.xAxisId; });
203
- if (!xAxis) {
204
- throw Error("Cannot find an X Axis with ID = " + series.xAxisId);
205
- }
206
- var yAxis = scs.yAxes.asArray().find(function (a) { return a.id === series.yAxisId; });
207
- if (!yAxis) {
208
- throw Error("Cannot find a Y Axis with ID = " + series.yAxisId);
209
- }
210
- if (xAxis.isVerticalChart && ![AxisAlignment_1.EAxisAlignment.Top, AxisAlignment_1.EAxisAlignment.Bottom].includes(yAxis.axisAlignment)) {
279
+ SciChartRenderer.prototype.drawSeries = function (scs, renderPassInfo, renderContext) {
280
+ var renderableSeriesArray = renderPassInfo.renderableSeriesArray, pointSeriesArray = renderPassInfo.pointSeriesArray, resamplingHashes = renderPassInfo.resamplingHashes, indicesRanges = renderPassInfo.indicesRanges;
281
+ var drawSeriesImpl = function (index) {
282
+ var renderableSeries = renderableSeriesArray[index];
283
+ var pointSeries = pointSeriesArray[index];
284
+ var resamplingHash = resamplingHashes[index];
285
+ var indexRange = indicesRanges[index];
286
+ var xAxis = scs.xAxes.asArray().find(function (a) { return a.id === renderableSeries.xAxisId; });
287
+ if (!xAxis)
288
+ throw Error("Cannot find an X Axis with ID = " + renderableSeries.xAxisId);
289
+ var yAxis = scs.yAxes.asArray().find(function (a) { return a.id === renderableSeries.yAxisId; });
290
+ if (!yAxis)
291
+ throw Error("Cannot find a Y Axis with ID = " + renderableSeries.yAxisId);
292
+ if (xAxis.isVerticalChart && ![AxisAlignment_1.EAxisAlignment.Top, AxisAlignment_1.EAxisAlignment.Bottom].includes(yAxis.axisAlignment))
211
293
  throw Error("For vertical chart (chart with X Axis alignment Left or Right) Y Axis alignment should be Top or Bottom, X Axis ID = ".concat(xAxis.id));
212
- }
213
- if ((0, AxisAlignment_1.getIsVertical)(xAxis.axisAlignment) && (0, AxisAlignment_1.getIsVertical)(yAxis.axisAlignment)) {
294
+ if ((0, AxisAlignment_1.getIsVertical)(xAxis.axisAlignment) && (0, AxisAlignment_1.getIsVertical)(yAxis.axisAlignment))
214
295
  throw Error("Both x and y axes can't have vertical alignment");
215
- }
216
- if ((0, AxisAlignment_1.getIsHorizontal)(xAxis.axisAlignment) && (0, AxisAlignment_1.getIsHorizontal)(yAxis.axisAlignment)) {
296
+ if ((0, AxisAlignment_1.getIsHorizontal)(xAxis.axisAlignment) && (0, AxisAlignment_1.getIsHorizontal)(yAxis.axisAlignment))
217
297
  throw Error("Both x and y axes can't have horizontal alignment");
218
- }
219
298
  var xCalc = xAxis.getCurrentCoordinateCalculator();
220
299
  var yCalc = yAxis.getCurrentCoordinateCalculator();
221
300
  try {
222
- var renderPassData = new RenderPassData_1.RenderPassData(indexRange, xCalc, yCalc, xAxis.isVerticalChart);
223
- series.draw(renderContext, renderPassData);
301
+ var renderPassData = new RenderPassData_1.RenderPassData(indexRange, xCalc, yCalc, xAxis.isVerticalChart, pointSeries, resamplingHash);
302
+ renderableSeries.draw(renderContext, renderPassData);
224
303
  }
225
304
  finally {
226
305
  // We can not delete calculators because we use them in Hit Test
@@ -228,10 +307,24 @@ var SciChartRenderer = /** @class */ (function () {
228
307
  // yCalc.delete();
229
308
  }
230
309
  };
310
+ var nativeContext = renderContext.getNativeContext();
311
+ var viewRect = this.sciChartSurface.seriesViewRect;
312
+ nativeContext.PushMatrix();
313
+ nativeContext.PushState();
314
+ nativeContext.Translate(viewRect.x, viewRect.y);
315
+ nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
231
316
  // Draw unselected series first
232
- renderableSeries.filter(function (rs) { return rs.isVisible && !rs.isSelected; }).forEach(drawSeriesImpl);
317
+ renderableSeriesArray.forEach(function (rs, index) {
318
+ if (rs.isVisible && !rs.isSelected)
319
+ drawSeriesImpl(index);
320
+ });
233
321
  // Draw selected series at higher z-index
234
- renderableSeries.filter(function (rs) { return rs.isVisible && rs.isSelected; }).forEach(drawSeriesImpl);
322
+ renderableSeriesArray.forEach(function (rs, index) {
323
+ if (rs.isVisible && rs.isSelected)
324
+ drawSeriesImpl(index);
325
+ });
326
+ nativeContext.PopMatrix();
327
+ nativeContext.PopState();
235
328
  };
236
329
  SciChartRenderer.prototype.drawDebugAxes = function (scs, renderContext) {
237
330
  scs.xAxes.asArray().forEach(function (xAxis) {
@@ -227,7 +227,7 @@ export declare abstract class AnnotationBase implements IAnnotation, IAdornerPro
227
227
  private opacityProperty;
228
228
  private annotationLayerProperty;
229
229
  private isEditableProperty;
230
- private isHiddenProperty;
230
+ protected isHiddenProperty: boolean;
231
231
  private parentSurfaceProperty;
232
232
  private x1Property;
233
233
  private x2Property;
@@ -30,6 +30,7 @@ export declare class CursorTooltipSvgAnnotation extends SvgAnnotationBase {
30
30
  private tooltipLegendOffsetXProperty;
31
31
  private tooltipLegendOffsetYProperty;
32
32
  private svgLegend;
33
+ private previousMousePosition;
33
34
  /**
34
35
  * Creates an instance of the {@link CursorTooltipSvgAnnotation}
35
36
  * @param options
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CursorTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var constants_1 = require("./constants");
20
21
  var IAnnotation_1 = require("./IAnnotation");
21
22
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
@@ -164,6 +165,11 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
164
165
  * @inheritDoc
165
166
  */
166
167
  CursorTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
168
+ var currentMousePosition = this.cursorModifier.getMousePosition();
169
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
170
+ return;
171
+ }
172
+ this.previousMousePosition = this.cursorModifier.getMousePosition();
167
173
  if (this.svg) {
168
174
  this.delete();
169
175
  }
@@ -1,3 +1,4 @@
1
+ import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
1
2
  import { RolloverModifierRenderableSeriesProps } from "../RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps";
2
3
  import { EAnnotationType } from "./IAnnotation";
3
4
  import { SvgAnnotationBase } from "./SvgAnnotationBase";
@@ -5,6 +6,10 @@ export declare class RolloverMarkerSvgAnnotation extends SvgAnnotationBase {
5
6
  /** @inheritDoc */
6
7
  readonly type = EAnnotationType.SVG;
7
8
  private tooltipProps;
9
+ private previousMousePosition;
8
10
  constructor(renderableSeriesProps: RolloverModifierRenderableSeriesProps);
11
+ /** @inheritDoc */
12
+ update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
13
+ /** @inheritDoc */
9
14
  protected create(): void;
10
15
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverMarkerSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IAnnotation_1 = require("./IAnnotation");
20
21
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
21
22
  var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
@@ -25,13 +26,23 @@ var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
25
26
  /** @inheritDoc */
26
27
  _this.type = IAnnotation_1.EAnnotationType.SVG;
27
28
  _this.tooltipProps = renderableSeriesProps;
28
- _this.isHidden = true;
29
+ _this.isHiddenProperty = true;
29
30
  _this.x1 = 0;
30
31
  _this.y1 = 0;
31
32
  _this.xCoordShift = -4;
32
33
  _this.yCoordShift = -4;
33
34
  return _this;
34
35
  }
36
+ /** @inheritDoc */
37
+ RolloverMarkerSvgAnnotation.prototype.update = function (xCalc, yCalc) {
38
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
39
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
40
+ return;
41
+ }
42
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
43
+ _super.prototype.update.call(this, xCalc, yCalc);
44
+ };
45
+ /** @inheritDoc */
35
46
  RolloverMarkerSvgAnnotation.prototype.create = function () {
36
47
  if (this.svg) {
37
48
  this.delete();
@@ -19,6 +19,7 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
19
19
  height: number;
20
20
  private svgLegend;
21
21
  private seriesInfoProperty;
22
+ private previousMousePosition;
22
23
  /**
23
24
  * Creates an instance of the {@link RolloverTooltipSvgAnnotation}
24
25
  * @param renderableSeriesProps The {@link RolloverModifierRenderableSeriesProps | props} pass
@@ -33,18 +34,15 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
33
34
  * Gets or sets seriesInfo {@link SeriesInfo} value on the tooltip
34
35
  */
35
36
  set seriesInfo(value: SeriesInfo);
36
- /**
37
- * @inheritDoc
38
- */
37
+ /** @inheritDoc */
39
38
  delete(): void;
40
- /**
41
- * @inheritDoc
42
- */
39
+ /** @inheritDoc */
43
40
  update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
44
- updateSize(width: number, height: number): void;
45
41
  /**
46
- * @inheritDoc
42
+ * Updates size of the tooltip
47
43
  */
44
+ updateSize(width: number, height: number): void;
45
+ /** @inheritDoc */
48
46
  protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
49
47
  private updateLegendTooltip;
50
48
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IDataSeries_1 = require("../../Model/IDataSeries");
20
21
  var AnnotationBase_1 = require("./AnnotationBase");
21
22
  var constants_1 = require("./constants");
@@ -64,9 +65,7 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
64
65
  enumerable: false,
65
66
  configurable: true
66
67
  });
67
- /**
68
- * @inheritDoc
69
- */
68
+ /** @inheritDoc */
70
69
  RolloverTooltipSvgAnnotation.prototype.delete = function () {
71
70
  var _a;
72
71
  if (!this.parentSurface || this.parentSurface.isDeleted)
@@ -76,23 +75,27 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
76
75
  this.svgRoot.removeChild(this.svgLegend);
77
76
  }
78
77
  };
79
- /**
80
- * @inheritDoc
81
- */
78
+ /** @inheritDoc */
82
79
  RolloverTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
80
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
81
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
82
+ return;
83
+ }
84
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
83
85
  if (this.svg) {
84
86
  this.delete();
85
87
  }
86
88
  _super.prototype.update.call(this, xCalc, yCalc);
87
89
  this.updateLegendTooltip();
88
90
  };
91
+ /**
92
+ * Updates size of the tooltip
93
+ */
89
94
  RolloverTooltipSvgAnnotation.prototype.updateSize = function (width, height) {
90
95
  this.width = width;
91
96
  this.height = height;
92
97
  };
93
- /**
94
- * @inheritDoc
95
- */
98
+ /** @inheritDoc */
96
99
  RolloverTooltipSvgAnnotation.prototype.create = function (xCalc, yCalc) {
97
100
  var _a;
98
101
  var svgString;
@@ -38,6 +38,11 @@ var SvgAnnotationBase = /** @class */ (function (_super) {
38
38
  var _this = _super.call(this, options) || this;
39
39
  /** @inheritDoc */
40
40
  _this.isSvgAnnotation = true;
41
+ /**
42
+ * The {@link SVGElement} which will be added to the chart
43
+ */
44
+ _this.xCoordShiftProperty = 0;
45
+ _this.yCoordShiftProperty = 0;
41
46
  _this.verticalAnchorPointProperty = AnchorPoint_1.EVerticalAnchorPoint.Top;
42
47
  _this.horizontalAnchorPointProperty = AnchorPoint_1.EHorizontalAnchorPoint.Left;
43
48
  _this.prevX1Coordinate = 0;
@@ -292,8 +297,8 @@ var SvgAnnotationBase = /** @class */ (function (_super) {
292
297
  SvgAnnotationBase.prototype.calcAndSetAnnotationBorders = function (xCalc, yCalc) {
293
298
  if (!this.svg)
294
299
  return;
295
- var borderX1 = this.getX1Coordinate(xCalc, yCalc);
296
- var borderY1 = this.getY1Coordinate(xCalc, yCalc);
300
+ var borderX1 = this.getX1Coordinate(xCalc, yCalc) + this.xCoordShift;
301
+ var borderY1 = this.getY1Coordinate(xCalc, yCalc) + this.yCoordShift;
297
302
  this.svgDOMRect = this.svg.getBoundingClientRect();
298
303
  var borderX2 = borderX1 + this.svgDOMRect.width;
299
304
  var borderY2 = borderY1 + this.svgDOMRect.height;