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