scichart 2.0.2228 → 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.
- package/Charting/ChartModifiers/DataPointSelectionModifier.js +0 -1
- package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
- package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
- package/Charting/Model/BaseDataSeries.d.ts +42 -15
- package/Charting/Model/BaseDataSeries.js +77 -28
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
- package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
- package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
- package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
- package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
- package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
- package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
- package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
- package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
- package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
- package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
- package/Charting/Model/IDataSeries.d.ts +37 -5
- package/Charting/Model/OhlcDataSeries.d.ts +12 -11
- package/Charting/Model/OhlcDataSeries.js +37 -34
- package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
- package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
- package/Charting/Model/PointSeries/IPointSeries.js +2 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
- package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
- package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
- package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
- package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
- package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
- package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
- package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
- package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
- package/Charting/Model/XyDataSeries.d.ts +3 -2
- package/Charting/Model/XyDataSeries.js +22 -22
- package/Charting/Model/XyyDataSeries.d.ts +5 -5
- package/Charting/Model/XyyDataSeries.js +24 -21
- package/Charting/Model/XyzDataSeries.d.ts +5 -5
- package/Charting/Model/XyzDataSeries.js +24 -21
- package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
- package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
- package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
- package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
- package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
- package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +232 -0
- package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
- package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
- package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
- package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
- package/Charting/Services/RenderPassData.d.ts +6 -1
- package/Charting/Services/RenderPassData.js +5 -1
- package/Charting/Services/RenderPassInfo.d.ts +18 -0
- package/Charting/Services/RenderPassInfo.js +14 -0
- package/Charting/Services/SciChartRenderer.d.ts +14 -1
- package/Charting/Services/SciChartRenderer.js +122 -31
- package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
- package/Charting/Visuals/Axis/AxisCore.js +39 -18
- package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +6 -6
- package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
- package/Charting/Visuals/Axis/NumericAxis.js +2 -2
- package/Charting/Visuals/Axis/constants.d.ts +1 -0
- package/Charting/Visuals/Axis/constants.js +1 -0
- package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +59 -0
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +40 -5
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +114 -10
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +4 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +6 -12
- package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +6 -2
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +5 -0
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
- package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +0 -6
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
- package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/constants.js +3 -0
- package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
- package/Charting/Visuals/SciChartDefaults.js +9 -1
- package/Charting/Visuals/licenseManager2D.js +19 -20
- package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
- package/Charting/Visuals/licenseManager2dState.js +12 -0
- package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
- package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/OneTimePerformanceWarning.d.ts +6 -0
- package/Core/OneTimePerformanceWarning.js +19 -0
- package/Core/storage/localStorageApi.d.ts +9 -0
- package/Core/storage/localStorageApi.js +32 -0
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +95 -95
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +96 -96
- package/_wasm/scichart3d.wasm +0 -0
- package/constants/performanceWarnings.d.ts +5 -0
- package/constants/performanceWarnings.js +8 -0
- package/package.json +1 -1
- package/types/SearchMode.d.ts +21 -0
- package/types/SearchMode.js +25 -0
- package/types/TSciChart.d.ts +143 -40
- package/types/TSciChart3D.d.ts +66 -28
- package/utils/array.d.ts +7 -0
- package/utils/array.js +19 -1
- package/utils/calcAverage.d.ts +2 -2
- package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
- package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
- package/utils/hash.d.ts +7 -0
- package/utils/hash.js +35 -0
- package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
- package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
- package/utils/performance.d.ts +0 -5
- package/utils/performance.js +0 -11
|
@@ -20,7 +20,7 @@ var Deleter_1 = require("../../Core/Deleter");
|
|
|
20
20
|
var Guard_1 = require("../../Core/Guard");
|
|
21
21
|
var NumberRange_1 = require("../../Core/NumberRange");
|
|
22
22
|
var NumberArray_1 = require("../../types/NumberArray");
|
|
23
|
-
var
|
|
23
|
+
var appendDoubleVectorFromJsArray_1 = require("../../utils/ccall/appendDoubleVectorFromJsArray");
|
|
24
24
|
var animationHelpers_1 = require("../Visuals/RenderableSeries/Animations/animationHelpers");
|
|
25
25
|
var BaseDataSeries_1 = require("./BaseDataSeries");
|
|
26
26
|
var IDataSeries_1 = require("./IDataSeries");
|
|
@@ -49,9 +49,9 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
49
49
|
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
50
50
|
/** @inheritDoc */
|
|
51
51
|
_this.type = IDataSeries_1.EDataSeriesType.Xyy;
|
|
52
|
-
_this.y1Values = new webAssemblyContext.
|
|
53
|
-
_this.y1InitialAnimationValues = new webAssemblyContext.
|
|
54
|
-
_this.y1FinalAnimationValues = new webAssemblyContext.
|
|
52
|
+
_this.y1Values = new webAssemblyContext.SCRTDoubleVector();
|
|
53
|
+
_this.y1InitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
54
|
+
_this.y1FinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
55
55
|
if (options === null || options === void 0 ? void 0 : options.xValues) {
|
|
56
56
|
Guard_1.Guard.notNull(options.yValues, "options.yValues");
|
|
57
57
|
Guard_1.Guard.notNull(options.y1Values, "options.y1Values");
|
|
@@ -78,9 +78,11 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
78
78
|
*/
|
|
79
79
|
XyyDataSeries.prototype.append = function (x, y, y1, metadata) {
|
|
80
80
|
if (!this.getIsDeleted()) {
|
|
81
|
+
var nativeX = this.getNativeXValues();
|
|
82
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, [x], [y]);
|
|
81
83
|
// Push metadata should be done before push x values
|
|
82
84
|
this.appendMetadata(metadata);
|
|
83
|
-
|
|
85
|
+
nativeX.push_back(x);
|
|
84
86
|
this.getNativeYValues().push_back(y);
|
|
85
87
|
this.getNativeY1Values().push_back(y1);
|
|
86
88
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, 1);
|
|
@@ -111,11 +113,12 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
111
113
|
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
112
114
|
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
113
115
|
}
|
|
114
|
-
// Push metadata should be done before push x values
|
|
115
|
-
this.appendMetadataRange(metadata, xValues.length);
|
|
116
116
|
var nativeX = this.getNativeXValues();
|
|
117
117
|
var nativeY = this.getNativeYValues();
|
|
118
118
|
var nativeY1 = this.getNativeY1Values();
|
|
119
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, xValues, yValues);
|
|
120
|
+
// Push metadata should be done before push x values
|
|
121
|
+
this.appendMetadataRange(metadata, xValues.length);
|
|
119
122
|
// Old implementation with copying each element
|
|
120
123
|
// for (let i = 0; i < xValues.length; i++) {
|
|
121
124
|
// nativeX.push_back(xValues[i]);
|
|
@@ -123,9 +126,9 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
123
126
|
// nativeY1.push_back(y1Values[i]);
|
|
124
127
|
// }
|
|
125
128
|
// New implementation passing array from JS
|
|
126
|
-
(0,
|
|
127
|
-
(0,
|
|
128
|
-
(0,
|
|
129
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeX, xValues);
|
|
130
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeY, yValues);
|
|
131
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeY1, y1Values);
|
|
129
132
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, xValues.length);
|
|
130
133
|
}
|
|
131
134
|
};
|
|
@@ -140,6 +143,7 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
140
143
|
XyyDataSeries.prototype.update = function (index, y, y1, metadata) {
|
|
141
144
|
if (!this.getIsDeleted()) {
|
|
142
145
|
this.validateIndex(index);
|
|
146
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, undefined, undefined, [y], index);
|
|
143
147
|
this.getNativeYValues().set(index, y);
|
|
144
148
|
this.getNativeY1Values().set(index, y1);
|
|
145
149
|
this.setMetadataAt(index, metadata);
|
|
@@ -157,7 +161,10 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
157
161
|
*/
|
|
158
162
|
XyyDataSeries.prototype.updateXyy1 = function (index, x, y, y1, metadata) {
|
|
159
163
|
if (!this.getIsDeleted()) {
|
|
160
|
-
this.
|
|
164
|
+
this.validateIndex(index);
|
|
165
|
+
var nativeX = this.getNativeXValues();
|
|
166
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, nativeX, [x], [y], index);
|
|
167
|
+
nativeX.set(index, x);
|
|
161
168
|
this.getNativeYValues().set(index, y);
|
|
162
169
|
this.getNativeY1Values().set(index, y1);
|
|
163
170
|
this.setMetadataAt(index, metadata);
|
|
@@ -182,6 +189,7 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
182
189
|
var nativeX = this.getNativeXValues();
|
|
183
190
|
var nativeY = this.getNativeYValues();
|
|
184
191
|
var nativeY1 = this.getNativeY1Values();
|
|
192
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, [x], [y], startIndex);
|
|
185
193
|
nativeX.insertAt(startIndex, x);
|
|
186
194
|
nativeY.insertAt(startIndex, y);
|
|
187
195
|
nativeY1.insertAt(startIndex, y1);
|
|
@@ -214,16 +222,11 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
214
222
|
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
215
223
|
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
216
224
|
}
|
|
217
|
-
var rangeLength = xValues.length;
|
|
218
225
|
var nativeX = this.getNativeXValues();
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
nativeX.insertAt(tempStartIndex, xValues[i]);
|
|
224
|
-
nativeY.insertAt(tempStartIndex, yValues[i]);
|
|
225
|
-
nativeY1.insertAt(tempStartIndex, y1Values[i]);
|
|
226
|
-
}
|
|
226
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, xValues, yValues, startIndex);
|
|
227
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, xValues, nativeX, startIndex);
|
|
228
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, yValues, this.getNativeYValues(), startIndex);
|
|
229
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, y1Values, this.getNativeY1Values(), startIndex);
|
|
227
230
|
this.insertMetadataRange(startIndex, metadata);
|
|
228
231
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Insert, startIndex, xValues.length);
|
|
229
232
|
}
|
|
@@ -269,7 +272,7 @@ var XyyDataSeries = /** @class */ (function (_super) {
|
|
|
269
272
|
*/
|
|
270
273
|
XyyDataSeries.prototype.clear = function () {
|
|
271
274
|
if (!this.getIsDeleted()) {
|
|
272
|
-
|
|
275
|
+
_super.prototype.clear.call(this);
|
|
273
276
|
this.getNativeXValues().clear();
|
|
274
277
|
this.getNativeYValues().clear();
|
|
275
278
|
this.getNativeY1Values().clear();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NumberArray } from "../../types/NumberArray";
|
|
2
|
-
import {
|
|
2
|
+
import { SCRTDoubleVector, TSciChart } from "../../types/TSciChart";
|
|
3
3
|
import { SeriesAnimation } from "../Visuals/RenderableSeries/Animations/SeriesAnimation";
|
|
4
4
|
import { BaseDataSeries, IBaseDataSeriesOptions } from "./BaseDataSeries";
|
|
5
5
|
import { EDataSeriesType } from "./IDataSeries";
|
|
@@ -40,12 +40,12 @@ export declare class XyzDataSeries extends BaseDataSeries {
|
|
|
40
40
|
/**
|
|
41
41
|
* Z vector with initial animation values
|
|
42
42
|
*/
|
|
43
|
-
zInitialAnimationValues:
|
|
43
|
+
zInitialAnimationValues: SCRTDoubleVector;
|
|
44
44
|
/**
|
|
45
45
|
* Z vector with final animation values
|
|
46
46
|
*/
|
|
47
|
-
zFinalAnimationValues:
|
|
48
|
-
protected zValues:
|
|
47
|
+
zFinalAnimationValues: SCRTDoubleVector;
|
|
48
|
+
protected zValues: SCRTDoubleVector;
|
|
49
49
|
/**
|
|
50
50
|
* Creates an instance of {@link XyzDataSeries}
|
|
51
51
|
* @param webAssemblyContext the {@link TSciChart | SciChart WebAssembly Context} containing native methods
|
|
@@ -56,7 +56,7 @@ export declare class XyzDataSeries extends BaseDataSeries {
|
|
|
56
56
|
/**
|
|
57
57
|
* Gets a native / WebAssembly vector of Z-values in the DataSeries
|
|
58
58
|
*/
|
|
59
|
-
getNativeZValues():
|
|
59
|
+
getNativeZValues(): SCRTDoubleVector;
|
|
60
60
|
/**
|
|
61
61
|
* Appends a single X, Y, Z point to the DataSeries
|
|
62
62
|
* @remarks
|
|
@@ -19,7 +19,7 @@ exports.XyzDataSeries = void 0;
|
|
|
19
19
|
var Deleter_1 = require("../../Core/Deleter");
|
|
20
20
|
var Guard_1 = require("../../Core/Guard");
|
|
21
21
|
var NumberArray_1 = require("../../types/NumberArray");
|
|
22
|
-
var
|
|
22
|
+
var appendDoubleVectorFromJsArray_1 = require("../../utils/ccall/appendDoubleVectorFromJsArray");
|
|
23
23
|
var animationHelpers_1 = require("../Visuals/RenderableSeries/Animations/animationHelpers");
|
|
24
24
|
var BaseDataSeries_1 = require("./BaseDataSeries");
|
|
25
25
|
var IDataSeries_1 = require("./IDataSeries");
|
|
@@ -48,9 +48,9 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
48
48
|
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
49
49
|
/** @inheritDoc */
|
|
50
50
|
_this.type = IDataSeries_1.EDataSeriesType.Xyz;
|
|
51
|
-
_this.zValues = new webAssemblyContext.
|
|
52
|
-
_this.zInitialAnimationValues = new webAssemblyContext.
|
|
53
|
-
_this.zFinalAnimationValues = new webAssemblyContext.
|
|
51
|
+
_this.zValues = new webAssemblyContext.SCRTDoubleVector();
|
|
52
|
+
_this.zInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
53
|
+
_this.zFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
54
54
|
if (options === null || options === void 0 ? void 0 : options.xValues) {
|
|
55
55
|
Guard_1.Guard.notNull(options.yValues, "options.yValues");
|
|
56
56
|
Guard_1.Guard.notNull(options.zValues, "options.zValues");
|
|
@@ -77,9 +77,11 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
77
77
|
*/
|
|
78
78
|
XyzDataSeries.prototype.append = function (x, y, z, metadata) {
|
|
79
79
|
if (!this.getIsDeleted()) {
|
|
80
|
+
var nativeX = this.getNativeXValues();
|
|
81
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, [x], [y]);
|
|
80
82
|
// Push metadata should be done before push x values
|
|
81
83
|
this.appendMetadata(metadata);
|
|
82
|
-
|
|
84
|
+
nativeX.push_back(x);
|
|
83
85
|
this.getNativeYValues().push_back(y);
|
|
84
86
|
this.getNativeZValues().push_back(z);
|
|
85
87
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, 1);
|
|
@@ -110,14 +112,15 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
110
112
|
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
111
113
|
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
112
114
|
}
|
|
113
|
-
// Push metadata should be done before push x values
|
|
114
|
-
this.appendMetadataRange(metadata, xValues.length);
|
|
115
115
|
var nativeX = this.getNativeXValues();
|
|
116
116
|
var nativeY = this.getNativeYValues();
|
|
117
117
|
var nativeZ = this.getNativeZValues();
|
|
118
|
-
(
|
|
119
|
-
|
|
120
|
-
(
|
|
118
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, xValues, yValues);
|
|
119
|
+
// Push metadata should be done before push x values
|
|
120
|
+
this.appendMetadataRange(metadata, xValues.length);
|
|
121
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeX, xValues);
|
|
122
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeY, yValues);
|
|
123
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeZ, zValues);
|
|
121
124
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, xValues.length);
|
|
122
125
|
}
|
|
123
126
|
};
|
|
@@ -132,6 +135,7 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
132
135
|
XyzDataSeries.prototype.update = function (index, y, z, metadata) {
|
|
133
136
|
if (!this.getIsDeleted()) {
|
|
134
137
|
this.validateIndex(index);
|
|
138
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, undefined, undefined, [y], index);
|
|
135
139
|
this.getNativeYValues().set(index, y);
|
|
136
140
|
this.getNativeZValues().set(index, z);
|
|
137
141
|
this.setMetadataAt(index, metadata);
|
|
@@ -149,7 +153,10 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
149
153
|
*/
|
|
150
154
|
XyzDataSeries.prototype.updateXyz = function (index, x, y, z, metadata) {
|
|
151
155
|
if (!this.getIsDeleted()) {
|
|
152
|
-
this.
|
|
156
|
+
this.validateIndex(index);
|
|
157
|
+
var nativeX = this.getNativeXValues();
|
|
158
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, nativeX, [x], [y], index);
|
|
159
|
+
nativeX.set(index, x);
|
|
153
160
|
this.getNativeYValues().set(index, y);
|
|
154
161
|
this.getNativeZValues().set(index, z);
|
|
155
162
|
this.setMetadataAt(index, metadata);
|
|
@@ -174,6 +181,7 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
174
181
|
var nativeX = this.getNativeXValues();
|
|
175
182
|
var nativeY = this.getNativeYValues();
|
|
176
183
|
var nativeZ = this.getNativeZValues();
|
|
184
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, [x], [y], startIndex);
|
|
177
185
|
nativeX.insertAt(startIndex, x);
|
|
178
186
|
nativeY.insertAt(startIndex, y);
|
|
179
187
|
nativeZ.insertAt(startIndex, z);
|
|
@@ -206,16 +214,11 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
206
214
|
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
207
215
|
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
208
216
|
}
|
|
209
|
-
var rangeLength = xValues.length;
|
|
210
217
|
var nativeX = this.getNativeXValues();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
nativeX.insertAt(tempStartIndex, xValues[i]);
|
|
216
|
-
nativeY.insertAt(tempStartIndex, yValues[i]);
|
|
217
|
-
nativeZ.insertAt(tempStartIndex, zValues[i]);
|
|
218
|
-
}
|
|
218
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, xValues, yValues, startIndex);
|
|
219
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, xValues, nativeX, startIndex);
|
|
220
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, yValues, this.getNativeYValues(), startIndex);
|
|
221
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, zValues, this.getNativeZValues(), startIndex);
|
|
219
222
|
this.insertMetadataRange(startIndex, metadata);
|
|
220
223
|
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Insert, startIndex, xValues.length);
|
|
221
224
|
}
|
|
@@ -261,7 +264,7 @@ var XyzDataSeries = /** @class */ (function (_super) {
|
|
|
261
264
|
*/
|
|
262
265
|
XyzDataSeries.prototype.clear = function () {
|
|
263
266
|
if (!this.getIsDeleted()) {
|
|
264
|
-
|
|
267
|
+
_super.prototype.clear.call(this);
|
|
265
268
|
this.getNativeXValues().clear();
|
|
266
269
|
this.getNativeYValues().clear();
|
|
267
270
|
this.getNativeZValues().clear();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SCRTDoubleVector, TSciChart } from "../../../types/TSciChart";
|
|
2
2
|
import { CoordinateCalculatorBase } from "./CoordinateCalculatorBase";
|
|
3
3
|
/**
|
|
4
4
|
* Provides an implementation of Numeric {@link CoordinateCalculatorBase | Coordinate Calculator} which transforms
|
|
@@ -34,7 +34,7 @@ export declare class CategoryCoordinateCalculator extends CoordinateCalculatorBa
|
|
|
34
34
|
/**
|
|
35
35
|
* The primary chart series X-values, required for category calculations and interpolation / extrapolation
|
|
36
36
|
*/
|
|
37
|
-
baseXValues:
|
|
37
|
+
baseXValues: SCRTDoubleVector;
|
|
38
38
|
/**
|
|
39
39
|
* Creates an instance of CategoryCoordinateCalculator
|
|
40
40
|
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} or {@link TSciChart2D | SciChart 2D WebAssembly Context}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SCRTDoubleVector, TSciChart } from "../../../types/TSciChart";
|
|
2
2
|
import { CoordinateCalculatorBase } from "./CoordinateCalculatorBase";
|
|
3
3
|
/**
|
|
4
4
|
* Provides an implementation of Numeric {@link CoordinateCalculatorBase | Coordinate Calculator} which transforms
|
|
@@ -35,7 +35,7 @@ export declare class FlippedCategoryCoordinateCalculator extends CoordinateCalcu
|
|
|
35
35
|
/**
|
|
36
36
|
* The primary chart series X-values, required for category calculations and interpolation / extrapolation
|
|
37
37
|
*/
|
|
38
|
-
baseXValues:
|
|
38
|
+
baseXValues: SCRTDoubleVector;
|
|
39
39
|
/**
|
|
40
40
|
* Creates an instance of FlippedCategoryCoordinateCalculator
|
|
41
41
|
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} or {@link TSciChart2D | SciChart 2D WebAssembly Context}
|
|
@@ -32,6 +32,7 @@ export declare class FlippedNumericCoordinateCalculator extends CoordinateCalcul
|
|
|
32
32
|
* @param visibleMin The {@link AxisCore.visibleRange}.min at the time of drawing
|
|
33
33
|
* @param visibleMax The {@link AxisCore.visibleRange}.max at the time of drawing
|
|
34
34
|
* @param offset A constant pixel offset used in coordinate calculations
|
|
35
|
+
* @param allowFastMath When true, calculate using 32-bit floating point values (faster, but less accurate)
|
|
35
36
|
*/
|
|
36
|
-
constructor(webAssemblyContext: TSciChart | TSciChart3D, viewportDimension: number, visibleMin: number, visibleMax: number, offset?: number);
|
|
37
|
+
constructor(webAssemblyContext: TSciChart | TSciChart3D, viewportDimension: number, visibleMin: number, visibleMax: number, offset?: number, allowFastMath?: boolean);
|
|
37
38
|
}
|
|
@@ -49,11 +49,15 @@ var FlippedNumericCoordinateCalculator = /** @class */ (function (_super) {
|
|
|
49
49
|
* @param visibleMin The {@link AxisCore.visibleRange}.min at the time of drawing
|
|
50
50
|
* @param visibleMax The {@link AxisCore.visibleRange}.max at the time of drawing
|
|
51
51
|
* @param offset A constant pixel offset used in coordinate calculations
|
|
52
|
+
* @param allowFastMath When true, calculate using 32-bit floating point values (faster, but less accurate)
|
|
52
53
|
*/
|
|
53
|
-
function FlippedNumericCoordinateCalculator(webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset) {
|
|
54
|
+
function FlippedNumericCoordinateCalculator(webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset, allowFastMath) {
|
|
54
55
|
if (offset === void 0) { offset = 0; }
|
|
56
|
+
if (allowFastMath === void 0) { allowFastMath = false; }
|
|
55
57
|
var _this = _super.call(this, webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset, true) || this;
|
|
56
|
-
_this.nativeCalculator =
|
|
58
|
+
_this.nativeCalculator = allowFastMath
|
|
59
|
+
? new webAssemblyContext.FlippedLinearCoordinateCalculatorSingle(_this.viewportDimension, _this.visibleMin, _this.visibleMax, -1, _this.offset)
|
|
60
|
+
: new webAssemblyContext.FlippedLinearCoordinateCalculatorDouble(_this.viewportDimension, _this.visibleMin, _this.visibleMax, -1, _this.offset);
|
|
57
61
|
return _this;
|
|
58
62
|
}
|
|
59
63
|
return FlippedNumericCoordinateCalculator;
|
|
@@ -31,6 +31,7 @@ export declare class NumericCoordinateCalculator extends CoordinateCalculatorBas
|
|
|
31
31
|
* @param visibleMin The {@link AxisCore.visibleRange}.min at the time of drawing
|
|
32
32
|
* @param visibleMax The {@link AxisCore.visibleRange}.max at the time of drawing
|
|
33
33
|
* @param offset A constant pixel offset used in coordinate calculations
|
|
34
|
+
* @param allowFastMath When true, calculate using 32-bit floating point values (faster, but less accurate)
|
|
34
35
|
*/
|
|
35
|
-
constructor(webAssemblyContext: TSciChart | TSciChart3D, viewportDimension: number, visibleMin: number, visibleMax: number, offset?: number);
|
|
36
|
+
constructor(webAssemblyContext: TSciChart | TSciChart3D, viewportDimension: number, visibleMin: number, visibleMax: number, offset?: number, allowFastMath?: boolean);
|
|
36
37
|
}
|
|
@@ -48,11 +48,15 @@ var NumericCoordinateCalculator = /** @class */ (function (_super) {
|
|
|
48
48
|
* @param visibleMin The {@link AxisCore.visibleRange}.min at the time of drawing
|
|
49
49
|
* @param visibleMax The {@link AxisCore.visibleRange}.max at the time of drawing
|
|
50
50
|
* @param offset A constant pixel offset used in coordinate calculations
|
|
51
|
+
* @param allowFastMath When true, calculate using 32-bit floating point values (faster, but less accurate)
|
|
51
52
|
*/
|
|
52
|
-
function NumericCoordinateCalculator(webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset) {
|
|
53
|
+
function NumericCoordinateCalculator(webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset, allowFastMath) {
|
|
53
54
|
if (offset === void 0) { offset = 0; }
|
|
55
|
+
if (allowFastMath === void 0) { allowFastMath = false; }
|
|
54
56
|
var _this = _super.call(this, webAssemblyContext, viewportDimension, visibleMin, visibleMax, offset, false) || this;
|
|
55
|
-
_this.nativeCalculator =
|
|
57
|
+
_this.nativeCalculator = allowFastMath
|
|
58
|
+
? new webAssemblyContext.LinearCoordinateCalculatorSingle(_this.viewportDimension, _this.visibleMin, _this.visibleMax, -1, _this.offset)
|
|
59
|
+
: new webAssemblyContext.LinearCoordinateCalculatorDouble(_this.viewportDimension, _this.visibleMin, _this.visibleMax, -1, _this.offset);
|
|
56
60
|
return _this;
|
|
57
61
|
}
|
|
58
62
|
return NumericCoordinateCalculator;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IDeletable } from "../../../Core/IDeletable";
|
|
2
|
+
import { IntVector, SCRTDoubleResamplerMergeIndicesParams, SCRTDoubleVector, TSciChart } from "../../../types/TSciChart";
|
|
3
|
+
import { ResamplingParams } from "./ResamplingParams";
|
|
4
|
+
/**
|
|
5
|
+
* Helper class for functions which optimise drawing
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExtremeResamplerHelper implements IDeletable {
|
|
8
|
+
readonly nativeMergeIndexParams: SCRTDoubleResamplerMergeIndicesParams;
|
|
9
|
+
private readonly wasmContext;
|
|
10
|
+
private readonly nativeResampler;
|
|
11
|
+
private readonly xInput;
|
|
12
|
+
private readonly nativeArgs;
|
|
13
|
+
private readonly output;
|
|
14
|
+
private isDeleted;
|
|
15
|
+
constructor(wasmContext: TSciChart);
|
|
16
|
+
/**
|
|
17
|
+
* Calls native RequiresReduction method to calculate if resampling is needed
|
|
18
|
+
* @param rp The resampling params
|
|
19
|
+
* @param xOriginalValues XValues
|
|
20
|
+
* @param fillBasicNativeArgs Update nativeArgs if True
|
|
21
|
+
* @param updateResamplingMode Update {@link ResamplingArgs.Resampling} property if True
|
|
22
|
+
*/
|
|
23
|
+
needsResampling(rp: ResamplingParams, xOriginalValues: SCRTDoubleVector, fillBasicNativeArgs?: boolean, updateResamplingMode?: boolean): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* This method calls does resampling by calling the native resampling methods.
|
|
26
|
+
* It does similar things as WPF AvxExtremeResamplerDoubleDouble.ResampleInternal() method
|
|
27
|
+
* The needsResampling() method must be called before, this is done in {@link SciChartRenderer.resampleSeries}
|
|
28
|
+
* @param wasmContext The WebAssembly context
|
|
29
|
+
* @param rp The resampling parameters
|
|
30
|
+
* @param xOriginalValues The original not resampled X values
|
|
31
|
+
* @param yOriginalValues The original not resampled Y values
|
|
32
|
+
* @param indexesOut The indices output
|
|
33
|
+
* @param xResampledValuesOut The resampled X values output
|
|
34
|
+
* @param yResampledValuesOut The resampled Y values output
|
|
35
|
+
* @param fillBasicNativeArgs If set to True resets and fill nativeArgs with basic properties,
|
|
36
|
+
* you can set it to False if {@link needsResampling()} was called before this method
|
|
37
|
+
* @returns indicesVector The resampled vector of indices
|
|
38
|
+
*/
|
|
39
|
+
resampleIntoPointSeries(wasmContext: TSciChart, rp: ResamplingParams, xOriginalValues: SCRTDoubleVector, yOriginalValues: SCRTDoubleVector, indexesOut: IntVector, xResampledValuesOut: SCRTDoubleVector, yResampledValuesOut: SCRTDoubleVector, fillBasicNativeArgs?: boolean): void;
|
|
40
|
+
mergeIndexes(indices: IntVector, size1: number, size2: number, mergedIndicesOut: IntVector): number;
|
|
41
|
+
copyValuesByIndexes(indices: IntVector, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, y1Values: SCRTDoubleVector, count: number, isCategoryAxis: boolean, xValuesOut: SCRTDoubleVector, yValuesOut: SCRTDoubleVector, y1ValuesOut: SCRTDoubleVector): void;
|
|
42
|
+
/** @inheritDoc */
|
|
43
|
+
delete(): void;
|
|
44
|
+
private debugParameters;
|
|
45
|
+
private debugRect;
|
|
46
|
+
private debugResamplingDataEnum;
|
|
47
|
+
private debugResamplingModeEnum;
|
|
48
|
+
private getDataDistribution;
|
|
49
|
+
private getNativeResamplingMode;
|
|
50
|
+
/**
|
|
51
|
+
* Fills basic native args needed for {@link needsResampling()} and {@link resampleIntoPointSeries} methods
|
|
52
|
+
*/
|
|
53
|
+
private resetAndFillBasicNativeArgs;
|
|
54
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtremeResamplerHelper = void 0;
|
|
4
|
+
var Deleter_1 = require("../../../Core/Deleter");
|
|
5
|
+
var Guard_1 = require("../../../Core/Guard");
|
|
6
|
+
var ResamplingMode_1 = require("./ResamplingMode");
|
|
7
|
+
/**
|
|
8
|
+
* Helper class for functions which optimise drawing
|
|
9
|
+
*/
|
|
10
|
+
var ExtremeResamplerHelper = /** @class */ (function () {
|
|
11
|
+
function ExtremeResamplerHelper(wasmContext) {
|
|
12
|
+
this.isDeleted = false;
|
|
13
|
+
this.nativeMergeIndexParams = new wasmContext.SCRTDoubleResamplerMergeIndicesParams();
|
|
14
|
+
this.wasmContext = wasmContext;
|
|
15
|
+
this.nativeResampler = new this.wasmContext.SCRTDoubleResampler();
|
|
16
|
+
this.xInput = new this.wasmContext.SCRTXvaluesProvider();
|
|
17
|
+
this.nativeArgs = new this.wasmContext.ResamplingArgs();
|
|
18
|
+
this.output = new this.wasmContext.SCRTDoubleArraysXyResampleOutput();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Calls native RequiresReduction method to calculate if resampling is needed
|
|
22
|
+
* @param rp The resampling params
|
|
23
|
+
* @param xOriginalValues XValues
|
|
24
|
+
* @param fillBasicNativeArgs Update nativeArgs if True
|
|
25
|
+
* @param updateResamplingMode Update {@link ResamplingArgs.Resampling} property if True
|
|
26
|
+
*/
|
|
27
|
+
ExtremeResamplerHelper.prototype.needsResampling = function (rp, xOriginalValues, fillBasicNativeArgs, updateResamplingMode) {
|
|
28
|
+
if (fillBasicNativeArgs === void 0) { fillBasicNativeArgs = true; }
|
|
29
|
+
if (updateResamplingMode === void 0) { updateResamplingMode = false; }
|
|
30
|
+
if (fillBasicNativeArgs)
|
|
31
|
+
this.resetAndFillBasicNativeArgs(rp, xOriginalValues);
|
|
32
|
+
var needsResampling = this.nativeResampler.RequiresReduction(this.nativeArgs);
|
|
33
|
+
if (updateResamplingMode && !needsResampling) {
|
|
34
|
+
this.nativeArgs.Resampling = this.getNativeResamplingMode(ResamplingMode_1.EResamplingMode.None);
|
|
35
|
+
}
|
|
36
|
+
return needsResampling;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* This method calls does resampling by calling the native resampling methods.
|
|
40
|
+
* It does similar things as WPF AvxExtremeResamplerDoubleDouble.ResampleInternal() method
|
|
41
|
+
* The needsResampling() method must be called before, this is done in {@link SciChartRenderer.resampleSeries}
|
|
42
|
+
* @param wasmContext The WebAssembly context
|
|
43
|
+
* @param rp The resampling parameters
|
|
44
|
+
* @param xOriginalValues The original not resampled X values
|
|
45
|
+
* @param yOriginalValues The original not resampled Y values
|
|
46
|
+
* @param indexesOut The indices output
|
|
47
|
+
* @param xResampledValuesOut The resampled X values output
|
|
48
|
+
* @param yResampledValuesOut The resampled Y values output
|
|
49
|
+
* @param fillBasicNativeArgs If set to True resets and fill nativeArgs with basic properties,
|
|
50
|
+
* you can set it to False if {@link needsResampling()} was called before this method
|
|
51
|
+
* @returns indicesVector The resampled vector of indices
|
|
52
|
+
*/
|
|
53
|
+
ExtremeResamplerHelper.prototype.resampleIntoPointSeries = function (wasmContext, rp, xOriginalValues, yOriginalValues, indexesOut, xResampledValuesOut, yResampledValuesOut, fillBasicNativeArgs) {
|
|
54
|
+
if (fillBasicNativeArgs === void 0) { fillBasicNativeArgs = true; }
|
|
55
|
+
if (this.isDeleted) {
|
|
56
|
+
throw new Error("should not call resampleIntoPointSeries() if deleted");
|
|
57
|
+
}
|
|
58
|
+
Guard_1.Guard.notNull(xOriginalValues, "xDataValues");
|
|
59
|
+
Guard_1.Guard.notNull(yOriginalValues, "yDataValues");
|
|
60
|
+
Guard_1.Guard.notNull(xOriginalValues, "xOriginalValues");
|
|
61
|
+
Guard_1.Guard.notNull(yOriginalValues, "yOriginalValues");
|
|
62
|
+
Guard_1.Guard.notNull(rp, "resamplingParams");
|
|
63
|
+
if (fillBasicNativeArgs)
|
|
64
|
+
this.resetAndFillBasicNativeArgs(rp, xOriginalValues);
|
|
65
|
+
// Set X Values
|
|
66
|
+
this.xInput.SetInput(xOriginalValues);
|
|
67
|
+
this.nativeArgs.FifoCapacity = rp.fifoCapacity;
|
|
68
|
+
this.nativeArgs.HasNaN = rp.dataHasNaN;
|
|
69
|
+
this.nativeArgs.IsFifo = rp.dataIsFifo;
|
|
70
|
+
this.nativeArgs.ResamplingPrecision = rp.precision;
|
|
71
|
+
this.nativeArgs.ZeroLineY = rp.zeroLineY;
|
|
72
|
+
this.nativeArgs.NewDataPointCount = -1;
|
|
73
|
+
if (fillBasicNativeArgs === true) {
|
|
74
|
+
this.needsResampling(rp, xOriginalValues, false, true);
|
|
75
|
+
}
|
|
76
|
+
// this.debugParameters(rp, this.nativeArgs);
|
|
77
|
+
// What does this method do???
|
|
78
|
+
var requestedSize = this.nativeResampler.UpdateIndices(indexesOut, this.xInput, yOriginalValues, this.nativeArgs.Resampling, this.nativeArgs);
|
|
79
|
+
// SC-5145 Adds +1 to be sure that reserved Capacity is not less than the actual resampled count,
|
|
80
|
+
// otherwise resampledXValues and resampledYValues will be recreated with default 0.0 values
|
|
81
|
+
xResampledValuesOut.resizeFast(requestedSize + 1);
|
|
82
|
+
yResampledValuesOut.resizeFast(requestedSize + 1);
|
|
83
|
+
this.output.Reset(xResampledValuesOut, yResampledValuesOut);
|
|
84
|
+
// Execute resampling and update indexesOut vector
|
|
85
|
+
this.nativeResampler.Execute(this.xInput, yOriginalValues, this.output, indexesOut, this.nativeArgs.Resampling, this.nativeArgs);
|
|
86
|
+
var resultCount = indexesOut.size();
|
|
87
|
+
xResampledValuesOut.resizeFast(resultCount);
|
|
88
|
+
yResampledValuesOut.resizeFast(resultCount);
|
|
89
|
+
};
|
|
90
|
+
ExtremeResamplerHelper.prototype.mergeIndexes = function (indices, size1, size2, mergedIndicesOut) {
|
|
91
|
+
return this.nativeResampler.MergeIndices(indices, size1, size2, mergedIndicesOut);
|
|
92
|
+
};
|
|
93
|
+
ExtremeResamplerHelper.prototype.copyValuesByIndexes = function (indices, xValues, yValues, y1Values, count, isCategoryAxis, xValuesOut, yValuesOut, y1ValuesOut) {
|
|
94
|
+
var mp = this.nativeMergeIndexParams;
|
|
95
|
+
mp.SetIndices(indices);
|
|
96
|
+
this.xInput.SetInput(xValues);
|
|
97
|
+
mp.SetXInput(this.xInput);
|
|
98
|
+
mp.SetYInput(yValues);
|
|
99
|
+
mp.SetY1Input(y1Values);
|
|
100
|
+
mp.count = count;
|
|
101
|
+
mp.isCategoryData = isCategoryAxis;
|
|
102
|
+
mp.SetXOut(xValuesOut);
|
|
103
|
+
mp.SetYOut(yValuesOut);
|
|
104
|
+
mp.SetY1Out(y1ValuesOut);
|
|
105
|
+
this.nativeResampler.CopyValuesByIndices(mp);
|
|
106
|
+
};
|
|
107
|
+
/** @inheritDoc */
|
|
108
|
+
ExtremeResamplerHelper.prototype.delete = function () {
|
|
109
|
+
if (!this.isDeleted) {
|
|
110
|
+
(0, Deleter_1.deleteSafe)(this.nativeResampler);
|
|
111
|
+
(0, Deleter_1.deleteSafe)(this.xInput);
|
|
112
|
+
(0, Deleter_1.deleteSafe)(this.nativeArgs);
|
|
113
|
+
(0, Deleter_1.deleteSafe)(this.output);
|
|
114
|
+
(0, Deleter_1.deleteSafe)(this.nativeMergeIndexParams);
|
|
115
|
+
this.isDeleted = true;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
ExtremeResamplerHelper.prototype.debugParameters = function (rp, nativeArgs) {
|
|
119
|
+
console.log(31415);
|
|
120
|
+
console.log("ResamplingParams:");
|
|
121
|
+
console.log(".. zeroLineY: ".concat(rp.zeroLineY));
|
|
122
|
+
console.log(".. resamplingPrecision: ".concat(rp.precision));
|
|
123
|
+
console.log(".. xVisibleRange: ".concat(rp.xVisibleRange));
|
|
124
|
+
console.log(".. indicesRange: ".concat(rp.indexesRange));
|
|
125
|
+
console.log(".. viewportRect: ".concat(this.debugRect(rp.viewportRect)));
|
|
126
|
+
console.log(".. isCategoryAxis: ".concat(rp.isCategoryAxis));
|
|
127
|
+
console.log(".. isXAxisAutoRanged: ".concat(rp.isXAxisAutoRanged));
|
|
128
|
+
console.log(".. resamplingMode: ".concat(rp.resamplingMode));
|
|
129
|
+
console.log(".. renderableSeriesHash: ".concat(rp.renderableSeriesHash));
|
|
130
|
+
console.log(".. enableExperimentalResampling: ".concat(rp.enableExperimentalResampling));
|
|
131
|
+
console.log(".. dataHasNan: ".concat(rp.dataHasNaN));
|
|
132
|
+
console.log(".. dataIsFifo: ".concat(rp.dataIsFifo));
|
|
133
|
+
console.log(".. fifoCapacity: ".concat(rp.fifoCapacity));
|
|
134
|
+
console.log(".. dataEvenlySpaced: ".concat(rp.dataEvenlySpaced));
|
|
135
|
+
console.log("native Resampling Args:");
|
|
136
|
+
console.log(".. ResamplingData: ".concat(this.debugResamplingDataEnum(nativeArgs.Data)));
|
|
137
|
+
console.log(".. StartIndex: ".concat(nativeArgs.StartIndex));
|
|
138
|
+
console.log(".. EndIndex: ".concat(nativeArgs.EndIndex));
|
|
139
|
+
console.log(".. FifoCapacity: ".concat(nativeArgs.FifoCapacity));
|
|
140
|
+
console.log(".. HasNaN: ".concat(nativeArgs.HasNaN));
|
|
141
|
+
console.log(".. IsFifo: ".concat(nativeArgs.IsFifo));
|
|
142
|
+
console.log(".. MaxXInclusive: ".concat(nativeArgs.MaxXInclusive));
|
|
143
|
+
console.log(".. MinXInclusive: ".concat(nativeArgs.MinXInclusive));
|
|
144
|
+
console.log(".. ResamplingMode: ".concat(this.debugResamplingModeEnum(nativeArgs.Resampling)));
|
|
145
|
+
console.log(".. ResamplingPrecision: ".concat(nativeArgs.ResamplingPrecision));
|
|
146
|
+
console.log(".. ViewportWidth: ".concat(nativeArgs.ViewportWidth));
|
|
147
|
+
console.log(".. ZeroLineY: ".concat(nativeArgs.ZeroLineY));
|
|
148
|
+
console.log(".. NewDataPointCount: ".concat(nativeArgs.NewDataPointCount));
|
|
149
|
+
console.log(".. InputBaseIndex: ".concat(nativeArgs.InputBaseIndex));
|
|
150
|
+
};
|
|
151
|
+
ExtremeResamplerHelper.prototype.debugRect = function (rect) {
|
|
152
|
+
return "X ".concat(rect.x, " Y ").concat(rect.y, " Width ").concat(rect.width, " Height ").concat(rect.height);
|
|
153
|
+
};
|
|
154
|
+
ExtremeResamplerHelper.prototype.debugResamplingDataEnum = function (resamplingData) {
|
|
155
|
+
return resamplingData === this.wasmContext.ResamplingData.LinearData
|
|
156
|
+
? "LinearData"
|
|
157
|
+
: resamplingData === this.wasmContext.ResamplingData.CategoryData
|
|
158
|
+
? "CategoryData"
|
|
159
|
+
: resamplingData === this.wasmContext.ResamplingData.UnsortedData
|
|
160
|
+
? "UnsortedData"
|
|
161
|
+
: resamplingData === this.wasmContext.ResamplingData.UnevenlySpacedData
|
|
162
|
+
? "UnevenlySpacedData"
|
|
163
|
+
: "Unknown";
|
|
164
|
+
};
|
|
165
|
+
ExtremeResamplerHelper.prototype.debugResamplingModeEnum = function (resamplingMode) {
|
|
166
|
+
return resamplingMode === this.wasmContext.ResamplingMode.MinMax
|
|
167
|
+
? "MinMax"
|
|
168
|
+
: resamplingMode === this.wasmContext.ResamplingMode.Auto
|
|
169
|
+
? "Auto"
|
|
170
|
+
: "Unknown";
|
|
171
|
+
};
|
|
172
|
+
ExtremeResamplerHelper.prototype.getDataDistribution = function (dataEvenlySpaced, isCategoryAxis) {
|
|
173
|
+
if (isCategoryAxis) {
|
|
174
|
+
return this.wasmContext.ResamplingData.CategoryData;
|
|
175
|
+
}
|
|
176
|
+
return dataEvenlySpaced
|
|
177
|
+
? this.wasmContext.ResamplingData.LinearData
|
|
178
|
+
: this.wasmContext.ResamplingData.UnevenlySpacedData;
|
|
179
|
+
};
|
|
180
|
+
// A different requireReduction method
|
|
181
|
+
// private requireReduction(resamplingMode: EResamplingMode, indicesRange: NumberRange, viewportWidth: number) {
|
|
182
|
+
// const setLength = indicesRange.max - indicesRange.min + 1;
|
|
183
|
+
// const resampledLength = 4 * viewportWidth;
|
|
184
|
+
//
|
|
185
|
+
// return resamplingMode !== EResamplingMode.None && setLength > resampledLength;
|
|
186
|
+
// }
|
|
187
|
+
ExtremeResamplerHelper.prototype.getNativeResamplingMode = function (resamplingMode) {
|
|
188
|
+
switch (resamplingMode) {
|
|
189
|
+
case ResamplingMode_1.EResamplingMode.Auto:
|
|
190
|
+
return this.wasmContext.ResamplingMode.Auto;
|
|
191
|
+
case ResamplingMode_1.EResamplingMode.Max:
|
|
192
|
+
return this.wasmContext.ResamplingMode.Max;
|
|
193
|
+
case ResamplingMode_1.EResamplingMode.Mid:
|
|
194
|
+
return this.wasmContext.ResamplingMode.Mid;
|
|
195
|
+
case ResamplingMode_1.EResamplingMode.Min:
|
|
196
|
+
return this.wasmContext.ResamplingMode.Min;
|
|
197
|
+
case ResamplingMode_1.EResamplingMode.MinMax:
|
|
198
|
+
return this.wasmContext.ResamplingMode.MinMax;
|
|
199
|
+
case ResamplingMode_1.EResamplingMode.MinOrMax:
|
|
200
|
+
return this.wasmContext.ResamplingMode.MinOrMax;
|
|
201
|
+
case ResamplingMode_1.EResamplingMode.None:
|
|
202
|
+
return this.wasmContext.ResamplingMode.None;
|
|
203
|
+
default:
|
|
204
|
+
throw new Error("Unknown resamplingMode ".concat(resamplingMode));
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Fills basic native args needed for {@link needsResampling()} and {@link resampleIntoPointSeries} methods
|
|
209
|
+
*/
|
|
210
|
+
ExtremeResamplerHelper.prototype.resetAndFillBasicNativeArgs = function (rp, xOriginalValues) {
|
|
211
|
+
this.nativeArgs.Reset();
|
|
212
|
+
this.nativeArgs.Data = this.getDataDistribution(rp.dataEvenlySpaced, rp.isCategoryAxis);
|
|
213
|
+
this.nativeArgs.StartIndex = rp.indexesRange.min;
|
|
214
|
+
this.nativeArgs.EndIndex = rp.indexesRange.max;
|
|
215
|
+
this.nativeArgs.MaxXInclusive = rp.xVisibleRange.max;
|
|
216
|
+
this.nativeArgs.MinXInclusive = rp.xVisibleRange.min;
|
|
217
|
+
this.nativeArgs.Resampling = this.getNativeResamplingMode(rp.resamplingMode);
|
|
218
|
+
this.nativeArgs.ViewportWidth = rp.viewportRect.width;
|
|
219
|
+
if (rp.isCategoryAxis) {
|
|
220
|
+
this.nativeArgs.MinXInclusive = rp.indexesRange.min;
|
|
221
|
+
this.nativeArgs.MaxXInclusive = rp.indexesRange.max;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
var firstPoint = xOriginalValues.get(rp.indexesRange.min);
|
|
225
|
+
var lastPoint = xOriginalValues.get(rp.indexesRange.max);
|
|
226
|
+
this.nativeArgs.MinXInclusive = Math.max(firstPoint, rp.xVisibleRange.min);
|
|
227
|
+
this.nativeArgs.MaxXInclusive = Math.min(lastPoint, rp.xVisibleRange.max);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
return ExtremeResamplerHelper;
|
|
231
|
+
}());
|
|
232
|
+
exports.ExtremeResamplerHelper = ExtremeResamplerHelper;
|