scichart 2.1.2301 → 2.2.2389

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 (189) hide show
  1. package/Builder/buildAxis.d.ts +7 -0
  2. package/Builder/buildAxis.js +6 -0
  3. package/Builder/buildDataSeries.d.ts +19 -1
  4. package/Builder/buildDataSeries.js +22 -1
  5. package/Builder/buildModifiers.d.ts +2 -1
  6. package/Builder/buildSeries.d.ts +7 -2
  7. package/Builder/buildSeries.js +5 -1
  8. package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
  9. package/Charting/ChartModifiers/CursorModifier.js +15 -10
  10. package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
  11. package/Charting/ChartModifiers/LegendModifier.js +22 -0
  12. package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
  13. package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
  14. package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
  15. package/Charting/ChartModifiers/RolloverModifier.js +76 -19
  16. package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
  17. package/Charting/LayoutManager/LayoutManager.js +6 -1
  18. package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
  19. package/Charting/Model/BaseHeatmapDataSeries.js +5 -2
  20. package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
  21. package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
  22. package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
  23. package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
  24. package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
  25. package/Charting/Model/Filters/HlcFilterBase.js +141 -0
  26. package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
  27. package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
  28. package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
  29. package/Charting/Model/Filters/XyFilterBase.js +6 -0
  30. package/Charting/Model/Filters/XyyFilterBase.js +9 -0
  31. package/Charting/Model/Filters/XyzFilterBase.js +12 -3
  32. package/Charting/Model/HlcDataSeries.d.ts +189 -0
  33. package/Charting/Model/HlcDataSeries.js +557 -0
  34. package/Charting/Model/IDataSeries.d.ts +5 -1
  35. package/Charting/Model/IDataSeries.js +4 -0
  36. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
  37. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
  38. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
  39. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
  40. package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
  41. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
  42. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
  43. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
  44. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
  45. package/Charting/Services/SciChartRenderer.d.ts +1 -0
  46. package/Charting/Services/SciChartRenderer.js +6 -0
  47. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
  48. package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
  49. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
  50. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
  51. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
  52. package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
  53. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
  54. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
  55. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
  56. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
  57. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
  58. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
  59. package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
  60. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
  61. package/Charting/Visuals/Annotations/constants.d.ts +2 -1
  62. package/Charting/Visuals/Annotations/constants.js +1 -0
  63. package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
  64. package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
  65. package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
  66. package/Charting/Visuals/Axis/AxisCore.js +6 -0
  67. package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
  68. package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
  69. package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
  70. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
  71. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
  72. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
  73. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
  74. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
  75. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
  76. package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
  77. package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
  78. package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
  79. package/Charting/Visuals/Helpers/NativeObject.js +101 -0
  80. package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
  81. package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
  82. package/Charting/Visuals/Helpers/drawBorder.js +2 -2
  83. package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
  84. package/Charting/Visuals/Helpers/drawLabel.js +38 -18
  85. package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
  86. package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
  87. package/Charting/Visuals/Legend/SciChartLegend.js +8 -2
  88. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
  89. package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
  90. package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
  91. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
  92. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
  93. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
  94. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
  95. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
  96. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
  97. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
  98. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
  99. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
  100. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
  101. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
  102. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
  103. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
  104. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
  105. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
  106. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
  107. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
  108. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
  109. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
  110. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
  111. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
  112. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
  113. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
  114. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
  115. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
  116. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
  117. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
  118. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
  119. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
  120. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  121. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
  122. package/Charting/Visuals/RenderableSeries/constants.d.ts +7 -0
  123. package/Charting/Visuals/RenderableSeries/constants.js +7 -0
  124. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
  125. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
  126. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
  127. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
  128. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
  129. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
  130. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
  131. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
  132. package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
  133. package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
  134. package/Charting/Visuals/SciChartSurface.d.ts +13 -2
  135. package/Charting/Visuals/SciChartSurface.js +39 -3
  136. package/Charting/Visuals/createMaster.js +17 -13
  137. package/Charting/Visuals/createSingle.js +5 -3
  138. package/Charting/Visuals/licenseManager2D.d.ts +6 -0
  139. package/Charting/Visuals/licenseManager2D.js +98 -9
  140. package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
  141. package/Charting/Visuals/licenseManager2dState.js +37 -1
  142. package/Charting/Visuals/loader.js +4 -1
  143. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  144. package/Charting/Visuals/sciChartInitCommon.js +13 -9
  145. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
  146. package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
  147. package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
  148. package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
  149. package/Charting3D/Visuals/createMaster3d.js +20 -14
  150. package/Charting3D/Visuals/createSingle3d.js +3 -4
  151. package/Charting3D/Visuals/licenseManager3D.js +3 -1
  152. package/Core/BuildStamp.d.ts +1 -1
  153. package/Core/BuildStamp.js +2 -2
  154. package/Core/Telemetry.d.ts +7 -0
  155. package/Core/Telemetry.js +109 -0
  156. package/Core/storage/localStorageApi.d.ts +4 -0
  157. package/Core/storage/localStorageApi.js +12 -0
  158. package/README.md +49 -13
  159. package/_wasm/scichart.browser.js +1 -1
  160. package/_wasm/scichart2d.js +95 -95
  161. package/_wasm/scichart2d.wasm +0 -0
  162. package/_wasm/scichart3d.js +97 -97
  163. package/_wasm/scichart3d.wasm +0 -0
  164. package/package.json +1 -1
  165. package/types/AxisType.d.ts +5 -1
  166. package/types/AxisType.js +4 -0
  167. package/types/Color.d.ts +1 -0
  168. package/types/Color.js +1 -0
  169. package/types/DataFilterType.d.ts +1 -0
  170. package/types/DataFilterType.js +1 -0
  171. package/types/DataPointWidthMode.d.ts +13 -0
  172. package/types/DataPointWidthMode.js +17 -0
  173. package/types/ErrorDirection.d.ts +13 -0
  174. package/types/ErrorDirection.js +17 -0
  175. package/types/ErrorMode.d.ts +17 -0
  176. package/types/ErrorMode.js +21 -0
  177. package/types/LabelPlacement.d.ts +8 -0
  178. package/types/LabelPlacement.js +11 -1
  179. package/types/LabelProviderType.d.ts +5 -1
  180. package/types/LabelProviderType.js +4 -0
  181. package/types/SeriesType.d.ts +3 -1
  182. package/types/SeriesType.js +2 -0
  183. package/types/TSciChart.d.ts +8 -2
  184. package/types/TSciChart3D.d.ts +5 -2
  185. package/types/TSciChartSurfaceCanvases.d.ts +1 -0
  186. package/utils/date.d.ts +1 -0
  187. package/utils/date.js +15 -1
  188. package/utils/guid.d.ts +6 -0
  189. package/utils/guid.js +17 -1
@@ -0,0 +1,357 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.adjustRangeByStrokeThickness = exports.FastErrorBarsRenderableSeries = void 0;
19
+ var Deleter_1 = require("../../../Core/Deleter");
20
+ var NumberRange_1 = require("../../../Core/NumberRange");
21
+ var AxisType_1 = require("../../../types/AxisType");
22
+ var DataPointWidthMode_1 = require("../../../types/DataPointWidthMode");
23
+ var ErrorDirection_1 = require("../../../types/ErrorDirection");
24
+ var ErrorMode_1 = require("../../../types/ErrorMode");
25
+ var SeriesType_1 = require("../../../types/SeriesType");
26
+ var IDataSeries_1 = require("../../Model/IDataSeries");
27
+ var HlcPointSeriesWrapped_1 = require("../../Model/PointSeries/HlcPointSeriesWrapped");
28
+ var BaseRenderableSeries_1 = require("./BaseRenderableSeries");
29
+ var constants_1 = require("./constants");
30
+ var ErrorSeriesDrawingProvider_1 = require("./DrawingProviders/ErrorSeriesDrawingProvider");
31
+ var PointMarkerDrawingProvider_1 = require("./DrawingProviders/PointMarkerDrawingProvider");
32
+ var ErrorSeriesHitTestProvider_1 = require("./HitTest/ErrorSeriesHitTestProvider");
33
+ /**
34
+ * Defines an Error Bars Series or Error Bars chart type in the SciChart's High Performance Real-time
35
+ * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
36
+ * @remarks
37
+ * To add a line series to a {@link SciChartSurface} you need to declare both the {@link FastErrorBarsRenderableSeries | RenderableSeries}
38
+ * and a {@link HlcDataSeries | DataSeries}. Simplified code sample below:
39
+ *
40
+ * ```ts
41
+ * const sciChartSurface: SciChartSurface;
42
+ * const wasmContext: TSciChart;
43
+ * // Create and fill the dataseries
44
+ * const dataSeries = new HlcDataSeries(wasmContext);
45
+ * dataSeries.append(1, 2, 0,4, 0.5);
46
+ * dataSeries.append(2, 3, 0,2, 0.3);
47
+ * // Create the renderableSeries
48
+ * const errorSeries = new FastErrorBarsRenderableSeries(wasmContext);
49
+ * errorSeries.dataSeries = dataSeries;
50
+ * // append to the SciChartSurface
51
+ * sciChartSurface.renderableSeries.add(errorSeries);
52
+ * ```
53
+ */
54
+ var FastErrorBarsRenderableSeries = /** @class */ (function (_super) {
55
+ __extends(FastErrorBarsRenderableSeries, _super);
56
+ /**
57
+ * Creates an instance of the {@link FastErrorBarsRenderableSeries}
58
+ * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
59
+ * native methods and access to our WebGL2 WebAssembly Drawing Engine
60
+ * @param options optional parameters of type {@link IFastErrorBarsRenderableSeriesOptions} applied when constructing the series type
61
+ */
62
+ function FastErrorBarsRenderableSeries(webAssemblyContext, options) {
63
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
64
+ var _this = _super.call(this, webAssemblyContext, options) || this;
65
+ _this.type = SeriesType_1.ESeriesType.ErrorBarsSeries;
66
+ _this.dataPointWidthProperty = 0.5;
67
+ _this.dataPointWidthModeProperty = DataPointWidthMode_1.EDataPointWidthMode.Relative;
68
+ _this.errorModeProperty = ErrorMode_1.EErrorMode.Both;
69
+ _this.errorDirectionProperty = ErrorDirection_1.EErrorDirection.Vertical;
70
+ _this.strokeDashArrayProperty = [];
71
+ _this.drawWhiskersProperty = true;
72
+ _this.drawConnectorProperty = true;
73
+ _this.dataPointWidth = (_a = options === null || options === void 0 ? void 0 : options.dataPointWidth) !== null && _a !== void 0 ? _a : _this.dataPointWidthProperty;
74
+ _this.errorModeProperty = (_b = options === null || options === void 0 ? void 0 : options.errorMode) !== null && _b !== void 0 ? _b : _this.errorModeProperty;
75
+ _this.errorDirectionProperty = (_c = options === null || options === void 0 ? void 0 : options.errorDirection) !== null && _c !== void 0 ? _c : _this.errorDirectionProperty;
76
+ _this.dataPointWidthMode = (_d = options === null || options === void 0 ? void 0 : options.dataPointWidthMode) !== null && _d !== void 0 ? _d : _this.dataPointWidthModeProperty;
77
+ _this.strokeDashArray = (_e = options === null || options === void 0 ? void 0 : options.strokeDashArray) !== null && _e !== void 0 ? _e : _this.strokeDashArrayProperty;
78
+ _this.drawWhiskers = (_f = options === null || options === void 0 ? void 0 : options.drawWhiskers) !== null && _f !== void 0 ? _f : _this.drawWhiskersProperty;
79
+ _this.drawConnector = (_g = options === null || options === void 0 ? void 0 : options.drawConnector) !== null && _g !== void 0 ? _g : _this.drawConnectorProperty;
80
+ // delete inherited drawing providers
81
+ _this.drawingProviders = [
82
+ new ErrorSeriesDrawingProvider_1.ErrorSeriesDrawingProvider(webAssemblyContext, _this),
83
+ new PointMarkerDrawingProvider_1.PointMarkerDrawingProvider(webAssemblyContext, _this)
84
+ ];
85
+ // Must be called here for the series type to be available
86
+ if ((_h = _this.paletteProvider) === null || _h === void 0 ? void 0 : _h.onAttached) {
87
+ (_j = _this.paletteProvider) === null || _j === void 0 ? void 0 : _j.onAttached(_this);
88
+ }
89
+ if (options === null || options === void 0 ? void 0 : options.animation) {
90
+ _this.animationQueue.push(options.animation);
91
+ }
92
+ return _this;
93
+ }
94
+ /** @inheritDoc */
95
+ FastErrorBarsRenderableSeries.prototype.applyTheme = function (themeProvider) {
96
+ _super.prototype.applyTheme.call(this, themeProvider);
97
+ var previousThemeProvider = this.parentSurface.previousThemeProvider;
98
+ if (this.stroke === previousThemeProvider.lineSeriesColor) {
99
+ this.stroke = themeProvider.lineSeriesColor;
100
+ }
101
+ };
102
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "strokeDashArray", {
103
+ /**
104
+ * The StrokeDashArray defines the stroke or dash pattern for the line.
105
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
106
+ */
107
+ get: function () {
108
+ return this.strokeDashArrayProperty;
109
+ },
110
+ /**
111
+ * The StrokeDashArray defines the stroke or dash pattern for the line.
112
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
113
+ */
114
+ set: function (strokeDashArray) {
115
+ this.strokeDashArrayProperty = strokeDashArray;
116
+ this.notifyPropertyChanged(constants_1.PROPERTY.STROKE_DASH_ARRAY);
117
+ },
118
+ enumerable: false,
119
+ configurable: true
120
+ });
121
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "drawWhiskers", {
122
+ /**
123
+ * Gets or sets whether Error Bars should be drawn with whiskers
124
+ * @remarks enabled by default
125
+ */
126
+ get: function () {
127
+ return this.drawWhiskersProperty;
128
+ },
129
+ /**
130
+ * Gets or sets whether Error Bars should be drawn with whiskers
131
+ * @remarks enabled by default
132
+ */
133
+ set: function (value) {
134
+ this.drawWhiskersProperty = value;
135
+ this.notifyPropertyChanged(constants_1.PROPERTY.DRAW_WHISKERS);
136
+ },
137
+ enumerable: false,
138
+ configurable: true
139
+ });
140
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "drawConnector", {
141
+ /**
142
+ * Gets or sets whether Error Bars should be drawn with a connector
143
+ * @remarks enabled by default
144
+ */
145
+ get: function () {
146
+ return this.drawConnectorProperty;
147
+ },
148
+ /**
149
+ * Gets or sets whether Error Bars should be drawn with a connector
150
+ * @remarks enabled by default
151
+ */
152
+ set: function (value) {
153
+ this.drawConnectorProperty = value;
154
+ this.notifyPropertyChanged(constants_1.PROPERTY.DRAW_CONNECTOR);
155
+ },
156
+ enumerable: false,
157
+ configurable: true
158
+ });
159
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "paletteProvider", {
160
+ /**
161
+ * Gets or sets the paletteProvider of Renderable Series
162
+ * @remarks paletteProvider is not supported by {@link FastErrorBarsRenderableSeries}
163
+ */
164
+ get: function () {
165
+ // TODO implement paletting for FastErrorBarsRenderableSeries
166
+ return undefined;
167
+ },
168
+ set: function (paletteProvider) {
169
+ throw new Error("paletteProvider is not supported by FastErrorBarsRenderableSeries!");
170
+ },
171
+ enumerable: false,
172
+ configurable: true
173
+ });
174
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "dataPointWidth", {
175
+ /**
176
+ * Gets or sets the width of error bar caps.
177
+ * By default the value is treated as relative, valid values range from 0.0 - 1.0.
178
+ * @remarks
179
+ * To specify if the value should be treated as relative or absolute use {@link errorType}
180
+ */
181
+ get: function () {
182
+ return this.dataPointWidthProperty;
183
+ },
184
+ /**
185
+ * Gets or sets the width of error bar caps.
186
+ * By default the value is treated as relative, valid values range from 0.0 - 1.0.
187
+ * @remarks
188
+ * To specify if the value should be treated as relative or absolute use {@link dataPointWidthMode}
189
+ */
190
+ set: function (value) {
191
+ this.dataPointWidthProperty = value;
192
+ this.notifyPropertyChanged(constants_1.PROPERTY.DATA_POINT_WIDTH);
193
+ },
194
+ enumerable: false,
195
+ configurable: true
196
+ });
197
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "errorMode", {
198
+ /**
199
+ * Gets or sets the errorMode of Error Bars. Available values are {@link EErrorMode}
200
+ */
201
+ get: function () {
202
+ return this.errorModeProperty;
203
+ },
204
+ /**
205
+ * Gets or sets the errorMode of Error Bars. Available values are {@link EErrorMode}
206
+ */
207
+ set: function (value) {
208
+ this.errorModeProperty = value;
209
+ this.notifyPropertyChanged(constants_1.PROPERTY.ERROR_MODE);
210
+ },
211
+ enumerable: false,
212
+ configurable: true
213
+ });
214
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "errorDirection", {
215
+ /**
216
+ * Gets or sets the errorDirection of Error Bars. Available values are {@link EErrorDirection}
217
+ */
218
+ get: function () {
219
+ return this.errorDirectionProperty;
220
+ },
221
+ /**
222
+ * Gets or sets the errorDirection of Error Bars. Available values are {@link EErrorDirection}
223
+ */
224
+ set: function (value) {
225
+ this.errorDirectionProperty = value;
226
+ this.notifyPropertyChanged(constants_1.PROPERTY.ERROR_DIRECTION);
227
+ },
228
+ enumerable: false,
229
+ configurable: true
230
+ });
231
+ Object.defineProperty(FastErrorBarsRenderableSeries.prototype, "dataPointWidthMode", {
232
+ /**
233
+ * Gets or sets the value mode for data point width. Available values are {@link EDataPointWidthMode}
234
+ */
235
+ get: function () {
236
+ return this.dataPointWidthModeProperty;
237
+ },
238
+ /**
239
+ * Gets or sets the value mode for data point width. Available values are {@link EDataPointWidthMode}
240
+ */
241
+ set: function (value) {
242
+ this.dataPointWidthModeProperty = value;
243
+ this.notifyPropertyChanged(constants_1.PROPERTY.DATA_POINT_WIDTH_MODE);
244
+ },
245
+ enumerable: false,
246
+ configurable: true
247
+ });
248
+ FastErrorBarsRenderableSeries.prototype.delete = function () {
249
+ _super.prototype.delete.call(this);
250
+ this.pointSeries = (0, Deleter_1.deleteSafe)(this.pointSeries);
251
+ };
252
+ /**
253
+ * @inheritDoc
254
+ */
255
+ FastErrorBarsRenderableSeries.prototype.getDataPointWidth = function (coordCalc, widthFraction) {
256
+ var isVerticalDirection = this.errorDirection === ErrorDirection_1.EErrorDirection.Vertical;
257
+ var values = isVerticalDirection ? this.dataSeries.getNativeXValues() : this.dataSeries.getNativeYValues();
258
+ var seriesViewRectWidth = coordCalc.viewportDimension;
259
+ var isCategoryAxis = coordCalc.isCategoryCoordinateCalculator;
260
+ return (0, BaseRenderableSeries_1.getDataPointWidth)(values, coordCalc, seriesViewRectWidth, widthFraction, isCategoryAxis, this.webAssemblyContext);
261
+ };
262
+ /**
263
+ * @inheritDoc
264
+ */
265
+ FastErrorBarsRenderableSeries.prototype.getXRange = function () {
266
+ var _a;
267
+ var isVerticalDirection = this.errorDirection === ErrorDirection_1.EErrorDirection.Vertical;
268
+ var hasHighCap = this.errorMode !== ErrorMode_1.EErrorMode.Low;
269
+ var hasLowCap = this.errorMode !== ErrorMode_1.EErrorMode.High;
270
+ var range = this.dataSeries.getXRange(IDataSeries_1.EDataSeriesValueType.Default, !isVerticalDirection, hasHighCap, hasLowCap);
271
+ if (this.xAxis.type === AxisType_1.EAxisType.LogarithmicAxis)
272
+ return range;
273
+ else
274
+ return isVerticalDirection
275
+ ? this.adjustRangeByDataPointWidth(range)
276
+ : (0, exports.adjustRangeByStrokeThickness)(range, this.strokeThickness, (_a = this.parentSurface.seriesViewRect) === null || _a === void 0 ? void 0 : _a.width);
277
+ };
278
+ /** @inheritDoc */
279
+ FastErrorBarsRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
280
+ var _a;
281
+ if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
282
+ var isHorizontalDirection = this.errorDirection === ErrorDirection_1.EErrorDirection.Horizontal;
283
+ var hasHighCap = this.errorMode !== ErrorMode_1.EErrorMode.Low;
284
+ var hasLowCap = this.errorMode !== ErrorMode_1.EErrorMode.High;
285
+ var dataSeriesValueType = this.isRunningDataAnimation
286
+ ? IDataSeries_1.EDataSeriesValueType.FinalAnimationValues
287
+ : IDataSeries_1.EDataSeriesValueType.Default;
288
+ var range = this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis, dataSeriesValueType, isHorizontalDirection, hasHighCap, hasLowCap);
289
+ // Not sure how to adjust this sensibly without having the dataPointWidth in pixels. Not sure if we can reliably get a valid coordCacluator
290
+ if (this.yAxis.type === AxisType_1.EAxisType.LogarithmicAxis)
291
+ return range;
292
+ else
293
+ return isHorizontalDirection
294
+ ? this.adjustRangeByDataPointWidth(range)
295
+ : (0, exports.adjustRangeByStrokeThickness)(range, this.strokeThickness, (_a = this.parentSurface.seriesViewRect) === null || _a === void 0 ? void 0 : _a.height);
296
+ };
297
+ /** @inheritDoc */
298
+ FastErrorBarsRenderableSeries.prototype.toJSON = function (excludeData) {
299
+ if (excludeData === void 0) { excludeData = false; }
300
+ var json = _super.prototype.toJSON.call(this, excludeData);
301
+ var options = {
302
+ dataPointWidth: this.dataPointWidth,
303
+ dataPointWidthMode: this.dataPointWidthMode,
304
+ errorDirection: this.errorDirection,
305
+ errorMode: this.errorMode,
306
+ drawWhiskers: this.drawWhiskers,
307
+ drawConnector: this.drawConnector,
308
+ strokeDashArray: this.strokeDashArray
309
+ };
310
+ Object.assign(json.options, options);
311
+ return json;
312
+ };
313
+ /** @inheritDoc */
314
+ FastErrorBarsRenderableSeries.prototype.toPointSeries = function (rp) {
315
+ if (rp) {
316
+ throw new Error("Error Bars Series don't support resampling!");
317
+ }
318
+ else {
319
+ return new HlcPointSeriesWrapped_1.HlcPointSeriesWrapped(this.dataSeries);
320
+ }
321
+ };
322
+ /**
323
+ * @inheritDoc
324
+ */
325
+ FastErrorBarsRenderableSeries.prototype.newHitTestProvider = function () {
326
+ return new ErrorSeriesHitTestProvider_1.ErrorSeriesHitTestProvider(this, this.webAssemblyContext);
327
+ };
328
+ FastErrorBarsRenderableSeries.prototype.adjustRangeByDataPointWidth = function (range) {
329
+ var _a, _b, _c, _d;
330
+ var count = this.dataSeries.count();
331
+ if (count > 1) {
332
+ var areaSize = this.errorDirection === ErrorDirection_1.EErrorDirection.Vertical
333
+ ? (_b = (_a = this.parentSurface.seriesViewRect) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0
334
+ : (_d = (_c = this.parentSurface.seriesViewRect) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0;
335
+ var additionalValue = this.dataPointWidthMode === DataPointWidthMode_1.EDataPointWidthMode.Relative
336
+ ? ((range.diff / (count - 1)) * this.dataPointWidth) / 2
337
+ : areaSize &&
338
+ (0, BaseRenderableSeries_1.getDelta)({
339
+ range: range,
340
+ areaSize: areaSize,
341
+ pointSize: this.dataPointWidth
342
+ });
343
+ return new NumberRange_1.NumberRange(range.min - additionalValue, range.max + additionalValue);
344
+ }
345
+ // TODO: figure out what to do if we have only one point
346
+ return range;
347
+ };
348
+ return FastErrorBarsRenderableSeries;
349
+ }(BaseRenderableSeries_1.BaseRenderableSeries));
350
+ exports.FastErrorBarsRenderableSeries = FastErrorBarsRenderableSeries;
351
+ /** @ignore */
352
+ var adjustRangeByStrokeThickness = function (range, strokeThickness, areaSize) {
353
+ if (areaSize === void 0) { areaSize = 0; }
354
+ var delta = areaSize && (0, BaseRenderableSeries_1.getDelta)({ pointSize: strokeThickness, areaSize: areaSize, range: range });
355
+ return new NumberRange_1.NumberRange(range.min - delta, range.max + delta);
356
+ };
357
+ exports.adjustRangeByStrokeThickness = adjustRangeByStrokeThickness;
@@ -20,7 +20,7 @@ var NumberRange_1 = require("../../../Core/NumberRange");
20
20
  var SeriesType_1 = require("../../../types/SeriesType");
21
21
  var EllipsePointMarker_1 = require("../PointMarkers/EllipsePointMarker");
22
22
  var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
23
- var DpiHelper_1 = require("../TextureManager/DpiHelper");
23
+ var BaseRenderableSeries_1 = require("./BaseRenderableSeries");
24
24
  var constants_1 = require("./constants");
25
25
  var FastColumnRenderableSeries_1 = require("./FastColumnRenderableSeries");
26
26
  var ImpulseSeriesHitTestProvider_1 = require("./HitTest/ImpulseSeriesHitTestProvider");
@@ -120,7 +120,7 @@ var FastImpulseRenderableSeries = /** @class */ (function (_super) {
120
120
  */
121
121
  FastImpulseRenderableSeries.prototype.getXRange = function () {
122
122
  var range = _super.prototype.getXRange.call(this);
123
- var delta = getDelta({
123
+ var delta = (0, BaseRenderableSeries_1.getDelta)({
124
124
  pointSize: this.size,
125
125
  areaSize: this.parentSurface.seriesViewRect.width,
126
126
  range: range
@@ -136,7 +136,7 @@ var FastImpulseRenderableSeries = /** @class */ (function (_super) {
136
136
  if (!yRange) {
137
137
  return undefined;
138
138
  }
139
- var delta = getDelta({
139
+ var delta = (0, BaseRenderableSeries_1.getDelta)({
140
140
  pointSize: this.size,
141
141
  areaSize: this.parentSurface.seriesViewRect.height,
142
142
  range: yRange
@@ -170,10 +170,3 @@ var FastImpulseRenderableSeries = /** @class */ (function (_super) {
170
170
  return FastImpulseRenderableSeries;
171
171
  }(FastColumnRenderableSeries_1.FastColumnRenderableSeries));
172
172
  exports.FastImpulseRenderableSeries = FastImpulseRenderableSeries;
173
- /** @ignore */
174
- var getDelta = function (_a) {
175
- var pointSize = _a.pointSize, areaSize = _a.areaSize, range = _a.range;
176
- var pointScaled = pointSize * DpiHelper_1.DpiHelper.PIXEL_RATIO;
177
- var k = areaSize / (areaSize - pointScaled);
178
- return (Math.abs(range.max - range.min) * (k - 1)) / 2;
179
- };
@@ -0,0 +1,20 @@
1
+ import { FastErrorBarsRenderableSeries } from "../FastErrorBarsRenderableSeries";
2
+ import { BaseHitTestProvider } from "./BaseHitTestProvider";
3
+ import { HitTestInfo } from "./HitTestInfo";
4
+ /**
5
+ * Hit-test provider for {@link FastColumnRenderableSeries}. See base class {@link BaseHitTestProvider} for further info
6
+ */
7
+ export declare class ErrorSeriesHitTestProvider extends BaseHitTestProvider<FastErrorBarsRenderableSeries> {
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ hitTest(x: number, y: number): HitTestInfo;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ hitTestForDataPointSelectionModifier(x: number, y: number, hitTestRadius?: number): HitTestInfo;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ hitTestXSlice(x: number, y: number): HitTestInfo;
20
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ErrorSeriesHitTestProvider = void 0;
19
+ var ErrorDirection_1 = require("../../../../types/ErrorDirection");
20
+ var ErrorMode_1 = require("../../../../types/ErrorMode");
21
+ var pointUtil_1 = require("../../../../utils/pointUtil");
22
+ var BaseHitTestProvider_1 = require("./BaseHitTestProvider");
23
+ var hitTestHelpers_1 = require("./hitTestHelpers");
24
+ var HitTestInfo_1 = require("./HitTestInfo");
25
+ /**
26
+ * Hit-test provider for {@link FastColumnRenderableSeries}. See base class {@link BaseHitTestProvider} for further info
27
+ */
28
+ var ErrorSeriesHitTestProvider = /** @class */ (function (_super) {
29
+ __extends(ErrorSeriesHitTestProvider, _super);
30
+ function ErrorSeriesHitTestProvider() {
31
+ return _super !== null && _super.apply(this, arguments) || this;
32
+ }
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ ErrorSeriesHitTestProvider.prototype.hitTest = function (x, y) {
37
+ var hitTestPoint = this.getTranslatedHitTestPoint(x, y);
38
+ if (!hitTestPoint) {
39
+ return HitTestInfo_1.HitTestInfo.empty();
40
+ }
41
+ var _a = this.currentRenderPassData, xCoordinateCalculator = _a.xCoordinateCalculator, yCoordinateCalculator = _a.yCoordinateCalculator, isVerticalChart = _a.isVerticalChart;
42
+ var xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
43
+ var yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
44
+ var dataSeries = this.parentSeries.dataSeries;
45
+ // TODO handle horizontal direction
46
+ var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
47
+ var xNativeValues = dataSeries.getNativeXValues();
48
+ var yNativeValues = dataSeries.getNativeYValues();
49
+ var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
50
+ if (nearestPointIndex >= 0) {
51
+ var res = hitTestHelpers_1.hitTestHelpers.testIsHitForErrorBars(xCoordinateCalculator, yCoordinateCalculator, this.parentSeries, xNativeValues, yNativeValues, nearestPointIndex, xHitCoord, yHitCoord);
52
+ hitTestInfo.isHit = res.isHit;
53
+ hitTestInfo.highValue = res.highValue;
54
+ hitTestInfo.lowValue = res.lowValue;
55
+ }
56
+ else {
57
+ hitTestInfo.isHit = false;
58
+ }
59
+ return hitTestInfo;
60
+ };
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ ErrorSeriesHitTestProvider.prototype.hitTestForDataPointSelectionModifier = function (x, y, hitTestRadius) {
65
+ if (hitTestRadius === void 0) { hitTestRadius = BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS; }
66
+ return this.hitTest(x, y);
67
+ };
68
+ /**
69
+ * @inheritDoc
70
+ */
71
+ ErrorSeriesHitTestProvider.prototype.hitTestXSlice = function (x, y) {
72
+ var hitTestPoint = this.getTranslatedHitTestPoint(x, y);
73
+ if (!hitTestPoint) {
74
+ return HitTestInfo_1.HitTestInfo.empty();
75
+ }
76
+ var _a = this.currentRenderPassData, xCoordinateCalculator = _a.xCoordinateCalculator, yCoordinateCalculator = _a.yCoordinateCalculator, isVerticalChart = _a.isVerticalChart;
77
+ var xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
78
+ var yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
79
+ var dataSeries = this.parentSeries.dataSeries;
80
+ var xNativeValues = dataSeries.getNativeXValues();
81
+ var yNativeValues = dataSeries.getNativeYValues();
82
+ var lowNativeValues = dataSeries.getNativeLowValues();
83
+ var highNativeValues = dataSeries.getNativeHighValues();
84
+ var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
85
+ var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
86
+ var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
87
+ if (nearestPointIndex >= 0) {
88
+ var isVerticalDirection = this.parentSeries.errorDirection === ErrorDirection_1.EErrorDirection.Vertical;
89
+ hitTestInfo.highValue = highNativeValues.get(nearestPointIndex);
90
+ hitTestInfo.lowValue = lowNativeValues.get(nearestPointIndex);
91
+ var hasLowCap = this.parentSeries.errorMode !== ErrorMode_1.EErrorMode.High;
92
+ var hasHighCap = this.parentSeries.errorMode !== ErrorMode_1.EErrorMode.Low;
93
+ var xFirstValue = void 0;
94
+ var xLastValue = void 0;
95
+ if (isVerticalDirection) {
96
+ xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
97
+ xLastValue = isCategoryAxis ? xNativeValues.size() - 1 : xNativeValues.get(xNativeValues.size() - 1);
98
+ }
99
+ else {
100
+ xFirstValue = hasLowCap ? lowNativeValues.get(0) : xNativeValues.get(0);
101
+ xLastValue = hasHighCap
102
+ ? highNativeValues.get(xNativeValues.size() - 1)
103
+ : xNativeValues.get(xNativeValues.size() - 1);
104
+ }
105
+ var dataPointWidthPx = this.parentSeries.getDataPointWidth(isVerticalDirection ? xCoordinateCalculator : yCoordinateCalculator, this.parentSeries.dataPointWidth);
106
+ var halfRange = dataPointWidthPx / 2;
107
+ var xCoord = xCoordinateCalculator.getCoordinate(hitTestInfo.hitTestPointValues.x);
108
+ var xFirstCoord = xCoordinateCalculator.getCoordinate(xFirstValue);
109
+ var xLastCoord = xCoordinateCalculator.getCoordinate(xLastValue);
110
+ hitTestInfo.isWithinDataBounds = (0, pointUtil_1.testIsInInterval)(xCoord, xFirstCoord - halfRange, xLastCoord + halfRange);
111
+ hitTestInfo.isHit = hitTestInfo.isWithinDataBounds;
112
+ }
113
+ else {
114
+ hitTestInfo.isHit = false;
115
+ }
116
+ return hitTestInfo;
117
+ };
118
+ return ErrorSeriesHitTestProvider;
119
+ }(BaseHitTestProvider_1.BaseHitTestProvider));
120
+ exports.ErrorSeriesHitTestProvider = ErrorSeriesHitTestProvider;
@@ -8,6 +8,7 @@ import { XyyDataSeries } from "../../../Model/XyyDataSeries";
8
8
  import { CoordinateCalculatorBase } from "../../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
9
9
  import { BaseOhlcRenderableSeries } from "../BaseOhlcRenderableSeries";
10
10
  import { FastColumnRenderableSeries } from "../FastColumnRenderableSeries";
11
+ import { FastErrorBarsRenderableSeries } from "../FastErrorBarsRenderableSeries";
11
12
  import { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
12
13
  import { IRenderableSeries } from "../IRenderableSeries";
13
14
  import { HitTestInfo } from "./HitTestInfo";
@@ -42,5 +43,10 @@ export declare const hitTestHelpers: {
42
43
  isHit: boolean;
43
44
  secondPointIndex: number;
44
45
  };
46
+ testIsHitForErrorBars: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, renderableSeries: FastErrorBarsRenderableSeries, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, pointIndex: number, xHitCoord: number, yHitCoord: number) => {
47
+ isHit: boolean;
48
+ highValue: number;
49
+ lowValue: number;
50
+ };
45
51
  testIsHitForImpulse: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, renderableSeries: FastImpulseRenderableSeries, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, pointIndex: number, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => boolean;
46
52
  };
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hitTestHelpers = void 0;
4
4
  var Point_1 = require("../../../../Core/Point");
5
+ var ErrorDirection_1 = require("../../../../types/ErrorDirection");
5
6
  var pointUtil_1 = require("../../../../utils/pointUtil");
6
7
  var HitTestInfo_1 = require("./HitTestInfo");
7
8
  var interpolateLinear = function (x, x1, y1, x2, y2) {
@@ -79,6 +80,7 @@ var getNearestXPoint = function (webAssemblyContext, xCoordinateCalculator, data
79
80
  if (isSorted) {
80
81
  return webAssemblyContext.NumberUtil.FindIndex(xValues, xHitValue, webAssemblyContext.SCRTFindIndexSearchMode.Nearest, isSorted);
81
82
  }
83
+ // TODO check if could be refactored
82
84
  var dataLength = dataSeries.count();
83
85
  var nearestPointIndex = -1;
84
86
  var currentDistance = Number.MAX_VALUE;
@@ -268,6 +270,39 @@ var testIsHitForColumn = function (xCoordinateCalculator, yCoordinateCalculator,
268
270
  var bottomColumnSide = zeroLineYCoord > yCoord ? yCoord : zeroLineYCoord;
269
271
  return (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord - halfWidth, topColumnSide, xCoord + halfWidth, bottomColumnSide);
270
272
  };
273
+ var testIsHitForErrorBars = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, xValues, yValues, pointIndex, xHitCoord, yHitCoord) {
274
+ var getDataPointWidth = renderableSeries.getDataPointWidth, dataPointWidth = renderableSeries.dataPointWidth, errorDirection = renderableSeries.errorDirection;
275
+ var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
276
+ var isVerticalDirection = errorDirection === ErrorDirection_1.EErrorDirection.Vertical;
277
+ var xValue = isCategoryAxis ? pointIndex : xValues.get(pointIndex);
278
+ var yValue = yValues.get(pointIndex);
279
+ var highValue = renderableSeries.dataSeries.getNativeHighValues().get(pointIndex);
280
+ var lowValue = renderableSeries.dataSeries.getNativeLowValues().get(pointIndex);
281
+ if (isNaN(highValue))
282
+ highValue = yValue;
283
+ if (isNaN(lowValue))
284
+ lowValue = yValue;
285
+ var xCoord = xCoordinateCalculator.getCoordinate(xValue);
286
+ var yCoord = yCoordinateCalculator.getCoordinate(yValue);
287
+ var highCoord = isVerticalDirection
288
+ ? yCoordinateCalculator.getCoordinate(highValue)
289
+ : xCoordinateCalculator.getCoordinate(highValue);
290
+ var lowCoord = isVerticalDirection
291
+ ? yCoordinateCalculator.getCoordinate(lowValue)
292
+ : xCoordinateCalculator.getCoordinate(lowValue);
293
+ var columnWidth = getDataPointWidth(isVerticalDirection ? xCoordinateCalculator : yCoordinateCalculator, dataPointWidth);
294
+ var halfWidth = columnWidth / 2;
295
+ var isHit = false;
296
+ var upperErrorBoundary = highCoord > lowCoord ? highCoord : lowCoord;
297
+ var lowerErrorBoundary = highCoord > lowCoord ? lowCoord : highCoord;
298
+ if (isVerticalDirection) {
299
+ isHit = (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord - halfWidth, upperErrorBoundary, xCoord + halfWidth, lowerErrorBoundary);
300
+ }
301
+ else {
302
+ isHit = (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, lowerErrorBoundary, yCoord + halfWidth, upperErrorBoundary, yCoord - halfWidth);
303
+ }
304
+ return { isHit: isHit, highValue: highValue, lowValue: lowValue };
305
+ };
271
306
  var testIsHitForImpulse = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, xValues, yValues, pointIndex, xHitCoord, yHitCoord, hitTestRadius) {
272
307
  var zeroLineY = renderableSeries.zeroLineY;
273
308
  var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
@@ -357,5 +392,6 @@ exports.hitTestHelpers = {
357
392
  testIsHitForColumn: testIsHitForColumn,
358
393
  testIsHitForOHLC: testIsHitForOHLC,
359
394
  testIsHitForMountain: testIsHitForMountain,
395
+ testIsHitForErrorBars: testIsHitForErrorBars,
360
396
  testIsHitForImpulse: testIsHitForImpulse
361
397
  };
@@ -7,6 +7,10 @@ import { IPointMarker } from "../PointMarkers/IPointMarker";
7
7
  import { SeriesAnimation } from "./Animations/SeriesAnimation";
8
8
  import { IRenderableSeries } from "./IRenderableSeries";
9
9
  import { ShaderEffect } from "./ShaderEffect";
10
+ /**
11
+ * The type of the {@link IBaseRenderableSeriesOptions.onIsVisibleChanged } callback
12
+ */
13
+ export declare type TSeriesVisibleChangedCallback = (sourceSeries: IRenderableSeries, isVisible: boolean) => void;
10
14
  /**
11
15
  * The type of the {@link IBaseRenderableSeriesOptions.onSelectedChanged } callback
12
16
  */
@@ -149,6 +153,10 @@ export interface IBaseRenderableSeriesOptions {
149
153
  * Initial hovered state for the series. Default to false
150
154
  */
151
155
  isHovered?: boolean;
156
+ /**
157
+ * Optional callback function when isVisible changed. Also see {@link IRenderableSeries.isVisibleChanged} event handler
158
+ */
159
+ onIsVisibleChanged?: TSeriesVisibleChangedCallback | string;
152
160
  /**
153
161
  * Optional callback function when selected changed. Also see {@link IRenderableSeries.selected} event handler
154
162
  */
@@ -26,6 +26,7 @@ import { IHitTestProvider } from "./HitTest/IHitTestProvider";
26
26
  import { RolloverModifierRenderableSeriesProps } from "./RolloverModifier/RolloverModifierRenderableSeriesProps";
27
27
  import { SeriesHoveredArgs } from "./SeriesHoveredArgs";
28
28
  import { SeriesSelectedArgs } from "./SeriesSelectedArgs";
29
+ import { SeriesVisibleChangedArgs } from "./SeriesVisibleChangedArgs";
29
30
  /**
30
31
  * @summary Defines the interface to a Render Series (or Chart Type) in SciChart's High Performance Real-time
31
32
  * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
@@ -222,6 +223,11 @@ export interface IRenderableSeries extends IDeletable, IThemeable, INotifyOnDpiC
222
223
  * @remarks See {@link EventHandler} for how to subscribe
223
224
  */
224
225
  readonly hovered: EventHandler<SeriesHoveredArgs>;
226
+ /**
227
+ * An isVisible changed EventHandler. This event fires whenever the {@link IRenderableSeries | Series} isVisible changes.
228
+ * @remarks See {@link EventHandler} for how to subscribe
229
+ */
230
+ readonly isVisibleChanged: EventHandler<SeriesVisibleChangedArgs>;
225
231
  /**
226
232
  * gets if the animation is currently running
227
233
  */