scichart 3.2.532 → 3.2.538

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.
Files changed (63) hide show
  1. package/Charting/ChartModifiers/CursorModifier.js +0 -1
  2. package/Charting/Model/BaseDataSeries.d.ts +3 -2
  3. package/Charting/Model/BaseDataSeries.js +8 -4
  4. package/Charting/Model/HlcDataSeries.d.ts +2 -1
  5. package/Charting/Model/HlcDataSeries.js +4 -2
  6. package/Charting/Model/IDataSeries.d.ts +2 -1
  7. package/Charting/Model/IPaletteProvider.d.ts +24 -0
  8. package/Charting/Model/IPaletteProvider.js +23 -7
  9. package/Charting/Model/OhlcDataSeries.d.ts +2 -1
  10. package/Charting/Model/OhlcDataSeries.js +4 -2
  11. package/Charting/Model/XyyDataSeries.d.ts +2 -1
  12. package/Charting/Model/XyyDataSeries.js +4 -2
  13. package/Charting/Visuals/Annotations/AnnotationBase.js +3 -3
  14. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +15 -4
  15. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +55 -8
  16. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +7 -0
  17. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +22 -3
  18. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +0 -6
  19. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +18 -13
  20. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +10 -2
  21. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +83 -23
  22. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +4 -2
  23. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +1 -0
  24. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +21 -15
  25. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -12
  26. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +17 -11
  27. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +1 -1
  28. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -0
  29. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +3 -0
  30. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +5 -2
  31. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.d.ts +30 -0
  32. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.js +63 -0
  33. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.d.ts +10 -0
  34. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.js +53 -0
  35. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.d.ts +10 -0
  36. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.js +55 -0
  37. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +13 -8
  38. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +63 -46
  39. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +12 -13
  40. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +60 -52
  41. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +12 -7
  42. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +54 -43
  43. package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -1
  44. package/Charting/Visuals/RenderableSeries/constants.js +1 -0
  45. package/Charting/Visuals/createMaster.d.ts +12 -2
  46. package/Charting/Visuals/createMaster.js +14 -2
  47. package/Core/BuildStamp.d.ts +1 -1
  48. package/Core/BuildStamp.js +2 -2
  49. package/Core/ObservableArray.d.ts +11 -9
  50. package/Core/ObservableArray.js +44 -21
  51. package/_wasm/scichart.browser.js +1 -1
  52. package/_wasm/scichart2d.wasm +0 -0
  53. package/_wasm/scichart3d.wasm +0 -0
  54. package/index.d.ts +9 -0
  55. package/index.dev.js +632 -266
  56. package/index.js +27 -13
  57. package/index.min.js +1 -1
  58. package/package.json +1 -1
  59. package/types/TSciChart.d.ts +4 -0
  60. package/types/YRangeMode.d.ts +10 -0
  61. package/types/YRangeMode.js +14 -0
  62. package/utils/debug.d.ts +2 -0
  63. package/utils/debug.js +17 -0
@@ -17,7 +17,6 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.MountainSeriesDrawingProvider = 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");
@@ -80,7 +79,7 @@ var MountainSeriesDrawingProvider = /** @class */ (function (_super) {
80
79
  this.args.SetLinesPen(strokePen);
81
80
  }
82
81
  // Paletting per point
83
- _super.prototype.applyStrokeFillPaletting.call(this, this.parentSeries.stroke, strokePen, this.parentSeries.fill, fillBrush, this.parentSeries.opacity, true, this.parentSeries.fillLinearGradient !== undefined);
82
+ _super.prototype.applyStrokeFillPaletting.call(this, this.parentSeries.stroke, strokePen, this.parentSeries.fill, fillBrush, this.parentSeries.opacity, true, this.parentSeries.fillLinearGradient !== undefined, renderPassData);
84
83
  var paletteTexture = (_a = this.palettingState.paletteTextureCache) === null || _a === void 0 ? void 0 : _a.value;
85
84
  if (paletteTexture) {
86
85
  this.args.SetPalette(paletteTexture);
@@ -92,16 +91,19 @@ var MountainSeriesDrawingProvider = /** @class */ (function (_super) {
92
91
  var xValues = pointSeries.xValues;
93
92
  var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
94
93
  var yDrawValues = pointSeries.yValues;
95
- var isSplineMountainSeries = this.parentSeries.type === SeriesType_1.ESeriesType.SplineMountainSeries && xValues.size() > 1;
96
- if (isSplineMountainSeries) {
97
- var rs = this.parentSeries;
98
- if (!this.parentSeries.isRunningAnimation) {
99
- rs.updateSplineValues();
100
- }
101
- xDrawValues = rs.xSplineValues;
102
- yDrawValues = rs.ySplineValues;
103
- }
104
- var _c = this.getStartAndCount(isSplineMountainSeries ? undefined : renderPassData, xDrawValues), startIndex = _c.startIndex, count = _c.count;
94
+ // const isSplineMountainSeries =
95
+ // this.parentSeries.type === ESeriesType.SplineMountainSeries && xValues.size() > 1;
96
+ // if (isSplineMountainSeries) {
97
+ // const rs = this.parentSeries as any as ISpline;
98
+ // if (!this.parentSeries.isRunningAnimation) {
99
+ // rs.updateSplineValues();
100
+ // }
101
+ // xDrawValues = rs.xSplineValues;
102
+ // yDrawValues = rs.ySplineValues;
103
+ // }
104
+ var _c = this.getStartAndCount(
105
+ //isSplineMountainSeries ? undefined : renderPassData,
106
+ renderPassData, xDrawValues), startIndex = _c.startIndex, count = _c.count;
105
107
  this.args.count = count;
106
108
  this.args.startIndex = startIndex;
107
109
  if (fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count()) {
@@ -151,6 +153,7 @@ var MountainSeriesDrawingProvider = /** @class */ (function (_super) {
151
153
  this.createBrush();
152
154
  };
153
155
  MountainSeriesDrawingProvider.prototype.createBrush = function () {
156
+ this.palettingState.requiresUpdate = true;
154
157
  var _a = this.parentSeries, fill = _a.fill, opacity = _a.opacity, fillLinearGradient = _a.fillLinearGradient, parentSurface = _a.parentSurface;
155
158
  var textureHeightRatio = (parentSurface === null || parentSurface === void 0 ? void 0 : parentSurface.isCopyCanvasSurface)
156
159
  ? parentSurface.domCanvas2D.height / SciChartSurfaceBase_1.SciChartSurfaceBase.domMasterCanvas.height
@@ -162,6 +165,7 @@ var MountainSeriesDrawingProvider = /** @class */ (function (_super) {
162
165
  };
163
166
  MountainSeriesDrawingProvider.prototype.createPen = function () {
164
167
  var _a = this.parentSeries, stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
168
+ this.palettingState.requiresUpdate = true;
165
169
  return (0, Pen2DCache_1.createPenInCache)(this.strokePenCache, stroke, strokeThickness, opacity, strokeDashArray);
166
170
  };
167
171
  return MountainSeriesDrawingProvider;
@@ -54,7 +54,7 @@ var PointMarkerDrawingProvider = /** @class */ (function (_super) {
54
54
  * @inheritDoc
55
55
  */
56
56
  PointMarkerDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
57
- var _a;
57
+ var _a, _b;
58
58
  var pointMarker = (_a = this.getProperties(this.parentSeries)) === null || _a === void 0 ? void 0 : _a.pointMarker;
59
59
  if (pointMarker === undefined) {
60
60
  return;
@@ -75,14 +75,19 @@ var PointMarkerDrawingProvider = /** @class */ (function (_super) {
75
75
  var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
76
76
  var xValues = this.xSelector(pointSeries);
77
77
  var yValues = this.ySelector(pointSeries);
78
- if (this.parentSeries.isSpline) {
79
- var spline = this.parentSeries;
80
- if (spline.xSplineValues.size() > 0 && spline.ySplineValues.size() > 0) {
81
- this.pointMarkerXYValuesFromSpline(xValues.size(), spline.xSplineValues, this.ySplineValuesSelector(spline), spline.interpolationPoints);
82
- xValues = this.xAnimationPointMarkerValues;
83
- yValues = this.yAnimationPointMarkerValues;
84
- }
85
- }
78
+ // if (this.parentSeries.isSpline) {
79
+ // const spline = this.parentSeries as any as ISpline;
80
+ // if (spline.xSplineValues.size() > 0 && spline.ySplineValues.size() > 0) {
81
+ // this.pointMarkerXYValuesFromSpline(
82
+ // xValues.size(),
83
+ // spline.xSplineValues,
84
+ // this.ySplineValuesSelector(spline),
85
+ // spline.interpolationPoints
86
+ // );
87
+ // xValues = this.xAnimationPointMarkerValues;
88
+ // yValues = this.yAnimationPointMarkerValues;
89
+ // }
90
+ // }
86
91
  this.args.Reset();
87
92
  this.args.verticalChart = renderPassData.isVerticalChart;
88
93
  this.args.forceShaderMethod = true;
@@ -90,7 +95,7 @@ var PointMarkerDrawingProvider = /** @class */ (function (_super) {
90
95
  if (strokeMaskTexture) {
91
96
  this.args.SetStrokeMask(strokeMaskTexture.getTexture());
92
97
  }
93
- var _b = this.parentSeries.dataSeries, fifoCapacity = _b.fifoCapacity, fifoSweeping = _b.fifoSweeping, fifoSweepingGap = _b.fifoSweepingGap;
98
+ var _c = this.parentSeries.dataSeries, fifoCapacity = _c.fifoCapacity, fifoSweeping = _c.fifoSweeping, fifoSweepingGap = _c.fifoSweepingGap;
94
99
  var fifoStartIndex = pointSeries.fifoStartIndex;
95
100
  if (pointMarker.lastPointOnly && yValues.size() > 0) {
96
101
  this.args.count = 1;
@@ -100,7 +105,7 @@ var PointMarkerDrawingProvider = /** @class */ (function (_super) {
100
105
  : yValues.size() - 1;
101
106
  }
102
107
  else {
103
- var _c = this.getStartAndCount(renderPassData, xValues), startIndex = _c.startIndex, count = _c.count;
108
+ var _d = this.getStartAndCount(renderPassData, xValues), startIndex = _d.startIndex, count = _d.count;
104
109
  this.args.count = count;
105
110
  this.args.startIndex = startIndex;
106
111
  if (fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count()) {
@@ -110,6 +115,7 @@ var PointMarkerDrawingProvider = /** @class */ (function (_super) {
110
115
  // Paletting per point
111
116
  this.applyStrokeFillPaletting(pointMarker.stroke, undefined, pointMarker.fill, undefined, this.parentSeries.opacity);
112
117
  this.args.SetPalettedColors(this.palettingState.palettedColors);
118
+ this.args.paletteStart = (_b = this.palettingState.paletteStartIndex) !== null && _b !== void 0 ? _b : 0;
113
119
  var nativeContext = renderContext.getNativeContext();
114
120
  this.drawPoints(nativeContext, isCategoryAxis ? pointSeries.indexes : xValues, yValues, renderPassData.xCoordinateCalculator.nativeCalculator, renderPassData.yCoordinateCalculator.nativeCalculator, this.args, this.parentSeries.parentSurface.seriesViewRect);
115
121
  if (fifoSweeping && fifoCapacity === this.parentSeries.dataSeries.count() && !pointMarker.lastPointOnly) {
@@ -286,7 +286,7 @@ var FastErrorBarsRenderableSeries = /** @class */ (function (_super) {
286
286
  var dataSeriesValueType = this.isRunningDataAnimation
287
287
  ? IDataSeries_1.EDataSeriesValueType.FinalAnimationValues
288
288
  : IDataSeries_1.EDataSeriesValueType.Default;
289
- var range = this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis, dataSeriesValueType, isHorizontalDirection, hasHighCap, hasLowCap);
289
+ var range = this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis, dataSeriesValueType, this.yRangeMode, isHorizontalDirection, hasHighCap, hasLowCap);
290
290
  // Not sure how to adjust this sensibly without having the dataPointWidth in pixels. Not sure if we can reliably get a valid coordCacluator
291
291
  if (this.yAxis.type === AxisType_1.EAxisType.LogarithmicAxis)
292
292
  return range;
@@ -56,6 +56,7 @@ var createHitTestInfo = function (renderableSeries, xCoordinateCalculator, yCoor
56
56
  hitTestInfo.yValue = yValue;
57
57
  var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
58
58
  var xLastValue = isCategoryAxis ? xNativeValues.size() - 1 : xNativeValues.get(xNativeValues.size() - 1);
59
+ // TODO - do this once when data changes
59
60
  if (!dataSeries.dataDistributionCalculator.isSortedAscending) {
60
61
  for (var i = 0; i < dataSeries.count(); i++) {
61
62
  if (xNativeValues.get(i) < xFirstValue) {
@@ -8,6 +8,7 @@ import { SeriesAnimation } from "./Animations/SeriesAnimation";
8
8
  import { IRenderableSeries } from "./IRenderableSeries";
9
9
  import { ShaderEffect } from "./ShaderEffect";
10
10
  import { BaseDataLabelProvider } from "./DataLabels/BaseDataLabelProvider";
11
+ import { EYRangeMode } from "../../../types/YRangeMode";
11
12
  /**
12
13
  * The type of the {@link IBaseRenderableSeriesOptions.onIsVisibleChanged } callback
13
14
  */
@@ -185,4 +186,6 @@ export interface IBaseRenderableSeriesOptions {
185
186
  * This is only really relevant if you are using Stacked Y Axes and do not want the series to be drawn outside that axis range
186
187
  */
187
188
  clipToYRange?: boolean;
189
+ /** 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 */
190
+ yRangeMode?: EYRangeMode;
188
191
  }
@@ -28,6 +28,7 @@ import { SeriesHoveredArgs } from "./SeriesHoveredArgs";
28
28
  import { SeriesSelectedArgs } from "./SeriesSelectedArgs";
29
29
  import { SeriesVisibleChangedArgs } from "./SeriesVisibleChangedArgs";
30
30
  import { BaseDataLabelProvider } from "./DataLabels/BaseDataLabelProvider";
31
+ import { EYRangeMode } from "../../../types/YRangeMode";
31
32
  /**
32
33
  * @summary Defines the interface to a Render Series (or Chart Type) in SciChart's High Performance Real-time
33
34
  * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
@@ -251,6 +252,8 @@ export interface IRenderableSeries extends IDeletable, IThemeable, INotifyOnDpiC
251
252
  * Gets or sets the {@link BaseDataLabelProvider} used for creating and drawing per-point text
252
253
  */
253
254
  dataLabelProvider: BaseDataLabelProvider;
255
+ /** 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 */
256
+ yRangeMode: EYRangeMode;
254
257
  /**
255
258
  * Called when the {@link BaseRenderableSeries} must be drawn
256
259
  * @param renderContext The {@link WebGL2RenderingContext} with methods for drawing on the WebGL Canvas via our WebAssembly Rendering Engine
@@ -285,11 +288,11 @@ export interface IRenderableSeries extends IDeletable, IThemeable, INotifyOnDpiC
285
288
  */
286
289
  hasStrokePaletteProvider(): boolean;
287
290
  /**
288
- * Returns true if the {@link BaseRenderableSeries} has an {@ IFillPaletteProvider }
291
+ * Returns true if the {@link BaseRenderableSeries} has an {@link IFillPaletteProvider }
289
292
  */
290
293
  hasFillPaletteProvider(): boolean;
291
294
  /**
292
- * Returns true if the {@link BaseRenderableSeries} has an {@ IPointMarkerPaletteProvider}
295
+ * Returns true if the {@link BaseRenderableSeries} has an {@link IPointMarkerPaletteProvider}
293
296
  */
294
297
  hasPointMarkerPaletteProvider(): boolean;
295
298
  /**
@@ -0,0 +1,30 @@
1
+ import { DeletableEntity } from "../../../../Core/DeletableEntity";
2
+ import { IDeletable } from "../../../../Core/IDeletable";
3
+ import { IDataChangeArgs } from "../../../Model/IDataSeries";
4
+ import { BasePointSeriesResampled } from "../../../Model/PointSeries/BasePointSeriesResampled";
5
+ import { IPointSeries } from "../../../Model/PointSeries/IPointSeries";
6
+ import { RenderPassData } from "../../../Services/RenderPassData";
7
+ import { TSciChart } from "../../SciChartSurface";
8
+ import { BaseRenderableSeries } from "../BaseRenderableSeries";
9
+ import { ISeriesDrawingProvider } from "../DrawingProviders/ISeriesDrawingProvider";
10
+ export interface IRenderDataTransform extends IDeletable {
11
+ readonly parentSeries: BaseRenderableSeries;
12
+ requiresTransform: boolean;
13
+ drawingProviders: Array<ISeriesDrawingProvider>;
14
+ runTransform(renderPassData: RenderPassData): RenderPassData;
15
+ onDataChange(args: IDataChangeArgs): void;
16
+ }
17
+ export declare abstract class BaseRenderDataTransform<T extends BasePointSeriesResampled> extends DeletableEntity implements IRenderDataTransform {
18
+ protected wasmContext: TSciChart;
19
+ readonly parentSeries: BaseRenderableSeries;
20
+ readonly drawingProviders: Array<ISeriesDrawingProvider>;
21
+ protected pointSeries: T;
22
+ requiresTransform: boolean;
23
+ constructor(parentSeries: BaseRenderableSeries, wasmContext: TSciChart, drawingProviders?: Array<ISeriesDrawingProvider>);
24
+ runTransform(renderPassData: RenderPassData): RenderPassData;
25
+ onDataChange(args: IDataChangeArgs): void;
26
+ delete(): void;
27
+ protected makeRenderPassData(originalRPD: RenderPassData, pointSeries: IPointSeries): RenderPassData;
28
+ protected abstract createPointSeries(): T;
29
+ protected abstract runTransformInternal(renderPassData: RenderPassData): IPointSeries;
30
+ }
@@ -0,0 +1,63 @@
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.BaseRenderDataTransform = void 0;
19
+ var DeletableEntity_1 = require("../../../../Core/DeletableEntity");
20
+ var Deleter_1 = require("../../../../Core/Deleter");
21
+ var Guard_1 = require("../../../../Core/Guard");
22
+ var NumberRange_1 = require("../../../../Core/NumberRange");
23
+ var RenderPassData_1 = require("../../../Services/RenderPassData");
24
+ var BaseRenderDataTransform = /** @class */ (function (_super) {
25
+ __extends(BaseRenderDataTransform, _super);
26
+ function BaseRenderDataTransform(parentSeries, wasmContext, drawingProviders) {
27
+ var _this = _super.call(this) || this;
28
+ _this.requiresTransform = true;
29
+ _this.parentSeries = parentSeries;
30
+ _this.wasmContext = wasmContext;
31
+ _this.parentSeries.dataSeries;
32
+ _this.pointSeries = _this.createPointSeries();
33
+ _this.drawingProviders = drawingProviders !== null && drawingProviders !== void 0 ? drawingProviders : [];
34
+ return _this;
35
+ }
36
+ BaseRenderDataTransform.prototype.runTransform = function (renderPassData) {
37
+ if (this.requiresTransform) {
38
+ Guard_1.Guard.notNull(renderPassData, "renderPassData");
39
+ Guard_1.Guard.notNull(renderPassData.pointSeries, "renderPassData.pointSeries");
40
+ var ps = this.runTransformInternal(renderPassData);
41
+ if (ps === this.pointSeries) {
42
+ this.requiresTransform = false;
43
+ }
44
+ return this.makeRenderPassData(renderPassData, ps);
45
+ }
46
+ return this.makeRenderPassData(renderPassData, this.pointSeries);
47
+ };
48
+ BaseRenderDataTransform.prototype.onDataChange = function (args) {
49
+ this.requiresTransform = true;
50
+ };
51
+ BaseRenderDataTransform.prototype.delete = function () {
52
+ this.pointSeries = (0, Deleter_1.deleteSafe)(this.pointSeries);
53
+ this.wasmContext = undefined;
54
+ };
55
+ BaseRenderDataTransform.prototype.makeRenderPassData = function (originalRPD, pointSeries) {
56
+ var indexRange = new NumberRange_1.NumberRange(0, pointSeries.xValues.size() - 1);
57
+ pointSeries.xRange = originalRPD.pointSeries.xRange;
58
+ pointSeries.fifoStartIndex = originalRPD.pointSeries.fifoStartIndex;
59
+ return new RenderPassData_1.RenderPassData(indexRange, originalRPD.getxCoordinateCalculator, originalRPD.getyCoordinateCalculator, originalRPD.isVerticalChart, pointSeries, originalRPD.resamplingHash);
60
+ };
61
+ return BaseRenderDataTransform;
62
+ }(DeletableEntity_1.DeletableEntity));
63
+ exports.BaseRenderDataTransform = BaseRenderDataTransform;
@@ -0,0 +1,10 @@
1
+ import { IPointSeries } from "../../../Model/PointSeries/IPointSeries";
2
+ import { XyPointSeriesResampled } from "../../../Model/PointSeries/XyPointSeriesResampled";
3
+ import { RenderPassData } from "../../../Services/RenderPassData";
4
+ import { BaseRenderDataTransform } from "./BaseRenderDataTransform";
5
+ export declare class SplineRenderDataTransform extends BaseRenderDataTransform<XyPointSeriesResampled> {
6
+ interpolationPoints: number;
7
+ warnOnSplineFailure: boolean;
8
+ protected createPointSeries(): XyPointSeriesResampled;
9
+ protected runTransformInternal(renderPassData: RenderPassData): IPointSeries;
10
+ }
@@ -0,0 +1,53 @@
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.SplineRenderDataTransform = void 0;
19
+ var NumberRange_1 = require("../../../../Core/NumberRange");
20
+ var XyPointSeriesResampled_1 = require("../../../Model/PointSeries/XyPointSeriesResampled");
21
+ var BaseRenderDataTransform_1 = require("./BaseRenderDataTransform");
22
+ var SplineRenderDataTransform = /** @class */ (function (_super) {
23
+ __extends(SplineRenderDataTransform, _super);
24
+ function SplineRenderDataTransform() {
25
+ var _this = _super !== null && _super.apply(this, arguments) || this;
26
+ _this.interpolationPoints = 10;
27
+ _this.warnOnSplineFailure = true;
28
+ return _this;
29
+ }
30
+ SplineRenderDataTransform.prototype.createPointSeries = function () {
31
+ return new XyPointSeriesResampled_1.XyPointSeriesResampled(this.wasmContext, new NumberRange_1.NumberRange(0, 0));
32
+ };
33
+ SplineRenderDataTransform.prototype.runTransformInternal = function (renderPassData) {
34
+ var xValues = this.parentSeries.xAxis.isCategoryAxis
35
+ ? renderPassData.pointSeries.indexes
36
+ : renderPassData.pointSeries.xValues;
37
+ var yValues = renderPassData.pointSeries.yValues;
38
+ var initialSize = xValues.size();
39
+ var containsNaN = this.parentSeries.dataSeries.dataDistributionCalculator.containsNaN;
40
+ this.wasmContext.SCRTSplineHelperCubicSpline(xValues, yValues, this.pointSeries.xValues, this.pointSeries.yValues, initialSize, this.interpolationPoints, this.parentSeries.dataSeries.dataDistributionCalculator.containsNaN);
41
+ if (!containsNaN && isNaN(this.pointSeries.yValues.get(0))) {
42
+ if (this.warnOnSplineFailure) {
43
+ console.warn("Could not calculate spline values. X data may contain duplicates. Falling back to original values.\n To disable this warning set warnOnSplineFailure = false.");
44
+ }
45
+ return renderPassData.pointSeries;
46
+ }
47
+ else {
48
+ return this.pointSeries;
49
+ }
50
+ };
51
+ return SplineRenderDataTransform;
52
+ }(BaseRenderDataTransform_1.BaseRenderDataTransform));
53
+ exports.SplineRenderDataTransform = SplineRenderDataTransform;
@@ -0,0 +1,10 @@
1
+ import { IPointSeries } from "../../../Model/PointSeries/IPointSeries";
2
+ import { XyyPointSeriesResampled } from "../../../Model/PointSeries/XyyPointSeriesResampled";
3
+ import { RenderPassData } from "../../../Services/RenderPassData";
4
+ import { BaseRenderDataTransform } from "./BaseRenderDataTransform";
5
+ export declare class XyySplineRenderDataTransform extends BaseRenderDataTransform<XyyPointSeriesResampled> {
6
+ interpolationPoints: number;
7
+ warnOnSplineFailure: boolean;
8
+ protected createPointSeries(): XyyPointSeriesResampled;
9
+ protected runTransformInternal(renderPassData: RenderPassData): IPointSeries;
10
+ }
@@ -0,0 +1,55 @@
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.XyySplineRenderDataTransform = void 0;
19
+ var NumberRange_1 = require("../../../../Core/NumberRange");
20
+ var XyyPointSeriesResampled_1 = require("../../../Model/PointSeries/XyyPointSeriesResampled");
21
+ var BaseRenderDataTransform_1 = require("./BaseRenderDataTransform");
22
+ var XyySplineRenderDataTransform = /** @class */ (function (_super) {
23
+ __extends(XyySplineRenderDataTransform, _super);
24
+ function XyySplineRenderDataTransform() {
25
+ var _this = _super !== null && _super.apply(this, arguments) || this;
26
+ _this.interpolationPoints = 10;
27
+ _this.warnOnSplineFailure = true;
28
+ return _this;
29
+ }
30
+ XyySplineRenderDataTransform.prototype.createPointSeries = function () {
31
+ return new XyyPointSeriesResampled_1.XyyPointSeriesResampled(this.wasmContext, new NumberRange_1.NumberRange(0, 0));
32
+ };
33
+ XyySplineRenderDataTransform.prototype.runTransformInternal = function (renderPassData) {
34
+ var xValues = this.parentSeries.xAxis.isCategoryAxis
35
+ ? renderPassData.pointSeries.indexes
36
+ : renderPassData.pointSeries.xValues;
37
+ var yValues = renderPassData.pointSeries.yValues;
38
+ var y1Values = renderPassData.pointSeries.y1Values;
39
+ var initialSize = xValues.size();
40
+ var containsNaN = this.parentSeries.dataSeries.dataDistributionCalculator.containsNaN;
41
+ this.wasmContext.SCRTSplineHelperCubicSpline(xValues, yValues, this.pointSeries.xValues, this.pointSeries.yValues, initialSize, this.interpolationPoints, containsNaN);
42
+ if (!containsNaN && isNaN(this.pointSeries.yValues.get(0))) {
43
+ if (this.warnOnSplineFailure) {
44
+ console.warn("Could not calculate spline values. X data may contain duplicates. Falling back to original values.\n To disable this warning set warnOnSplineFailure = false.");
45
+ }
46
+ return renderPassData.pointSeries;
47
+ }
48
+ else {
49
+ this.wasmContext.SCRTSplineHelperCubicSpline(xValues, y1Values, this.pointSeries.xValues, this.pointSeries.y1Values, initialSize, this.interpolationPoints, containsNaN);
50
+ return this.pointSeries;
51
+ }
52
+ };
53
+ return XyySplineRenderDataTransform;
54
+ }(BaseRenderDataTransform_1.BaseRenderDataTransform));
55
+ exports.XyySplineRenderDataTransform = XyySplineRenderDataTransform;
@@ -40,13 +40,9 @@ export interface ISplineBandRenderableSeriesOptions extends IBaseBandRenderableS
40
40
  */
41
41
  export declare class SplineBandRenderableSeries extends BaseBandRenderableSeries implements ISpline {
42
42
  readonly type = ESeriesType.SplineBandSeries;
43
- xSplineValues: SCRTDoubleVector;
44
- ySplineValues: SCRTDoubleVector;
45
- y1SplineValues: SCRTDoubleVector;
46
- warnOnSplineFailure: boolean;
47
43
  protected isSplineProperty: boolean;
48
- private recalculateSpline;
49
44
  private interpolationPointsProperty;
45
+ private splineRenderPassData;
50
46
  /**
51
47
  * Creates an instance of the {@link SplineBandRenderableSeries}
52
48
  * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
@@ -63,13 +59,24 @@ export declare class SplineBandRenderableSeries extends BaseBandRenderableSeries
63
59
  * Gets or sets the interpolationPoints being used for the Spline
64
60
  */
65
61
  set interpolationPoints(value: number);
62
+ get xSplineValues(): SCRTDoubleVector;
63
+ get ySplineValues(): SCRTDoubleVector;
64
+ get y1SplineValues(): SCRTDoubleVector;
66
65
  /** @inheritDoc */
67
66
  delete(): void;
67
+ /**
68
+ * Set false to disable the warning if the spline cannot be calculated
69
+ */
70
+ get warnOnSplineFailure(): boolean;
71
+ /**
72
+ * Set false to disable the warning if the spline cannot be calculated
73
+ */
74
+ set warnOnSplineFailure(value: boolean);
68
75
  /**
69
76
  * Updates spline values
70
77
  */
71
78
  updateSplineValues(): void;
72
- /** @inheritDoc */
79
+ /** @deprecated This is now handled within the renderDataTransform */
73
80
  onSplineFailure(): void;
74
81
  /** @inheritDoc */
75
82
  getYRange(xVisibleRange: NumberRange, isXCategoryAxis?: boolean): NumberRange;
@@ -79,6 +86,4 @@ export declare class SplineBandRenderableSeries extends BaseBandRenderableSeries
79
86
  protected setAnimationVectors(animation: SeriesAnimation): void;
80
87
  /** @inheritDoc */
81
88
  protected updateAnimationProperties(progress: number, animationFSM: SeriesAnimationFiniteStateMachine): void;
82
- /** @inheritDoc */
83
- protected dataSeriesDataChanged(): void;
84
89
  }
@@ -19,12 +19,15 @@ exports.SplineBandRenderableSeries = void 0;
19
19
  var Deleter_1 = require("../../../Core/Deleter");
20
20
  var NumberRange_1 = require("../../../Core/NumberRange");
21
21
  var SeriesType_1 = require("../../../types/SeriesType");
22
- var copyVector_1 = require("../../../utils/copyVector");
23
22
  var isRealNumber_1 = require("../../../utils/isRealNumber");
24
23
  var BaseDataSeries_1 = require("../../Model/BaseDataSeries");
24
+ var IDataSeries_1 = require("../../Model/IDataSeries");
25
+ var XyyPointSeriesWrapped_1 = require("../../Model/PointSeries/XyyPointSeriesWrapped");
26
+ var RenderPassData_1 = require("../../Services/RenderPassData");
25
27
  var animationHelpers_1 = require("./Animations/animationHelpers");
26
28
  var BaseBandRenderableSeries_1 = require("./BaseBandRenderableSeries");
27
29
  var constants_1 = require("./constants");
30
+ var XyySplineRenderDataTransform_1 = require("./RenderDataTransforms/XyySplineRenderDataTransform");
28
31
  /**
29
32
  * Defines a JavaScript Spline Band-series or High-Low polygon fill chart type in the SciChart's High Performance Real-time
30
33
  * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
@@ -61,14 +64,13 @@ var SplineBandRenderableSeries = /** @class */ (function (_super) {
61
64
  var _a, _b, _c;
62
65
  _this = _super.call(this, webAssemblyContext, options) || this;
63
66
  _this.type = SeriesType_1.ESeriesType.SplineBandSeries;
64
- _this.warnOnSplineFailure = true;
65
67
  _this.isSplineProperty = true;
66
- _this.recalculateSpline = true;
67
68
  _this.interpolationPointsProperty = 10;
68
- _this.xSplineValues = new webAssemblyContext.SCRTDoubleVector();
69
- _this.ySplineValues = new webAssemblyContext.SCRTDoubleVector();
70
- _this.y1SplineValues = new webAssemblyContext.SCRTDoubleVector();
71
69
  _this.interpolationPointsProperty = (_a = options === null || options === void 0 ? void 0 : options.interpolationPoints) !== null && _a !== void 0 ? _a : _this.interpolationPointsProperty;
70
+ _this.renderDataTransform = new XyySplineRenderDataTransform_1.XyySplineRenderDataTransform(_this, webAssemblyContext, [
71
+ _this.drawingProviders[0]
72
+ ]);
73
+ _this.renderDataTransform.interpolationPoints = _this.interpolationPoints;
72
74
  // Must be called here for the series type to be available
73
75
  if ((_b = _this.paletteProvider) === null || _b === void 0 ? void 0 : _b.onAttached) {
74
76
  (_c = _this.paletteProvider) === null || _c === void 0 ? void 0 : _c.onAttached(_this);
@@ -94,63 +96,83 @@ var SplineBandRenderableSeries = /** @class */ (function (_super) {
94
96
  */
95
97
  set: function (value) {
96
98
  this.interpolationPointsProperty = value;
99
+ this.renderDataTransform.interpolationPoints = this.interpolationPoints;
100
+ this.renderDataTransform.requiresTransform = true;
97
101
  this.notifyPropertyChanged(constants_1.PROPERTY.INTERPOLATION_POINTS);
98
102
  },
99
103
  enumerable: false,
100
104
  configurable: true
101
105
  });
106
+ Object.defineProperty(SplineBandRenderableSeries.prototype, "xSplineValues", {
107
+ get: function () {
108
+ if (!this.splineRenderPassData) {
109
+ throw Error("Spline values are not available until after first render, or call updateSplineValues");
110
+ }
111
+ return this.splineRenderPassData.pointSeries.xValues;
112
+ },
113
+ enumerable: false,
114
+ configurable: true
115
+ });
116
+ Object.defineProperty(SplineBandRenderableSeries.prototype, "ySplineValues", {
117
+ get: function () {
118
+ if (!this.splineRenderPassData) {
119
+ throw Error("Spline values are not available until after first render, or call updateSplineValues");
120
+ }
121
+ return this.splineRenderPassData.pointSeries.yValues;
122
+ },
123
+ enumerable: false,
124
+ configurable: true
125
+ });
126
+ Object.defineProperty(SplineBandRenderableSeries.prototype, "y1SplineValues", {
127
+ get: function () {
128
+ if (!this.splineRenderPassData) {
129
+ throw Error("Spline values are not available until after first render, or call updateSplineValues");
130
+ }
131
+ return this.splineRenderPassData.pointSeries.y1Values;
132
+ },
133
+ enumerable: false,
134
+ configurable: true
135
+ });
102
136
  /** @inheritDoc */
103
137
  SplineBandRenderableSeries.prototype.delete = function () {
104
- this.xSplineValues = (0, Deleter_1.deleteSafe)(this.xSplineValues);
105
- this.ySplineValues = (0, Deleter_1.deleteSafe)(this.ySplineValues);
106
- this.y1SplineValues = (0, Deleter_1.deleteSafe)(this.y1SplineValues);
107
138
  _super.prototype.delete.call(this);
108
139
  };
140
+ Object.defineProperty(SplineBandRenderableSeries.prototype, "warnOnSplineFailure", {
141
+ /**
142
+ * Set false to disable the warning if the spline cannot be calculated
143
+ */
144
+ get: function () {
145
+ return this.renderDataTransform.warnOnSplineFailure;
146
+ },
147
+ /**
148
+ * Set false to disable the warning if the spline cannot be calculated
149
+ */
150
+ set: function (value) {
151
+ this.renderDataTransform.warnOnSplineFailure = value;
152
+ },
153
+ enumerable: false,
154
+ configurable: true
155
+ });
109
156
  /**
110
157
  * Updates spline values
111
158
  */
112
159
  SplineBandRenderableSeries.prototype.updateSplineValues = function () {
113
- if (!(this.dataSeries && this.recalculateSpline && this.parentSurface)) {
160
+ if (!this.dataSeries || !this.parentSurface) {
114
161
  return;
115
162
  }
116
- this.isSplineProperty = true;
117
- var dataSeries = this.dataSeries;
118
- if (dataSeries.fifoCapacity) {
119
- throw new Error("Sorry, fifo is not currently supported for spline series");
120
- }
121
- var xValues = this.xAxis.isCategoryAxis ? dataSeries.getNativeIndexes() : dataSeries.getNativeXValues();
122
- var yValues = dataSeries.getNativeYValues();
123
- var y1Values = dataSeries.getNativeY1Values();
124
- var initialSize = xValues.size();
125
- this.webAssemblyContext.SCRTSplineHelperCubicSpline(xValues, yValues, this.xSplineValues, this.ySplineValues, initialSize, this.interpolationPoints, dataSeries.dataDistributionCalculator.containsNaN);
126
- if (isNaN(this.ySplineValues.get(0))) {
127
- this.onSplineFailure();
163
+ if (!this.currentRenderPassData) {
164
+ this.currentRenderPassData = new RenderPassData_1.RenderPassData(this.getIndicesRange(this.xAxis.visibleRange, this.xAxis.isCategoryAxis), this.xAxis.getCurrentCoordinateCalculator, this.yAxis.getCurrentCoordinateCalculator, this.xAxis.isVerticalChart, new XyyPointSeriesWrapped_1.XyyPointSeriesWrapped(this.dataSeries));
128
165
  }
129
- else {
130
- this.webAssemblyContext.SCRTSplineHelperCubicSpline(xValues, y1Values, this.xSplineValues, this.y1SplineValues, initialSize, this.interpolationPoints, dataSeries.dataDistributionCalculator.containsNaN);
131
- }
132
- this.recalculateSpline = false;
133
- };
134
- /** @inheritDoc */
135
- SplineBandRenderableSeries.prototype.onSplineFailure = function () {
136
- if (this.warnOnSplineFailure) {
137
- console.warn("Could not calculate spline values. X data may contain duplicates. Falling back to original values.\nTo disable this warning set warnOnSplineFailure = false. To change this behaviour, override onSplineFailure");
138
- }
139
- var xValues = this.xAxis.isCategoryAxis
140
- ? this.dataSeries.getNativeIndexes()
141
- : this.dataSeries.getNativeXValues();
142
- (0, copyVector_1.copyDoubleVector)(xValues, this.xSplineValues, this.webAssemblyContext);
143
- (0, copyVector_1.copyDoubleVector)(this.dataSeries.getNativeYValues(), this.ySplineValues, this.webAssemblyContext);
144
- (0, copyVector_1.copyDoubleVector)(this.dataSeries.getNativeY1Values(), this.y1SplineValues, this.webAssemblyContext);
145
- // This tells the drawing providers not to treat the data as interpolated
146
- this.isSplineProperty = false;
166
+ this.splineRenderPassData = this.renderDataTransform.runTransform(this.currentRenderPassData);
147
167
  };
168
+ /** @deprecated This is now handled within the renderDataTransform */
169
+ SplineBandRenderableSeries.prototype.onSplineFailure = function () { };
148
170
  /** @inheritDoc */
149
171
  SplineBandRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
150
172
  var _a;
151
173
  if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
152
174
  if (this.isRunningAnimation) {
153
- return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis);
175
+ return this.dataSeries.getWindowedYRange(xVisibleRange, true, isXCategoryAxis, IDataSeries_1.EDataSeriesValueType.Default, this.yRangeMode);
154
176
  }
155
177
  this.updateSplineValues();
156
178
  var xValues = this.xSplineValues;
@@ -220,11 +242,6 @@ var SplineBandRenderableSeries = /** @class */ (function (_super) {
220
242
  this.invalidateParentCallback();
221
243
  }
222
244
  };
223
- /** @inheritDoc */
224
- SplineBandRenderableSeries.prototype.dataSeriesDataChanged = function () {
225
- this.recalculateSpline = true;
226
- _super.prototype.dataSeriesDataChanged.call(this);
227
- };
228
245
  return SplineBandRenderableSeries;
229
246
  }(BaseBandRenderableSeries_1.BaseBandRenderableSeries));
230
247
  exports.SplineBandRenderableSeries = SplineBandRenderableSeries;