scichart 3.2.528 → 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 (74) hide show
  1. package/Charting/ChartModifiers/CursorModifier.js +0 -1
  2. package/Charting/ChartModifiers/DataPointSelectionModifier.js +2 -5
  3. package/Charting/ChartModifiers/RolloverModifier.d.ts +5 -0
  4. package/Charting/ChartModifiers/RolloverModifier.js +18 -18
  5. package/Charting/ChartModifiers/VerticalSliceModifier.js +8 -5
  6. package/Charting/Model/BaseDataSeries.d.ts +3 -2
  7. package/Charting/Model/BaseDataSeries.js +8 -4
  8. package/Charting/Model/HlcDataSeries.d.ts +2 -1
  9. package/Charting/Model/HlcDataSeries.js +4 -2
  10. package/Charting/Model/IDataSeries.d.ts +2 -1
  11. package/Charting/Model/IPaletteProvider.d.ts +24 -0
  12. package/Charting/Model/IPaletteProvider.js +23 -7
  13. package/Charting/Model/OhlcDataSeries.d.ts +2 -1
  14. package/Charting/Model/OhlcDataSeries.js +4 -2
  15. package/Charting/Model/XyyDataSeries.d.ts +2 -1
  16. package/Charting/Model/XyyDataSeries.js +4 -2
  17. package/Charting/Visuals/Annotations/AnnotationBase.js +3 -3
  18. package/Charting/Visuals/Legend/SciChartLegend.js +4 -4
  19. package/Charting/Visuals/Legend/SciChartLegendBase.js +3 -4
  20. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +3 -0
  21. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +15 -4
  22. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +55 -8
  23. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +7 -0
  24. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +22 -3
  25. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +2 -1
  26. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +0 -6
  27. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +18 -13
  28. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +10 -2
  29. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +83 -23
  30. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +4 -2
  31. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +1 -0
  32. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +22 -16
  33. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -12
  34. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +17 -11
  35. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +1 -1
  36. package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +78 -0
  37. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +4 -0
  38. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +6 -1
  39. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +3 -0
  40. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +5 -2
  41. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.d.ts +30 -0
  42. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/BaseRenderDataTransform.js +63 -0
  43. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.d.ts +10 -0
  44. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/SplineRenderDataTransform.js +53 -0
  45. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.d.ts +10 -0
  46. package/Charting/Visuals/RenderableSeries/RenderDataTransforms/XyySplineRenderDataTransform.js +55 -0
  47. package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.js +2 -0
  48. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +13 -8
  49. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +63 -46
  50. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +12 -13
  51. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +60 -52
  52. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +12 -7
  53. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +54 -43
  54. package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -1
  55. package/Charting/Visuals/RenderableSeries/constants.js +1 -0
  56. package/Charting/Visuals/createMaster.d.ts +12 -2
  57. package/Charting/Visuals/createMaster.js +14 -2
  58. package/Core/BuildStamp.d.ts +1 -1
  59. package/Core/BuildStamp.js +2 -2
  60. package/Core/ObservableArray.d.ts +11 -9
  61. package/Core/ObservableArray.js +44 -21
  62. package/_wasm/scichart.browser.js +1 -1
  63. package/_wasm/scichart2d.wasm +0 -0
  64. package/_wasm/scichart3d.wasm +0 -0
  65. package/index.d.ts +9 -0
  66. package/index.dev.js +754 -303
  67. package/index.js +27 -13
  68. package/index.min.js +1 -1
  69. package/package.json +1 -1
  70. package/types/TSciChart.d.ts +4 -0
  71. package/types/YRangeMode.d.ts +10 -0
  72. package/types/YRangeMode.js +14 -0
  73. package/utils/debug.d.ts +2 -0
  74. package/utils/debug.js +17 -0
@@ -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,7 +73,7 @@ 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.indexes.size() : xCount, xCount);
76
+ var count = Math.min(pointSeries ? pointSeries.xValues.size() : xCount, xCount);
76
77
  var startIndex = 0;
77
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) {
@@ -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
- if (this.parentSeries.hasStrokePaletteProvider()) {
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
- var renderPassData = this.parentSeries.getCurrentRenderPassData();
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 _d = this.getStartAndCount(renderPassData, xValues), startIndex = _d.startIndex, count = _d.count;
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 overrideColor = strokePaletteProvider.overrideStrokeArgb(xValues.get(index), yValues.get(index), originalDataIndex, this.parentSeries.opacity, dataSeries.getMetadataAt(originalDataIndex));
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
- (_c = this.palettingState.palettedColors) === null || _c === void 0 ? void 0 : _c.clear();
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 fillPaletteProvider = this.parentSeries.paletteProvider;
148
- if (hasStrokePaletteProvider || hasFillPaletteProvider || hasPointMarkerPaletteProvider) {
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
- var renderPassData = this.parentSeries.getCurrentRenderPassData();
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 _f = this.getStartAndCount(renderPassData, xValues), startIndex = _f.startIndex, count = _f.count;
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 = (_c = overriddenColors.stroke) !== null && _c !== void 0 ? _c : strokeColor;
213
- var overrideFillColor = (_d = overriddenColors.fill) !== null && _d !== void 0 ? _d : fillColor;
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
- (_e = this.palettingState.palettedColors) === null || _e === void 0 ? void 0 : _e.clear();
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,45 @@ 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
+ if (paletteProvider.shouldUpdatePalette && paletteProvider.shouldUpdatePalette()) {
360
+ this.palettingState.requiresUpdate = true;
361
+ }
362
+ };
303
363
  BaseSeriesDrawingProvider.prototype.overridePaletteProviderColors = function (rs, xValue, yValue, index, opacity, metadata) {
304
364
  var stroke;
305
365
  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 _a = this.getStartAndCount(renderPassData, xValues), startIndex = _a.startIndex, count = _a.count;
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 _b = this.parentSeries.dataSeries, fifoCapacity = _b.fifoCapacity, fifoSweeping = _b.fifoSweeping, fifoSweepingGap = _b.fifoSweepingGap;
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 = this.getProperties(this.parentSeries), stroke = _a.stroke, isDigitalLine = _a.isDigitalLine, lineType = _a.lineType, drawNaNAs = _a.drawNaNAs, containsNaNOverride = _a.containsNaN;
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;
@@ -118,7 +119,7 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
118
119
  this.args.digitalYX = lineType === BaseLineRenderableSeries_1.ELineType.DigitalYX;
119
120
  this.args.forceShaderMethod = true;
120
121
  this.args.containsNaN = containsNaN;
121
- this.args.forceClamp = true;
122
+ this.args.forceClamp = !this.args.isDigitalLine;
122
123
  this.args.lineGaps = containsNaN
123
124
  ? drawNaNAs === WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine
124
125
  ? this.webAssemblyContext.SCRTLineGapMode.DrawGaps
@@ -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 _b = this.parentSeries.dataSeries, fifoCapacity = _b.fifoCapacity, fifoSweeping = _b.fifoSweeping, fifoSweepingGap = _b.fifoSweepingGap;
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
- var isSplineLineSeries = this.parentSeries.type === SeriesType_1.ESeriesType.SplineLineSeries && xValues.size() > 1;
135
- if (isSplineLineSeries) {
136
- var spline = this.parentSeries;
137
- // If animation is running we animate between two interpolated vectors and do not want to update spline
138
- if (!this.parentSeries.isRunningAnimation) {
139
- spline.updateSplineValues();
140
- }
141
- xDrawValues = spline.xSplineValues;
142
- yDrawValues = spline.ySplineValues;
143
- }
144
- var _c = this.getStartAndCount(isSplineLineSeries ? undefined : renderPassData, xDrawValues), startIndex = _c.startIndex, count = _c.count;
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);
@@ -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;
@@ -62,6 +62,84 @@ var OhlcSeriesHitTestProvider = /** @class */ (function (_super) {
62
62
  }
63
63
  return hitTestInfo;
64
64
  };
65
+ // Alternate method that deals slighty better with unsorted data where multiple candles share an x value, but fails for large candles.
66
+ // See the new Editable Event Markers demo for yet another method which does better still, for a slightly special case
67
+ // public hitTest(x: number, y: number, hitTestRadius: number = 0): HitTestInfo {
68
+ // const hitTestPoint = this.getTranslatedHitTestPoint(x, y);
69
+ // if (!hitTestPoint) {
70
+ // return HitTestInfo.empty();
71
+ // }
72
+ // const { xCoordinateCalculator, yCoordinateCalculator, isVerticalChart } = this.currentRenderPassData;
73
+ // const xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
74
+ // const yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
75
+ // const renderableSeries = this.parentSeries as BaseOhlcRenderableSeries;
76
+ // const dataSeries = this.parentSeries.dataSeries as OhlcDataSeries;
77
+ // if (!dataSeries) {
78
+ // return HitTestInfo.empty();
79
+ // }
80
+ // const isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
81
+ // const xValues = isCategoryAxis ? dataSeries.getNativeIndexes() : dataSeries.getNativeXValues();
82
+ // const isSorted = dataSeries.dataDistributionCalculator.isSortedAscending;
83
+ // const nearestClose = hitTestHelpers.getNearestPoint(
84
+ // this.webAssemblyContext,
85
+ // xCoordinateCalculator,
86
+ // yCoordinateCalculator,
87
+ // xValues,
88
+ // dataSeries.getNativeCloseValues(),
89
+ // isSorted,
90
+ // xHitCoord,
91
+ // yHitCoord,
92
+ // hitTestRadius
93
+ // );
94
+ // const nearestOpen = hitTestHelpers.getNearestPoint(
95
+ // this.webAssemblyContext,
96
+ // xCoordinateCalculator,
97
+ // yCoordinateCalculator,
98
+ // xValues,
99
+ // dataSeries.getNativeOpenValues(),
100
+ // isSorted,
101
+ // xHitCoord,
102
+ // yHitCoord,
103
+ // hitTestRadius
104
+ // );
105
+ // const nearestPoint = nearestClose.distance < nearestOpen.distance ? nearestClose : nearestOpen;
106
+ // const xNativeValues = dataSeries.getNativeXValues();
107
+ // const yNativeValues = dataSeries.getNativeYValues();
108
+ // const hitTestInfo = hitTestHelpers.createHitTestInfo(
109
+ // this.parentSeries,
110
+ // xCoordinateCalculator,
111
+ // yCoordinateCalculator,
112
+ // isVerticalChart,
113
+ // dataSeries,
114
+ // xNativeValues,
115
+ // yNativeValues,
116
+ // xHitCoord,
117
+ // yHitCoord,
118
+ // nearestPoint.nearestPointIndex,
119
+ // hitTestRadius,
120
+ // nearestPoint.distance
121
+ // );
122
+ // if (nearestPoint.nearestPointIndex >= 0) {
123
+ // const res = hitTestHelpers.testIsHitForOHLC(
124
+ // xCoordinateCalculator,
125
+ // yCoordinateCalculator,
126
+ // renderableSeries,
127
+ // dataSeries,
128
+ // nearestPoint.nearestPointIndex,
129
+ // xHitCoord,
130
+ // yHitCoord,
131
+ // hitTestRadius
132
+ // );
133
+ // hitTestInfo.isHit = res.isHit;
134
+ // hitTestInfo.openValue = res.openValue;
135
+ // hitTestInfo.highValue = res.highValue;
136
+ // hitTestInfo.lowValue = res.lowValue;
137
+ // hitTestInfo.closeValue = res.closeValue;
138
+ // } else {
139
+ // hitTestInfo.isHit = false;
140
+ // }
141
+ // return hitTestInfo;
142
+ // }
65
143
  /**
66
144
  * @inheritDoc
67
145
  */
@@ -15,6 +15,10 @@ import { IRenderableSeries } from "../IRenderableSeries";
15
15
  import { HitTestInfo } from "./HitTestInfo";
16
16
  export declare const hitTestHelpers: {
17
17
  createHitTestInfo: (renderableSeries: IRenderableSeries, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, isVerticalChart: boolean, dataSeries: BaseDataSeries, xNativeValues: SCRTDoubleVector, yNativeValues: SCRTDoubleVector, xHitCoord: number, yHitCoord: number, nearestPointIndex: number, hitTestRadius: number, distance?: number) => HitTestInfo;
18
+ getNearestPoint: (webassemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, isSorted: boolean, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => {
19
+ nearestPointIndex: number;
20
+ distance: number;
21
+ };
18
22
  getNearestXPoint: (webAssemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, dataSeries: IDataSeries, xHitCoord: number, isSorted: boolean) => number;
19
23
  getNearestXyPoint: (webassemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, dataSeries: IDataSeries, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => {
20
24
  nearestPointIndex: number;
@@ -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) {
@@ -83,9 +84,12 @@ var getNearestXyPoint = function (webassemblyContext, xCoordinateCalculator, yCo
83
84
  var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
84
85
  var dataX = isCategoryAxis ? dataSeries.getNativeIndexes() : dataSeries.getNativeXValues();
85
86
  var dataY = dataSeries.getNativeYValues();
87
+ return getNearestPoint(webassemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataX, dataY, dataSeries.dataDistributionCalculator.isSortedAscending, xHitCoord, yHitCoord, hitTestRadius);
88
+ };
89
+ var getNearestPoint = function (webassemblyContext, xCoordinateCalculator, yCoordinateCalculator, xValues, yValues, isSorted, xHitCoord, yHitCoord, hitTestRadius) {
86
90
  var result;
87
91
  try {
88
- result = webassemblyContext.SCRTHitTestHelper.GetNearestXyPoint(xCoordinateCalculator.nativeCalculator, yCoordinateCalculator.nativeCalculator, dataX, dataY, dataSeries.dataDistributionCalculator.isSortedAscending, xHitCoord, yHitCoord, hitTestRadius !== null && hitTestRadius !== void 0 ? hitTestRadius : 1 // Default to 1 here so unsorted data will get nearest by x and y
92
+ result = webassemblyContext.SCRTHitTestHelper.GetNearestXyPoint(xCoordinateCalculator.nativeCalculator, yCoordinateCalculator.nativeCalculator, xValues, yValues, isSorted, xHitCoord, yHitCoord, hitTestRadius !== null && hitTestRadius !== void 0 ? hitTestRadius : 1 // Default to 1 here so unsorted data will get nearest by x and y
89
93
  );
90
94
  return { nearestPointIndex: result.minD, distance: result.maxD };
91
95
  }
@@ -396,6 +400,7 @@ var testIsHitForMountain = function (isDigitalLine, xCoordinateCalculator, yCoor
396
400
  };
397
401
  exports.hitTestHelpers = {
398
402
  createHitTestInfo: createHitTestInfo,
403
+ getNearestPoint: getNearestPoint,
399
404
  getNearestXPoint: getNearestXPoint,
400
405
  getNearestXyPoint: getNearestXyPoint,
401
406
  getNearestXyyPoint: getNearestXyyPoint,
@@ -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
  }