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,252 @@
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.ErrorSeriesDrawingProvider = void 0;
19
+ var Deleter_1 = require("../../../../Core/Deleter");
20
+ var AxisType_1 = require("../../../../types/AxisType");
21
+ var DataPointWidthMode_1 = require("../../../../types/DataPointWidthMode");
22
+ var ErrorDirection_1 = require("../../../../types/ErrorDirection");
23
+ var ErrorMode_1 = require("../../../../types/ErrorMode");
24
+ var Pen2DCache_1 = require("../../../Drawing/Pen2DCache");
25
+ var WebGlRenderContext2D_1 = require("../../../Drawing/WebGlRenderContext2D");
26
+ var LogarithmicAxis_1 = require("../../Axis/LogarithmicAxis");
27
+ var constants_1 = require("../constants");
28
+ var BaseSeriesDrawingProvider_1 = require("./BaseSeriesDrawingProvider");
29
+ /**
30
+ * Used internally - a drawing provider performs drawing for a {@link BaseBandRenderableSeries} using
31
+ * our WebAssembly WebGL rendering engine
32
+ */
33
+ var ErrorSeriesDrawingProvider = /** @class */ (function (_super) {
34
+ __extends(ErrorSeriesDrawingProvider, _super);
35
+ // private args: SCRTLineDrawingParams;
36
+ // private xLineCoordinates: SCRTDoubleVector;
37
+ // private yLineCoordinates: SCRTDoubleVector;
38
+ /**
39
+ * Creates an instance of the {@link BandSeriesDrawingProvider}
40
+ * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
41
+ * access to our WebGL2 Engine and WebAssembly numerical methods
42
+ * @param parentSeries the parent {@link BaseBandRenderableSeries} which this drawing provider is attached to
43
+ */
44
+ function ErrorSeriesDrawingProvider(webAssemblyContext, parentSeries) {
45
+ var _this = _super.call(this, webAssemblyContext, parentSeries) || this;
46
+ _this.linesPenCache = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
47
+ _this.vertices = new _this.webAssemblyContext.VectorColorVertex();
48
+ return _this;
49
+ // this.args = new webAssemblyContext.SCRTLineDrawingParams();
50
+ // this.xLineCoordinates = new this.webAssemblyContext.SCRTDoubleVector();
51
+ // this.yLineCoordinates = new this.webAssemblyContext.SCRTDoubleVector();
52
+ }
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ ErrorSeriesDrawingProvider.prototype.onAttachSeries = function () {
57
+ _super.prototype.onAttachSeries.call(this);
58
+ // this.nativeDrawingProvider = new this.webAssemblyContext.SCRTLineSeriesDrawingProvider();
59
+ var _a = this.parentSeries, stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
60
+ (0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity, strokeDashArray);
61
+ };
62
+ /**
63
+ * @inheritDoc
64
+ */
65
+ ErrorSeriesDrawingProvider.prototype.onDetachSeries = function () {
66
+ _super.prototype.onDetachSeries.call(this);
67
+ this.delete();
68
+ };
69
+ /**
70
+ * @inheritDoc
71
+ */
72
+ ErrorSeriesDrawingProvider.prototype.delete = function () {
73
+ // this.nativeDrawingProvider = deleteSafe(this.nativeDrawingProvider);
74
+ this.linesPenCache = (0, Deleter_1.deleteSafe)(this.linesPenCache);
75
+ this.vertices = (0, Deleter_1.deleteSafe)(this.vertices);
76
+ // this.args = deleteSafe(this.args);
77
+ _super.prototype.delete.call(this);
78
+ };
79
+ /**
80
+ * @inheritDoc
81
+ */
82
+ ErrorSeriesDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
83
+ var linesPen = (0, Pen2DCache_1.getScrtPenFromCache)(this.linesPenCache);
84
+ if (!linesPen) {
85
+ return;
86
+ }
87
+ var pointSeries = renderPassData.pointSeries;
88
+ this.vertices.clear();
89
+ // this.xLineCoordinates.clear();
90
+ // this.yLineCoordinates.clear();
91
+ // this.args.Reset();
92
+ // this.args.SetLinesPen(linesPen);
93
+ // this.args.isDigitalLine = this.parentSeries.isDigitalLine;
94
+ // this.args.forceShaderMethod = true;
95
+ // this.args.containsNaN = true;
96
+ // this.args.lineGaps = this.webAssemblyContext.SCRTLineGapMode.DrawGaps;
97
+ // this.args.verticalChart = renderPassData.isVerticalChart;
98
+ // // Stroke paletting per point
99
+ // this.applyStrokePaletting(linesPen);
100
+ // if (this.palettingState.palettedColors) {
101
+ // this.args.SetPalettedColors(this.palettingState.palettedColors);
102
+ // }
103
+ // const nativeContext = renderContext.getNativeContext();
104
+ var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
105
+ var xValues = pointSeries.xValues;
106
+ var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
107
+ var yDrawValues = pointSeries.yValues;
108
+ var hDrawValues = pointSeries.highValues;
109
+ var lDrawValues = pointSeries.lowValues;
110
+ var isVerticalDirection = this.parentSeries.errorDirection === ErrorDirection_1.EErrorDirection.Vertical;
111
+ var dataPointWidthCalc = isVerticalDirection
112
+ ? renderPassData.xCoordinateCalculator
113
+ : renderPassData.yCoordinateCalculator;
114
+ var dataPointWidthPx = this.parentSeries.dataPointWidthMode === DataPointWidthMode_1.EDataPointWidthMode.Absolute
115
+ ? this.parentSeries.dataPointWidth
116
+ : this.parentSeries.getDataPointWidth(dataPointWidthCalc, this.parentSeries.dataPointWidth);
117
+ // const halfRange = Math.abs(
118
+ // dataPointWidthCalc.getDataValue(dataPointWidthPx * 0.5) - dataPointWidthCalc.getDataValue(0)
119
+ // );
120
+ var halfRange = dataPointWidthPx * 0.5;
121
+ var hasLogarithmicXAxis = this.parentSeries.xAxis.type === AxisType_1.EAxisType.LogarithmicAxis;
122
+ var hasLogarithmicYAxis = this.parentSeries.yAxis.type === AxisType_1.EAxisType.LogarithmicAxis;
123
+ var hasNegativeLogXAxis = this.parentSeries.xAxis.isNegative;
124
+ var hasNegativeLogYAxis = this.parentSeries.yAxis.isNegative;
125
+ var hasHighCap = this.parentSeries.errorMode !== ErrorMode_1.EErrorMode.Low;
126
+ var hasLowCap = this.parentSeries.errorMode !== ErrorMode_1.EErrorMode.High;
127
+ var dataPointsCount = xDrawValues.size();
128
+ if (isVerticalDirection) {
129
+ for (var i = 0; i < dataPointsCount; ++i) {
130
+ var xValue = xDrawValues.get(i);
131
+ var yValue = yDrawValues.get(i);
132
+ var highValue = hasHighCap ? hDrawValues.get(i) : yValue;
133
+ var lowValue = hasLowCap ? lDrawValues.get(i) : yValue;
134
+ var shouldDrawLowErrorToLimit = hasLogarithmicYAxis && !hasNegativeLogYAxis && lowValue <= 0;
135
+ if (shouldDrawLowErrorToLimit) {
136
+ lowValue = this.parentSeries.yAxis.visibleRange.min;
137
+ }
138
+ var shouldDrawHighErrorToLimit = hasLogarithmicYAxis && hasNegativeLogYAxis && highValue >= 0;
139
+ if (shouldDrawHighErrorToLimit) {
140
+ highValue = this.parentSeries.yAxis.visibleRange.max;
141
+ }
142
+ // const xCoord = xValue;
143
+ // const yCoord = yValue;
144
+ // const highCoord = highValue;
145
+ // const lowCoord = lowValue;
146
+ var xCoord = renderPassData.xCoordinateCalculator.getCoordinate(xValue);
147
+ var yCoord = renderPassData.yCoordinateCalculator.getCoordinate(yValue);
148
+ var highCoord = renderPassData.yCoordinateCalculator.getCoordinate(highValue);
149
+ var lowCoord = renderPassData.yCoordinateCalculator.getCoordinate(lowValue);
150
+ var capStart = xCoord - halfRange;
151
+ var capEnd = xCoord + halfRange;
152
+ // main line
153
+ if (this.parentSeries.drawConnector) {
154
+ this.addLineVertices(xCoord, isNaN(highValue) ? yCoord : highCoord, xCoord, isNaN(lowValue) ? yCoord : lowCoord);
155
+ }
156
+ if (hasHighCap && !shouldDrawHighErrorToLimit && this.parentSeries.drawWhiskers) {
157
+ // top whiskers
158
+ this.addLineVertices(capStart, highCoord, capEnd, highCoord);
159
+ }
160
+ if (hasLowCap && !shouldDrawLowErrorToLimit && this.parentSeries.drawWhiskers) {
161
+ // bottom whiskers
162
+ this.addLineVertices(capStart, lowCoord, capEnd, lowCoord);
163
+ }
164
+ }
165
+ }
166
+ else {
167
+ for (var i = 0; i < dataPointsCount; ++i) {
168
+ var xValue = xDrawValues.get(i);
169
+ var yValue = yDrawValues.get(i);
170
+ var lowValue = hasLowCap ? lDrawValues.get(i) : xValue;
171
+ var highValue = hasHighCap ? hDrawValues.get(i) : xValue;
172
+ var shouldDrawLowErrorToLimit = hasLogarithmicXAxis && !hasNegativeLogXAxis && lowValue <= 0;
173
+ if (shouldDrawLowErrorToLimit) {
174
+ lowValue = LogarithmicAxis_1.MIN_LOG_AXIS_VALUE;
175
+ }
176
+ var shouldDrawHighErrorToLimit = hasLogarithmicXAxis && hasNegativeLogXAxis && highValue >= 0;
177
+ if (shouldDrawHighErrorToLimit) {
178
+ highValue = -LogarithmicAxis_1.MIN_LOG_AXIS_VALUE;
179
+ }
180
+ // const xCoord = xValue;
181
+ // const yCoord = yValue;
182
+ // const highCoord = highValue;
183
+ // const lowCoord = lowValue;
184
+ var xCoord = renderPassData.xCoordinateCalculator.getCoordinate(xValue);
185
+ var yCoord = renderPassData.yCoordinateCalculator.getCoordinate(yValue);
186
+ var highCoord = renderPassData.xCoordinateCalculator.getCoordinate(highValue);
187
+ var lowCoord = renderPassData.xCoordinateCalculator.getCoordinate(lowValue);
188
+ var capStart = yCoord - halfRange;
189
+ var capEnd = yCoord + halfRange;
190
+ // main line
191
+ if (this.parentSeries.drawConnector) {
192
+ this.addLineVertices(isNaN(lowValue) ? xCoord : lowCoord, yCoord, isNaN(highValue) ? xCoord : highCoord, yCoord);
193
+ }
194
+ if (hasHighCap && !shouldDrawHighErrorToLimit && this.parentSeries.drawWhiskers) {
195
+ // top whiskers
196
+ this.addLineVertices(highCoord, capStart, highCoord, capEnd);
197
+ }
198
+ if (hasLowCap && !shouldDrawLowErrorToLimit && this.parentSeries.drawWhiskers) {
199
+ // bottom whiskers
200
+ this.addLineVertices(lowCoord, capStart, lowCoord, capEnd);
201
+ }
202
+ }
203
+ }
204
+ // this.nativeDrawingProvider.DrawLinesVec(nativeContext, xValues, yValues, xCoordCalc, yCoordCalc, args);
205
+ renderContext.drawLinesNative(this.vertices, linesPen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine);
206
+ };
207
+ /**
208
+ * @inheritDoc
209
+ */
210
+ ErrorSeriesDrawingProvider.prototype.onDpiChanged = function (args) {
211
+ _super.prototype.onDpiChanged.call(this, args);
212
+ this.onSeriesPropertyChange(constants_1.PROPERTY.STROKE);
213
+ };
214
+ /**
215
+ * @inheritDoc
216
+ */
217
+ ErrorSeriesDrawingProvider.prototype.onSeriesPropertyChange = function (propertyName) {
218
+ _super.prototype.onSeriesPropertyChange.call(this, propertyName);
219
+ var _a = this.parentSeries, stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
220
+ if (propertyName === constants_1.PROPERTY.STROKE ||
221
+ propertyName === constants_1.PROPERTY.STROKE_THICKNESS ||
222
+ propertyName === constants_1.PROPERTY.OPACITY ||
223
+ propertyName === constants_1.PROPERTY.STROKE_DASH_ARRAY) {
224
+ (0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity, strokeDashArray);
225
+ }
226
+ };
227
+ ErrorSeriesDrawingProvider.prototype.addLineVertices = function (x1, y1, x2, y2) {
228
+ var isVerticalChart = this.parentSeries.xAxis.isVerticalChart;
229
+ var vertex1;
230
+ var vertex2;
231
+ if (isVerticalChart) {
232
+ vertex1 = new this.webAssemblyContext.SCRTColorVertex(y1, x1);
233
+ vertex2 = new this.webAssemblyContext.SCRTColorVertex(y2, x2);
234
+ }
235
+ else {
236
+ vertex1 = new this.webAssemblyContext.SCRTColorVertex(x1, y1);
237
+ vertex2 = new this.webAssemblyContext.SCRTColorVertex(x2, y2);
238
+ }
239
+ this.vertices.push_back(vertex1);
240
+ this.vertices.push_back(vertex2);
241
+ vertex1.delete();
242
+ vertex2.delete();
243
+ // this.xLineCoordinates.push_back(x1);
244
+ // this.yLineCoordinates.push_back(x2);
245
+ // this.xLineCoordinates.push_back(y1);
246
+ // this.yLineCoordinates.push_back(y2);
247
+ // this.xLineCoordinates.push_back(NaN);
248
+ // this.yLineCoordinates.push_back(NaN);
249
+ };
250
+ return ErrorSeriesDrawingProvider;
251
+ }(BaseSeriesDrawingProvider_1.BaseSeriesDrawingProvider));
252
+ exports.ErrorSeriesDrawingProvider = ErrorSeriesDrawingProvider;
@@ -0,0 +1,188 @@
1
+ import { NumberRange } from "../../../Core/NumberRange";
2
+ import { EDataPointWidthMode } from "../../../types/DataPointWidthMode";
3
+ import { EErrorDirection } from "../../../types/ErrorDirection";
4
+ import { EErrorMode } from "../../../types/ErrorMode";
5
+ import { ESeriesType } from "../../../types/SeriesType";
6
+ import { TSciChart } from "../../../types/TSciChart";
7
+ import { IPaletteProvider } from "../../Model/IPaletteProvider";
8
+ import { IHlcPointSeries } from "../../Model/PointSeries/IPointSeries";
9
+ import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
10
+ import { ResamplingParams } from "../../Numerics/Resamplers/ResamplingParams";
11
+ import { IThemeProvider } from "../../Themes/IThemeProvider";
12
+ import { BaseRenderableSeries } from "./BaseRenderableSeries";
13
+ import { IHitTestProvider } from "./HitTest/IHitTestProvider";
14
+ import { IBaseRenderableSeriesOptions } from "./IBaseRenderableSeriesOptions";
15
+ /**
16
+ * Options to pass to the {@link FastErrorBarsRenderableSeries} constructor
17
+ */
18
+ export interface IFastErrorBarsRenderableSeriesOptions extends IBaseRenderableSeriesOptions {
19
+ /**
20
+ * The StrokeDashArray defines the stroke or dash pattern for the line.
21
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
22
+ */
23
+ strokeDashArray?: number[];
24
+ /**
25
+ * The width of error bar caps.
26
+ * By default the value is treated as relative, valid values range from 0.0 - 1.0.
27
+ * To specify if the value should be treated as relative or absolute use {@link dataPointWidthMode}
28
+ */
29
+ dataPointWidth?: number;
30
+ /**
31
+ * The value mode for data point width. Available values are {@link EDataPointWidthMode}
32
+ */
33
+ dataPointWidthMode?: EDataPointWidthMode;
34
+ /**
35
+ * Gets or sets the errorMode of Error Bars. Available values are {@link EErrorMode}
36
+ */
37
+ errorMode?: EErrorMode;
38
+ /**
39
+ * The errorDirection of Error Bars. Available values are {@link EErrorDirection}
40
+ */
41
+ errorDirection?: EErrorDirection;
42
+ /**
43
+ * The flag defining whether Error Bars should be drawn with whiskers
44
+ * @remarks enabled by default
45
+ */
46
+ drawWhiskers?: boolean;
47
+ /**
48
+ * TThe flag defining whether Error Bars should be drawn with a connector
49
+ * @remarks enabled by default
50
+ */
51
+ drawConnector?: boolean;
52
+ }
53
+ /**
54
+ * Defines an Error Bars Series or Error Bars chart type in the SciChart's High Performance Real-time
55
+ * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
56
+ * @remarks
57
+ * To add a line series to a {@link SciChartSurface} you need to declare both the {@link FastErrorBarsRenderableSeries | RenderableSeries}
58
+ * and a {@link HlcDataSeries | DataSeries}. Simplified code sample below:
59
+ *
60
+ * ```ts
61
+ * const sciChartSurface: SciChartSurface;
62
+ * const wasmContext: TSciChart;
63
+ * // Create and fill the dataseries
64
+ * const dataSeries = new HlcDataSeries(wasmContext);
65
+ * dataSeries.append(1, 2, 0,4, 0.5);
66
+ * dataSeries.append(2, 3, 0,2, 0.3);
67
+ * // Create the renderableSeries
68
+ * const errorSeries = new FastErrorBarsRenderableSeries(wasmContext);
69
+ * errorSeries.dataSeries = dataSeries;
70
+ * // append to the SciChartSurface
71
+ * sciChartSurface.renderableSeries.add(errorSeries);
72
+ * ```
73
+ */
74
+ export declare class FastErrorBarsRenderableSeries extends BaseRenderableSeries {
75
+ readonly type = ESeriesType.ErrorBarsSeries;
76
+ private dataPointWidthProperty;
77
+ private dataPointWidthModeProperty;
78
+ private errorModeProperty;
79
+ private errorDirectionProperty;
80
+ private strokeDashArrayProperty;
81
+ private drawWhiskersProperty;
82
+ private drawConnectorProperty;
83
+ /**
84
+ * Creates an instance of the {@link FastErrorBarsRenderableSeries}
85
+ * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
86
+ * native methods and access to our WebGL2 WebAssembly Drawing Engine
87
+ * @param options optional parameters of type {@link IFastErrorBarsRenderableSeriesOptions} applied when constructing the series type
88
+ */
89
+ constructor(webAssemblyContext: TSciChart, options?: IFastErrorBarsRenderableSeriesOptions);
90
+ /** @inheritDoc */
91
+ applyTheme(themeProvider: IThemeProvider): void;
92
+ /**
93
+ * The StrokeDashArray defines the stroke or dash pattern for the line.
94
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
95
+ */
96
+ get strokeDashArray(): number[];
97
+ /**
98
+ * The StrokeDashArray defines the stroke or dash pattern for the line.
99
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
100
+ */
101
+ set strokeDashArray(strokeDashArray: number[]);
102
+ /**
103
+ * Gets or sets whether Error Bars should be drawn with whiskers
104
+ * @remarks enabled by default
105
+ */
106
+ get drawWhiskers(): boolean;
107
+ /**
108
+ * Gets or sets whether Error Bars should be drawn with whiskers
109
+ * @remarks enabled by default
110
+ */
111
+ set drawWhiskers(value: boolean);
112
+ /**
113
+ * Gets or sets whether Error Bars should be drawn with a connector
114
+ * @remarks enabled by default
115
+ */
116
+ get drawConnector(): boolean;
117
+ /**
118
+ * Gets or sets whether Error Bars should be drawn with a connector
119
+ * @remarks enabled by default
120
+ */
121
+ set drawConnector(value: boolean);
122
+ /**
123
+ * Gets or sets the paletteProvider of Renderable Series
124
+ * @remarks paletteProvider is not supported by {@link FastErrorBarsRenderableSeries}
125
+ */
126
+ get paletteProvider(): IPaletteProvider;
127
+ set paletteProvider(paletteProvider: IPaletteProvider);
128
+ /**
129
+ * Gets or sets the width of error bar caps.
130
+ * By default the value is treated as relative, valid values range from 0.0 - 1.0.
131
+ * @remarks
132
+ * To specify if the value should be treated as relative or absolute use {@link errorType}
133
+ */
134
+ get dataPointWidth(): number;
135
+ /**
136
+ * Gets or sets the width of error bar caps.
137
+ * By default the value is treated as relative, valid values range from 0.0 - 1.0.
138
+ * @remarks
139
+ * To specify if the value should be treated as relative or absolute use {@link dataPointWidthMode}
140
+ */
141
+ set dataPointWidth(value: number);
142
+ /**
143
+ * Gets or sets the errorMode of Error Bars. Available values are {@link EErrorMode}
144
+ */
145
+ get errorMode(): EErrorMode;
146
+ /**
147
+ * Gets or sets the errorMode of Error Bars. Available values are {@link EErrorMode}
148
+ */
149
+ set errorMode(value: EErrorMode);
150
+ /**
151
+ * Gets or sets the errorDirection of Error Bars. Available values are {@link EErrorDirection}
152
+ */
153
+ get errorDirection(): EErrorDirection;
154
+ /**
155
+ * Gets or sets the errorDirection of Error Bars. Available values are {@link EErrorDirection}
156
+ */
157
+ set errorDirection(value: EErrorDirection);
158
+ /**
159
+ * Gets or sets the value mode for data point width. Available values are {@link EDataPointWidthMode}
160
+ */
161
+ get dataPointWidthMode(): EDataPointWidthMode;
162
+ /**
163
+ * Gets or sets the value mode for data point width. Available values are {@link EDataPointWidthMode}
164
+ */
165
+ set dataPointWidthMode(value: EDataPointWidthMode);
166
+ delete(): void;
167
+ /**
168
+ * @inheritDoc
169
+ */
170
+ getDataPointWidth(coordCalc: CoordinateCalculatorBase, widthFraction: number): number;
171
+ /**
172
+ * @inheritDoc
173
+ */
174
+ getXRange(): NumberRange;
175
+ /** @inheritDoc */
176
+ getYRange(xVisibleRange: NumberRange, isXCategoryAxis?: boolean): NumberRange;
177
+ /** @inheritDoc */
178
+ toJSON(excludeData?: boolean): import("../../../Builder/buildSeries").TSeriesDefinition;
179
+ /** @inheritDoc */
180
+ toPointSeries(rp?: ResamplingParams): IHlcPointSeries;
181
+ /**
182
+ * @inheritDoc
183
+ */
184
+ protected newHitTestProvider(): IHitTestProvider;
185
+ protected adjustRangeByDataPointWidth(range: NumberRange): NumberRange;
186
+ }
187
+ /** @ignore */
188
+ export declare const adjustRangeByStrokeThickness: (range: NumberRange, strokeThickness: number, areaSize?: number) => NumberRange;