scichart 3.2.532 → 3.2.543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Charting/ChartModifiers/CursorModifier.js +0 -1
- package/Charting/Model/BaseDataSeries.d.ts +3 -2
- package/Charting/Model/BaseDataSeries.js +8 -4
- package/Charting/Model/HlcDataSeries.d.ts +2 -1
- package/Charting/Model/HlcDataSeries.js +4 -2
- package/Charting/Model/IDataSeries.d.ts +2 -1
- package/Charting/Model/IPaletteProvider.d.ts +25 -0
- package/Charting/Model/IPaletteProvider.js +23 -7
- package/Charting/Model/OhlcDataSeries.d.ts +2 -1
- package/Charting/Model/OhlcDataSeries.js +4 -2
- package/Charting/Model/XyyDataSeries.d.ts +2 -1
- package/Charting/Model/XyyDataSeries.js +4 -2
- package/Charting/Visuals/Annotations/AnnotationBase.js +3 -3
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +15 -4
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +55 -8
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +22 -3
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +0 -6
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +18 -13
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +10 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +85 -24
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +4 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +1 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +21 -15
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -12
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +17 -11
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -0
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.d.ts +30 -0
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.js +63 -0
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.d.ts +10 -0
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.js +53 -0
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.d.ts +10 -0
- package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.js +55 -0
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +13 -8
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +63 -46
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +12 -13
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +60 -52
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +12 -7
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +54 -43
- package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/constants.js +1 -0
- package/Charting/Visuals/createMaster.d.ts +12 -2
- package/Charting/Visuals/createMaster.js +14 -2
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/ObservableArray.d.ts +11 -9
- package/Core/ObservableArray.js +44 -21
- package/README.md +17 -8
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.wasm +0 -0
- package/index.d.ts +9 -0
- package/index.dev.js +634 -267
- package/index.js +27 -13
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/types/TSciChart.d.ts +4 -0
- package/types/YRangeMode.d.ts +10 -0
- package/types/YRangeMode.js +14 -0
- package/utils/debug.d.ts +2 -0
- package/utils/debug.js +17 -0
|
@@ -5,6 +5,7 @@ import { NumberRange } from "../../../Core/NumberRange";
|
|
|
5
5
|
import { ObservableArray } from "../../../Core/ObservableArray";
|
|
6
6
|
import { ESeriesType } from "../../../types/SeriesType";
|
|
7
7
|
import { SCRTDoubleVector, TSciChart } from "../../../types/TSciChart";
|
|
8
|
+
import { EYRangeMode } from "../../../types/YRangeMode";
|
|
8
9
|
import { ELineDrawMode, WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
|
|
9
10
|
import { SeriesInfo } from "../../Model/ChartData/SeriesInfo";
|
|
10
11
|
import { IDataSeries } from "../../Model/IDataSeries";
|
|
@@ -53,6 +54,8 @@ export interface IBaseStackedCollectionOptions {
|
|
|
53
54
|
* Sets 100% mode. When true, the stacked group becomes a 100% stacked chart
|
|
54
55
|
*/
|
|
55
56
|
isOneHundredPercent?: boolean;
|
|
57
|
+
/** Determines whether the y range for this series should consider only the visible data (the default), or include the drawn points just outside the visible range */
|
|
58
|
+
yRangeMode?: EYRangeMode;
|
|
56
59
|
}
|
|
57
60
|
/**
|
|
58
61
|
* A base class for stacked collections, which are used to create stacked mountain or column chart types.
|
|
@@ -93,6 +96,7 @@ export declare abstract class BaseStackedCollection<T extends BaseStackedRendera
|
|
|
93
96
|
private yAxisIdProperty;
|
|
94
97
|
private isOneHundredPercentProperty;
|
|
95
98
|
private animationQueue;
|
|
99
|
+
private yRangeModeProperty;
|
|
96
100
|
/**
|
|
97
101
|
* Creates an instance of the {@link BaseStackedCollection}
|
|
98
102
|
* @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
|
|
@@ -144,6 +148,9 @@ export declare abstract class BaseStackedCollection<T extends BaseStackedRendera
|
|
|
144
148
|
* Gets or sets 100% mode. When true, the stacked group becomes a 100% stacked chart
|
|
145
149
|
*/
|
|
146
150
|
set isOneHundredPercent(value: boolean);
|
|
151
|
+
/** @inheritDoc */
|
|
152
|
+
get yRangeMode(): EYRangeMode;
|
|
153
|
+
set yRangeMode(value: EYRangeMode);
|
|
147
154
|
/**
|
|
148
155
|
* dataSeries property is not supported for BaseStackedCollection
|
|
149
156
|
*/
|
|
@@ -21,6 +21,8 @@ var DeletableEntity_1 = require("../../../Core/DeletableEntity");
|
|
|
21
21
|
var Deleter_1 = require("../../../Core/Deleter");
|
|
22
22
|
var NumberRange_1 = require("../../../Core/NumberRange");
|
|
23
23
|
var ObservableArray_1 = require("../../../Core/ObservableArray");
|
|
24
|
+
var SearchMode_1 = require("../../../types/SearchMode");
|
|
25
|
+
var YRangeMode_1 = require("../../../types/YRangeMode");
|
|
24
26
|
var guid_1 = require("../../../utils/guid");
|
|
25
27
|
var MemoryUsageHelper_1 = require("../../../utils/MemoryUsageHelper");
|
|
26
28
|
var BaseDataSeries_1 = require("../../Model/BaseDataSeries");
|
|
@@ -41,7 +43,7 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
41
43
|
*/
|
|
42
44
|
function BaseStackedCollection(webAssemblyContext, options) {
|
|
43
45
|
var _this = this;
|
|
44
|
-
var _a, _b, _c, _d;
|
|
46
|
+
var _a, _b, _c, _d, _e;
|
|
45
47
|
_this = _super.call(this) || this;
|
|
46
48
|
/** @inheritDoc */
|
|
47
49
|
_this.id = (0, guid_1.generateGuid)();
|
|
@@ -60,11 +62,13 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
60
62
|
_this.yAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
|
|
61
63
|
_this.isOneHundredPercentProperty = false;
|
|
62
64
|
_this.animationQueue = [];
|
|
65
|
+
_this.yRangeModeProperty = YRangeMode_1.EYRangeMode.Drawn;
|
|
63
66
|
_this.webAssemblyContext = webAssemblyContext;
|
|
64
67
|
_this.isVisibleProperty = (_a = options === null || options === void 0 ? void 0 : options.isVisible) !== null && _a !== void 0 ? _a : _this.isVisibleProperty;
|
|
65
68
|
_this.xAxisIdProperty = (_b = options === null || options === void 0 ? void 0 : options.xAxisId) !== null && _b !== void 0 ? _b : _this.xAxisIdProperty;
|
|
66
69
|
_this.yAxisIdProperty = (_c = options === null || options === void 0 ? void 0 : options.yAxisId) !== null && _c !== void 0 ? _c : _this.yAxisIdProperty;
|
|
67
70
|
_this.isOneHundredPercentProperty = (_d = options === null || options === void 0 ? void 0 : options.isOneHundredPercent) !== null && _d !== void 0 ? _d : _this.isOneHundredPercentProperty;
|
|
71
|
+
_this.yRangeModeProperty = (_e = options === null || options === void 0 ? void 0 : options.yRangeMode) !== null && _e !== void 0 ? _e : _this.yRangeModeProperty;
|
|
68
72
|
_this.updateAnimationProperties = _this.updateAnimationProperties.bind(_this);
|
|
69
73
|
_this.notifyPropertyChanged = _this.notifyPropertyChanged.bind(_this);
|
|
70
74
|
_this.getParentSurface = _this.getParentSurface.bind(_this);
|
|
@@ -221,6 +225,20 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
221
225
|
enumerable: false,
|
|
222
226
|
configurable: true
|
|
223
227
|
});
|
|
228
|
+
Object.defineProperty(BaseStackedCollection.prototype, "yRangeMode", {
|
|
229
|
+
/** @inheritDoc */
|
|
230
|
+
get: function () {
|
|
231
|
+
return this.yRangeModeProperty;
|
|
232
|
+
},
|
|
233
|
+
set: function (value) {
|
|
234
|
+
if (this.yRangeModeProperty !== value) {
|
|
235
|
+
this.yRangeModeProperty = value;
|
|
236
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.YRANGEMODE);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
enumerable: false,
|
|
240
|
+
configurable: true
|
|
241
|
+
});
|
|
224
242
|
Object.defineProperty(BaseStackedCollection.prototype, "dataSeries", {
|
|
225
243
|
// PROPERTIES END
|
|
226
244
|
// Un-Supported PROPERTIES
|
|
@@ -517,7 +535,7 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
517
535
|
this.getVisibleSeries().forEach(function (rs) {
|
|
518
536
|
if (rs.accumulatedValues.size() === _this.getNativeXValues().size()) {
|
|
519
537
|
// TODO: calc isSorted flag
|
|
520
|
-
var range = (0, BaseDataSeries_1.getWindowedYRange)(_this.webAssemblyContext, _this.getNativeXValues(), rs.accumulatedValues, xVisibleRange, true, isXCategoryAxis, true);
|
|
538
|
+
var range = (0, BaseDataSeries_1.getWindowedYRange)(_this.webAssemblyContext, _this.getNativeXValues(), rs.accumulatedValues, xVisibleRange, true, isXCategoryAxis, true, _this.yRangeMode === YRangeMode_1.EYRangeMode.Visible ? SearchMode_1.ESearchMode.RoundUp : SearchMode_1.ESearchMode.RoundDown, _this.yRangeMode === YRangeMode_1.EYRangeMode.Visible ? SearchMode_1.ESearchMode.RoundDown : SearchMode_1.ESearchMode.RoundUp);
|
|
521
539
|
if (range) {
|
|
522
540
|
maxRange = maxRange ? maxRange.union(range) : range;
|
|
523
541
|
}
|
|
@@ -652,7 +670,8 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
652
670
|
isVisible: this.isVisible,
|
|
653
671
|
isOneHundredPercent: this.isOneHundredPercent,
|
|
654
672
|
xAxisId: this.xAxisId,
|
|
655
|
-
yAxisId: this.yAxisId
|
|
673
|
+
yAxisId: this.yAxisId,
|
|
674
|
+
yRangeMode: this.yRangeMode
|
|
656
675
|
};
|
|
657
676
|
// @ts-ignore
|
|
658
677
|
return { type: this.type, series: series, options: options };
|
|
@@ -336,12 +336,6 @@ var DataLabelProvider = /** @class */ (function (_super) {
|
|
|
336
336
|
if (!yValues || yValues.size() === 0)
|
|
337
337
|
return;
|
|
338
338
|
this.state = new DataLabelState_1.DataLabelState(renderContext, renderPassData, this.style, this.color, yValues, this.parentSeries);
|
|
339
|
-
// console.log(
|
|
340
|
-
// "gen ",
|
|
341
|
-
// yValues.size(),
|
|
342
|
-
// renderPassData.pointSeries.xRange,
|
|
343
|
-
// renderPassData.pointSeries.indexes.size()
|
|
344
|
-
// );
|
|
345
339
|
var _c = this.parentSeries.dataSeries, fifoCapacity = _c.fifoCapacity, fifoSweeping = _c.fifoSweeping, fifoSweepingGap = _c.fifoSweepingGap, fifoStartIndex = _c.fifoStartIndex;
|
|
346
340
|
var bounds = (0, NativeObject_1.getTextBounds)(this.webAssemblyContext);
|
|
347
341
|
if (!this.shouldGenerate(this.state))
|
|
@@ -17,7 +17,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.BandSeriesDrawingProvider = void 0;
|
|
19
19
|
var Deleter_1 = require("../../../../Core/Deleter");
|
|
20
|
-
var SeriesType_1 = require("../../../../types/SeriesType");
|
|
21
20
|
var BrushCache_1 = require("../../../Drawing/BrushCache");
|
|
22
21
|
var Pen2DCache_1 = require("../../../Drawing/Pen2DCache");
|
|
23
22
|
var WebGlRenderContext2D_1 = require("../../../Drawing/WebGlRenderContext2D");
|
|
@@ -115,24 +114,26 @@ var BandSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
115
114
|
var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
|
|
116
115
|
var yDrawValues = this.ySelector(pointSeries);
|
|
117
116
|
var y1DrawValues = this.y1Selector(pointSeries);
|
|
118
|
-
|
|
119
|
-
if (isSplineBandSeries) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
var _c = this.getStartAndCount(
|
|
117
|
+
// const isSplineBandSeries = this.parentSeries.type === ESeriesType.SplineBandSeries && xValues.size() > 1;
|
|
118
|
+
// if (isSplineBandSeries) {
|
|
119
|
+
// const splineBandSeries = this.parentSeries as SplineBandRenderableSeries;
|
|
120
|
+
// if (!this.parentSeries.isRunningAnimation) {
|
|
121
|
+
// splineBandSeries.updateSplineValues();
|
|
122
|
+
// }
|
|
123
|
+
// xDrawValues = splineBandSeries.xSplineValues;
|
|
124
|
+
// yDrawValues = splineBandSeries.ySplineValues;
|
|
125
|
+
// y1DrawValues = splineBandSeries.y1SplineValues;
|
|
126
|
+
// }
|
|
127
|
+
var _c = this.getStartAndCount(
|
|
128
|
+
//isSplineBandSeries ? undefined : renderPassData,
|
|
129
|
+
renderPassData, xDrawValues), startIndex = _c.startIndex, count = _c.count;
|
|
129
130
|
this.args.count = count;
|
|
130
131
|
this.args.startIndex = startIndex;
|
|
131
132
|
if (fifoCapacity > 0 && fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count()) {
|
|
132
133
|
this.args.count = fifoStartIndex;
|
|
133
134
|
}
|
|
134
135
|
// Paletting per point
|
|
135
|
-
_super.prototype.applyStrokeFillPaletting.call(this, undefined, undefined, undefined, undefined, this.parentSeries.opacity, true);
|
|
136
|
+
_super.prototype.applyStrokeFillPaletting.call(this, undefined, undefined, undefined, undefined, this.parentSeries.opacity, true, true, renderPassData);
|
|
136
137
|
var paletteTexture = (_a = this.palettingState.paletteTextureCache) === null || _a === void 0 ? void 0 : _a.value;
|
|
137
138
|
if (paletteTexture) {
|
|
138
139
|
this.args.SetPalette(paletteTexture);
|
|
@@ -166,18 +167,22 @@ var BandSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
166
167
|
propertyName === constants_1.PROPERTY.STROKE_THICKNESS ||
|
|
167
168
|
propertyName === constants_1.PROPERTY.OPACITY ||
|
|
168
169
|
propertyName === constants_1.PROPERTY.STROKE_DASH_ARRAY) {
|
|
170
|
+
this.palettingState.requiresUpdate = true;
|
|
169
171
|
(0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity, strokeDashArray);
|
|
170
172
|
}
|
|
171
173
|
if (propertyName === constants_1.PROPERTY.STROKE_Y1 ||
|
|
172
174
|
propertyName === constants_1.PROPERTY.STROKE_THICKNESS ||
|
|
173
175
|
propertyName === constants_1.PROPERTY.OPACITY ||
|
|
174
176
|
propertyName === constants_1.PROPERTY.STROKE_Y1_DASH_ARRAY) {
|
|
177
|
+
this.palettingState.requiresUpdate = true;
|
|
175
178
|
(0, Pen2DCache_1.createPenInCache)(this.strokePenY1Cache, strokeY1, strokeThickness, opacity, strokeY1DashArray);
|
|
176
179
|
}
|
|
177
180
|
if (propertyName === constants_1.PROPERTY.FILL || propertyName === constants_1.PROPERTY.OPACITY) {
|
|
181
|
+
this.palettingState.requiresUpdate = true;
|
|
178
182
|
(0, BrushCache_1.createBrushInCache)(this.fillBrushCache, fill, opacity);
|
|
179
183
|
}
|
|
180
184
|
if (propertyName === constants_1.PROPERTY.FILL_Y1 || propertyName === constants_1.PROPERTY.OPACITY) {
|
|
185
|
+
this.palettingState.requiresUpdate = true;
|
|
181
186
|
(0, BrushCache_1.createBrushInCache)(this.fillBrushY1Cache, fillY1, opacity);
|
|
182
187
|
}
|
|
183
188
|
};
|
|
@@ -3,6 +3,7 @@ import { IDeletable } from "../../../../Core/IDeletable";
|
|
|
3
3
|
import { SCRTBrush, SCRTDoubleVector, TSciChart, UIntVector } from "../../../../types/TSciChart";
|
|
4
4
|
import { PaletteCache } from "../../../Drawing/PaletteCache";
|
|
5
5
|
import { WebGlRenderContext2D } from "../../../Drawing/WebGlRenderContext2D";
|
|
6
|
+
import { IPaletteProvider } from "../../../Model/IPaletteProvider";
|
|
6
7
|
import { IPointMetadata } from "../../../Model/IPointMetadata";
|
|
7
8
|
import { IPointSeries } from "../../../Model/PointSeries/IPointSeries";
|
|
8
9
|
import { RenderPassData } from "../../../Services/RenderPassData";
|
|
@@ -31,6 +32,11 @@ export declare type TPalettingState = {
|
|
|
31
32
|
originalPenColor?: number;
|
|
32
33
|
originalPenGradient?: boolean;
|
|
33
34
|
originalBrushColor?: number;
|
|
35
|
+
lastStartIndex?: number;
|
|
36
|
+
lastCount?: number;
|
|
37
|
+
lastResamplingHash?: number;
|
|
38
|
+
paletteStartIndex?: number;
|
|
39
|
+
requiresUpdate: boolean;
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* Used internally - a drawing provider performs drawing for a specific chart-type or series using
|
|
@@ -75,10 +81,11 @@ export declare abstract class BaseSeriesDrawingProvider<T extends IRenderableSer
|
|
|
75
81
|
* Helper function to apply color-paletting to a {@link UIntVector} - where each element in the vector
|
|
76
82
|
* is an ARGB color that defines stroke of the series
|
|
77
83
|
* @param strokePen the current pen, as type {@link SCRTPen}
|
|
84
|
+
* @param renderPassData optional renderPassData. If not supplied, the current renderPassData for the parent series will be used
|
|
78
85
|
* @returns the new {@link UIntVector} with ARGB colors
|
|
79
86
|
*/
|
|
80
|
-
applyStrokePaletting(strokePen: ISCRTPen): void;
|
|
81
|
-
applyStrokeFillPaletting(stroke: string, strokePen: ISCRTPen | undefined, fill: string, fillBrush: ISCRTBrush | undefined, opacity: number, usePalette?: boolean, resetPenBrushColors?: boolean): void;
|
|
87
|
+
applyStrokePaletting(strokePen: ISCRTPen, renderPassData?: RenderPassData): void;
|
|
88
|
+
applyStrokeFillPaletting(stroke: string, strokePen: ISCRTPen | undefined, fill: string, fillBrush: ISCRTBrush | undefined, opacity: number, usePalette?: boolean, resetPenBrushColors?: boolean, renderPassData?: RenderPassData): void;
|
|
82
89
|
/**
|
|
83
90
|
* Creates a native {@link SCRTBrush} Solid Color Brush from html color code string passed in
|
|
84
91
|
* @param htmlColorCode The HTML Color code
|
|
@@ -110,6 +117,7 @@ export declare abstract class BaseSeriesDrawingProvider<T extends IRenderableSer
|
|
|
110
117
|
*/
|
|
111
118
|
onDetachSeries(): void;
|
|
112
119
|
protected seriesHasDataChanges(): void;
|
|
120
|
+
protected shouldUpdatePalette(renderPassData: RenderPassData, paletteProvider: IPaletteProvider, startIndex: number, count: number): void;
|
|
113
121
|
protected overridePaletteProviderColors(rs: IRenderableSeries, xValue: number, yValue: number, index: number, opacity?: number, metadata?: IPointMetadata): {
|
|
114
122
|
stroke: number | undefined;
|
|
115
123
|
fill: number | undefined;
|
|
@@ -52,7 +52,8 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
52
52
|
palettedColors: undefined,
|
|
53
53
|
palettedColorsHashCode: 0,
|
|
54
54
|
gradientPaletting: false,
|
|
55
|
-
paletteTextureCache: new PaletteCache_1.PaletteCache(webAssemblyContext)
|
|
55
|
+
paletteTextureCache: new PaletteCache_1.PaletteCache(webAssemblyContext),
|
|
56
|
+
requiresUpdate: true
|
|
56
57
|
};
|
|
57
58
|
_this.seriesHasDataChanges = _this.seriesHasDataChanges.bind(_this);
|
|
58
59
|
_this.parentDataSeries = _this.parentSeries.dataSeries;
|
|
@@ -72,9 +73,9 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
72
73
|
var xAxis = (_a = this.parentSeries) === null || _a === void 0 ? void 0 : _a.xAxis;
|
|
73
74
|
var shouldClip = (_b = xAxis === null || xAxis === void 0 ? void 0 : xAxis.clipToXRange) !== null && _b !== void 0 ? _b : true; // fo the sake of tests
|
|
74
75
|
var xCount = xValues.size();
|
|
75
|
-
var count = Math.min(pointSeries ? pointSeries.
|
|
76
|
+
var count = Math.min(pointSeries ? pointSeries.xValues.size() : xCount, xCount);
|
|
76
77
|
var startIndex = 0;
|
|
77
|
-
if (shouldClip && !(pointSeries === null || pointSeries === void 0 ? void 0 : pointSeries.resampled) && ((_c = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.indexRange) === null || _c === void 0 ? void 0 : _c.diff)
|
|
78
|
+
if (shouldClip && !(pointSeries === null || pointSeries === void 0 ? void 0 : pointSeries.resampled) && ((_c = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.indexRange) === null || _c === void 0 ? void 0 : _c.diff) >= 0) {
|
|
78
79
|
if (renderPassData.indexRange.diff + 1 < count) {
|
|
79
80
|
startIndex = renderPassData.indexRange.min;
|
|
80
81
|
}
|
|
@@ -86,11 +87,13 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
86
87
|
* Helper function to apply color-paletting to a {@link UIntVector} - where each element in the vector
|
|
87
88
|
* is an ARGB color that defines stroke of the series
|
|
88
89
|
* @param strokePen the current pen, as type {@link SCRTPen}
|
|
90
|
+
* @param renderPassData optional renderPassData. If not supplied, the current renderPassData for the parent series will be used
|
|
89
91
|
* @returns the new {@link UIntVector} with ARGB colors
|
|
90
92
|
*/
|
|
91
|
-
BaseSeriesDrawingProvider.prototype.applyStrokePaletting = function (strokePen) {
|
|
92
|
-
var _a, _b, _c;
|
|
93
|
-
|
|
93
|
+
BaseSeriesDrawingProvider.prototype.applyStrokePaletting = function (strokePen, renderPassData) {
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
|
+
var advancedPP = this.parentSeries.paletteProvider;
|
|
96
|
+
if (this.parentSeries.hasStrokePaletteProvider() || advancedPP.applyPaletting !== undefined) {
|
|
94
97
|
var strokeColorArgb = (0, colorUtil_1.uintArgbColorMultiplyOpacity)((0, parseColor_1.parseColorToUIntArgb)(this.parentSeries.stroke), this.parentSeries.opacity);
|
|
95
98
|
if (isNaN(strokeColorArgb)) {
|
|
96
99
|
throw Error("applyStrokePaletting(): renderSeries.stroke " +
|
|
@@ -99,44 +102,55 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
99
102
|
}
|
|
100
103
|
var strokePaletteProvider = this.parentSeries.paletteProvider;
|
|
101
104
|
var dataSeries = this.parentSeries.dataSeries;
|
|
102
|
-
|
|
105
|
+
renderPassData = renderPassData !== null && renderPassData !== void 0 ? renderPassData : this.parentSeries.getCurrentRenderPassData();
|
|
103
106
|
var pointSeries = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.pointSeries;
|
|
104
107
|
var xValues = (_a = (pointSeries ? this.xSelector(pointSeries) : undefined)) !== null && _a !== void 0 ? _a : dataSeries.getNativeXValues();
|
|
105
108
|
var yValues = (_b = (pointSeries ? this.ySelector(pointSeries) : undefined)) !== null && _b !== void 0 ? _b : dataSeries.getNativeYValues();
|
|
106
|
-
var
|
|
109
|
+
var _e = this.getStartAndCount(renderPassData, xValues), startIndex = _e.startIndex, count = _e.count;
|
|
107
110
|
if (!this.palettingState.palettedColors) {
|
|
108
111
|
this.palettingState.palettedColors = new this.webAssemblyContext.UIntVector();
|
|
109
112
|
}
|
|
110
|
-
this.palettingState.palettedColors.clear();
|
|
111
|
-
this.palettingState.palettedColors.reserve(count);
|
|
112
|
-
strokePen.m_bGradient = strokePaletteProvider.strokePaletteMode === IPaletteProvider_1.EStrokePaletteMode.GRADIENT;
|
|
113
113
|
// For paletted series, we must pass 0xFFFFFFFF (white) to pen line
|
|
114
114
|
this.palettingState.originalPenColor = strokePen.m_uiColor;
|
|
115
115
|
strokePen.m_uiColor = 0xffffffff;
|
|
116
|
+
strokePen.m_bGradient = strokePaletteProvider.strokePaletteMode === IPaletteProvider_1.EStrokePaletteMode.GRADIENT;
|
|
117
|
+
if (advancedPP.applyPaletting) {
|
|
118
|
+
advancedPP.applyPaletting(this.palettingState, xValues, yValues, (_c = pointSeries === null || pointSeries === void 0 ? void 0 : pointSeries.indexes) !== null && _c !== void 0 ? _c : dataSeries.getNativeIndexes(), startIndex, count);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.shouldUpdatePalette(renderPassData, strokePaletteProvider, startIndex, count);
|
|
122
|
+
if (!this.palettingState.requiresUpdate) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
this.palettingState.palettedColors.clear();
|
|
126
|
+
this.palettingState.palettedColors.reserve(count);
|
|
116
127
|
for (var index = startIndex; index < startIndex + count; index++) {
|
|
117
128
|
var originalDataIndex = pointSeries ? pointSeries.indexes.get(index) : index;
|
|
118
129
|
if (originalDataIndex < 0)
|
|
119
130
|
originalDataIndex = 0;
|
|
120
131
|
else if (originalDataIndex >= dataSeries.count())
|
|
121
132
|
originalDataIndex = dataSeries.count() - 1;
|
|
122
|
-
var
|
|
133
|
+
var xValue = xValues.get(index);
|
|
134
|
+
var yValue = yValues.get(index);
|
|
135
|
+
var overrideColor = strokePaletteProvider.overrideStrokeArgb(xValue, yValue, originalDataIndex, this.parentSeries.opacity, dataSeries.getMetadataAt(originalDataIndex));
|
|
123
136
|
this.parentSeries.pushPalettedColors(overrideColor ? overrideColor : strokeColorArgb, this.palettingState);
|
|
124
137
|
}
|
|
138
|
+
this.palettingState.requiresUpdate = false;
|
|
125
139
|
}
|
|
126
140
|
else {
|
|
127
141
|
if (this.palettingState.originalPenColor) {
|
|
128
142
|
strokePen.m_uiColor = this.palettingState.originalPenColor;
|
|
129
143
|
this.palettingState.originalPenColor = undefined;
|
|
130
144
|
}
|
|
131
|
-
(
|
|
145
|
+
(_d = this.palettingState.palettedColors) === null || _d === void 0 ? void 0 : _d.clear();
|
|
132
146
|
}
|
|
133
147
|
// Due to pass-by-pointer limitations of WASM binding, we pass an empty vector rather than null
|
|
134
148
|
if (!this.palettingState.palettedColors) {
|
|
135
149
|
this.palettingState.palettedColors = new this.webAssemblyContext.UIntVector();
|
|
136
150
|
}
|
|
137
151
|
};
|
|
138
|
-
BaseSeriesDrawingProvider.prototype.applyStrokeFillPaletting = function (stroke, strokePen, fill, fillBrush, opacity, usePalette, resetPenBrushColors) {
|
|
139
|
-
var _a, _b, _c, _d, _e;
|
|
152
|
+
BaseSeriesDrawingProvider.prototype.applyStrokeFillPaletting = function (stroke, strokePen, fill, fillBrush, opacity, usePalette, resetPenBrushColors, renderPassData) {
|
|
153
|
+
var _a, _b, _c, _d, _e, _f;
|
|
140
154
|
if (usePalette === void 0) { usePalette = false; }
|
|
141
155
|
if (resetPenBrushColors === void 0) { resetPenBrushColors = true; }
|
|
142
156
|
var hasStrokePaletteProvider = this.parentSeries.hasStrokePaletteProvider();
|
|
@@ -144,8 +158,9 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
144
158
|
var hasPointMarkerPaletteProvider = this.parentSeries.hasPointMarkerPaletteProvider();
|
|
145
159
|
var strokePaletteProvider = this.parentSeries.paletteProvider;
|
|
146
160
|
var pointMarkerPaletteProvider = this.parentSeries.paletteProvider;
|
|
147
|
-
var
|
|
148
|
-
|
|
161
|
+
var advancedPP = this.parentSeries.paletteProvider;
|
|
162
|
+
var hasAdvancedPP = (advancedPP === null || advancedPP === void 0 ? void 0 : advancedPP.applyPaletting) !== undefined;
|
|
163
|
+
if (hasStrokePaletteProvider || hasFillPaletteProvider || hasPointMarkerPaletteProvider || hasAdvancedPP) {
|
|
149
164
|
var strokeColor = void 0;
|
|
150
165
|
var fillColor = void 0;
|
|
151
166
|
// Palette (this.palettingState.paletteTextureCache) is used only for band and mountain series
|
|
@@ -166,18 +181,25 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
166
181
|
throw Error("updatePalette(): fillColor " + fillColor + " cannot be converted to a valid color");
|
|
167
182
|
}
|
|
168
183
|
var dataSeries = this.parentSeries.dataSeries;
|
|
169
|
-
|
|
184
|
+
renderPassData = renderPassData !== null && renderPassData !== void 0 ? renderPassData : this.parentSeries.getCurrentRenderPassData();
|
|
170
185
|
var pointSeries = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.pointSeries;
|
|
171
186
|
var xValues = (_a = (pointSeries ? this.xSelector(pointSeries) : undefined)) !== null && _a !== void 0 ? _a : dataSeries.getNativeXValues();
|
|
172
187
|
var yValues = (_b = (pointSeries ? this.ySelector(pointSeries) : undefined)) !== null && _b !== void 0 ? _b : dataSeries.getNativeYValues();
|
|
173
|
-
var
|
|
188
|
+
var _g = this.getStartAndCount(renderPassData, xValues), startIndex = _g.startIndex, count = _g.count;
|
|
174
189
|
if (!this.palettingState.palettedColors) {
|
|
175
190
|
this.palettingState.palettedColors = new this.webAssemblyContext.UIntVector();
|
|
176
191
|
}
|
|
192
|
+
if (advancedPP.applyPaletting) {
|
|
193
|
+
advancedPP.applyPaletting(this.palettingState, xValues, yValues, (_c = pointSeries === null || pointSeries === void 0 ? void 0 : pointSeries.indexes) !== null && _c !== void 0 ? _c : dataSeries.getNativeIndexes(), startIndex, count);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.shouldUpdatePalette(renderPassData, strokePaletteProvider, startIndex, count);
|
|
197
|
+
if (!this.palettingState.requiresUpdate) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
177
200
|
this.palettingState.paletteTextureCache.reset();
|
|
178
201
|
this.palettingState.palettedColors.clear();
|
|
179
202
|
this.palettingState.palettedColors.reserve(count * 2);
|
|
180
|
-
// Commented this code out, because I don't know what this code does
|
|
181
203
|
if (resetPenBrushColors) {
|
|
182
204
|
if (strokePen) {
|
|
183
205
|
// For paletted series, we must pass 0xFFFFFFFF (white) to pen line
|
|
@@ -209,8 +231,8 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
209
231
|
var xValue = xValues.get(index);
|
|
210
232
|
var yValue = yValues.get(index);
|
|
211
233
|
var overriddenColors = this.overridePaletteProviderColors(this.parentSeries, xValue, yValue, originalDataIndex, opacity, dataSeries.getMetadataAt(originalDataIndex));
|
|
212
|
-
var overrideStrokeColor = (
|
|
213
|
-
var overrideFillColor = (
|
|
234
|
+
var overrideStrokeColor = (_d = overriddenColors.stroke) !== null && _d !== void 0 ? _d : strokeColor;
|
|
235
|
+
var overrideFillColor = (_e = overriddenColors.fill) !== null && _e !== void 0 ? _e : fillColor;
|
|
214
236
|
this.palettingState.palettedColors.push_back(overrideStrokeColor);
|
|
215
237
|
this.palettingState.palettedColors.push_back(overrideFillColor);
|
|
216
238
|
hashCode = (0, number_1.numericHashCode)(hashCode, overrideStrokeColor);
|
|
@@ -224,11 +246,11 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
224
246
|
this.palettingState.paletteTextureCache.create(this.palettingState.palettedColors);
|
|
225
247
|
this.palettingState.palettedColorsHashCode = hashCode;
|
|
226
248
|
}
|
|
249
|
+
this.palettingState.requiresUpdate = false;
|
|
227
250
|
}
|
|
228
251
|
else {
|
|
229
252
|
this.palettingState.paletteTextureCache.reset();
|
|
230
|
-
(
|
|
231
|
-
// This was needed for resetPenBrushColors, therefore commented out as well
|
|
253
|
+
(_f = this.palettingState.palettedColors) === null || _f === void 0 ? void 0 : _f.clear();
|
|
232
254
|
if (strokePen) {
|
|
233
255
|
if (this.palettingState.originalPenColor) {
|
|
234
256
|
strokePen.m_uiColor = this.palettingState.originalPenColor;
|
|
@@ -277,6 +299,7 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
277
299
|
(_a = this.parentDataSeries) === null || _a === void 0 ? void 0 : _a.dataChanged.unsubscribe(this.seriesHasDataChanges);
|
|
278
300
|
this.parentDataSeries = this.parentSeries.dataSeries;
|
|
279
301
|
(_b = this.parentDataSeries) === null || _b === void 0 ? void 0 : _b.dataChanged.subscribe(this.seriesHasDataChanges);
|
|
302
|
+
this.palettingState.requiresUpdate = true;
|
|
280
303
|
}
|
|
281
304
|
};
|
|
282
305
|
/**
|
|
@@ -298,8 +321,46 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
298
321
|
// Override in derived class to be notified of series being detached from sciChartSurface
|
|
299
322
|
};
|
|
300
323
|
BaseSeriesDrawingProvider.prototype.seriesHasDataChanges = function () {
|
|
324
|
+
this.palettingState.requiresUpdate = true;
|
|
301
325
|
// TODO override in derived class.
|
|
302
326
|
};
|
|
327
|
+
BaseSeriesDrawingProvider.prototype.shouldUpdatePalette = function (renderPassData, paletteProvider, startIndex, count) {
|
|
328
|
+
var _a, _b, _c, _d, _e, _f;
|
|
329
|
+
if (((_a = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.pointSeries) === null || _a === void 0 ? void 0 : _a.resampled) &&
|
|
330
|
+
(renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.resamplingHash) !== this.palettingState.lastResamplingHash) {
|
|
331
|
+
this.palettingState.lastResamplingHash = renderPassData === null || renderPassData === void 0 ? void 0 : renderPassData.resamplingHash;
|
|
332
|
+
this.palettingState.requiresUpdate = true;
|
|
333
|
+
}
|
|
334
|
+
if (!((_b = paletteProvider.isRangeIndependant) !== null && _b !== void 0 ? _b : false)) {
|
|
335
|
+
// Range dependant (the default) so recalculate if start and count have changed
|
|
336
|
+
if (((_c = this.palettingState.lastStartIndex) !== null && _c !== void 0 ? _c : 0) !== startIndex ||
|
|
337
|
+
((_d = this.palettingState.lastCount) !== null && _d !== void 0 ? _d : 0) !== count) {
|
|
338
|
+
this.palettingState.lastStartIndex = startIndex;
|
|
339
|
+
this.palettingState.lastCount = count;
|
|
340
|
+
this.palettingState.requiresUpdate = true;
|
|
341
|
+
this.palettingState.paletteStartIndex = 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
if (((_e = this.palettingState.lastStartIndex) !== null && _e !== void 0 ? _e : Number.MAX_SAFE_INTEGER) > startIndex ||
|
|
346
|
+
((_f = this.palettingState.lastCount) !== null && _f !== void 0 ? _f : 0) < count ||
|
|
347
|
+
startIndex + count > this.palettingState.lastStartIndex + this.palettingState.lastCount) {
|
|
348
|
+
// Range has grown so recalcualte and start from 0
|
|
349
|
+
this.palettingState.lastStartIndex = startIndex;
|
|
350
|
+
this.palettingState.lastCount = count;
|
|
351
|
+
this.palettingState.requiresUpdate = true;
|
|
352
|
+
this.palettingState.paletteStartIndex = 0;
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
// Range is same or smaller so adjust palette startIndex
|
|
356
|
+
this.palettingState.paletteStartIndex = startIndex - this.palettingState.lastStartIndex;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// Default to always update for back compatability
|
|
360
|
+
if (!paletteProvider.shouldUpdatePalette || paletteProvider.shouldUpdatePalette()) {
|
|
361
|
+
this.palettingState.requiresUpdate = true;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
303
364
|
BaseSeriesDrawingProvider.prototype.overridePaletteProviderColors = function (rs, xValue, yValue, index, opacity, metadata) {
|
|
304
365
|
var stroke;
|
|
305
366
|
var fill;
|
|
@@ -47,6 +47,7 @@ var BubbleSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
47
47
|
* @inheritDoc
|
|
48
48
|
*/
|
|
49
49
|
BubbleSeriesDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
|
|
50
|
+
var _a;
|
|
50
51
|
var pointMarker = this.parentSeries.pointMarker;
|
|
51
52
|
if (pointMarker === undefined) {
|
|
52
53
|
return;
|
|
@@ -58,10 +59,10 @@ var BubbleSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
58
59
|
var xValues = pointSeries.xValues;
|
|
59
60
|
var yValues = pointSeries.yValues;
|
|
60
61
|
var zValues = pointSeries.zValues;
|
|
61
|
-
var
|
|
62
|
+
var _b = this.getStartAndCount(renderPassData, xValues), startIndex = _b.startIndex, count = _b.count;
|
|
62
63
|
this.args.count = count;
|
|
63
64
|
this.args.startIndex = startIndex;
|
|
64
|
-
var
|
|
65
|
+
var _c = this.parentSeries.dataSeries, fifoCapacity = _c.fifoCapacity, fifoSweeping = _c.fifoSweeping, fifoSweepingGap = _c.fifoSweepingGap;
|
|
65
66
|
var fifoStartIndex = pointSeries.fifoStartIndex;
|
|
66
67
|
if (fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count()) {
|
|
67
68
|
this.args.count = fifoStartIndex;
|
|
@@ -72,6 +73,7 @@ var BubbleSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
72
73
|
// Paletting per point
|
|
73
74
|
_super.prototype.applyStrokeFillPaletting.call(this, this.parentSeries.stroke, undefined, undefined, undefined, this.parentSeries.opacity);
|
|
74
75
|
this.args.SetPalettedColors(this.palettingState.palettedColors);
|
|
76
|
+
this.args.paletteStart = (_a = this.palettingState.paletteStartIndex) !== null && _a !== void 0 ? _a : 0;
|
|
75
77
|
this.args.zMultiplier = this.parentSeries.zMultiplier * DpiHelper_1.DpiHelper.PIXEL_RATIO;
|
|
76
78
|
var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
|
|
77
79
|
var nativeContext = renderContext.getNativeContext();
|
|
@@ -94,6 +94,7 @@ var ColumnSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
94
94
|
// Paletting per point
|
|
95
95
|
_super.prototype.applyStrokeFillPaletting.call(this, this.parentSeries.stroke, linesPen, this.parentSeries.fill, fillBrush, this.parentSeries.opacity, false, this.parentSeries.fillLinearGradient !== undefined);
|
|
96
96
|
this.args.SetPalettedColors(this.palettingState.palettedColors);
|
|
97
|
+
this.args.paletteStart = this.palettingState.paletteStartIndex * 2;
|
|
97
98
|
var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
98
99
|
var xValues = this.xSelector(pointSeries);
|
|
99
100
|
var yValues = this.ySelector(pointSeries);
|
|
@@ -17,7 +17,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.LineSeriesDrawingProvider = void 0;
|
|
19
19
|
var Deleter_1 = require("../../../../Core/Deleter");
|
|
20
|
-
var SeriesType_1 = require("../../../../types/SeriesType");
|
|
21
20
|
var Pen2DCache_1 = require("../../../Drawing/Pen2DCache");
|
|
22
21
|
var WebGlRenderContext2D_1 = require("../../../Drawing/WebGlRenderContext2D");
|
|
23
22
|
var BaseLineRenderableSeries_1 = require("../BaseLineRenderableSeries");
|
|
@@ -61,6 +60,7 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
61
60
|
propertyName === constants_1.PROPERTY.PALETTE_PROVIDER ||
|
|
62
61
|
propertyName === constants_1.PROPERTY.OPACITY ||
|
|
63
62
|
propertyName === constants_1.PROPERTY.STROKE_DASH_ARRAY) {
|
|
63
|
+
this.palettingState.requiresUpdate = true;
|
|
64
64
|
var _a = this.getProperties(this.parentSeries), stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
|
|
65
65
|
if (stroke) {
|
|
66
66
|
(0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity !== null && opacity !== void 0 ? opacity : 1, strokeDashArray);
|
|
@@ -103,7 +103,8 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
103
103
|
* @inheritDoc
|
|
104
104
|
*/
|
|
105
105
|
LineSeriesDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
|
|
106
|
-
var _a
|
|
106
|
+
var _a;
|
|
107
|
+
var _b = this.getProperties(this.parentSeries), stroke = _b.stroke, isDigitalLine = _b.isDigitalLine, lineType = _b.lineType, drawNaNAs = _b.drawNaNAs, containsNaNOverride = _b.containsNaN;
|
|
107
108
|
var linesPen = (0, Pen2DCache_1.getScrtPenFromCache)(this.linesPenCache);
|
|
108
109
|
if (!linesPen || !stroke) {
|
|
109
110
|
return;
|
|
@@ -126,32 +127,37 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
126
127
|
: this.webAssemblyContext.SCRTLineGapMode.Default;
|
|
127
128
|
this.args.verticalChart = renderPassData.isVerticalChart;
|
|
128
129
|
var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
129
|
-
var
|
|
130
|
+
var _c = this.parentSeries.dataSeries, fifoCapacity = _c.fifoCapacity, fifoSweeping = _c.fifoSweeping, fifoSweepingGap = _c.fifoSweepingGap;
|
|
130
131
|
var fifoStartIndex = pointSeries.fifoStartIndex;
|
|
131
132
|
var xValues = this.xSelector(pointSeries);
|
|
132
133
|
var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
|
|
133
134
|
var yDrawValues = this.ySelector(pointSeries);
|
|
134
|
-
|
|
135
|
-
if (isSplineLineSeries) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
var
|
|
135
|
+
// const isSplineLineSeries = this.parentSeries.type === ESeriesType.SplineLineSeries && xValues.size() > 1;
|
|
136
|
+
// if (isSplineLineSeries) {
|
|
137
|
+
// const spline = this.parentSeries as any as ISpline;
|
|
138
|
+
// // If animation is running we animate between two interpolated vectors and do not want to update spline
|
|
139
|
+
// if (!this.parentSeries.isRunningAnimation) {
|
|
140
|
+
// spline.updateSplineValues();
|
|
141
|
+
// }
|
|
142
|
+
// xDrawValues = spline.xSplineValues;
|
|
143
|
+
// yDrawValues = spline.ySplineValues;
|
|
144
|
+
// }
|
|
145
|
+
var _d = this.getStartAndCount(
|
|
146
|
+
//isSplineLineSeries ? undefined : renderPassData,
|
|
147
|
+
renderPassData, xDrawValues), startIndex = _d.startIndex, count = _d.count;
|
|
145
148
|
this.args.count = count;
|
|
146
149
|
this.args.startIndex = startIndex;
|
|
150
|
+
//logDoubleVector(xDrawValues, "xValues");
|
|
151
|
+
//logDoubleVector(yDrawValues, "yValues");
|
|
147
152
|
//console.log(renderPassData.indexRange, yDrawValues.size(), this.args.count);
|
|
148
153
|
if (fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count()) {
|
|
149
154
|
this.args.count = fifoStartIndex;
|
|
150
155
|
}
|
|
151
156
|
// Stroke paletting per point
|
|
152
|
-
this.applyStrokePaletting(linesPen);
|
|
157
|
+
this.applyStrokePaletting(linesPen, renderPassData);
|
|
153
158
|
if (this.palettingState.palettedColors) {
|
|
154
159
|
this.args.SetPalettedColors(this.palettingState.palettedColors);
|
|
160
|
+
this.args.paletteStart = (_a = this.palettingState.paletteStartIndex) !== null && _a !== void 0 ? _a : 0;
|
|
155
161
|
}
|
|
156
162
|
var nativeContext = renderContext.getNativeContext();
|
|
157
163
|
this.drawLines(renderContext, nativeContext, xDrawValues, yDrawValues, renderPassData.xCoordinateCalculator.nativeCalculator, renderPassData.yCoordinateCalculator.nativeCalculator, this.args, this.parentSeries.parentSurface.seriesViewRect);
|