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
package/Builder/buildSeries.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { ESeriesType } from "../types/SeriesType";
|
|
|
35
35
|
import { EShaderEffectType } from "../types/ShaderEffectType";
|
|
36
36
|
import { TSciChart } from "../types/TSciChart";
|
|
37
37
|
import { TOhlcSeriesData, TSharedDataDefinition, TXySeriesData, TXyySeriesData, TXyzSeriesData } from "./buildDataSeries";
|
|
38
|
+
import { IImpulseRenderableSeries } from "../Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries";
|
|
38
39
|
/** Definition of a pointmarker, comprising a {@link EPointMarkerType} and the relevant options */
|
|
39
40
|
export declare type TPointMarkerDefinition = {
|
|
40
41
|
type: EPointMarkerType.Cross;
|
|
@@ -113,6 +114,10 @@ export declare type TSeriesDefinition = {
|
|
|
113
114
|
type: ESeriesType.ColumnSeries;
|
|
114
115
|
options?: IColumnRenderableSeriesOptions;
|
|
115
116
|
xyData?: TXySeriesData;
|
|
117
|
+
} | {
|
|
118
|
+
type: ESeriesType.ImpulseSeries;
|
|
119
|
+
options?: IImpulseRenderableSeries;
|
|
120
|
+
xyData?: TXySeriesData;
|
|
116
121
|
} | {
|
|
117
122
|
type: ESeriesType.CandlestickSeries;
|
|
118
123
|
options?: ICandlestickRenderableSeriesOptions;
|
package/Builder/buildSeries.js
CHANGED
|
@@ -42,6 +42,7 @@ var ShaderEffectType_1 = require("../types/ShaderEffectType");
|
|
|
42
42
|
var buildDataSeries_1 = require("./buildDataSeries");
|
|
43
43
|
var classFactory_1 = require("./classFactory");
|
|
44
44
|
var chartBuilder_1 = require("./chartBuilder");
|
|
45
|
+
var FastImpulseRenderableSeries_1 = require("../Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries");
|
|
45
46
|
(0, classFactory_1.registerWasmType)(BaseType_1.EBaseType.PointMarker, PointMarkerType_1.EPointMarkerType.Cross, function (wasm, options) { return new CrossPointMarker_1.CrossPointMarker(wasm, options); }, true);
|
|
46
47
|
(0, classFactory_1.registerWasmType)(BaseType_1.EBaseType.PointMarker, PointMarkerType_1.EPointMarkerType.Ellipse, function (wasm, options) { return new EllipsePointMarker_1.EllipsePointMarker(wasm, options); }, true);
|
|
47
48
|
(0, classFactory_1.registerWasmType)(BaseType_1.EBaseType.PointMarker, PointMarkerType_1.EPointMarkerType.Sprite, function (wasm, options) { return new SpritePointMarker_1.SpritePointMarker(wasm, options); }, true);
|
|
@@ -93,6 +94,9 @@ var buildSeries = function (wasmContext, definition, sharedData) {
|
|
|
93
94
|
else if (seriesDef.type === SeriesType_1.ESeriesType.ColumnSeries) {
|
|
94
95
|
series = new FastColumnRenderableSeries_1.FastColumnRenderableSeries(wasmContext, seriesDef.options);
|
|
95
96
|
}
|
|
97
|
+
else if (seriesDef.type === SeriesType_1.ESeriesType.ImpulseSeries) {
|
|
98
|
+
series = new FastImpulseRenderableSeries_1.FastImpulseRenderableSeries(wasmContext, seriesDef.options);
|
|
99
|
+
}
|
|
96
100
|
else if (seriesDef.type === SeriesType_1.ESeriesType.LineSeries) {
|
|
97
101
|
series = new FastLineRenderableSeries_1.FastLineRenderableSeries(wasmContext, seriesDef.options);
|
|
98
102
|
}
|
|
@@ -34,9 +34,9 @@ export interface ILegendModifierOptions extends IChartModifierBaseOptions {
|
|
|
34
34
|
*/
|
|
35
35
|
margin?: number;
|
|
36
36
|
/**
|
|
37
|
-
* The parent div element Id, the Legend will be appended to this element
|
|
37
|
+
* The parent div element Id or reference, the Legend will be appended to this element
|
|
38
38
|
*/
|
|
39
|
-
placementDivId?: string;
|
|
39
|
+
placementDivId?: string | HTMLDivElement;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* The LegendModifier provides interactive legend behavior on a 2D {@link SciChartSurface}
|
|
@@ -204,6 +204,11 @@ export interface IThemeProvider {
|
|
|
204
204
|
* @remarks Acceptable values include RGB format e.g. ```#FF0000```, RGBA format e.g. ```#FF000077`` and RGBA format e.g. ```rgba(255,0,0,0.5)```
|
|
205
205
|
*/
|
|
206
206
|
columnFillBrush: string;
|
|
207
|
+
/**
|
|
208
|
+
* The default {@link FastImpulseRenderableSeries} fill brush as an HTML color code
|
|
209
|
+
* @remarks Acceptable values include RGB format e.g. ```#FF0000```, RGBA format e.g. ```#FF000077`` and RGBA format e.g. ```rgba(255,0,0,0.5)```
|
|
210
|
+
*/
|
|
211
|
+
impulseFillBrush?: string;
|
|
207
212
|
/**
|
|
208
213
|
* The default {@link UniformHeatmapRenderableSeries} color-map gradient stops
|
|
209
214
|
*/
|
|
@@ -487,6 +492,7 @@ export declare abstract class ThemeProvider implements IThemeProvider {
|
|
|
487
492
|
abstract lineSeriesColor: string;
|
|
488
493
|
abstract columnLineColor: string;
|
|
489
494
|
abstract columnFillBrush: string;
|
|
495
|
+
abstract impulseFillBrush: string;
|
|
490
496
|
abstract defaultColorMapBrush: TGradientStop[];
|
|
491
497
|
abstract axisTitleColor: string;
|
|
492
498
|
abstract shadowEffectColor: string;
|
|
@@ -111,6 +111,8 @@ export declare class SciChartJSDarkTheme extends ThemeProvider {
|
|
|
111
111
|
/** @inheritDoc */
|
|
112
112
|
columnFillBrush: string;
|
|
113
113
|
/** @inheritDoc */
|
|
114
|
+
impulseFillBrush: string;
|
|
115
|
+
/** @inheritDoc */
|
|
114
116
|
defaultColorMapBrush: {
|
|
115
117
|
offset: number;
|
|
116
118
|
color: string;
|
|
@@ -132,6 +132,8 @@ var SciChartJSDarkTheme = /** @class */ (function (_super) {
|
|
|
132
132
|
/** @inheritDoc */
|
|
133
133
|
_this.columnFillBrush = "#FFFFFFFF";
|
|
134
134
|
/** @inheritDoc */
|
|
135
|
+
_this.impulseFillBrush = "#FFFFFFFF";
|
|
136
|
+
/** @inheritDoc */
|
|
135
137
|
_this.defaultColorMapBrush = [
|
|
136
138
|
{ offset: 0, color: "DARKBLUE" },
|
|
137
139
|
{ offset: 0.5, color: "CORNFLOWERBLUE" },
|
|
@@ -111,6 +111,8 @@ export declare class SciChartJSLightTheme extends ThemeProvider {
|
|
|
111
111
|
/** @inheritDoc */
|
|
112
112
|
columnFillBrush: string;
|
|
113
113
|
/** @inheritDoc */
|
|
114
|
+
impulseFillBrush: string;
|
|
115
|
+
/** @inheritDoc */
|
|
114
116
|
defaultColorMapBrush: {
|
|
115
117
|
offset: number;
|
|
116
118
|
color: string;
|
|
@@ -132,6 +132,8 @@ var SciChartJSLightTheme = /** @class */ (function (_super) {
|
|
|
132
132
|
/** @inheritDoc */
|
|
133
133
|
_this.columnFillBrush = "#777777FF";
|
|
134
134
|
/** @inheritDoc */
|
|
135
|
+
_this.impulseFillBrush = "#777777FF";
|
|
136
|
+
/** @inheritDoc */
|
|
135
137
|
_this.defaultColorMapBrush = [
|
|
136
138
|
{ offset: 0, color: "DARKBLUE" },
|
|
137
139
|
{ offset: 0.5, color: "CORNFLOWERBLUE" },
|
|
@@ -30,6 +30,7 @@ export declare abstract class CategoryAxisBase extends AxisBase2D {
|
|
|
30
30
|
private defaultXValuesProperty;
|
|
31
31
|
private defaultXStartProperty;
|
|
32
32
|
private defaultXStepProperty;
|
|
33
|
+
private defaultBaseXValues;
|
|
33
34
|
/**
|
|
34
35
|
* Creates an instance of a {@link CategoryAxisBase}
|
|
35
36
|
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
|
|
@@ -86,5 +87,10 @@ export declare abstract class CategoryAxisBase extends AxisBase2D {
|
|
|
86
87
|
*/
|
|
87
88
|
protected getXDataRange(): NumberRange;
|
|
88
89
|
protected getMaxAutoTicks(): number;
|
|
90
|
+
private generateDefaultXValuesForCategoryAxis;
|
|
89
91
|
private setBaseXValues;
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
delete(): void;
|
|
90
96
|
}
|
|
@@ -47,6 +47,7 @@ var CategoryAxisBase = /** @class */ (function (_super) {
|
|
|
47
47
|
_this.defaultXStepProperty = (_c = options === null || options === void 0 ? void 0 : options.defaultXStep) !== null && _c !== void 0 ? _c : _this.defaultXStepProperty;
|
|
48
48
|
_this.tickProvider = new NumericTickProvider_1.NumericTickProvider(_this.webAssemblyContext2D);
|
|
49
49
|
_this.deltaCalculator = new CategoryDeltaCalculator_1.CategoryDeltaCalculator(_this.webAssemblyContext2D);
|
|
50
|
+
_this.defaultBaseXValues = new _this.webAssemblyContext2D.SCRTDoubleVector();
|
|
50
51
|
return _this;
|
|
51
52
|
}
|
|
52
53
|
Object.defineProperty(CategoryAxisBase.prototype, "isCategoryAxis", {
|
|
@@ -177,37 +178,55 @@ var CategoryAxisBase = /** @class */ (function (_super) {
|
|
|
177
178
|
var coordCalc = this.getCurrentCoordinateCalculator();
|
|
178
179
|
return Math.min(Math.max(1, this.maxAutoTicks), coordCalc.baseXValues.size());
|
|
179
180
|
};
|
|
180
|
-
CategoryAxisBase.prototype.
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, defaultBaseXValues, xValues);
|
|
191
|
-
}
|
|
192
|
-
coordCalc.baseXValues = defaultBaseXValues;
|
|
181
|
+
CategoryAxisBase.prototype.generateDefaultXValuesForCategoryAxis = function () {
|
|
182
|
+
this.defaultBaseXValues.clear();
|
|
183
|
+
if (this.defaultXValues && this.defaultXValues.length > 0) {
|
|
184
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, this.defaultBaseXValues, this.defaultXValues);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
var xValues = [];
|
|
188
|
+
var length_1 = 10;
|
|
189
|
+
for (var i = 0; i < length_1; i++) {
|
|
190
|
+
xValues.push(this.defaultXStart + i * this.defaultXStep);
|
|
193
191
|
}
|
|
194
|
-
|
|
192
|
+
(0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, this.defaultBaseXValues, xValues);
|
|
195
193
|
}
|
|
196
|
-
|
|
194
|
+
return this.defaultBaseXValues;
|
|
195
|
+
};
|
|
196
|
+
CategoryAxisBase.prototype.setBaseXValues = function (coordCalc, renderableSeries) {
|
|
197
|
+
if ((renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.type) === SeriesType_1.ESeriesType.UniformHeatmapSeries) {
|
|
197
198
|
throw Error("Category Axis is not supported for UniformHeatmapRenderableSeries");
|
|
198
199
|
}
|
|
199
|
-
if (renderableSeries.isStacked) {
|
|
200
|
+
if (renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.isStacked) {
|
|
200
201
|
var stackedCollection = renderableSeries;
|
|
201
202
|
if (stackedCollection.size() === 0) {
|
|
202
203
|
throw Error("BaseStackedCollection should have at least one BaseStackedRenderableSeries");
|
|
203
204
|
}
|
|
204
205
|
var firstStackedRS = stackedCollection.get(0);
|
|
206
|
+
if (!(firstStackedRS === null || firstStackedRS === void 0 ? void 0 : firstStackedRS.dataSeries)) {
|
|
207
|
+
if (!coordCalc.baseXValues)
|
|
208
|
+
coordCalc.baseXValues = this.generateDefaultXValuesForCategoryAxis();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
205
211
|
coordCalc.baseXValues = firstStackedRS.dataSeries.getNativeXValues();
|
|
206
212
|
}
|
|
207
213
|
else {
|
|
214
|
+
// Not stacked renderable series
|
|
215
|
+
if (!(renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.dataSeries)) {
|
|
216
|
+
if (!coordCalc.baseXValues)
|
|
217
|
+
coordCalc.baseXValues = this.generateDefaultXValuesForCategoryAxis();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
208
220
|
coordCalc.baseXValues = renderableSeries.dataSeries.getNativeXValues();
|
|
209
221
|
}
|
|
210
222
|
};
|
|
223
|
+
/**
|
|
224
|
+
* @inheritDoc
|
|
225
|
+
*/
|
|
226
|
+
CategoryAxisBase.prototype.delete = function () {
|
|
227
|
+
_super.prototype.delete.call(this);
|
|
228
|
+
this.defaultBaseXValues = (0, Deleter_1.deleteSafe)(this.defaultBaseXValues);
|
|
229
|
+
};
|
|
211
230
|
return CategoryAxisBase;
|
|
212
231
|
}(AxisBase2D_1.AxisBase2D));
|
|
213
232
|
exports.CategoryAxisBase = CategoryAxisBase;
|
|
@@ -35,5 +35,11 @@ export declare class SciChartLegend extends SciChartLegendBase {
|
|
|
35
35
|
/** @inheritDoc */
|
|
36
36
|
protected addEventListeners(): void;
|
|
37
37
|
/** @inheritDoc */
|
|
38
|
+
protected removeEventListeners(): void;
|
|
39
|
+
/**
|
|
40
|
+
* adds event listeners to a specific {@link IRenderableSeries} series
|
|
41
|
+
*/
|
|
42
|
+
protected addEventListenerToSeries(rs: IRenderableSeries): void;
|
|
43
|
+
/** @inheritDoc */
|
|
38
44
|
protected getInnerHTML(): string;
|
|
39
45
|
}
|
|
@@ -79,7 +79,36 @@ var SciChartLegend = /** @class */ (function (_super) {
|
|
|
79
79
|
};
|
|
80
80
|
/** @inheritDoc */
|
|
81
81
|
SciChartLegend.prototype.addEventListeners = function () {
|
|
82
|
-
|
|
82
|
+
var _this = this;
|
|
83
|
+
this.renderableSeriesArray.forEach(function (rs) { return _this.addEventListenerToSeries(rs); });
|
|
84
|
+
};
|
|
85
|
+
/** @inheritDoc */
|
|
86
|
+
SciChartLegend.prototype.removeEventListeners = function () {
|
|
87
|
+
var _this = this;
|
|
88
|
+
this.renderableSeriesArray.forEach(function (rs) { return _this.removeEventListenerFromSeries(rs.id); });
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* adds event listeners to a specific {@link IRenderableSeries} series
|
|
92
|
+
*/
|
|
93
|
+
SciChartLegend.prototype.addEventListenerToSeries = function (rs) {
|
|
94
|
+
var el = this.getParentDiv().querySelector("[id='".concat(rs.id, "']"));
|
|
95
|
+
if (el) {
|
|
96
|
+
var onChangeEventListener_1 = function (e) { return (rs.isVisible = e.target.checked); };
|
|
97
|
+
el.addEventListener("change", onChangeEventListener_1);
|
|
98
|
+
var eventSubscriptionItem = {
|
|
99
|
+
element: el,
|
|
100
|
+
eventType: "change",
|
|
101
|
+
eventListener: onChangeEventListener_1,
|
|
102
|
+
delete: function () { return el.removeEventListener("change", onChangeEventListener_1); }
|
|
103
|
+
};
|
|
104
|
+
var eventListenersForRenderableSeries = this.eventListenersCollection.get(rs.id);
|
|
105
|
+
if (eventListenersForRenderableSeries) {
|
|
106
|
+
eventListenersForRenderableSeries.push(eventSubscriptionItem);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.eventListenersCollection.set(rs.id, [eventSubscriptionItem]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
83
112
|
};
|
|
84
113
|
/** @inheritDoc */
|
|
85
114
|
SciChartLegend.prototype.getInnerHTML = function () {
|
|
@@ -104,15 +133,3 @@ var SciChartLegend = /** @class */ (function (_super) {
|
|
|
104
133
|
return SciChartLegend;
|
|
105
134
|
}(SciChartLegendBase_1.SciChartLegendBase));
|
|
106
135
|
exports.SciChartLegend = SciChartLegend;
|
|
107
|
-
/** @ignore */
|
|
108
|
-
var addEventListenerToSeries = function (rs) {
|
|
109
|
-
var el = document.getElementById(rs.id);
|
|
110
|
-
if (el) {
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
el.addEventListener("change", function (e) { return (rs.isVisible = e.target.checked); });
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
/** @ignore */
|
|
116
|
-
var removeEventListenerFromSeries = function (renderableSeriesId) {
|
|
117
|
-
// TODO: to think about how to remove event listeners when removing series
|
|
118
|
-
};
|
|
@@ -10,6 +10,11 @@ export declare type TLegendItem = {
|
|
|
10
10
|
checked: boolean;
|
|
11
11
|
gradient?: GradientParams;
|
|
12
12
|
};
|
|
13
|
+
export interface IEventSubscriptionItem extends IDeletable {
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
eventType: string;
|
|
16
|
+
eventListener: EventListener;
|
|
17
|
+
}
|
|
13
18
|
/**
|
|
14
19
|
* Enumeration constants to define legend orientation
|
|
15
20
|
*/
|
|
@@ -48,7 +53,8 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
48
53
|
protected marginProperty: number;
|
|
49
54
|
protected isDirty: boolean;
|
|
50
55
|
protected parentSurfaceProperty: ISciChartSurfaceBase;
|
|
51
|
-
protected placementDivIdProperty: string;
|
|
56
|
+
protected placementDivIdProperty: string | HTMLDivElement;
|
|
57
|
+
protected eventListenersCollection: Map<string, IEventSubscriptionItem[]>;
|
|
52
58
|
/** @inheritDoc */
|
|
53
59
|
abstract applyTheme(): void;
|
|
54
60
|
setInvalidateParentSurface(value: () => void): void;
|
|
@@ -107,13 +113,13 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
107
113
|
*/
|
|
108
114
|
set margin(value: number);
|
|
109
115
|
/**
|
|
110
|
-
* Gets or sets the parent div element for the Legend
|
|
116
|
+
* Gets or sets the parent div element reference or id for the Legend
|
|
111
117
|
*/
|
|
112
|
-
get placementDivId(): string;
|
|
118
|
+
get placementDivId(): string | HTMLDivElement;
|
|
113
119
|
/**
|
|
114
|
-
* Gets or sets the parent div element for the Legend
|
|
120
|
+
* Gets or sets the parent div element reference or id for the Legend
|
|
115
121
|
*/
|
|
116
|
-
set placementDivId(value: string);
|
|
122
|
+
set placementDivId(value: string | HTMLDivElement);
|
|
117
123
|
/** @inheritDoc */
|
|
118
124
|
delete(): void;
|
|
119
125
|
/**
|
|
@@ -156,7 +162,15 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
156
162
|
* When overridden in a derived class, will be called when its time to add event listeners to series
|
|
157
163
|
*/
|
|
158
164
|
protected abstract addEventListeners(): void;
|
|
159
|
-
|
|
165
|
+
/**
|
|
166
|
+
* When overridden in a derived class, will be called when its time to remove event listeners from series
|
|
167
|
+
*/
|
|
168
|
+
protected abstract removeEventListeners(): void;
|
|
169
|
+
/**
|
|
170
|
+
* removes event listeners from a specific {@link IRenderableSeries} series
|
|
171
|
+
*/
|
|
172
|
+
protected removeEventListenerFromSeries: (renderableSeriesId: string) => void;
|
|
173
|
+
protected getParentDiv(): HTMLDivElement;
|
|
160
174
|
}
|
|
161
175
|
export declare const getLegendItemHtml: (orientation: ELegendOrientation, showCheckboxes: boolean, showSeriesMarkers: boolean, item: TLegendItem) => string;
|
|
162
176
|
export declare const getLegendContainerHtml: (placement: ELegendPlacement, textColor: string, backgroundColor: string, margin: Thickness, body: string) => string;
|
|
@@ -35,11 +35,24 @@ var ELegendType;
|
|
|
35
35
|
*/
|
|
36
36
|
var SciChartLegendBase = /** @class */ (function () {
|
|
37
37
|
function SciChartLegendBase() {
|
|
38
|
+
var _this = this;
|
|
38
39
|
this.orientationProperty = ELegendOrientation.Vertical;
|
|
39
40
|
this.showLegendProperty = true;
|
|
40
41
|
this.placementProperty = ELegendPlacement.TopLeft;
|
|
41
42
|
this.marginProperty = 10;
|
|
42
43
|
this.isDirty = true;
|
|
44
|
+
this.eventListenersCollection = new Map();
|
|
45
|
+
/**
|
|
46
|
+
* removes event listeners from a specific {@link IRenderableSeries} series
|
|
47
|
+
*/
|
|
48
|
+
this.removeEventListenerFromSeries = function (renderableSeriesId) {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = _this.eventListenersCollection.get(renderableSeriesId)) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) {
|
|
51
|
+
var element = _a.element, eventListener = _a.eventListener, eventType = _a.eventType;
|
|
52
|
+
element.removeEventListener(eventType, eventListener);
|
|
53
|
+
});
|
|
54
|
+
_this.eventListenersCollection.delete(renderableSeriesId);
|
|
55
|
+
};
|
|
43
56
|
}
|
|
44
57
|
SciChartLegendBase.prototype.setInvalidateParentSurface = function (value) {
|
|
45
58
|
this.invalidateParentSurface = value;
|
|
@@ -156,13 +169,13 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
156
169
|
});
|
|
157
170
|
Object.defineProperty(SciChartLegendBase.prototype, "placementDivId", {
|
|
158
171
|
/**
|
|
159
|
-
* Gets or sets the parent div element for the Legend
|
|
172
|
+
* Gets or sets the parent div element reference or id for the Legend
|
|
160
173
|
*/
|
|
161
174
|
get: function () {
|
|
162
175
|
return this.placementDivIdProperty;
|
|
163
176
|
},
|
|
164
177
|
/**
|
|
165
|
-
* Gets or sets the parent div element for the Legend
|
|
178
|
+
* Gets or sets the parent div element reference or id for the Legend
|
|
166
179
|
*/
|
|
167
180
|
set: function (value) {
|
|
168
181
|
this.delete();
|
|
@@ -175,8 +188,8 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
175
188
|
/** @inheritDoc */
|
|
176
189
|
SciChartLegendBase.prototype.delete = function () {
|
|
177
190
|
var _a;
|
|
178
|
-
// TODO: remove listeners from renderable series to prevent memory leaks in older browsers
|
|
179
191
|
if (this.div) {
|
|
192
|
+
this.removeEventListeners();
|
|
180
193
|
(_a = this.getParentDiv()) === null || _a === void 0 ? void 0 : _a.removeChild(this.div);
|
|
181
194
|
this.div = undefined;
|
|
182
195
|
}
|
|
@@ -239,7 +252,12 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
239
252
|
}
|
|
240
253
|
};
|
|
241
254
|
SciChartLegendBase.prototype.getParentDiv = function () {
|
|
242
|
-
|
|
255
|
+
if (this.placementDivId) {
|
|
256
|
+
return typeof this.placementDivId === "string"
|
|
257
|
+
? document.getElementById(this.placementDivId)
|
|
258
|
+
: this.placementDivId;
|
|
259
|
+
}
|
|
260
|
+
return this.rootDiv;
|
|
243
261
|
};
|
|
244
262
|
return SciChartLegendBase;
|
|
245
263
|
}());
|
|
@@ -95,10 +95,25 @@ var SciChartPieLegend = /** @class */ (function (_super) {
|
|
|
95
95
|
SciChartPieLegend.prototype.addEventListeners = function () {
|
|
96
96
|
var _this = this;
|
|
97
97
|
this.pieSegmentArray.forEach(function (ps) {
|
|
98
|
-
var el =
|
|
99
|
-
|
|
98
|
+
var el = _this.getParentDiv().querySelector("#".concat(getCheckboxId(ps.id)));
|
|
99
|
+
if (!el) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var eventSubscriptionItem = (0, SciChartPieSurface_1.addEventListenerToPieSegment)(ps, el, _this.animate);
|
|
103
|
+
var eventListenersForRenderableSeries = _this.eventListenersCollection.get(ps.id);
|
|
104
|
+
if (eventListenersForRenderableSeries) {
|
|
105
|
+
eventListenersForRenderableSeries.push(eventSubscriptionItem);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
_this.eventListenersCollection.set(ps.id, [eventSubscriptionItem]);
|
|
109
|
+
}
|
|
100
110
|
});
|
|
101
111
|
};
|
|
112
|
+
/** @inheritDoc */
|
|
113
|
+
SciChartPieLegend.prototype.removeEventListeners = function () {
|
|
114
|
+
var _this = this;
|
|
115
|
+
this.pieSegmentArray.forEach(function (ps) { return _this.removeEventListenerFromSeries(ps.id); });
|
|
116
|
+
};
|
|
102
117
|
/**
|
|
103
118
|
* @inheritDoc
|
|
104
119
|
*/
|
|
@@ -123,7 +138,3 @@ var SciChartPieLegend = /** @class */ (function (_super) {
|
|
|
123
138
|
exports.SciChartPieLegend = SciChartPieLegend;
|
|
124
139
|
/** @ignore */
|
|
125
140
|
var getCheckboxId = function (pieSegmentId) { return "check".concat(pieSegmentId); };
|
|
126
|
-
/** @ignore */
|
|
127
|
-
var removeEventListenerFromSeries = function (renderableSeriesId) {
|
|
128
|
-
// TODO: to think about how to remove event listeners when removing series
|
|
129
|
-
};
|
|
@@ -14,7 +14,7 @@ export declare const animationHelpers: {
|
|
|
14
14
|
checkCanDraw: (animationFSM: AnimationFiniteStateMachine) => boolean;
|
|
15
15
|
checkIsAnimationRunning: (animationQueue: IAnimation[], animationFSM: AnimationFiniteStateMachine) => boolean;
|
|
16
16
|
animationUpdate: (animationFSM: SeriesAnimationFiniteStateMachine, timeElapsed: number, beforeAnimationStart: () => void, afterAnimationComplete: () => void, updateAnimationProperties: (progress: number, animationFSM: SeriesAnimationFiniteStateMachine) => void) => void;
|
|
17
|
-
createPointMarker: (wasmContext: TSciChart, pointMarkerStyle: BasePointMarkerStyle) =>
|
|
17
|
+
createPointMarker: (wasmContext: TSciChart, pointMarkerStyle: BasePointMarkerStyle) => EllipsePointMarker | SpritePointMarker | CrossPointMarker | XPointMarker | SquarePointMarker | TrianglePointMarker;
|
|
18
18
|
interpolateNumber: (from: number, to: number, progress: number) => number;
|
|
19
19
|
interpolateColor: (from: number, to: number, progress: number) => number;
|
|
20
20
|
copyVector: (sourceVector: SCRTDoubleVector, targetVector: SCRTDoubleVector) => void;
|
package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js
CHANGED
|
@@ -85,6 +85,7 @@ var UniformContoursDrawingProvider = /** @class */ (function (_super) {
|
|
|
85
85
|
* @inheritDoc
|
|
86
86
|
*/
|
|
87
87
|
UniformContoursDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
|
|
88
|
+
var _this = this;
|
|
88
89
|
var _a, _b;
|
|
89
90
|
var heightsTexture = (_a = this.heightsTextureCache) === null || _a === void 0 ? void 0 : _a.value;
|
|
90
91
|
if (heightsTexture) {
|
|
@@ -94,15 +95,36 @@ var UniformContoursDrawingProvider = /** @class */ (function (_super) {
|
|
|
94
95
|
// renderContext.getNativeContext().DrawTexture(this.heightsTexture, 10, 100, 256, 256);
|
|
95
96
|
// renderContext.getNativeContext().DrawTexture(this.paletteTexture.getTexture(), 310, 100, 256, 256);
|
|
96
97
|
// END DEBUG CODE
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
var cParams_1 = this.parentSeries.getContourDrawingParams();
|
|
99
|
+
var isVerticalChart = renderPassData.isVerticalChart;
|
|
100
|
+
var x_1 = renderPassData.xCoordinateCalculator.getCoordinate(cParams_1.xMin);
|
|
101
|
+
var y_1 = renderPassData.yCoordinateCalculator.getCoordinate(cParams_1.yMin);
|
|
102
|
+
var width_1 = renderPassData.xCoordinateCalculator.getCoordinate(cParams_1.xMax);
|
|
103
|
+
var height_1 = renderPassData.yCoordinateCalculator.getCoordinate(cParams_1.yMax);
|
|
104
|
+
var textureWidth = Math.abs(x_1 - width_1);
|
|
105
|
+
var drawContours = function () {
|
|
106
|
+
if (_this.parentSeries.minorsPerMajor > 0) {
|
|
107
|
+
_this.drawContours(renderContext, x_1, y_1, width_1, height_1, cParams_1.zMin, cParams_1.zMax, cParams_1.minorStepZ, cParams_1.minorLineStyle);
|
|
108
|
+
}
|
|
109
|
+
_this.drawContours(renderContext, x_1, y_1, width_1, height_1, cParams_1.zMin, cParams_1.zMax, cParams_1.majorStepZ, cParams_1.majorLineStyle);
|
|
110
|
+
};
|
|
111
|
+
if (isVerticalChart) {
|
|
112
|
+
var nativeContext = renderContext.getNativeContext();
|
|
113
|
+
var hasFlippedXCoordinates = renderPassData.xCoordinateCalculator.hasFlippedCoordinates;
|
|
114
|
+
nativeContext.PushMatrix();
|
|
115
|
+
nativeContext.PushState();
|
|
116
|
+
nativeContext.Rotate(-90);
|
|
117
|
+
var xTrans = hasFlippedXCoordinates ? -textureWidth - x_1 : -x_1;
|
|
118
|
+
nativeContext.Translate(xTrans, 0);
|
|
119
|
+
x_1 = hasFlippedXCoordinates ? textureWidth : 0;
|
|
120
|
+
width_1 = hasFlippedXCoordinates ? 0 : textureWidth;
|
|
121
|
+
drawContours();
|
|
122
|
+
nativeContext.PopMatrix();
|
|
123
|
+
nativeContext.PopState();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
drawContours();
|
|
104
127
|
}
|
|
105
|
-
this.drawContours(renderContext, x, y, width, height, cParams.zMin, cParams.zMax, cParams.majorStepZ, cParams.majorLineStyle);
|
|
106
128
|
}
|
|
107
129
|
};
|
|
108
130
|
UniformContoursDrawingProvider.prototype.drawContours = function (renderContext, x, y, width, height, zMin, zMax, zStep, lineStyle) {
|
|
@@ -112,15 +112,19 @@ var UniformHeatmapDrawingProvider = /** @class */ (function (_super) {
|
|
|
112
112
|
var viewRect = this.parentSeries.parentSurface.seriesViewRect;
|
|
113
113
|
var textureWidth = Math.abs(xMin - xMax);
|
|
114
114
|
if (isVerticalChart) {
|
|
115
|
+
nativeContext.PushMatrix();
|
|
116
|
+
nativeContext.PushState();
|
|
115
117
|
nativeContext.Rotate(-90);
|
|
116
|
-
var xTrans = hasFlippedXCoordinates ? -
|
|
117
|
-
nativeContext.Translate(xTrans,
|
|
118
|
+
var xTrans = hasFlippedXCoordinates ? -xMin : -textureWidth - xMin;
|
|
119
|
+
nativeContext.Translate(xTrans, 0);
|
|
118
120
|
var x = hasFlippedXCoordinates ? 0 : textureWidth;
|
|
119
121
|
var width = hasFlippedXCoordinates ? textureWidth : 0;
|
|
120
122
|
var y = yMin;
|
|
121
123
|
var height = yMax;
|
|
122
124
|
this.drawHeatmap(nativeContext, x, y, width, height);
|
|
123
125
|
// Maybe to use nativeContext.Scale(-1, 1);???
|
|
126
|
+
nativeContext.PopMatrix();
|
|
127
|
+
nativeContext.PopState();
|
|
124
128
|
}
|
|
125
129
|
else {
|
|
126
130
|
this.drawHeatmap(nativeContext, xMin, yMin, xMax, yMax);
|
|
@@ -45,7 +45,7 @@ export interface IColumnRenderableSeriesOptions extends IBaseRenderableSeriesOpt
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class FastColumnRenderableSeries extends BaseRenderableSeries {
|
|
47
47
|
/** @inheritDoc */
|
|
48
|
-
readonly type
|
|
48
|
+
readonly type: ESeriesType;
|
|
49
49
|
private fillProperty;
|
|
50
50
|
private zeroLineYProperty;
|
|
51
51
|
private dataPointWidthProperty;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { NumberRange } from "../../../Core/NumberRange";
|
|
2
|
+
import { ESeriesType } from "../../../types/SeriesType";
|
|
3
|
+
import { TSciChart } from "../../../types/TSciChart";
|
|
4
|
+
import { IThemeProvider } from "../../Themes/IThemeProvider";
|
|
5
|
+
import { FastColumnRenderableSeries } from "./FastColumnRenderableSeries";
|
|
6
|
+
import { IHitTestProvider } from "./HitTest/IHitTestProvider";
|
|
7
|
+
import { IBaseRenderableSeriesOptions } from "./IBaseRenderableSeriesOptions";
|
|
8
|
+
/**
|
|
9
|
+
* Options to pass to the {@link FastImpulseRenderableSeries} constructor
|
|
10
|
+
*/
|
|
11
|
+
export interface IImpulseRenderableSeries extends IBaseRenderableSeriesOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The impulse fill as an HTML color code
|
|
14
|
+
*/
|
|
15
|
+
fill?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The impulse point size as a number value
|
|
18
|
+
*/
|
|
19
|
+
size?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Gets or sets the Zero-line Y, the Y-value where the column crosses zero and inverts. Default is 0
|
|
22
|
+
*/
|
|
23
|
+
zeroLineY?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Defines a impulse-series or JavaScript impulse chart type in the SciChart's High Performance Real-time
|
|
27
|
+
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
28
|
+
* @remarks
|
|
29
|
+
* To add a impulse series to a {@link SciChartSurface} you need to declare both the {@link FastImpulseRenderableSeries | RenderableSeries}
|
|
30
|
+
* and a {@link XyDataSeries | DataSeries}. Simplified code sample below:
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* const sciChartSurface: SciChartSurface;
|
|
34
|
+
* const wasmContext: TSciChart;
|
|
35
|
+
* // Create and fill the dataseries
|
|
36
|
+
* const dataSeries = new XyDataSeries(wasmContext);
|
|
37
|
+
* dataSeries.append(1,2);
|
|
38
|
+
* dataSeries.append(1,2);
|
|
39
|
+
* // Create the renderableSeries
|
|
40
|
+
* const impulseSeries = new FastImpulseRenderableSeries(wasmContext);
|
|
41
|
+
* impulseSeries.dataSeries = dataSeries;
|
|
42
|
+
* // append to the SciChartSurface
|
|
43
|
+
* sciChartSurface.renderableSeries.add(impulseSeries);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class FastImpulseRenderableSeries extends FastColumnRenderableSeries {
|
|
47
|
+
/** @inheritDoc */
|
|
48
|
+
readonly type = ESeriesType.ImpulseSeries;
|
|
49
|
+
private impulseFillProperty;
|
|
50
|
+
private impulseSizeProperty;
|
|
51
|
+
private impulseDataPointWidthProperty;
|
|
52
|
+
private impulseStrokeThicknessProperty;
|
|
53
|
+
/**
|
|
54
|
+
* Creates an instance of the {@link FastImpulseRenderableSeries}
|
|
55
|
+
* @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
|
|
56
|
+
* native methods and access to our WebGL2 WebAssembly Drawing Engine
|
|
57
|
+
* @param options optional parameters of type {@link IImpulseRenderableSeries} applied when constructing the series type
|
|
58
|
+
*/
|
|
59
|
+
constructor(webAssemblyContext: TSciChart, options?: IImpulseRenderableSeries);
|
|
60
|
+
/**
|
|
61
|
+
* Gets or sets the color of each impulse
|
|
62
|
+
*/
|
|
63
|
+
get fill(): string;
|
|
64
|
+
set fill(htmlColorCode: string);
|
|
65
|
+
/**
|
|
66
|
+
* Gets or sets the size of each impulse point
|
|
67
|
+
*/
|
|
68
|
+
get size(): number;
|
|
69
|
+
set size(sizeParam: number);
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
getXRange(): NumberRange;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
getYRange(xVisibleRange: NumberRange, isXCategoryAxis?: boolean): NumberRange;
|
|
78
|
+
/** @inheritDoc */
|
|
79
|
+
toJSON(excludeData?: boolean): import("../../../Builder/buildSeries").TSeriesDefinition;
|
|
80
|
+
/** @inheritDoc */
|
|
81
|
+
applyTheme(themeProvider: IThemeProvider): void;
|
|
82
|
+
/** @inheritDoc */
|
|
83
|
+
protected newHitTestProvider(): IHitTestProvider;
|
|
84
|
+
}
|