scichart 2.1.2261 → 2.1.2290
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/buildSeries.d.ts +5 -0
- package/Builder/buildSeries.js +4 -0
- package/Charting/ChartModifiers/LegendModifier.d.ts +2 -2
- package/Charting/Themes/IThemeProvider.d.ts +6 -0
- package/Charting/Themes/SciChartJSDarkTheme.d.ts +2 -0
- package/Charting/Themes/SciChartJSDarkTheme.js +2 -0
- package/Charting/Themes/SciChartJSLightTheme.d.ts +2 -0
- package/Charting/Themes/SciChartJSLightTheme.js +2 -0
- package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +6 -0
- package/Charting/Visuals/Axis/CategoryAxisBase.js +35 -16
- package/Charting/Visuals/Legend/SciChartLegend.d.ts +6 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +30 -13
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +20 -6
- package/Charting/Visuals/Legend/SciChartLegendBase.js +22 -4
- package/Charting/Visuals/Legend/SciChartPieLegend.d.ts +2 -0
- package/Charting/Visuals/Legend/SciChartPieLegend.js +17 -6
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +30 -8
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +6 -2
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.d.ts +84 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +179 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.js +100 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +2 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +14 -1
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +2 -1
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +3 -2
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +39 -30
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/README.md +223 -1
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +1 -1
- package/_wasm/scichart3d.wasm +0 -0
- package/constants/performanceWarnings.js +2 -2
- package/package.json +1 -1
- package/types/SeriesType.d.ts +2 -0
- package/types/SeriesType.js +2 -0
- package/utils/pointUtil.d.ts +1 -1
- package/utils/pointUtil.js +3 -2
|
@@ -0,0 +1,179 @@
|
|
|
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.FastImpulseRenderableSeries = void 0;
|
|
19
|
+
var NumberRange_1 = require("../../../Core/NumberRange");
|
|
20
|
+
var SeriesType_1 = require("../../../types/SeriesType");
|
|
21
|
+
var EllipsePointMarker_1 = require("../PointMarkers/EllipsePointMarker");
|
|
22
|
+
var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
|
|
23
|
+
var DpiHelper_1 = require("../TextureManager/DpiHelper");
|
|
24
|
+
var constants_1 = require("./constants");
|
|
25
|
+
var FastColumnRenderableSeries_1 = require("./FastColumnRenderableSeries");
|
|
26
|
+
var ImpulseSeriesHitTestProvider_1 = require("./HitTest/ImpulseSeriesHitTestProvider");
|
|
27
|
+
/**
|
|
28
|
+
* Defines a impulse-series or JavaScript impulse chart type in the SciChart's High Performance Real-time
|
|
29
|
+
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
30
|
+
* @remarks
|
|
31
|
+
* To add a impulse series to a {@link SciChartSurface} you need to declare both the {@link FastImpulseRenderableSeries | RenderableSeries}
|
|
32
|
+
* and a {@link XyDataSeries | DataSeries}. Simplified code sample below:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* const sciChartSurface: SciChartSurface;
|
|
36
|
+
* const wasmContext: TSciChart;
|
|
37
|
+
* // Create and fill the dataseries
|
|
38
|
+
* const dataSeries = new XyDataSeries(wasmContext);
|
|
39
|
+
* dataSeries.append(1,2);
|
|
40
|
+
* dataSeries.append(1,2);
|
|
41
|
+
* // Create the renderableSeries
|
|
42
|
+
* const impulseSeries = new FastImpulseRenderableSeries(wasmContext);
|
|
43
|
+
* impulseSeries.dataSeries = dataSeries;
|
|
44
|
+
* // append to the SciChartSurface
|
|
45
|
+
* sciChartSurface.renderableSeries.add(impulseSeries);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
var FastImpulseRenderableSeries = /** @class */ (function (_super) {
|
|
49
|
+
__extends(FastImpulseRenderableSeries, _super);
|
|
50
|
+
/**
|
|
51
|
+
* Creates an instance of the {@link FastImpulseRenderableSeries}
|
|
52
|
+
* @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
|
|
53
|
+
* native methods and access to our WebGL2 WebAssembly Drawing Engine
|
|
54
|
+
* @param options optional parameters of type {@link IImpulseRenderableSeries} applied when constructing the series type
|
|
55
|
+
*/
|
|
56
|
+
function FastImpulseRenderableSeries(webAssemblyContext, options) {
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
|
+
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
59
|
+
/** @inheritDoc */
|
|
60
|
+
_this.type = SeriesType_1.ESeriesType.ImpulseSeries;
|
|
61
|
+
_this.impulseFillProperty = SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.impulseFillBrush;
|
|
62
|
+
_this.impulseSizeProperty = 10;
|
|
63
|
+
_this.impulseDataPointWidthProperty = 0;
|
|
64
|
+
_this.impulseStrokeThicknessProperty = 1;
|
|
65
|
+
_this.strokeThickness = (_a = options === null || options === void 0 ? void 0 : options.strokeThickness) !== null && _a !== void 0 ? _a : _this.impulseStrokeThicknessProperty;
|
|
66
|
+
_this.fill = (_b = options === null || options === void 0 ? void 0 : options.fill) !== null && _b !== void 0 ? _b : _this.impulseFillProperty;
|
|
67
|
+
_this.size = (_c = options === null || options === void 0 ? void 0 : options.size) !== null && _c !== void 0 ? _c : _this.impulseSizeProperty;
|
|
68
|
+
_this.stroke = (_d = options === null || options === void 0 ? void 0 : options.fill) !== null && _d !== void 0 ? _d : _this.impulseFillProperty;
|
|
69
|
+
_this.dataPointWidth = _this.impulseDataPointWidthProperty;
|
|
70
|
+
if (!(options === null || options === void 0 ? void 0 : options.pointMarker)) {
|
|
71
|
+
_this.pointMarker = new EllipsePointMarker_1.EllipsePointMarker(webAssemblyContext, {
|
|
72
|
+
width: _this.impulseSizeProperty,
|
|
73
|
+
height: _this.impulseSizeProperty,
|
|
74
|
+
fill: _this.fill,
|
|
75
|
+
stroke: _this.fill
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
Object.defineProperty(FastImpulseRenderableSeries.prototype, "fill", {
|
|
81
|
+
/**
|
|
82
|
+
* Gets or sets the color of each impulse
|
|
83
|
+
*/
|
|
84
|
+
get: function () {
|
|
85
|
+
return this.impulseFillProperty;
|
|
86
|
+
},
|
|
87
|
+
set: function (htmlColorCode) {
|
|
88
|
+
this.impulseFillProperty = htmlColorCode;
|
|
89
|
+
this.stroke = htmlColorCode;
|
|
90
|
+
if (this.pointMarker) {
|
|
91
|
+
this.pointMarker.fill = htmlColorCode;
|
|
92
|
+
this.pointMarker.stroke = htmlColorCode;
|
|
93
|
+
}
|
|
94
|
+
if (this.impulseFillProperty !== htmlColorCode) {
|
|
95
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.STROKE);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(FastImpulseRenderableSeries.prototype, "size", {
|
|
102
|
+
/**
|
|
103
|
+
* Gets or sets the size of each impulse point
|
|
104
|
+
*/
|
|
105
|
+
get: function () {
|
|
106
|
+
return this.impulseSizeProperty;
|
|
107
|
+
},
|
|
108
|
+
set: function (sizeParam) {
|
|
109
|
+
this.impulseSizeProperty = sizeParam;
|
|
110
|
+
if (this.pointMarker) {
|
|
111
|
+
this.pointMarker.width = sizeParam;
|
|
112
|
+
this.pointMarker.height = sizeParam;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
enumerable: false,
|
|
116
|
+
configurable: true
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* @inheritDoc
|
|
120
|
+
*/
|
|
121
|
+
FastImpulseRenderableSeries.prototype.getXRange = function () {
|
|
122
|
+
var range = _super.prototype.getXRange.call(this);
|
|
123
|
+
var delta = getDelta({
|
|
124
|
+
pointSize: this.size,
|
|
125
|
+
areaSize: this.parentSurface.seriesViewRect.width,
|
|
126
|
+
range: range
|
|
127
|
+
});
|
|
128
|
+
return new NumberRange_1.NumberRange(range.min - delta, range.max + delta);
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @inheritDoc
|
|
132
|
+
*/
|
|
133
|
+
FastImpulseRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
|
|
134
|
+
if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
|
|
135
|
+
var yRange = _super.prototype.getYRange.call(this, xVisibleRange, isXCategoryAxis);
|
|
136
|
+
if (!yRange) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
var delta = getDelta({
|
|
140
|
+
pointSize: this.size,
|
|
141
|
+
areaSize: this.parentSurface.seriesViewRect.height,
|
|
142
|
+
range: yRange
|
|
143
|
+
});
|
|
144
|
+
return new NumberRange_1.NumberRange(yRange.min - delta, yRange.max + delta);
|
|
145
|
+
};
|
|
146
|
+
/** @inheritDoc */
|
|
147
|
+
FastImpulseRenderableSeries.prototype.toJSON = function (excludeData) {
|
|
148
|
+
if (excludeData === void 0) { excludeData = false; }
|
|
149
|
+
var json = _super.prototype.toJSON.call(this, excludeData);
|
|
150
|
+
var options = {
|
|
151
|
+
fill: this.fill,
|
|
152
|
+
size: this.size,
|
|
153
|
+
zeroLineY: this.zeroLineY
|
|
154
|
+
};
|
|
155
|
+
Object.assign(json.options, options);
|
|
156
|
+
return json;
|
|
157
|
+
};
|
|
158
|
+
/** @inheritDoc */
|
|
159
|
+
FastImpulseRenderableSeries.prototype.applyTheme = function (themeProvider) {
|
|
160
|
+
_super.prototype.applyTheme.call(this, themeProvider);
|
|
161
|
+
var previousThemeProvider = this.parentSurface.previousThemeProvider;
|
|
162
|
+
if (this.fill === previousThemeProvider.impulseFillBrush) {
|
|
163
|
+
this.fill = themeProvider.impulseFillBrush;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
/** @inheritDoc */
|
|
167
|
+
FastImpulseRenderableSeries.prototype.newHitTestProvider = function () {
|
|
168
|
+
return new ImpulseSeriesHitTestProvider_1.ImpulseSeriesHitTestProvider(this, this.webAssemblyContext);
|
|
169
|
+
};
|
|
170
|
+
return FastImpulseRenderableSeries;
|
|
171
|
+
}(FastColumnRenderableSeries_1.FastColumnRenderableSeries));
|
|
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 { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
|
|
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 ImpulseSeriesHitTestProvider extends BaseHitTestProvider<FastImpulseRenderableSeries> {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
hitTest(x: number, y: number, hitTestRadius?: 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,100 @@
|
|
|
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.ImpulseSeriesHitTestProvider = void 0;
|
|
19
|
+
var pointUtil_1 = require("../../../../utils/pointUtil");
|
|
20
|
+
var DpiHelper_1 = require("../../TextureManager/DpiHelper");
|
|
21
|
+
var BaseHitTestProvider_1 = require("./BaseHitTestProvider");
|
|
22
|
+
var hitTestHelpers_1 = require("./hitTestHelpers");
|
|
23
|
+
var HitTestInfo_1 = require("./HitTestInfo");
|
|
24
|
+
/**
|
|
25
|
+
* Hit-test provider for {@link FastColumnRenderableSeries}. See base class {@link BaseHitTestProvider} for further info
|
|
26
|
+
*/
|
|
27
|
+
var ImpulseSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
28
|
+
__extends(ImpulseSeriesHitTestProvider, _super);
|
|
29
|
+
function ImpulseSeriesHitTestProvider() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
ImpulseSeriesHitTestProvider.prototype.hitTest = function (x, y, hitTestRadius) {
|
|
36
|
+
if (hitTestRadius === void 0) { hitTestRadius = BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS; }
|
|
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
|
+
var nearestXyPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord);
|
|
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 || nearestXyPointIndex >= 0) {
|
|
51
|
+
hitTestInfo.isHit =
|
|
52
|
+
hitTestHelpers_1.hitTestHelpers.testIsHitForImpulse(xCoordinateCalculator, yCoordinateCalculator, this.parentSeries, xNativeValues, yNativeValues, nearestPointIndex, xHitCoord, yHitCoord, hitTestRadius) ||
|
|
53
|
+
hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues, nearestXyPointIndex, xHitCoord, yHitCoord, this.parentSeries.size);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
hitTestInfo.isHit = false;
|
|
57
|
+
}
|
|
58
|
+
return hitTestInfo;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
ImpulseSeriesHitTestProvider.prototype.hitTestForDataPointSelectionModifier = function (x, y, hitTestRadius) {
|
|
64
|
+
if (hitTestRadius === void 0) { hitTestRadius = BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS; }
|
|
65
|
+
return this.hitTest(x, y, hitTestRadius);
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @inheritDoc
|
|
69
|
+
*/
|
|
70
|
+
ImpulseSeriesHitTestProvider.prototype.hitTestXSlice = function (x, y) {
|
|
71
|
+
var _a;
|
|
72
|
+
var hitTestPoint = this.getTranslatedHitTestPoint(x, y);
|
|
73
|
+
if (!hitTestPoint) {
|
|
74
|
+
return HitTestInfo_1.HitTestInfo.empty();
|
|
75
|
+
}
|
|
76
|
+
var _b = this.currentRenderPassData, xCoordinateCalculator = _b.xCoordinateCalculator, yCoordinateCalculator = _b.yCoordinateCalculator, isVerticalChart = _b.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 nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
|
|
83
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
|
|
84
|
+
var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
85
|
+
var markerWidth = ((_a = this.parentSeries.size) !== null && _a !== void 0 ? _a : 0) * DpiHelper_1.DpiHelper.PIXEL_RATIO;
|
|
86
|
+
var markerDataWidth = Math.abs(xCoordinateCalculator.getDataValue(markerWidth) - xCoordinateCalculator.getDataValue(0));
|
|
87
|
+
if (nearestPointIndex >= 0) {
|
|
88
|
+
var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
|
|
89
|
+
var xLastValue = isCategoryAxis ? xNativeValues.size() - 1 : xNativeValues.get(xNativeValues.size() - 1);
|
|
90
|
+
hitTestInfo.isWithinDataBounds = (0, pointUtil_1.testIsInInterval)(hitTestInfo.hitTestPointValues.x, xFirstValue, xLastValue, markerDataWidth / 2);
|
|
91
|
+
hitTestInfo.isHit = hitTestInfo.isWithinDataBounds;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
hitTestInfo.isHit = false;
|
|
95
|
+
}
|
|
96
|
+
return hitTestInfo;
|
|
97
|
+
};
|
|
98
|
+
return ImpulseSeriesHitTestProvider;
|
|
99
|
+
}(BaseHitTestProvider_1.BaseHitTestProvider));
|
|
100
|
+
exports.ImpulseSeriesHitTestProvider = ImpulseSeriesHitTestProvider;
|
|
@@ -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 { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
|
|
11
12
|
import { IRenderableSeries } from "../IRenderableSeries";
|
|
12
13
|
import { HitTestInfo } from "./HitTestInfo";
|
|
13
14
|
export declare const hitTestHelpers: {
|
|
@@ -41,4 +42,5 @@ export declare const hitTestHelpers: {
|
|
|
41
42
|
isHit: boolean;
|
|
42
43
|
secondPointIndex: number;
|
|
43
44
|
};
|
|
45
|
+
testIsHitForImpulse: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, renderableSeries: FastImpulseRenderableSeries, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, pointIndex: number, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => boolean;
|
|
44
46
|
};
|
|
@@ -268,6 +268,18 @@ var testIsHitForColumn = function (xCoordinateCalculator, yCoordinateCalculator,
|
|
|
268
268
|
var bottomColumnSide = zeroLineYCoord > yCoord ? yCoord : zeroLineYCoord;
|
|
269
269
|
return (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord - halfWidth, topColumnSide, xCoord + halfWidth, bottomColumnSide);
|
|
270
270
|
};
|
|
271
|
+
var testIsHitForImpulse = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, xValues, yValues, pointIndex, xHitCoord, yHitCoord, hitTestRadius) {
|
|
272
|
+
var zeroLineY = renderableSeries.zeroLineY;
|
|
273
|
+
var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
274
|
+
var xValue = isCategoryAxis ? pointIndex : xValues.get(pointIndex);
|
|
275
|
+
var yValue = yValues.get(pointIndex);
|
|
276
|
+
var xCoord = xCoordinateCalculator.getCoordinate(xValue);
|
|
277
|
+
var yCoord = yCoordinateCalculator.getCoordinate(yValue);
|
|
278
|
+
var zeroLineYCoord = yCoordinateCalculator.getCoordinate(zeroLineY);
|
|
279
|
+
var topColumnSide = zeroLineYCoord > yCoord ? zeroLineYCoord : yCoord;
|
|
280
|
+
var bottomColumnSide = zeroLineYCoord > yCoord ? yCoord : zeroLineYCoord;
|
|
281
|
+
return (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord, topColumnSide, xCoord, bottomColumnSide, hitTestRadius);
|
|
282
|
+
};
|
|
271
283
|
var testIsHitForOHLC = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, dataSeries, pointIndex, xHitCoord, yHitCoord, hitTestRadius) {
|
|
272
284
|
var getDataPointWidth = renderableSeries.getDataPointWidth, dataPointWidth = renderableSeries.dataPointWidth;
|
|
273
285
|
var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
@@ -344,5 +356,6 @@ exports.hitTestHelpers = {
|
|
|
344
356
|
testIsHitForBand: testIsHitForBand,
|
|
345
357
|
testIsHitForColumn: testIsHitForColumn,
|
|
346
358
|
testIsHitForOHLC: testIsHitForOHLC,
|
|
347
|
-
testIsHitForMountain: testIsHitForMountain
|
|
359
|
+
testIsHitForMountain: testIsHitForMountain,
|
|
360
|
+
testIsHitForImpulse: testIsHitForImpulse
|
|
348
361
|
};
|
|
@@ -275,7 +275,8 @@ var StackedColumnCollection = /** @class */ (function (_super) {
|
|
|
275
275
|
StackedColumnCollection.prototype.checkXValuesCorrect = function () {
|
|
276
276
|
var length = this.getDataSeriesValuesCount();
|
|
277
277
|
this.getVisibleSeries().forEach(function (el) {
|
|
278
|
-
|
|
278
|
+
var _a;
|
|
279
|
+
if (!(((_a = el.dataSeries) === null || _a === void 0 ? void 0 : _a.count()) === length)) {
|
|
279
280
|
throw Error("All stacked series in on collection should have the same amount of X Values");
|
|
280
281
|
}
|
|
281
282
|
});
|
|
@@ -4,6 +4,7 @@ import { ObservableArray } from "../../../Core/ObservableArray";
|
|
|
4
4
|
import { ESciChartSurfaceType } from "../../../types/SciChartSurfaceType";
|
|
5
5
|
import { TSciChartSurfaceCanvases } from "../../../types/TSciChartSurfaceCanvases";
|
|
6
6
|
import { IThemeProvider } from "../../Themes/IThemeProvider";
|
|
7
|
+
import { IEventSubscriptionItem } from "../Legend/SciChartLegendBase";
|
|
7
8
|
import { SciChartPieLegend } from "../Legend/SciChartPieLegend";
|
|
8
9
|
import { ISciChartSurfaceBase } from "../SciChartSurfaceBase";
|
|
9
10
|
import { IPieSurfaceOptions } from "./IPieSurfaceOptions";
|
|
@@ -45,7 +46,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
45
46
|
* @param width Optional - the width of the {@link SciChartPieSurface} in pixels. By default SciChart will scale to fit the parent Div
|
|
46
47
|
* @param height Optional - the height of the {@link SciChartPieSurface} in pixels. By default SciChart will scale to fit the parent Div
|
|
47
48
|
*/
|
|
48
|
-
static create(
|
|
49
|
+
static create(divElement: string | HTMLDivElement, options?: IPieSurfaceOptions): Promise<SciChartPieSurface>;
|
|
49
50
|
/**
|
|
50
51
|
* @summary Gets the collection of {@link IPieSegment} - the pie segments or slices on this {@link SciChartPieSurface}
|
|
51
52
|
* @description A {@link SciChartPieSurface} can have one to many {@link IPieSegment | Pie Segments}. *
|
|
@@ -178,4 +179,4 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
178
179
|
private applySciChartBackground;
|
|
179
180
|
}
|
|
180
181
|
/** @ignore */
|
|
181
|
-
export declare const addEventListenerToPieSegment: (ps: IPieSegment, el: HTMLElement, animate: boolean) =>
|
|
182
|
+
export declare const addEventListenerToPieSegment: (ps: IPieSegment, el: HTMLElement, animate: boolean) => IEventSubscriptionItem;
|
|
@@ -118,10 +118,10 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
118
118
|
* @param width Optional - the width of the {@link SciChartPieSurface} in pixels. By default SciChart will scale to fit the parent Div
|
|
119
119
|
* @param height Optional - the height of the {@link SciChartPieSurface} in pixels. By default SciChart will scale to fit the parent Div
|
|
120
120
|
*/
|
|
121
|
-
SciChartPieSurface.create = function (
|
|
121
|
+
SciChartPieSurface.create = function (divElement, options) {
|
|
122
122
|
var _a, _b;
|
|
123
123
|
(0, chartBuilder_1.ensureRegistrations)();
|
|
124
|
-
var canvases = sciChartInitCommon_1.default.initCanvas(
|
|
124
|
+
var canvases = sciChartInitCommon_1.default.initCanvas(divElement, (_a = options === null || options === void 0 ? void 0 : options.widthAspect) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.heightAspect) !== null && _b !== void 0 ? _b : 0, sciChartInitCommon_1.default.ECanvasType.svg);
|
|
125
125
|
return new Promise(function (resolve) {
|
|
126
126
|
var conflictingRenderContextDestinations = __spreadArray(__spreadArray(__spreadArray([], createMaster_1.sciChartDestinations, true), createMaster3d_1.sciChartDestinations, true), createSingle_1.sciChartSingleDestinations, true).filter(function (destination) { return destination.sciChartSurface.domChartRoot.id === canvases.domChartRoot.id; });
|
|
127
127
|
conflictingRenderContextDestinations.forEach(function (destination) { return destination.sciChartSurface.delete(); });
|
|
@@ -129,6 +129,7 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
129
129
|
var scps = new SciChartPieSurface(canvases, options);
|
|
130
130
|
scps.applyTheme(options === null || options === void 0 ? void 0 : options.theme);
|
|
131
131
|
var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, scps);
|
|
132
|
+
scps.addDeletable(unsub);
|
|
132
133
|
// setTimeout is used to make function async like createSciChartSurface, to have a consistent API
|
|
133
134
|
setTimeout(function () { return resolve(scps); }, 0);
|
|
134
135
|
});
|
|
@@ -392,8 +393,11 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
392
393
|
// ADD EVENT LISTENERS
|
|
393
394
|
if (!app_1.IS_TEST_ENV) {
|
|
394
395
|
this.pieSegments.asArray().forEach(function (ps) {
|
|
395
|
-
var el =
|
|
396
|
-
|
|
396
|
+
var el = _this.domChartRoot.querySelector("[id='".concat(ps.id, "']"));
|
|
397
|
+
if (el) {
|
|
398
|
+
var subscriptionToken = (0, exports.addEventListenerToPieSegment)(ps, el, _this.animate);
|
|
399
|
+
_this.addDeletable(subscriptionToken);
|
|
400
|
+
}
|
|
397
401
|
});
|
|
398
402
|
}
|
|
399
403
|
this.drawSegmentTitles();
|
|
@@ -561,31 +565,36 @@ var calcTitlePosition = function (x, y, outerRadius, innerRadius, a1, a2, delta,
|
|
|
561
565
|
var isListenerBlocked = false;
|
|
562
566
|
/** @ignore */
|
|
563
567
|
var addEventListenerToPieSegment = function (ps, el, animate) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
(function
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
568
|
+
var eventListener = function (e) {
|
|
569
|
+
if (!animate) {
|
|
570
|
+
ps.isSelected = !ps.isSelected;
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
// ANIMATE
|
|
574
|
+
if (!isListenerBlocked) {
|
|
575
|
+
var ROUNDS_1 = 10;
|
|
576
|
+
var directionDown = ps.isSelected;
|
|
577
|
+
var start_1 = directionDown ? PieSegment_1.PieSegment.DEFAULT_DELTA : 0;
|
|
578
|
+
var d_1 = directionDown ? -PieSegment_1.PieSegment.DEFAULT_DELTA / ROUNDS_1 : PieSegment_1.PieSegment.DEFAULT_DELTA / ROUNDS_1;
|
|
579
|
+
isListenerBlocked = true;
|
|
580
|
+
(function myLoop(k) {
|
|
581
|
+
setTimeout(function () {
|
|
582
|
+
ps.delta = start_1 + d_1 * k;
|
|
583
|
+
if (k === ROUNDS_1) {
|
|
584
|
+
isListenerBlocked = false;
|
|
585
|
+
}
|
|
586
|
+
if (++k <= ROUNDS_1)
|
|
587
|
+
myLoop(k);
|
|
588
|
+
}, 20);
|
|
589
|
+
})(1);
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
el.addEventListener("click", eventListener);
|
|
593
|
+
return {
|
|
594
|
+
eventListener: eventListener,
|
|
595
|
+
eventType: "click",
|
|
596
|
+
element: el,
|
|
597
|
+
delete: function () { return el.removeEventListener("click", eventListener); }
|
|
598
|
+
};
|
|
590
599
|
};
|
|
591
600
|
exports.addEventListenerToPieSegment = addEventListenerToPieSegment;
|
package/Core/BuildStamp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TSciChart } from "../types/TSciChart";
|
|
2
2
|
import { TSciChart3D } from "../types/TSciChart3D";
|
|
3
|
-
export declare const libraryVersion = "2.1.
|
|
3
|
+
export declare const libraryVersion = "2.1.2290";
|
|
4
4
|
export declare const checkBuildStamp: (wasmContext: TSciChart | TSciChart3D) => boolean;
|
package/Core/BuildStamp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkBuildStamp = exports.libraryVersion = void 0;
|
|
4
|
-
var buildStamp = "2022-
|
|
4
|
+
var buildStamp = "2022-03-08T00:00:00";
|
|
5
5
|
var result;
|
|
6
6
|
// tslint:disable-next-line:no-var-requires
|
|
7
|
-
exports.libraryVersion = "2.1.
|
|
7
|
+
exports.libraryVersion = "2.1.2290";
|
|
8
8
|
var checkBuildStamp = function (wasmContext) {
|
|
9
9
|
if (result !== undefined)
|
|
10
10
|
return result;
|