scichart 2.1.2273 → 2.1.2301

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 (40) hide show
  1. package/Builder/buildSeries.d.ts +5 -0
  2. package/Builder/buildSeries.js +4 -0
  3. package/Charting/Model/BaseHeatmapDataSeries.d.ts +2 -2
  4. package/Charting/Model/BaseHeatmapDataSeries.js +13 -4
  5. package/Charting/Themes/IThemeProvider.d.ts +6 -0
  6. package/Charting/Themes/SciChartJSDarkTheme.d.ts +2 -0
  7. package/Charting/Themes/SciChartJSDarkTheme.js +2 -0
  8. package/Charting/Themes/SciChartJSLightTheme.d.ts +2 -0
  9. package/Charting/Themes/SciChartJSLightTheme.js +2 -0
  10. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +5 -0
  11. package/Charting/Visuals/Axis/CategoryAxisBase.js +19 -9
  12. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +1 -1
  13. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +30 -8
  14. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +7 -3
  15. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -1
  16. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.d.ts +84 -0
  17. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +179 -0
  18. package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.d.ts +20 -0
  19. package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.js +100 -0
  20. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +2 -0
  21. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +14 -1
  22. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +13 -0
  23. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +23 -3
  24. package/Charting/Visuals/RenderableSeries/constants.d.ts +1 -0
  25. package/Charting/Visuals/RenderableSeries/constants.js +1 -0
  26. package/Charting/Visuals/SciChartSurface.d.ts +6 -1
  27. package/Charting/Visuals/SciChartSurface.js +10 -1
  28. package/Core/BuildStamp.d.ts +1 -1
  29. package/Core/BuildStamp.js +2 -2
  30. package/_wasm/scichart.browser.js +1 -1
  31. package/_wasm/scichart2d.js +1 -1
  32. package/_wasm/scichart2d.wasm +0 -0
  33. package/_wasm/scichart3d.js +1 -1
  34. package/_wasm/scichart3d.wasm +0 -0
  35. package/constants/performanceWarnings.js +2 -2
  36. package/package.json +1 -1
  37. package/types/SeriesType.d.ts +2 -0
  38. package/types/SeriesType.js +2 -0
  39. package/utils/pointUtil.d.ts +1 -1
  40. package/utils/pointUtil.js +3 -2
@@ -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;
@@ -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
  }
@@ -252,13 +252,13 @@ export declare abstract class BaseHeatmapDataSeries implements IHeatmapSeries {
252
252
  * @param colorMap the {@link IColorMapParams} provides properties used to map heatmap Z-values into colors
253
253
  * for rendering in SciChart's {@link https://www.scichart.com/javascript-chart-features | Realtime JavaScript Charts}
254
254
  */
255
- getNormalizedVector(colorMap: IColorMapParams): FloatVector;
255
+ getNormalizedVector(colorMap: IColorMapParams, fillValuesOutOfRange?: boolean): FloatVector;
256
256
  /**
257
257
  * Recreates the normalized vector (internally used for drawing heatmap) according to zMin and zMax values
258
258
  * @param zMin
259
259
  * @param zMax
260
260
  */
261
- recreateNormalizedVector(zMin: number, zMax: number): void;
261
+ recreateNormalizedVector(zMin: number, zMax: number, fillValuesOutOfRange?: boolean): void;
262
262
  /**
263
263
  * Gets the metadata by Y and X indexes
264
264
  * @param yIndex The Y index
@@ -401,7 +401,7 @@ var BaseHeatmapDataSeries = /** @class */ (function () {
401
401
  * @param colorMap the {@link IColorMapParams} provides properties used to map heatmap Z-values into colors
402
402
  * for rendering in SciChart's {@link https://www.scichart.com/javascript-chart-features | Realtime JavaScript Charts}
403
403
  */
404
- BaseHeatmapDataSeries.prototype.getNormalizedVector = function (colorMap) {
404
+ BaseHeatmapDataSeries.prototype.getNormalizedVector = function (colorMap, fillValuesOutOfRange) {
405
405
  Guard_1.Guard.notNull(colorMap, "colorMap");
406
406
  Guard_1.Guard.argumentIsRealNumber(colorMap.minimum, "colorMap.minimum");
407
407
  Guard_1.Guard.argumentIsRealNumber(colorMap.maximum, "colorMap.maximum");
@@ -410,7 +410,7 @@ var BaseHeatmapDataSeries = /** @class */ (function () {
410
410
  size !== this.normalizedVector.size() ||
411
411
  colorMap.minimum !== this.lastZMin ||
412
412
  colorMap.maximum !== this.lastZMax) {
413
- this.recreateNormalizedVector(colorMap.minimum, colorMap.maximum);
413
+ this.recreateNormalizedVector(colorMap.minimum, colorMap.maximum, fillValuesOutOfRange);
414
414
  this.lastZMin = colorMap.minimum;
415
415
  this.lastZMax = colorMap.maximum;
416
416
  this.hasDataChangesProperty = false;
@@ -422,7 +422,7 @@ var BaseHeatmapDataSeries = /** @class */ (function () {
422
422
  * @param zMin
423
423
  * @param zMax
424
424
  */
425
- BaseHeatmapDataSeries.prototype.recreateNormalizedVector = function (zMin, zMax) {
425
+ BaseHeatmapDataSeries.prototype.recreateNormalizedVector = function (zMin, zMax, fillValuesOutOfRange) {
426
426
  var size = this.arrayWidth * this.arrayHeight;
427
427
  this.normalizedVector.clear();
428
428
  this.normalizedVector.resize(size, 0);
@@ -437,7 +437,16 @@ var BaseHeatmapDataSeries = /** @class */ (function () {
437
437
  for (var y = 0; y < this.arrayHeight; y++) {
438
438
  for (var x = 0; x < this.arrayWidth; x++) {
439
439
  // normalized value from 0..1 = (zValue - zMin) / ((zMax - zMin))
440
- var zValue = isNaN(this.zValuesProperty[y][x]) ? 0 : this.zValuesProperty[y][x] - newZMin;
440
+ var zValue = this.zValuesProperty[y][x] - newZMin;
441
+ if (isNaN(this.zValuesProperty[y][x])) {
442
+ zValue = 0;
443
+ }
444
+ else if (zValue < newZMin) {
445
+ zValue = fillValuesOutOfRange ? zMin - newZMin : 0;
446
+ }
447
+ else if (zValue > zMax - newZMin) {
448
+ zValue = fillValuesOutOfRange ? zMax - newZMin : 0;
449
+ }
441
450
  var normalizedZValue = zValue * normalizationFactor;
442
451
  this.normalizedVector.set(index++, normalizedZValue);
443
452
  }
@@ -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
@@ -88,4 +89,8 @@ export declare abstract class CategoryAxisBase extends AxisBase2D {
88
89
  protected getMaxAutoTicks(): number;
89
90
  private generateDefaultXValuesForCategoryAxis;
90
91
  private setBaseXValues;
92
+ /**
93
+ * @inheritDoc
94
+ */
95
+ delete(): void;
91
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", {
@@ -178,23 +179,25 @@ var CategoryAxisBase = /** @class */ (function (_super) {
178
179
  return Math.min(Math.max(1, this.maxAutoTicks), coordCalc.baseXValues.size());
179
180
  };
180
181
  CategoryAxisBase.prototype.generateDefaultXValuesForCategoryAxis = function () {
181
- var _this = this;
182
- var defaultBaseXValues = new this.webAssemblyContext2D.SCRTDoubleVector();
182
+ this.defaultBaseXValues.clear();
183
183
  if (this.defaultXValues && this.defaultXValues.length > 0) {
184
- (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, defaultBaseXValues, this.defaultXValues);
184
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, this.defaultBaseXValues, this.defaultXValues);
185
185
  }
186
186
  else {
187
- var length_1 = Math.ceil(this.visibleRange.diff);
188
- var xValues = Array.from(Array(length_1), function (_, i) { return _this.defaultXStart + i * _this.defaultXStep; });
189
- (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, defaultBaseXValues, xValues);
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);
191
+ }
192
+ (0, appendDoubleVectorFromJsArray_1.appendDoubleVectorFromJsArray)(this.webAssemblyContext2D, this.defaultBaseXValues, xValues);
190
193
  }
191
- return defaultBaseXValues;
194
+ return this.defaultBaseXValues;
192
195
  };
193
196
  CategoryAxisBase.prototype.setBaseXValues = function (coordCalc, renderableSeries) {
194
- if (renderableSeries.type === SeriesType_1.ESeriesType.UniformHeatmapSeries) {
197
+ if ((renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.type) === SeriesType_1.ESeriesType.UniformHeatmapSeries) {
195
198
  throw Error("Category Axis is not supported for UniformHeatmapRenderableSeries");
196
199
  }
197
- if (renderableSeries.isStacked) {
200
+ if (renderableSeries === null || renderableSeries === void 0 ? void 0 : renderableSeries.isStacked) {
198
201
  var stackedCollection = renderableSeries;
199
202
  if (stackedCollection.size() === 0) {
200
203
  throw Error("BaseStackedCollection should have at least one BaseStackedRenderableSeries");
@@ -217,6 +220,13 @@ var CategoryAxisBase = /** @class */ (function (_super) {
217
220
  coordCalc.baseXValues = renderableSeries.dataSeries.getNativeXValues();
218
221
  }
219
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
+ };
220
230
  return CategoryAxisBase;
221
231
  }(AxisBase2D_1.AxisBase2D));
222
232
  exports.CategoryAxisBase = CategoryAxisBase;
@@ -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) => SpritePointMarker | CrossPointMarker | EllipsePointMarker | XPointMarker | SquarePointMarker | TrianglePointMarker;
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;
@@ -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 cParams = this.parentSeries.getContourDrawingParams();
98
- var x = renderPassData.xCoordinateCalculator.getCoordinate(cParams.xMin);
99
- var y = renderPassData.yCoordinateCalculator.getCoordinate(cParams.yMin);
100
- var width = renderPassData.xCoordinateCalculator.getCoordinate(cParams.xMax);
101
- var height = renderPassData.yCoordinateCalculator.getCoordinate(cParams.yMax);
102
- if (this.parentSeries.minorsPerMajor > 0) {
103
- this.drawContours(renderContext, x, y, width, height, cParams.zMin, cParams.zMax, cParams.minorStepZ, cParams.minorLineStyle);
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) {
@@ -94,7 +94,7 @@ var UniformHeatmapDrawingProvider = /** @class */ (function (_super) {
94
94
  var heatTexture = (_a = this.heatTextureCache) === null || _a === void 0 ? void 0 : _a.value;
95
95
  if (heatTexture) {
96
96
  var dataSeries = this.parentSeries.dataSeries;
97
- var zValuesVector = dataSeries.getNormalizedVector(this.parentSeries.colorMap);
97
+ var zValuesVector = dataSeries.getNormalizedVector(this.parentSeries.colorMap, this.parentSeries.fillValuesOutOfRange);
98
98
  this.packedFloatParams = this.webAssemblyContext.SCRTFillTextureFloat32(heatTexture, dataSeries.arrayWidth, dataSeries.arrayHeight, zValuesVector);
99
99
  this.packedFloatParams.x = 0;
100
100
  this.packedFloatParams.y = 1;
@@ -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 ? -viewRect.y - xMin : -textureWidth - viewRect.y - xMin;
117
- nativeContext.Translate(xTrans, viewRect.x);
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 = ESeriesType.ColumnSeries;
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
+ }
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.FastImpulseRenderableSeries = void 0;
19
+ var NumberRange_1 = require("../../../Core/NumberRange");
20
+ var SeriesType_1 = require("../../../types/SeriesType");
21
+ var EllipsePointMarker_1 = require("../PointMarkers/EllipsePointMarker");
22
+ var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
23
+ var DpiHelper_1 = require("../TextureManager/DpiHelper");
24
+ var constants_1 = require("./constants");
25
+ var FastColumnRenderableSeries_1 = require("./FastColumnRenderableSeries");
26
+ var ImpulseSeriesHitTestProvider_1 = require("./HitTest/ImpulseSeriesHitTestProvider");
27
+ /**
28
+ * Defines a impulse-series or JavaScript impulse chart type in the SciChart's High Performance Real-time
29
+ * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
30
+ * @remarks
31
+ * To add a impulse series to a {@link SciChartSurface} you need to declare both the {@link FastImpulseRenderableSeries | RenderableSeries}
32
+ * and a {@link XyDataSeries | DataSeries}. Simplified code sample below:
33
+ *
34
+ * ```ts
35
+ * const sciChartSurface: SciChartSurface;
36
+ * const wasmContext: TSciChart;
37
+ * // Create and fill the dataseries
38
+ * const dataSeries = new XyDataSeries(wasmContext);
39
+ * dataSeries.append(1,2);
40
+ * dataSeries.append(1,2);
41
+ * // Create the renderableSeries
42
+ * const impulseSeries = new FastImpulseRenderableSeries(wasmContext);
43
+ * impulseSeries.dataSeries = dataSeries;
44
+ * // append to the SciChartSurface
45
+ * sciChartSurface.renderableSeries.add(impulseSeries);
46
+ * ```
47
+ */
48
+ var FastImpulseRenderableSeries = /** @class */ (function (_super) {
49
+ __extends(FastImpulseRenderableSeries, _super);
50
+ /**
51
+ * Creates an instance of the {@link FastImpulseRenderableSeries}
52
+ * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
53
+ * native methods and access to our WebGL2 WebAssembly Drawing Engine
54
+ * @param options optional parameters of type {@link IImpulseRenderableSeries} applied when constructing the series type
55
+ */
56
+ function FastImpulseRenderableSeries(webAssemblyContext, options) {
57
+ var _a, _b, _c, _d;
58
+ var _this = _super.call(this, webAssemblyContext, options) || this;
59
+ /** @inheritDoc */
60
+ _this.type = SeriesType_1.ESeriesType.ImpulseSeries;
61
+ _this.impulseFillProperty = SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.impulseFillBrush;
62
+ _this.impulseSizeProperty = 10;
63
+ _this.impulseDataPointWidthProperty = 0;
64
+ _this.impulseStrokeThicknessProperty = 1;
65
+ _this.strokeThickness = (_a = options === null || options === void 0 ? void 0 : options.strokeThickness) !== null && _a !== void 0 ? _a : _this.impulseStrokeThicknessProperty;
66
+ _this.fill = (_b = options === null || options === void 0 ? void 0 : options.fill) !== null && _b !== void 0 ? _b : _this.impulseFillProperty;
67
+ _this.size = (_c = options === null || options === void 0 ? void 0 : options.size) !== null && _c !== void 0 ? _c : _this.impulseSizeProperty;
68
+ _this.stroke = (_d = options === null || options === void 0 ? void 0 : options.fill) !== null && _d !== void 0 ? _d : _this.impulseFillProperty;
69
+ _this.dataPointWidth = _this.impulseDataPointWidthProperty;
70
+ if (!(options === null || options === void 0 ? void 0 : options.pointMarker)) {
71
+ _this.pointMarker = new EllipsePointMarker_1.EllipsePointMarker(webAssemblyContext, {
72
+ width: _this.impulseSizeProperty,
73
+ height: _this.impulseSizeProperty,
74
+ fill: _this.fill,
75
+ stroke: _this.fill
76
+ });
77
+ }
78
+ return _this;
79
+ }
80
+ Object.defineProperty(FastImpulseRenderableSeries.prototype, "fill", {
81
+ /**
82
+ * Gets or sets the color of each impulse
83
+ */
84
+ get: function () {
85
+ return this.impulseFillProperty;
86
+ },
87
+ set: function (htmlColorCode) {
88
+ this.impulseFillProperty = htmlColorCode;
89
+ this.stroke = htmlColorCode;
90
+ if (this.pointMarker) {
91
+ this.pointMarker.fill = htmlColorCode;
92
+ this.pointMarker.stroke = htmlColorCode;
93
+ }
94
+ if (this.impulseFillProperty !== htmlColorCode) {
95
+ this.notifyPropertyChanged(constants_1.PROPERTY.STROKE);
96
+ }
97
+ },
98
+ enumerable: false,
99
+ configurable: true
100
+ });
101
+ Object.defineProperty(FastImpulseRenderableSeries.prototype, "size", {
102
+ /**
103
+ * Gets or sets the size of each impulse point
104
+ */
105
+ get: function () {
106
+ return this.impulseSizeProperty;
107
+ },
108
+ set: function (sizeParam) {
109
+ this.impulseSizeProperty = sizeParam;
110
+ if (this.pointMarker) {
111
+ this.pointMarker.width = sizeParam;
112
+ this.pointMarker.height = sizeParam;
113
+ }
114
+ },
115
+ enumerable: false,
116
+ configurable: true
117
+ });
118
+ /**
119
+ * @inheritDoc
120
+ */
121
+ FastImpulseRenderableSeries.prototype.getXRange = function () {
122
+ var range = _super.prototype.getXRange.call(this);
123
+ var delta = getDelta({
124
+ pointSize: this.size,
125
+ areaSize: this.parentSurface.seriesViewRect.width,
126
+ range: range
127
+ });
128
+ return new NumberRange_1.NumberRange(range.min - delta, range.max + delta);
129
+ };
130
+ /**
131
+ * @inheritDoc
132
+ */
133
+ FastImpulseRenderableSeries.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) {
134
+ if (isXCategoryAxis === void 0) { isXCategoryAxis = false; }
135
+ var yRange = _super.prototype.getYRange.call(this, xVisibleRange, isXCategoryAxis);
136
+ if (!yRange) {
137
+ return undefined;
138
+ }
139
+ var delta = getDelta({
140
+ pointSize: this.size,
141
+ areaSize: this.parentSurface.seriesViewRect.height,
142
+ range: yRange
143
+ });
144
+ return new NumberRange_1.NumberRange(yRange.min - delta, yRange.max + delta);
145
+ };
146
+ /** @inheritDoc */
147
+ FastImpulseRenderableSeries.prototype.toJSON = function (excludeData) {
148
+ if (excludeData === void 0) { excludeData = false; }
149
+ var json = _super.prototype.toJSON.call(this, excludeData);
150
+ var options = {
151
+ fill: this.fill,
152
+ size: this.size,
153
+ zeroLineY: this.zeroLineY
154
+ };
155
+ Object.assign(json.options, options);
156
+ return json;
157
+ };
158
+ /** @inheritDoc */
159
+ FastImpulseRenderableSeries.prototype.applyTheme = function (themeProvider) {
160
+ _super.prototype.applyTheme.call(this, themeProvider);
161
+ var previousThemeProvider = this.parentSurface.previousThemeProvider;
162
+ if (this.fill === previousThemeProvider.impulseFillBrush) {
163
+ this.fill = themeProvider.impulseFillBrush;
164
+ }
165
+ };
166
+ /** @inheritDoc */
167
+ FastImpulseRenderableSeries.prototype.newHitTestProvider = function () {
168
+ return new ImpulseSeriesHitTestProvider_1.ImpulseSeriesHitTestProvider(this, this.webAssemblyContext);
169
+ };
170
+ return FastImpulseRenderableSeries;
171
+ }(FastColumnRenderableSeries_1.FastColumnRenderableSeries));
172
+ exports.FastImpulseRenderableSeries = FastImpulseRenderableSeries;
173
+ /** @ignore */
174
+ var getDelta = function (_a) {
175
+ var pointSize = _a.pointSize, areaSize = _a.areaSize, range = _a.range;
176
+ var pointScaled = pointSize * DpiHelper_1.DpiHelper.PIXEL_RATIO;
177
+ var k = areaSize / (areaSize - pointScaled);
178
+ return (Math.abs(range.max - range.min) * (k - 1)) / 2;
179
+ };
@@ -0,0 +1,20 @@
1
+ import { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
2
+ import { BaseHitTestProvider } from "./BaseHitTestProvider";
3
+ import { HitTestInfo } from "./HitTestInfo";
4
+ /**
5
+ * Hit-test provider for {@link FastColumnRenderableSeries}. See base class {@link BaseHitTestProvider} for further info
6
+ */
7
+ export declare class ImpulseSeriesHitTestProvider extends BaseHitTestProvider<FastImpulseRenderableSeries> {
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ hitTest(x: number, y: number, hitTestRadius?: number): HitTestInfo;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ hitTestForDataPointSelectionModifier(x: number, y: number, hitTestRadius?: number): HitTestInfo;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ hitTestXSlice(x: number, y: number): HitTestInfo;
20
+ }