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.
- package/Builder/buildAxis.d.ts +7 -0
- package/Builder/buildAxis.js +6 -0
- package/Builder/buildDataSeries.d.ts +19 -1
- package/Builder/buildDataSeries.js +22 -1
- package/Builder/buildModifiers.d.ts +2 -1
- package/Builder/buildSeries.d.ts +7 -2
- package/Builder/buildSeries.js +5 -1
- package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
- package/Charting/ChartModifiers/CursorModifier.js +15 -10
- package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
- package/Charting/ChartModifiers/LegendModifier.js +22 -0
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
- package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
- package/Charting/ChartModifiers/RolloverModifier.js +76 -19
- package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
- package/Charting/LayoutManager/LayoutManager.js +6 -1
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
- package/Charting/Model/BaseHeatmapDataSeries.js +5 -2
- package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
- package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
- package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
- package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
- package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
- package/Charting/Model/Filters/HlcFilterBase.js +141 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
- package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
- package/Charting/Model/Filters/XyFilterBase.js +6 -0
- package/Charting/Model/Filters/XyyFilterBase.js +9 -0
- package/Charting/Model/Filters/XyzFilterBase.js +12 -3
- package/Charting/Model/HlcDataSeries.d.ts +189 -0
- package/Charting/Model/HlcDataSeries.js +557 -0
- package/Charting/Model/IDataSeries.d.ts +5 -1
- package/Charting/Model/IDataSeries.js +4 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
- package/Charting/Services/SciChartRenderer.d.ts +1 -0
- package/Charting/Services/SciChartRenderer.js +6 -0
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
- package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
- package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/constants.d.ts +2 -1
- package/Charting/Visuals/Annotations/constants.js +1 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
- package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
- package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
- package/Charting/Visuals/Axis/AxisCore.js +6 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
- package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
- package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
- package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
- package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
- package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
- package/Charting/Visuals/Helpers/NativeObject.js +101 -0
- package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
- package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
- package/Charting/Visuals/Helpers/drawBorder.js +2 -2
- package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
- package/Charting/Visuals/Helpers/drawLabel.js +38 -18
- package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
- package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +8 -2
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
- package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
- package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/constants.js +7 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
- package/Charting/Visuals/SciChartSurface.d.ts +13 -2
- package/Charting/Visuals/SciChartSurface.js +39 -3
- package/Charting/Visuals/createMaster.js +17 -13
- package/Charting/Visuals/createSingle.js +5 -3
- package/Charting/Visuals/licenseManager2D.d.ts +6 -0
- package/Charting/Visuals/licenseManager2D.js +98 -9
- package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
- package/Charting/Visuals/licenseManager2dState.js +37 -1
- package/Charting/Visuals/loader.js +4 -1
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +13 -9
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
- package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
- package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
- package/Charting3D/Visuals/createMaster3d.js +20 -14
- package/Charting3D/Visuals/createSingle3d.js +3 -4
- package/Charting3D/Visuals/licenseManager3D.js +3 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Telemetry.d.ts +7 -0
- package/Core/Telemetry.js +109 -0
- package/Core/storage/localStorageApi.d.ts +4 -0
- package/Core/storage/localStorageApi.js +12 -0
- package/README.md +49 -13
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +95 -95
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +97 -97
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/AxisType.d.ts +5 -1
- package/types/AxisType.js +4 -0
- package/types/Color.d.ts +1 -0
- package/types/Color.js +1 -0
- package/types/DataFilterType.d.ts +1 -0
- package/types/DataFilterType.js +1 -0
- package/types/DataPointWidthMode.d.ts +13 -0
- package/types/DataPointWidthMode.js +17 -0
- package/types/ErrorDirection.d.ts +13 -0
- package/types/ErrorDirection.js +17 -0
- package/types/ErrorMode.d.ts +17 -0
- package/types/ErrorMode.js +21 -0
- package/types/LabelPlacement.d.ts +8 -0
- package/types/LabelPlacement.js +11 -1
- package/types/LabelProviderType.d.ts +5 -1
- package/types/LabelProviderType.js +4 -0
- package/types/SeriesType.d.ts +3 -1
- package/types/SeriesType.js +2 -0
- package/types/TSciChart.d.ts +8 -2
- package/types/TSciChart3D.d.ts +5 -2
- package/types/TSciChartSurfaceCanvases.d.ts +1 -0
- package/utils/date.d.ts +1 -0
- package/utils/date.js +15 -1
- package/utils/guid.d.ts +6 -0
- package/utils/guid.js +17 -1
|
@@ -0,0 +1,557 @@
|
|
|
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.HlcDataSeries = void 0;
|
|
19
|
+
var Deleter_1 = require("../../Core/Deleter");
|
|
20
|
+
var Guard_1 = require("../../Core/Guard");
|
|
21
|
+
var NumberRange_1 = require("../../Core/NumberRange");
|
|
22
|
+
var NumberArray_1 = require("../../types/NumberArray");
|
|
23
|
+
var appendDoubleVectorFromJsArray_1 = require("../../utils/ccall/appendDoubleVectorFromJsArray");
|
|
24
|
+
var isRealNumber_1 = require("../../utils/isRealNumber");
|
|
25
|
+
var animationHelpers_1 = require("../Visuals/RenderableSeries/Animations/animationHelpers");
|
|
26
|
+
var BaseDataSeries_1 = require("./BaseDataSeries");
|
|
27
|
+
var IDataSeries_1 = require("./IDataSeries");
|
|
28
|
+
/**
|
|
29
|
+
* HlcDataSeries is a DataSeries for holding X, Y, H, L data in SciChart's 2D
|
|
30
|
+
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
31
|
+
* @remarks
|
|
32
|
+
* The HlcDataSeries is primarily used with our {@link FastErrorBarsRenderableSeries | JavaScript Error Bars Chart},
|
|
33
|
+
* which draws a High-Low Bars around points
|
|
34
|
+
*
|
|
35
|
+
* A DataSeries stores the data to render. This is independent from the {@link IRenderableSeries | RenderableSeries}
|
|
36
|
+
* which defines how that data should be rendered.
|
|
37
|
+
*
|
|
38
|
+
* See derived types of {@link BaseDataSeries} to find out what data-series are available.
|
|
39
|
+
* See derived types of {@link IRenderableSeries} to find out what 2D JavaScript Chart types are available.
|
|
40
|
+
*/
|
|
41
|
+
var HlcDataSeries = /** @class */ (function (_super) {
|
|
42
|
+
__extends(HlcDataSeries, _super);
|
|
43
|
+
/**
|
|
44
|
+
* Creates an instance of {@link HlcDataSeries}
|
|
45
|
+
* @param webAssemblyContext the {@link TSciChart | SciChart WebAssembly Context} containing native methods
|
|
46
|
+
* and access to our underlying WebGL2 rendering engine
|
|
47
|
+
* @param options the {@link IHlcDataSeriesOptions} which can be passed to configure the DataSeries at construct time
|
|
48
|
+
*/
|
|
49
|
+
function HlcDataSeries(webAssemblyContext, options) {
|
|
50
|
+
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
51
|
+
/** @inheritDoc */
|
|
52
|
+
_this.type = IDataSeries_1.EDataSeriesType.Hlc;
|
|
53
|
+
_this.highValues = new webAssemblyContext.SCRTDoubleVector();
|
|
54
|
+
_this.lowValues = new webAssemblyContext.SCRTDoubleVector();
|
|
55
|
+
_this.lInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
56
|
+
_this.lFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
57
|
+
_this.hInitialAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
58
|
+
_this.hFinalAnimationValues = new webAssemblyContext.SCRTDoubleVector();
|
|
59
|
+
if (options === null || options === void 0 ? void 0 : options.xValues) {
|
|
60
|
+
Guard_1.Guard.notNull(options.yValues, "options.yValues");
|
|
61
|
+
Guard_1.Guard.notNull(options.highValues, "options.highValues");
|
|
62
|
+
Guard_1.Guard.notNull(options.lowValues, "options.lowValues");
|
|
63
|
+
_this.appendRange(options.xValues, options.yValues, options.highValues, options.lowValues, options.metadata);
|
|
64
|
+
}
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Gets a native / WebAssembly vector of H-values in the DataSeries
|
|
69
|
+
*/
|
|
70
|
+
HlcDataSeries.prototype.getNativeHighValues = function () {
|
|
71
|
+
return this.highValues;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Gets a native / WebAssembly vector of L-values in the DataSeries
|
|
75
|
+
*/
|
|
76
|
+
HlcDataSeries.prototype.getNativeLowValues = function () {
|
|
77
|
+
return this.lowValues;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Appends a single X, Y, Y1 point to the DataSeries
|
|
81
|
+
* @remarks
|
|
82
|
+
* For best performance on drawing large datasets, use the {@link appendRange} method
|
|
83
|
+
*
|
|
84
|
+
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
85
|
+
* @param x The X-value
|
|
86
|
+
* @param y The Y1-value
|
|
87
|
+
* @param h The H-value
|
|
88
|
+
* @param l The L-value
|
|
89
|
+
* @param metadata The point metadata
|
|
90
|
+
*/
|
|
91
|
+
HlcDataSeries.prototype.append = function (x, y, h, l, metadata) {
|
|
92
|
+
if (!this.getIsDeleted()) {
|
|
93
|
+
var nativeX = this.getNativeXValues();
|
|
94
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, [x], [y]);
|
|
95
|
+
// Push metadata should be done before push x values
|
|
96
|
+
this.appendMetadata(metadata);
|
|
97
|
+
nativeX.push_back(x);
|
|
98
|
+
this.getNativeYValues().push_back(y);
|
|
99
|
+
this.getNativeHighValues().push_back(h);
|
|
100
|
+
this.getNativeLowValues().push_back(l);
|
|
101
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, 1);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Appends a range of X, Y, Y1 points to the DataSeries
|
|
106
|
+
* @remarks
|
|
107
|
+
* This method is considerably higher performance than {@link append} which appends a single point
|
|
108
|
+
*
|
|
109
|
+
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
110
|
+
* @param xValues The X-values
|
|
111
|
+
* @param yValues The Y-values
|
|
112
|
+
* @param y1Values The Y1-values
|
|
113
|
+
* @param metadata The array of point metadata
|
|
114
|
+
*/
|
|
115
|
+
HlcDataSeries.prototype.appendRange = function (xValues, yValues, hValues, lValues, metadata) {
|
|
116
|
+
if (!this.getIsDeleted()) {
|
|
117
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
|
|
118
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
|
|
119
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(hValues) || (0, NumberArray_1.isTypedArray)(hValues), "hValues must be an array of numbers");
|
|
120
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lValues) || (0, NumberArray_1.isTypedArray)(lValues), "lValues must be an array of numbers");
|
|
121
|
+
Guard_1.Guard.arraysSameLengthArr([
|
|
122
|
+
{ arg: xValues, name: "xValues" },
|
|
123
|
+
{ arg: yValues, name: "yValues" },
|
|
124
|
+
{ arg: hValues, name: "hValues" },
|
|
125
|
+
{ arg: lValues, name: "lValues" }
|
|
126
|
+
]);
|
|
127
|
+
if (metadata) {
|
|
128
|
+
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
129
|
+
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
130
|
+
}
|
|
131
|
+
var nativeX = this.getNativeXValues();
|
|
132
|
+
var nativeY = this.getNativeYValues();
|
|
133
|
+
var nativeH = this.getNativeHighValues();
|
|
134
|
+
var nativeL = this.getNativeLowValues();
|
|
135
|
+
this.dataDistributionCalculator.onAppend(this.isSorted, this.containsNaN, nativeX, xValues, yValues);
|
|
136
|
+
// Push metadata should be done before push x values
|
|
137
|
+
this.appendMetadataRange(metadata, xValues.length);
|
|
138
|
+
// New implementation passing array from JS
|
|
139
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeX, xValues);
|
|
140
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeY, yValues);
|
|
141
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeH, hValues);
|
|
142
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext, nativeL, lValues);
|
|
143
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Append, null, xValues.length);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Updates a single Y, H, L-value by X-index
|
|
148
|
+
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
149
|
+
* @param index the index to update
|
|
150
|
+
* @param y The new Y value
|
|
151
|
+
* @param h The new H value
|
|
152
|
+
* @param l The new L value
|
|
153
|
+
* @param metadata The point metadata
|
|
154
|
+
*/
|
|
155
|
+
HlcDataSeries.prototype.update = function (index, y, h, l, metadata) {
|
|
156
|
+
if (!this.getIsDeleted()) {
|
|
157
|
+
this.validateIndex(index);
|
|
158
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, undefined, undefined, [y], index);
|
|
159
|
+
this.getNativeYValues().set(index, y);
|
|
160
|
+
this.getNativeHighValues().set(index, h);
|
|
161
|
+
this.getNativeLowValues().set(index, l);
|
|
162
|
+
this.setMetadataAt(index, metadata);
|
|
163
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Update, index, 1);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Updates a single X, Y, H, L-value by X-index. Might also need to set isSorted = false
|
|
168
|
+
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
169
|
+
* @param index the index to update
|
|
170
|
+
* @param x The new X value
|
|
171
|
+
* @param y The new Y value
|
|
172
|
+
* @param h The new H value
|
|
173
|
+
* @param l The new L value
|
|
174
|
+
* @param metadata The point metadata
|
|
175
|
+
*/
|
|
176
|
+
HlcDataSeries.prototype.updateXyhl = function (index, x, y, h, l, metadata) {
|
|
177
|
+
// TODO probably update method signature
|
|
178
|
+
if (!this.getIsDeleted()) {
|
|
179
|
+
this.validateIndex(index);
|
|
180
|
+
var nativeX = this.getNativeXValues();
|
|
181
|
+
this.dataDistributionCalculator.onUpdate(this.isSorted, this.containsNaN, nativeX, [x], [y], index);
|
|
182
|
+
nativeX.set(index, x);
|
|
183
|
+
this.getNativeYValues().set(index, y);
|
|
184
|
+
this.getNativeHighValues().set(index, h);
|
|
185
|
+
this.getNativeLowValues().set(index, l);
|
|
186
|
+
this.setMetadataAt(index, metadata);
|
|
187
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Update, index, 1);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Inserts a single X,Y, H, L value at the start index
|
|
192
|
+
* @remarks
|
|
193
|
+
* For best performance on drawing large datasets, use the {@link insertRange} method
|
|
194
|
+
*
|
|
195
|
+
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
196
|
+
* @param startIndex the index to insert at
|
|
197
|
+
* @param x the XValue
|
|
198
|
+
* @param y the YValue
|
|
199
|
+
* @param h the HighValue
|
|
200
|
+
* @param l the LowValue
|
|
201
|
+
* @param metadata The point metadata
|
|
202
|
+
*/
|
|
203
|
+
HlcDataSeries.prototype.insert = function (startIndex, x, y, h, l, metadata) {
|
|
204
|
+
if (!this.getIsDeleted()) {
|
|
205
|
+
this.validateIndex(startIndex, "Start index is out of range");
|
|
206
|
+
var nativeX = this.getNativeXValues();
|
|
207
|
+
var nativeY = this.getNativeYValues();
|
|
208
|
+
var nativeH = this.getNativeHighValues();
|
|
209
|
+
var nativeL = this.getNativeLowValues();
|
|
210
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, [x], [y], startIndex);
|
|
211
|
+
nativeX.insertAt(startIndex, x);
|
|
212
|
+
nativeY.insertAt(startIndex, y);
|
|
213
|
+
nativeH.insertAt(startIndex, h);
|
|
214
|
+
nativeL.insertAt(startIndex, l);
|
|
215
|
+
this.insertMetadata(startIndex, metadata);
|
|
216
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Insert, startIndex, 1);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Inserts a range of X,Y, H, L values at the startIndex
|
|
221
|
+
* @remarks
|
|
222
|
+
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
223
|
+
* @param startIndex the index to insert at
|
|
224
|
+
* @param xValues the XValues
|
|
225
|
+
* @param yValues the YValues
|
|
226
|
+
* @param hValues the HValues
|
|
227
|
+
* @param lValues the LValues
|
|
228
|
+
* @param metadata The array of point metadata
|
|
229
|
+
*/
|
|
230
|
+
HlcDataSeries.prototype.insertRange = function (startIndex, xValues, yValues, hValues, lValues, metadata) {
|
|
231
|
+
if (!this.getIsDeleted()) {
|
|
232
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(xValues) || (0, NumberArray_1.isTypedArray)(xValues), "xValues must be an array of numbers");
|
|
233
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(yValues) || (0, NumberArray_1.isTypedArray)(yValues), "yValues must be an array of numbers");
|
|
234
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(hValues) || (0, NumberArray_1.isTypedArray)(hValues), "hValues must be an array of numbers");
|
|
235
|
+
Guard_1.Guard.isTrue((0, NumberArray_1.isNumberArray)(lValues) || (0, NumberArray_1.isTypedArray)(lValues), "lValues must be an array of numbers");
|
|
236
|
+
this.validateIndex(startIndex, "Start index is out of range");
|
|
237
|
+
Guard_1.Guard.arraysSameLengthArr([
|
|
238
|
+
{ arg: xValues, name: "xValues" },
|
|
239
|
+
{ arg: yValues, name: "yValues" },
|
|
240
|
+
{ arg: hValues, name: "hValues" },
|
|
241
|
+
{ arg: lValues, name: "lValues" }
|
|
242
|
+
]);
|
|
243
|
+
if (metadata) {
|
|
244
|
+
Guard_1.Guard.isTrue(Array.isArray(metadata), "metadata must be an array of IPointMetadata");
|
|
245
|
+
Guard_1.Guard.arraysSameLength(xValues, "xValues", metadata, "metadata");
|
|
246
|
+
}
|
|
247
|
+
var nativeX = this.getNativeXValues();
|
|
248
|
+
this.dataDistributionCalculator.onInsert(this.isSorted, this.containsNaN, nativeX, xValues, yValues, startIndex);
|
|
249
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, xValues, nativeX, startIndex);
|
|
250
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, yValues, this.getNativeYValues(), startIndex);
|
|
251
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, hValues, this.getNativeHighValues(), startIndex);
|
|
252
|
+
(0, appendDoubleVectorFromJsArray_1.insertDoubleVectorFromJsArray)(this.webAssemblyContext, lValues, this.getNativeLowValues(), startIndex);
|
|
253
|
+
this.insertMetadataRange(startIndex, metadata);
|
|
254
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Insert, startIndex, xValues.length);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Removes a single X,Y, H, L value at the specified index
|
|
259
|
+
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
260
|
+
* @param index the index to remove at
|
|
261
|
+
*/
|
|
262
|
+
HlcDataSeries.prototype.removeAt = function (index) {
|
|
263
|
+
if (!this.getIsDeleted()) {
|
|
264
|
+
this.validateIndex(index);
|
|
265
|
+
this.getNativeXValues().removeAt(index);
|
|
266
|
+
this.getNativeYValues().removeAt(index);
|
|
267
|
+
this.getNativeHighValues().removeAt(index);
|
|
268
|
+
this.getNativeLowValues().removeAt(index);
|
|
269
|
+
this.removeMetadataAt(index);
|
|
270
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Remove, index, 1);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Removes a range of X, Y, H, L values at the specified index
|
|
275
|
+
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
276
|
+
* @param startIndex the start index to remove at
|
|
277
|
+
* @param count the number of points to remove
|
|
278
|
+
*/
|
|
279
|
+
HlcDataSeries.prototype.removeRange = function (startIndex, count) {
|
|
280
|
+
if (!this.getIsDeleted()) {
|
|
281
|
+
this.validateIndex(startIndex, "Start index is out of range");
|
|
282
|
+
this.getNativeXValues().removeRange(startIndex, count);
|
|
283
|
+
this.getNativeYValues().removeRange(startIndex, count);
|
|
284
|
+
this.getNativeHighValues().removeRange(startIndex, count);
|
|
285
|
+
this.getNativeLowValues().removeRange(startIndex, count);
|
|
286
|
+
this.removeMetadataRange(startIndex, count);
|
|
287
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Remove, startIndex, count);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Clears the entire DataSeries.
|
|
292
|
+
* @remarks
|
|
293
|
+
* Note this does not free memory, WebAssembly/Native memory is released by calling {@link delete}, after which the
|
|
294
|
+
* DataSeries is no longer usable.
|
|
295
|
+
*
|
|
296
|
+
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
|
|
297
|
+
*/
|
|
298
|
+
HlcDataSeries.prototype.clear = function () {
|
|
299
|
+
if (!this.getIsDeleted()) {
|
|
300
|
+
_super.prototype.clear.call(this);
|
|
301
|
+
this.getNativeXValues().clear();
|
|
302
|
+
this.getNativeYValues().clear();
|
|
303
|
+
this.getNativeHighValues().clear();
|
|
304
|
+
this.getNativeLowValues().clear();
|
|
305
|
+
this.setMetadata(undefined);
|
|
306
|
+
this.notifyDataChanged(IDataSeries_1.EDataChangeType.Clear, null, null);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
/** @inheritDoc */
|
|
310
|
+
HlcDataSeries.prototype.getXRange = function (dataSeriesValueType, isHorizontalDirection, hasHighCap, hasLowCap) {
|
|
311
|
+
var xValues = this.getXValues(dataSeriesValueType);
|
|
312
|
+
var _a = this.getHlcValues(dataSeriesValueType), hValues = _a.hValues, lValues = _a.lValues;
|
|
313
|
+
var temp;
|
|
314
|
+
if (isHorizontalDirection) {
|
|
315
|
+
if (this.count() === 1) {
|
|
316
|
+
// TODO check if logic is valid here
|
|
317
|
+
var minValues = hasLowCap ? lValues : xValues;
|
|
318
|
+
var maxValues = hasHighCap ? hValues : xValues;
|
|
319
|
+
var min = minValues.get(0) - 1;
|
|
320
|
+
var max = maxValues.get(0) + 1;
|
|
321
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
322
|
+
}
|
|
323
|
+
else if (this.count() > 1) {
|
|
324
|
+
var min = void 0;
|
|
325
|
+
var max = void 0;
|
|
326
|
+
var minMax = void 0;
|
|
327
|
+
try {
|
|
328
|
+
// TODO probably can be optimized, make sure there are no memory leaks here
|
|
329
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMax(hasLowCap ? this.getNativeLowValues() : this.getNativeXValues());
|
|
330
|
+
min = minMax.minD;
|
|
331
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMax(hasHighCap ? this.getNativeHighValues() : this.getNativeXValues());
|
|
332
|
+
max = minMax.maxD;
|
|
333
|
+
if (!(0, isRealNumber_1.isRealNumber)(min) || !(0, isRealNumber_1.isRealNumber)(max)) {
|
|
334
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
(0, Deleter_1.deleteSafe)(minMax);
|
|
339
|
+
}
|
|
340
|
+
if (min === max) {
|
|
341
|
+
return new NumberRange_1.NumberRange(min - 1, max + 1);
|
|
342
|
+
}
|
|
343
|
+
else if (min > max) {
|
|
344
|
+
temp = min;
|
|
345
|
+
min = max;
|
|
346
|
+
max = temp;
|
|
347
|
+
}
|
|
348
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (this.count() === 1) {
|
|
353
|
+
var min = xValues.get(0) - 1;
|
|
354
|
+
var max = xValues.get(0) + 1;
|
|
355
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
356
|
+
}
|
|
357
|
+
else if (this.count() > 1) {
|
|
358
|
+
var min = xValues.get(0);
|
|
359
|
+
var max = xValues.get(this.count() - 1);
|
|
360
|
+
if (!this.dataDistributionCalculator.isSortedAscending) {
|
|
361
|
+
var minMax = void 0;
|
|
362
|
+
try {
|
|
363
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMax(this.getNativeXValues());
|
|
364
|
+
if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
|
|
365
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
366
|
+
}
|
|
367
|
+
min = minMax.minD;
|
|
368
|
+
max = minMax.maxD;
|
|
369
|
+
}
|
|
370
|
+
finally {
|
|
371
|
+
(0, Deleter_1.deleteSafe)(minMax);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (min === max) {
|
|
375
|
+
return new NumberRange_1.NumberRange(min - 1, max + 1);
|
|
376
|
+
}
|
|
377
|
+
else if (min > max) {
|
|
378
|
+
temp = min;
|
|
379
|
+
min = max;
|
|
380
|
+
max = temp;
|
|
381
|
+
}
|
|
382
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
386
|
+
};
|
|
387
|
+
/** @inheritDoc */
|
|
388
|
+
HlcDataSeries.prototype.getWindowedYRange = function (xRange, getPositiveRange, isXCategoryAxis, dataSeriesValueType, isHorizontalDirection, hasHighCap, hasLowCap) {
|
|
389
|
+
if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
|
|
390
|
+
if (dataSeriesValueType === void 0) { dataSeriesValueType = IDataSeries_1.EDataSeriesValueType.Default; }
|
|
391
|
+
if (isHorizontalDirection === void 0) { isHorizontalDirection = false; }
|
|
392
|
+
var _a = this.getHlcValues(dataSeriesValueType), hValues = _a.hValues, lValues = _a.lValues, yValues = _a.yValues;
|
|
393
|
+
// TODO: getPositiveRange
|
|
394
|
+
// if one point
|
|
395
|
+
if (this.count() === 1 && !isHorizontalDirection) {
|
|
396
|
+
if (isHorizontalDirection) {
|
|
397
|
+
var min = yValues.get(0) - 1;
|
|
398
|
+
var max = yValues.get(0) + 1;
|
|
399
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
var min = Math.min(hValues.get(0), lValues.get(0)) - 1;
|
|
403
|
+
var max = Math.max(hValues.get(0), lValues.get(0)) + 1;
|
|
404
|
+
return new NumberRange_1.NumberRange(min, max);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
var indicesRange = isXCategoryAxis ? xRange : this.getIndicesRange(xRange);
|
|
408
|
+
var yMin = Number.MAX_VALUE;
|
|
409
|
+
var yMax = Number.MIN_VALUE;
|
|
410
|
+
var iMin = Math.max(Math.floor(indicesRange.min), 0);
|
|
411
|
+
var iMax = Math.min(Math.ceil(indicesRange.max), this.count() - 1);
|
|
412
|
+
if (iMax < iMin) {
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
// TODO handle log axis
|
|
416
|
+
// TODO check for memory leaks
|
|
417
|
+
if (isHorizontalDirection) {
|
|
418
|
+
var minMax = void 0;
|
|
419
|
+
try {
|
|
420
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMaxWithIndex(yValues, iMin, iMax - iMin + 1);
|
|
421
|
+
if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
|
|
422
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
423
|
+
}
|
|
424
|
+
yMin = minMax.minD;
|
|
425
|
+
yMax = minMax.maxD;
|
|
426
|
+
}
|
|
427
|
+
finally {
|
|
428
|
+
(0, Deleter_1.deleteSafe)(minMax);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
var maxValues = hasHighCap ? hValues : yValues;
|
|
433
|
+
var minValues = hasLowCap ? lValues : yValues;
|
|
434
|
+
var minMax = void 0;
|
|
435
|
+
try {
|
|
436
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMaxWithIndex(maxValues, iMin, iMax - iMin + 1);
|
|
437
|
+
if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
|
|
438
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
439
|
+
}
|
|
440
|
+
yMax = minMax.maxD;
|
|
441
|
+
minMax = this.webAssemblyContext.NumberUtil.MinMaxWithIndex(minValues, iMin, iMax - iMin + 1);
|
|
442
|
+
if (!(0, isRealNumber_1.isRealNumber)(minMax.minD) || !(0, isRealNumber_1.isRealNumber)(minMax.maxD)) {
|
|
443
|
+
return new NumberRange_1.NumberRange(0, 0);
|
|
444
|
+
}
|
|
445
|
+
yMin = minMax.minD;
|
|
446
|
+
}
|
|
447
|
+
finally {
|
|
448
|
+
(0, Deleter_1.deleteSafe)(minMax);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return new NumberRange_1.NumberRange(yMin, yMax);
|
|
452
|
+
};
|
|
453
|
+
/** @inheritDoc */
|
|
454
|
+
HlcDataSeries.prototype.delete = function () {
|
|
455
|
+
this.highValues = (0, Deleter_1.deleteSafe)(this.highValues);
|
|
456
|
+
this.lowValues = (0, Deleter_1.deleteSafe)(this.lowValues);
|
|
457
|
+
this.hInitialAnimationValues = (0, Deleter_1.deleteSafe)(this.hInitialAnimationValues);
|
|
458
|
+
this.hFinalAnimationValues = (0, Deleter_1.deleteSafe)(this.hFinalAnimationValues);
|
|
459
|
+
this.lInitialAnimationValues = (0, Deleter_1.deleteSafe)(this.lInitialAnimationValues);
|
|
460
|
+
this.lFinalAnimationValues = (0, Deleter_1.deleteSafe)(this.lFinalAnimationValues);
|
|
461
|
+
_super.prototype.delete.call(this);
|
|
462
|
+
};
|
|
463
|
+
/** @inheritDoc */
|
|
464
|
+
HlcDataSeries.prototype.setInitialAnimationVectors = function (dataSeries) {
|
|
465
|
+
_super.prototype.setInitialAnimationVectors.call(this, dataSeries);
|
|
466
|
+
if (!dataSeries) {
|
|
467
|
+
this.hInitialAnimationValues.resize(0, 0);
|
|
468
|
+
this.lInitialAnimationValues.resize(0, 0);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
animationHelpers_1.animationHelpers.copyVector(dataSeries.getNativeHighValues(), this.hInitialAnimationValues);
|
|
472
|
+
animationHelpers_1.animationHelpers.copyVector(dataSeries.getNativeLowValues(), this.lInitialAnimationValues);
|
|
473
|
+
};
|
|
474
|
+
/** @inheritDoc */
|
|
475
|
+
HlcDataSeries.prototype.setFinalAnimationVectors = function (dataSeries) {
|
|
476
|
+
_super.prototype.setFinalAnimationVectors.call(this, dataSeries);
|
|
477
|
+
if (!dataSeries) {
|
|
478
|
+
this.hFinalAnimationValues.resize(0, 0);
|
|
479
|
+
this.lFinalAnimationValues.resize(0, 0);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
animationHelpers_1.animationHelpers.copyVector(dataSeries.getNativeHighValues(), this.hFinalAnimationValues);
|
|
483
|
+
animationHelpers_1.animationHelpers.copyVector(dataSeries.getNativeLowValues(), this.lFinalAnimationValues);
|
|
484
|
+
};
|
|
485
|
+
/** @inheritDoc */
|
|
486
|
+
HlcDataSeries.prototype.validateAnimationVectors = function () {
|
|
487
|
+
_super.prototype.validateAnimationVectors.call(this);
|
|
488
|
+
var size = this.xInitialAnimationValues.size();
|
|
489
|
+
if (size !== this.hInitialAnimationValues.size() ||
|
|
490
|
+
size !== this.hFinalAnimationValues.size() ||
|
|
491
|
+
size !== this.lInitialAnimationValues.size() ||
|
|
492
|
+
size !== this.lFinalAnimationValues.size()) {
|
|
493
|
+
throw Error("initialAnimationValues and finalAnimationValues must have the same length");
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
/** @inheritDoc */
|
|
497
|
+
HlcDataSeries.prototype.updateAnimationProperties = function (progress, animation) {
|
|
498
|
+
_super.prototype.updateAnimationProperties.call(this, progress, animation);
|
|
499
|
+
if (animation.isOnStartAnimation) {
|
|
500
|
+
animation.calculateAnimationValues(this.webAssemblyContext, this.hFinalAnimationValues, this.getNativeHighValues(), progress);
|
|
501
|
+
animation.calculateAnimationValues(this.webAssemblyContext, this.lFinalAnimationValues, this.getNativeLowValues(), progress);
|
|
502
|
+
}
|
|
503
|
+
else if (animation.isDataSeriesAnimation) {
|
|
504
|
+
animation.calculateDataSeriesAnimationValues(this.webAssemblyContext, this.hInitialAnimationValues, this.hFinalAnimationValues, this.getNativeHighValues(), progress);
|
|
505
|
+
animation.calculateDataSeriesAnimationValues(this.webAssemblyContext, this.lInitialAnimationValues, this.lFinalAnimationValues, this.getNativeLowValues(), progress);
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
/** @inheritDoc */
|
|
509
|
+
HlcDataSeries.prototype.toJSON = function (excludeData) {
|
|
510
|
+
if (excludeData === void 0) { excludeData = false; }
|
|
511
|
+
var json = _super.prototype.toJSON.call(this);
|
|
512
|
+
if (!excludeData) {
|
|
513
|
+
var xValues = [];
|
|
514
|
+
var yValues = [];
|
|
515
|
+
var highValues = [];
|
|
516
|
+
var lowValues = [];
|
|
517
|
+
for (var i = 0; i < this.count(); i++) {
|
|
518
|
+
xValues.push(this.xValues.get(i));
|
|
519
|
+
yValues.push(this.yValues.get(i));
|
|
520
|
+
highValues.push(this.highValues.get(i));
|
|
521
|
+
lowValues.push(this.lowValues.get(i));
|
|
522
|
+
}
|
|
523
|
+
var options = {
|
|
524
|
+
xValues: xValues,
|
|
525
|
+
yValues: yValues,
|
|
526
|
+
highValues: highValues,
|
|
527
|
+
lowValues: lowValues
|
|
528
|
+
};
|
|
529
|
+
Object.assign(json, options);
|
|
530
|
+
}
|
|
531
|
+
return json;
|
|
532
|
+
};
|
|
533
|
+
HlcDataSeries.prototype.getHlcValues = function (dataSeriesValueType) {
|
|
534
|
+
var hValues;
|
|
535
|
+
var lValues;
|
|
536
|
+
var yValues;
|
|
537
|
+
switch (dataSeriesValueType) {
|
|
538
|
+
case IDataSeries_1.EDataSeriesValueType.FinalAnimationValues:
|
|
539
|
+
hValues = this.hFinalAnimationValues;
|
|
540
|
+
lValues = this.lFinalAnimationValues;
|
|
541
|
+
yValues = this.yFinalAnimationValues;
|
|
542
|
+
break;
|
|
543
|
+
case IDataSeries_1.EDataSeriesValueType.InitialAnimationValues:
|
|
544
|
+
hValues = this.hInitialAnimationValues;
|
|
545
|
+
lValues = this.lInitialAnimationValues;
|
|
546
|
+
yValues = this.yInitialAnimationValues;
|
|
547
|
+
break;
|
|
548
|
+
default:
|
|
549
|
+
hValues = this.highValues;
|
|
550
|
+
lValues = this.lowValues;
|
|
551
|
+
yValues = this.yValues;
|
|
552
|
+
}
|
|
553
|
+
return { hValues: hValues, lValues: lValues, yValues: yValues };
|
|
554
|
+
};
|
|
555
|
+
return HlcDataSeries;
|
|
556
|
+
}(BaseDataSeries_1.BaseDataSeries));
|
|
557
|
+
exports.HlcDataSeries = HlcDataSeries;
|
|
@@ -30,7 +30,11 @@ export declare enum EDataSeriesType {
|
|
|
30
30
|
/**
|
|
31
31
|
* Defines a {@link UniformHeatmapDataSeries | DataSeries}
|
|
32
32
|
*/
|
|
33
|
-
HeatmapUniform = "UniformHeatmap"
|
|
33
|
+
HeatmapUniform = "UniformHeatmap",
|
|
34
|
+
/**
|
|
35
|
+
* Defines a {@link HlcDataSeries}
|
|
36
|
+
*/
|
|
37
|
+
Hlc = "Hlc"
|
|
34
38
|
}
|
|
35
39
|
export declare enum EDataChangeType {
|
|
36
40
|
Append = 0,
|
|
@@ -29,6 +29,10 @@ var EDataSeriesType;
|
|
|
29
29
|
* Defines a {@link UniformHeatmapDataSeries | DataSeries}
|
|
30
30
|
*/
|
|
31
31
|
EDataSeriesType["HeatmapUniform"] = "UniformHeatmap";
|
|
32
|
+
/**
|
|
33
|
+
* Defines a {@link HlcDataSeries}
|
|
34
|
+
*/
|
|
35
|
+
EDataSeriesType["Hlc"] = "Hlc";
|
|
32
36
|
})(EDataSeriesType = exports.EDataSeriesType || (exports.EDataSeriesType = {}));
|
|
33
37
|
var EDataChangeType;
|
|
34
38
|
(function (EDataChangeType) {
|
|
@@ -9,6 +9,6 @@ export declare class BasePointSeriesWrapped implements IPointSeries {
|
|
|
9
9
|
readonly yValues: SCRTDoubleVector;
|
|
10
10
|
protected dataSeries: IDataSeries;
|
|
11
11
|
protected indexesProperty: SCRTDoubleVector;
|
|
12
|
-
constructor(dataSeries: IDataSeries);
|
|
12
|
+
constructor(dataSeries: IDataSeries, yValues?: SCRTDoubleVector);
|
|
13
13
|
get indexes(): SCRTDoubleVector;
|
|
14
14
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BasePointSeriesWrapped = void 0;
|
|
4
4
|
var BasePointSeriesWrapped = /** @class */ (function () {
|
|
5
|
-
function BasePointSeriesWrapped(dataSeries) {
|
|
5
|
+
function BasePointSeriesWrapped(dataSeries, yValues) {
|
|
6
6
|
this.dataSeries = dataSeries;
|
|
7
7
|
this.count = dataSeries.count();
|
|
8
8
|
this.xValues = this.dataSeries.getNativeXValues();
|
|
9
|
-
this.yValues = this.dataSeries.getNativeYValues();
|
|
9
|
+
this.yValues = yValues !== null && yValues !== void 0 ? yValues : this.dataSeries.getNativeYValues();
|
|
10
10
|
}
|
|
11
11
|
Object.defineProperty(BasePointSeriesWrapped.prototype, "indexes", {
|
|
12
12
|
get: function () {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SCRTDoubleVector } from "../../../types/TSciChart";
|
|
2
|
+
import { HlcDataSeries } from "../HlcDataSeries";
|
|
3
|
+
import { BasePointSeriesWrapped } from "./BasePointSeriesWrapped";
|
|
4
|
+
import { IHlcPointSeries } from "./IPointSeries";
|
|
5
|
+
export declare class HlcPointSeriesWrapped extends BasePointSeriesWrapped implements IHlcPointSeries {
|
|
6
|
+
readonly highValues: SCRTDoubleVector;
|
|
7
|
+
readonly lowValues: SCRTDoubleVector;
|
|
8
|
+
readonly closeValues: SCRTDoubleVector;
|
|
9
|
+
constructor(dataSeries: HlcDataSeries);
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.HlcPointSeriesWrapped = void 0;
|
|
19
|
+
var BasePointSeriesWrapped_1 = require("./BasePointSeriesWrapped");
|
|
20
|
+
var HlcPointSeriesWrapped = /** @class */ (function (_super) {
|
|
21
|
+
__extends(HlcPointSeriesWrapped, _super);
|
|
22
|
+
function HlcPointSeriesWrapped(dataSeries) {
|
|
23
|
+
var _this = _super.call(this, dataSeries) || this;
|
|
24
|
+
_this.highValues = dataSeries.getNativeHighValues();
|
|
25
|
+
_this.lowValues = dataSeries.getNativeLowValues();
|
|
26
|
+
_this.closeValues = _this.yValues;
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
return HlcPointSeriesWrapped;
|
|
30
|
+
}(BasePointSeriesWrapped_1.BasePointSeriesWrapped));
|
|
31
|
+
exports.HlcPointSeriesWrapped = HlcPointSeriesWrapped;
|
|
@@ -23,6 +23,11 @@ export interface IXyyPointSeries extends IPointSeries {
|
|
|
23
23
|
export interface IXyzPointSeries extends IPointSeries {
|
|
24
24
|
readonly zValues: SCRTDoubleVector;
|
|
25
25
|
}
|
|
26
|
+
export interface IHlcPointSeries extends IPointSeries {
|
|
27
|
+
readonly highValues: SCRTDoubleVector;
|
|
28
|
+
readonly lowValues: SCRTDoubleVector;
|
|
29
|
+
readonly closeValues: SCRTDoubleVector;
|
|
30
|
+
}
|
|
26
31
|
export interface IOhlcPointSeries extends IPointSeries {
|
|
27
32
|
readonly openValues: SCRTDoubleVector;
|
|
28
33
|
readonly highValues: SCRTDoubleVector;
|
|
@@ -4,5 +4,5 @@ import { BasePointSeriesWrapped } from "./BasePointSeriesWrapped";
|
|
|
4
4
|
import { IXyyPointSeries } from "./IPointSeries";
|
|
5
5
|
export declare class XyyPointSeriesWrapped extends BasePointSeriesWrapped implements IXyyPointSeries {
|
|
6
6
|
readonly y1Values: SCRTDoubleVector;
|
|
7
|
-
constructor(dataSeries: XyyDataSeries);
|
|
7
|
+
constructor(dataSeries: XyyDataSeries, yValues?: SCRTDoubleVector, y1Values?: SCRTDoubleVector);
|
|
8
8
|
}
|