scichart 3.2.481 → 3.2.509

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 (62) hide show
  1. package/Charting/ChartModifiers/CursorModifier.js +3 -7
  2. package/Charting/ChartModifiers/RolloverModifier.js +1 -2
  3. package/Charting/ChartModifiers/VerticalSliceModifier.js +6 -0
  4. package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -1
  5. package/Charting/Drawing/WebGlRenderContext2D.js +1 -1
  6. package/Charting/LayoutManager/SynchronizedLayoutManager.js +12 -0
  7. package/Charting/Numerics/TickCoordinateProviders/DefaultTickCoordinatesProvider.d.ts +5 -0
  8. package/Charting/Numerics/TickCoordinateProviders/DefaultTickCoordinatesProvider.js +11 -1
  9. package/Charting/Numerics/TickCoordinateProviders/StaticTickCoordinatesProvider.d.ts +19 -0
  10. package/Charting/Numerics/TickCoordinateProviders/StaticTickCoordinatesProvider.js +86 -0
  11. package/Charting/Numerics/TickCoordinateProviders/TickCoordinatesProvider.d.ts +2 -0
  12. package/Charting/Numerics/TickProviders/LogarithmicTickProvider.d.ts +1 -0
  13. package/Charting/Numerics/TickProviders/LogarithmicTickProvider.js +6 -1
  14. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +1 -2
  15. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +2 -3
  16. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +1 -1
  17. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +1 -2
  18. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +16 -17
  19. package/Charting/Visuals/Annotations/SvgAnnotationBase.d.ts +2 -0
  20. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +9 -4
  21. package/Charting/Visuals/Axis/AxisBase2D.d.ts +14 -1
  22. package/Charting/Visuals/Axis/AxisBase2D.js +51 -19
  23. package/Charting/Visuals/Axis/AxisCore.d.ts +1 -1
  24. package/Charting/Visuals/Axis/DeltaCalculator/LogarithmicDeltaCalculator.d.ts +1 -0
  25. package/Charting/Visuals/Axis/DeltaCalculator/LogarithmicDeltaCalculator.js +13 -4
  26. package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +6 -1
  27. package/Charting/Visuals/Axis/LogarithmicAxis.js +27 -10
  28. package/Charting/Visuals/Axis/constants.d.ts +2 -1
  29. package/Charting/Visuals/Axis/constants.js +1 -0
  30. package/Charting/Visuals/Helpers/createPen.js +8 -0
  31. package/Charting/Visuals/Legend/SciChartLegendBase.js +15 -2
  32. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +7 -0
  33. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +41 -16
  34. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +1 -1
  35. package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +16 -5
  36. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +5 -0
  37. package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.js +7 -2
  38. package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -1
  39. package/Charting/Visuals/RenderableSeries/constants.js +1 -0
  40. package/Charting/Visuals/SciChartOverview.js +3 -2
  41. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +1 -0
  42. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +9 -8
  43. package/Charting/Visuals/SciChartSurfaceBase.js +5 -1
  44. package/Charting/Visuals/TextureManager/CanvasTexture.js +1 -7
  45. package/Charting3D/Visuals/Axis/AxisBase3D.d.ts +1 -1
  46. package/Core/BuildStamp.d.ts +1 -1
  47. package/Core/BuildStamp.js +2 -2
  48. package/Core/ObservableArray.d.ts +1 -1
  49. package/Core/ObservableArray.js +1 -1
  50. package/README.md +6 -1
  51. package/_wasm/scichart.browser.js +1 -1
  52. package/_wasm/scichart2d.js +1 -1
  53. package/_wasm/scichart2d.wasm +0 -0
  54. package/_wasm/scichart3d.js +1 -1
  55. package/_wasm/scichart3d.wasm +0 -0
  56. package/index.d.ts +1 -0
  57. package/index.dev.js +339 -119
  58. package/index.js +13 -11
  59. package/index.min.js +1 -1
  60. package/package.json +1 -1
  61. package/types/TSciChart.d.ts +19 -17
  62. package/types/TSciChart3D.d.ts +1 -0
@@ -43,6 +43,7 @@ var Pen2DCache_1 = require("../../Drawing/Pen2DCache");
43
43
  var SolidBrushCache_1 = require("../../Drawing/SolidBrushCache");
44
44
  var WebGlRenderContext2D_1 = require("../../Drawing/WebGlRenderContext2D");
45
45
  var DefaultTickCoordinatesProvider_1 = require("../../Numerics/TickCoordinateProviders/DefaultTickCoordinatesProvider");
46
+ var StaticTickCoordinatesProvider_1 = require("../../Numerics/TickCoordinateProviders/StaticTickCoordinatesProvider");
46
47
  var createNativeRect_1 = require("../Helpers/createNativeRect");
47
48
  var drawBorder_1 = require("../Helpers/drawBorder");
48
49
  var NativeObject_1 = require("../Helpers/NativeObject");
@@ -102,7 +103,7 @@ var AxisBase2D = /** @class */ (function (_super) {
102
103
  */
103
104
  function AxisBase2D(webAssemblyContext, options) {
104
105
  var _this = this;
105
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
106
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
106
107
  _this = _super.call(this, options) || this;
107
108
  /**
108
109
  * Gets the {@link AxisLayoutState} class which manages layout
@@ -142,6 +143,7 @@ var AxisBase2D = /** @class */ (function (_super) {
142
143
  _this.offsetOverrideProperty = undefined;
143
144
  _this.tickCache = undefined;
144
145
  _this.clipToXRangeProperty = true;
146
+ _this.isStaticAxisProperty = false;
145
147
  _this.webAssemblyContext2D = webAssemblyContext;
146
148
  _this.penCacheForMajorGridLines = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
147
149
  _this.penCacheForMinorGridLines = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
@@ -156,16 +158,18 @@ var AxisBase2D = /** @class */ (function (_super) {
156
158
  (_b = options === null || options === void 0 ? void 0 : options.hideOverlappingLabels) !== null && _b !== void 0 ? _b : _this.axisRenderer.hideOverlappingLabels;
157
159
  _this.axisRenderer.axisThickness = (_c = options === null || options === void 0 ? void 0 : options.axisThickness) !== null && _c !== void 0 ? _c : _this.axisRenderer.axisThickness;
158
160
  _this.axisTitleRenderer = new AxisTitleRenderer_1.AxisTitleRenderer(webAssemblyContext);
159
- _this.tickCoordinatesProvider = new DefaultTickCoordinatesProvider_1.DefaultTickCoordinatesProvider();
160
- _this.visibleRangeLimit = (_d = options === null || options === void 0 ? void 0 : options.visibleRangeLimit) !== null && _d !== void 0 ? _d : _this.visibleRangeLimit;
161
- _this.visibleRangeSizeLimit = (_e = options === null || options === void 0 ? void 0 : options.visibleRangeSizeLimit) !== null && _e !== void 0 ? _e : _this.visibleRangeSizeLimit;
161
+ _this.isStaticAxis = (_d = options === null || options === void 0 ? void 0 : options.isStaticAxis) !== null && _d !== void 0 ? _d : _this.isStaticAxisProperty;
162
+ // setting isStaticAxis sets the tickCoordinatesProvider
163
+ //this.tickCoordinatesProvider = new DefaultTickCoordinatesProvider();
164
+ _this.visibleRangeLimit = (_e = options === null || options === void 0 ? void 0 : options.visibleRangeLimit) !== null && _e !== void 0 ? _e : _this.visibleRangeLimit;
165
+ _this.visibleRangeSizeLimit = (_f = options === null || options === void 0 ? void 0 : options.visibleRangeSizeLimit) !== null && _f !== void 0 ? _f : _this.visibleRangeSizeLimit;
162
166
  _this.zoomExtentsRange = (options === null || options === void 0 ? void 0 : options.zoomExtentsToInitialRange) ? _this.visibleRange : options === null || options === void 0 ? void 0 : options.zoomExtentsRange;
163
- _this.axisAlignment = (_f = options === null || options === void 0 ? void 0 : options.axisAlignment) !== null && _f !== void 0 ? _f : _this.axisAlignment;
164
- _this.axisTitle = (_g = options === null || options === void 0 ? void 0 : options.axisTitle) !== null && _g !== void 0 ? _g : _this.axisTitle;
167
+ _this.axisAlignment = (_g = options === null || options === void 0 ? void 0 : options.axisAlignment) !== null && _g !== void 0 ? _g : _this.axisAlignment;
168
+ _this.axisTitle = (_h = options === null || options === void 0 ? void 0 : options.axisTitle) !== null && _h !== void 0 ? _h : _this.axisTitle;
165
169
  _this.labelStyle = _this.getlabelStyleProxy(__assign(__assign({}, _this.labelStyle), options === null || options === void 0 ? void 0 : options.labelStyle));
166
170
  _this.axisBorder = __assign(__assign({}, _this.axisBorder), options === null || options === void 0 ? void 0 : options.axisBorder);
167
- _this.isInnerAxis = (_h = options === null || options === void 0 ? void 0 : options.isInnerAxis) !== null && _h !== void 0 ? _h : _this.isInnerAxis;
168
- _this.stackedAxisLength = (_j = options === null || options === void 0 ? void 0 : options.stackedAxisLength) !== null && _j !== void 0 ? _j : _this.stackedAxisLength;
171
+ _this.isInnerAxis = (_j = options === null || options === void 0 ? void 0 : options.isInnerAxis) !== null && _j !== void 0 ? _j : _this.isInnerAxis;
172
+ _this.stackedAxisLength = (_k = options === null || options === void 0 ? void 0 : options.stackedAxisLength) !== null && _k !== void 0 ? _k : _this.stackedAxisLength;
169
173
  _this.solidBrushCacheBorder = new SolidBrushCache_1.SolidBrushCache(webAssemblyContext);
170
174
  if (options === null || options === void 0 ? void 0 : options.labelProvider) {
171
175
  if (!("getLabels" in (options === null || options === void 0 ? void 0 : options.labelProvider))) {
@@ -173,9 +177,9 @@ var AxisBase2D = /** @class */ (function (_super) {
173
177
  }
174
178
  }
175
179
  _this.autoRangeAnimationProperty = options === null || options === void 0 ? void 0 : options.autoRangeAnimation;
176
- _this.backgroundColor = (_k = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _k !== void 0 ? _k : _this.backgroundColor;
180
+ _this.backgroundColor = (_l = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _l !== void 0 ? _l : _this.backgroundColor;
177
181
  _this.offsetOverrideProperty = options === null || options === void 0 ? void 0 : options.overrideOffset; // undefined if not set
178
- _this.clipToXRangeProperty = (_l = options === null || options === void 0 ? void 0 : options.clipToXRange) !== null && _l !== void 0 ? _l : _this.clipToXRange;
182
+ _this.clipToXRangeProperty = (_m = options === null || options === void 0 ? void 0 : options.clipToXRange) !== null && _m !== void 0 ? _m : _this.clipToXRange;
179
183
  return _this;
180
184
  }
181
185
  Object.defineProperty(AxisBase2D.prototype, "labelProvider", {
@@ -595,6 +599,28 @@ var AxisBase2D = /** @class */ (function (_super) {
595
599
  enumerable: false,
596
600
  configurable: true
597
601
  });
602
+ Object.defineProperty(AxisBase2D.prototype, "isStaticAxis", {
603
+ /**
604
+ * Gets whether the gridlines and axis labels keep their initial position when the visible range changes.
605
+ */
606
+ get: function () {
607
+ return this.isStaticAxisProperty;
608
+ },
609
+ /**
610
+ * Sets whether the gridlines and axis labels keep their initial position when the visible range changes.
611
+ */
612
+ set: function (value) {
613
+ this.isStaticAxisProperty = value;
614
+ if (value) {
615
+ this.tickCoordinatesProvider = new StaticTickCoordinatesProvider_1.StaticTickCoordinatesProvider();
616
+ }
617
+ else {
618
+ this.tickCoordinatesProvider = new DefaultTickCoordinatesProvider_1.DefaultTickCoordinatesProvider();
619
+ }
620
+ },
621
+ enumerable: false,
622
+ configurable: true
623
+ });
598
624
  /** @inheritDoc */
599
625
  AxisBase2D.prototype.applyTheme = function (themeProvider) {
600
626
  var previousThemeProvider = this.parentSurface.previousThemeProvider;
@@ -1011,7 +1037,8 @@ var AxisBase2D = /** @class */ (function (_super) {
1011
1037
  // @ts-ignore
1012
1038
  labelProvider: this.labelProvider.toJSON(),
1013
1039
  keepLabelsWithinAxis: this.axisRenderer.keepLabelsWithinAxis,
1014
- clipToXRange: this.clipToXRange
1040
+ clipToXRange: this.clipToXRange,
1041
+ isStaticAxis: this.isStaticAxis
1015
1042
  };
1016
1043
  return { type: this.type, options: options };
1017
1044
  };
@@ -1207,13 +1234,15 @@ var AxisBase2D = /** @class */ (function (_super) {
1207
1234
  this.minorDeltaProperty = delta.min;
1208
1235
  this.majorDeltaProperty = delta.max;
1209
1236
  }
1237
+ // See if tickCoordinatesProvider has cached ticks (if isStaticAxis)
1238
+ var _c = this.tickCoordinatesProvider.getTickCoordinates(undefined, undefined), majorTickCoords = _c.majorTickCoords, minorTickCoords = _c.minorTickCoords, majorTickOverrides = _c.majorTickOverrides, minorTickOverRides = _c.minorTickOverRides;
1210
1239
  var majorTicks = this.drawLabels || this.drawMajorGridLines || this.drawMajorTickLines
1211
- ? this.tickProvider.getMajorTicks((_a = this.minorDeltaProperty) !== null && _a !== void 0 ? _a : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1240
+ ? majorTickOverrides !== null && majorTickOverrides !== void 0 ? majorTickOverrides : this.tickProvider.getMajorTicks((_a = this.minorDeltaProperty) !== null && _a !== void 0 ? _a : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1212
1241
  : [];
1213
1242
  var minorTicks = this.drawMinorGridLines || this.drawMinorTickLines
1214
- ? this.tickProvider.getMinorTicks((_b = this.minorDeltaProperty) !== null && _b !== void 0 ? _b : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1243
+ ? minorTickOverRides !== null && minorTickOverRides !== void 0 ? minorTickOverRides : this.tickProvider.getMinorTicks((_b = this.minorDeltaProperty) !== null && _b !== void 0 ? _b : this.majorDeltaProperty / this.minorsPerMajor, this.majorDeltaProperty, this.visibleRange)
1215
1244
  : [];
1216
- var _c = this.visibleRange, min_1 = _c.min, max_1 = _c.max;
1245
+ var _d = this.visibleRange, min_1 = _d.min, max_1 = _d.max;
1217
1246
  majorTicks = majorTicks.filter(function (t) { return t >= min_1 && t <= max_1; });
1218
1247
  minorTicks = minorTicks.filter(function (t) { return t >= min_1 && t <= max_1; });
1219
1248
  var majorTickLabels = [];
@@ -1226,9 +1255,9 @@ var AxisBase2D = /** @class */ (function (_super) {
1226
1255
  this.tickCache = {
1227
1256
  majorTicks: majorTicks,
1228
1257
  majorTickLabels: majorTickLabels,
1229
- majorTickCoords: null,
1258
+ majorTickCoords: majorTickCoords,
1230
1259
  minorTicks: minorTicks,
1231
- minorTickCoords: null
1260
+ minorTickCoords: minorTickCoords // probably undefined unless isStaticAxis
1232
1261
  };
1233
1262
  }
1234
1263
  return this.tickCache;
@@ -1237,9 +1266,12 @@ var AxisBase2D = /** @class */ (function (_super) {
1237
1266
  if (!this.tickCache) {
1238
1267
  this.getTicks(true);
1239
1268
  }
1240
- var _a = this.tickCoordinatesProvider.getTickCoordinates(this.tickCache.majorTicks, this.tickCache.minorTicks), majorTickCoords = _a.majorTickCoords, minorTickCoords = _a.minorTickCoords;
1241
- this.tickCache.majorTickCoords = majorTickCoords;
1242
- this.tickCache.minorTickCoords = minorTickCoords;
1269
+ if (this.tickCache.majorTickCoords === undefined) {
1270
+ var _a = this.tickCoordinatesProvider.getTickCoordinates(this.tickCache.majorTicks, this.tickCache.minorTicks), majorTickCoords = _a.majorTickCoords, minorTickCoords = _a.minorTickCoords;
1271
+ // tick values are never overridden at this point. If they could be, it would have been done in the call from measure.
1272
+ this.tickCache.majorTickCoords = majorTickCoords;
1273
+ this.tickCache.minorTickCoords = minorTickCoords;
1274
+ }
1243
1275
  return this.tickCache;
1244
1276
  };
1245
1277
  AxisBase2D.prototype.applyVisibleRangeLimit = function (visibleRange) {
@@ -784,7 +784,7 @@ export declare abstract class AxisCore extends DeletableEntity implements IAxisP
784
784
  /**
785
785
  * Gets the long dimension of the axis, in pixels
786
786
  */
787
- protected abstract getAxisSize(): number;
787
+ abstract getAxisSize(): number;
788
788
  /**
789
789
  * SET INTERNALLY. Sets whether this axis is an XAxis or not
790
790
  * @remarks
@@ -11,6 +11,7 @@ export declare class LogarithmicDeltaCalculator extends DeltaCalculator {
11
11
  * Gets or sets the logarithmic base. Defaults to 10
12
12
  */
13
13
  logarithmicBase: number;
14
+ isHighPrecisionTicks: boolean;
14
15
  private webAssemblyContext;
15
16
  /**
16
17
  * Creates an instance of the {@link LogarithmicDeltaCalculator}
@@ -36,6 +36,7 @@ var LogarithmicDeltaCalculator = /** @class */ (function (_super) {
36
36
  * Gets or sets the logarithmic base. Defaults to 10
37
37
  */
38
38
  _this.logarithmicBase = 10;
39
+ _this.isHighPrecisionTicks = true;
39
40
  _this.webAssemblyContext = webAssemblyContext;
40
41
  return _this;
41
42
  }
@@ -54,10 +55,18 @@ var LogarithmicDeltaCalculator = /** @class */ (function (_super) {
54
55
  min = max;
55
56
  max = temp;
56
57
  }
57
- var delta = this.webAssemblyContext.NiceLogScale.CalculateTickSpacing(min, max, this.logarithmicBase, minorsPerMajor, maxTicks);
58
- var tsDelta = new NumberRange_1.NumberRange(delta.minD, delta.maxD);
59
- delta.delete();
60
- return tsDelta;
58
+ if (this.isHighPrecisionTicks) {
59
+ var delta = this.webAssemblyContext.NiceLogScale.CalculateTickSpacing(min, max, this.logarithmicBase, minorsPerMajor, maxTicks);
60
+ var tsDelta = new NumberRange_1.NumberRange(delta.minD, delta.maxD);
61
+ delta.delete();
62
+ return tsDelta;
63
+ }
64
+ else {
65
+ var delta = this.webAssemblyContext.NiceLogScale.CalculateLowPrecisionTickSpacing(min, max, this.logarithmicBase, minorsPerMajor, maxTicks);
66
+ var tsDelta = new NumberRange_1.NumberRange(delta.minD, delta.maxD);
67
+ delta.delete();
68
+ return tsDelta;
69
+ }
61
70
  };
62
71
  return LogarithmicDeltaCalculator;
63
72
  }(DeltaCalculator_1.DeltaCalculator));
@@ -34,6 +34,8 @@ export interface ILogarithmicAxisOptions extends INumericAxisOptions {
34
34
  * the first linear minor tick would be more than 70% of the major tick)
35
35
  */
36
36
  minorTickMode?: ELogarithmicMinorTickMode;
37
+ /** If false, only ticks that are whole number multiples of the log base will be used */
38
+ isHighPrecisionTicks?: boolean;
37
39
  }
38
40
  /**
39
41
  * Creates an instance of a {@link LogarithmicAxis}
@@ -45,6 +47,7 @@ export declare class LogarithmicAxis extends AxisBase2D {
45
47
  readonly type = EAxisType.LogarithmicAxis;
46
48
  private logBaseProperty;
47
49
  private isNegativeProperty;
50
+ private isHighPrecisionTicksProperty;
48
51
  constructor(wasmContext: TSciChart, options?: ILogarithmicAxisOptions);
49
52
  /**
50
53
  * Gets or sets the Logarithmic Base for the axis. Defaults to 10
@@ -56,6 +59,8 @@ export declare class LogarithmicAxis extends AxisBase2D {
56
59
  set logBase(logBase: number);
57
60
  get isNegative(): boolean;
58
61
  set isNegative(isNegative: boolean);
62
+ get isHighPrecisionTicks(): boolean;
63
+ set isHighPrecisionTicks(isHighPrecisionTicks: boolean);
59
64
  getDefaultNonZeroRange(): NumberRange;
60
65
  hasValidVisibleRange(): boolean;
61
66
  get tickProvider(): TickProvider;
@@ -102,5 +107,5 @@ export declare class LogarithmicAxis extends AxisBase2D {
102
107
  protected getCurrentCoordinateCalculatorInternal(): CoordinateCalculatorBase;
103
108
  protected getMaxXRange(): NumberRange;
104
109
  private get logTickProvider();
105
- private updateLogarithmicBase;
110
+ private updateProviders;
106
111
  }
@@ -39,10 +39,11 @@ var LogarithmicAxis = /** @class */ (function (_super) {
39
39
  __extends(LogarithmicAxis, _super);
40
40
  function LogarithmicAxis(wasmContext, options) {
41
41
  var _this = this;
42
- var _a, _b, _c;
42
+ var _a, _b, _c, _d;
43
43
  _this = _super.call(this, wasmContext, options) || this;
44
44
  _this.type = AxisType_1.EAxisType.LogarithmicAxis;
45
45
  _this.logBaseProperty = 10;
46
+ _this.isHighPrecisionTicksProperty = true;
46
47
  _this.tickProvider = new LogarithmicTickProvider_1.LogarithmicTickProvider(wasmContext);
47
48
  _this.deltaCalculator = new LogarithmicDeltaCalculator_1.LogarithmicDeltaCalculator(wasmContext);
48
49
  _this.labelProvider =
@@ -52,6 +53,7 @@ var LogarithmicAxis = /** @class */ (function (_super) {
52
53
  _this.visibleRange = (options === null || options === void 0 ? void 0 : options.visibleRange) || _this.getDefaultNonZeroRange();
53
54
  _this.majorTickMode = (options === null || options === void 0 ? void 0 : options.majorTickMode) || _this.majorTickMode;
54
55
  _this.minorTickMode = (options === null || options === void 0 ? void 0 : options.minorTickMode) || _this.minorTickMode;
56
+ _this.isHighPrecisionTicks = (_d = options === null || options === void 0 ? void 0 : options.isHighPrecisionTicks) !== null && _d !== void 0 ? _d : _this.isHighPrecisionTicksProperty;
55
57
  if (options === null || options === void 0 ? void 0 : options.visibleRangeLimit) {
56
58
  _this.visibleRangeLimit = options.visibleRangeLimit;
57
59
  }
@@ -80,7 +82,7 @@ var LogarithmicAxis = /** @class */ (function (_super) {
80
82
  if (this.logBaseProperty !== logBase) {
81
83
  this.logBaseProperty = logBase;
82
84
  this.clearCoordCalcCache();
83
- this.updateLogarithmicBase(this.logBase);
85
+ this.updateProviders();
84
86
  this.notifyPropertyChanged(constants_1.PROPERTY.LOG_BASE);
85
87
  }
86
88
  },
@@ -104,6 +106,18 @@ var LogarithmicAxis = /** @class */ (function (_super) {
104
106
  enumerable: false,
105
107
  configurable: true
106
108
  });
109
+ Object.defineProperty(LogarithmicAxis.prototype, "isHighPrecisionTicks", {
110
+ get: function () {
111
+ return this.isHighPrecisionTicksProperty;
112
+ },
113
+ set: function (isHighPrecisionTicks) {
114
+ this.isHighPrecisionTicksProperty = isHighPrecisionTicks;
115
+ this.updateProviders();
116
+ this.notifyPropertyChanged(constants_1.PROPERTY.HIGH_PRECISION_TICKS);
117
+ },
118
+ enumerable: false,
119
+ configurable: true
120
+ });
107
121
  LogarithmicAxis.prototype.getDefaultNonZeroRange = function () {
108
122
  var adj = this.isNegativeProperty ? -1 : 1;
109
123
  return new NumberRange_1.NumberRange(adj * Math.pow(this.logBase, -1), adj * Math.pow(this.logBase, 2));
@@ -117,7 +131,7 @@ var LogarithmicAxis = /** @class */ (function (_super) {
117
131
  },
118
132
  set: function (tickProvider) {
119
133
  this.tickProviderProperty = tickProvider;
120
- this.updateLogarithmicBase(this.logBase);
134
+ this.updateProviders();
121
135
  this.notifyPropertyChanged(constants_1.PROPERTY.TICK_PROVIDER);
122
136
  },
123
137
  enumerable: false,
@@ -129,7 +143,7 @@ var LogarithmicAxis = /** @class */ (function (_super) {
129
143
  },
130
144
  set: function (deltaCalculator) {
131
145
  this.deltaCalculatorProperty = deltaCalculator;
132
- this.updateLogarithmicBase(this.logBase);
146
+ this.updateProviders();
133
147
  this.notifyPropertyChanged(constants_1.PROPERTY.DELTA_CALCULATOR);
134
148
  },
135
149
  enumerable: false,
@@ -141,7 +155,7 @@ var LogarithmicAxis = /** @class */ (function (_super) {
141
155
  },
142
156
  set: function (labelProvider) {
143
157
  this.labelProviderProperty = labelProvider;
144
- this.updateLogarithmicBase(this.logBase);
158
+ this.updateProviders();
145
159
  this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_PROVIDER);
146
160
  },
147
161
  enumerable: false,
@@ -268,7 +282,8 @@ var LogarithmicAxis = /** @class */ (function (_super) {
268
282
  logBase: this.logBase,
269
283
  isNegative: this.isNegative,
270
284
  majorTickMode: this.majorTickMode,
271
- minorTickMode: this.minorTickMode
285
+ minorTickMode: this.minorTickMode,
286
+ isHighPrecisionTicks: this.isHighPrecisionTicks
272
287
  };
273
288
  Object.assign(json.options, options);
274
289
  return json;
@@ -300,18 +315,20 @@ var LogarithmicAxis = /** @class */ (function (_super) {
300
315
  enumerable: false,
301
316
  configurable: true
302
317
  });
303
- LogarithmicAxis.prototype.updateLogarithmicBase = function (logBase) {
318
+ LogarithmicAxis.prototype.updateProviders = function () {
304
319
  var logTickProvider = this.tickProvider;
305
320
  if (logTickProvider) {
306
- logTickProvider.logarithmicBase = logBase;
321
+ logTickProvider.logarithmicBase = this.logBase;
322
+ logTickProvider.isHighPrecisionTicks = this.isHighPrecisionTicks;
307
323
  }
308
324
  var logDeltaCalculator = this.deltaCalculator;
309
325
  if (logDeltaCalculator) {
310
- logDeltaCalculator.logarithmicBase = logBase;
326
+ logDeltaCalculator.logarithmicBase = this.logBase;
327
+ logDeltaCalculator.isHighPrecisionTicks = this.isHighPrecisionTicks;
311
328
  }
312
329
  var logLabelProvider = this.labelProvider;
313
330
  if (logLabelProvider) {
314
- logLabelProvider.logarithmicBase = logBase;
331
+ logLabelProvider.logarithmicBase = this.logBase;
315
332
  }
316
333
  };
317
334
  return LogarithmicAxis;
@@ -46,5 +46,6 @@ export declare enum PROPERTY {
46
46
  TICK_PROVIDER = "TICK_PROVIDER",
47
47
  VIEW_RECT = "VIEW_RECT",
48
48
  ZOOMEXTENTS_RANGE = "ZOOMEXTENTS_RANGE",
49
- DRAW_ONLY_WITHIN_XRANGE = "DRAW_ONLY_WITHIN_XRANGE"
49
+ DRAW_ONLY_WITHIN_XRANGE = "DRAW_ONLY_WITHIN_XRANGE",
50
+ HIGH_PRECISION_TICKS = "HIGH_PRECISION_TICKS"
50
51
  }
@@ -51,4 +51,5 @@ var PROPERTY;
51
51
  PROPERTY["VIEW_RECT"] = "VIEW_RECT";
52
52
  PROPERTY["ZOOMEXTENTS_RANGE"] = "ZOOMEXTENTS_RANGE";
53
53
  PROPERTY["DRAW_ONLY_WITHIN_XRANGE"] = "DRAW_ONLY_WITHIN_XRANGE";
54
+ PROPERTY["HIGH_PRECISION_TICKS"] = "HIGH_PRECISION_TICKS";
54
55
  })(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSCRTPen = void 0;
4
4
  var app_1 = require("../../../constants/app");
5
+ var MemoryUsageHelper_1 = require("../../../utils/MemoryUsageHelper");
5
6
  var colorUtil_1 = require("../../../utils/colorUtil");
6
7
  var parseColor_1 = require("../../../utils/parseColor");
7
8
  /**
@@ -27,6 +28,13 @@ var createSCRTPen = function (wasmContext, htmlColorCode, strokeThickness, opaci
27
28
  if (strokeDashArray && strokeDashArray.length) {
28
29
  // Create a dashed pen
29
30
  var strokeDashFloatVector_1 = new wasmContext.FloatVector();
31
+ if (process.env.NODE_ENV !== "production") {
32
+ // prevent unnecessary warning
33
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
34
+ var vectorId = MemoryUsageHelper_1.MemoryUsageHelper.objectRegistry.getObjectId(strokeDashFloatVector_1);
35
+ MemoryUsageHelper_1.MemoryUsageHelper.unregister(vectorId);
36
+ }
37
+ }
30
38
  strokeDashArray.forEach(function (item) { return strokeDashFloatVector_1.push_back(item); });
31
39
  return wasmContext.SCRTCreateDahedPen(colorArgb, strokeThickness, antiAliased, strokeDashFloatVector_1);
32
40
  }
@@ -371,8 +371,21 @@ exports.getLegendItemHtml = getLegendItemHtml;
371
371
  var getLegendContainerHtml = function (placement, textColor, backgroundColor, margin, body) {
372
372
  if (!body)
373
373
  return "";
374
- var float = [ELegendPlacement.TopLeft, ELegendPlacement.BottomLeft].includes(placement) ? "left" : "right";
375
- var htmlStr = "<div class=\"scichart__legend\" style=\"height: 100%; display: flex; float: ".concat(float, "; text-align: center;\">");
374
+ //const float = [ELegendPlacement.TopLeft, ELegendPlacement.BottomLeft].includes(placement) ? "left" : "right";
375
+ var positionStyle = "";
376
+ if (placement === ELegendPlacement.TopLeft) {
377
+ positionStyle = "left: 0; top: 0;";
378
+ }
379
+ else if (placement === ELegendPlacement.TopRight) {
380
+ positionStyle = "right: 0; top: 0;";
381
+ }
382
+ else if (placement === ELegendPlacement.BottomLeft) {
383
+ positionStyle = "left: 0; bottom: 0;";
384
+ }
385
+ else if (placement === ELegendPlacement.BottomRight) {
386
+ positionStyle = "right: 0; bottom: 0;";
387
+ }
388
+ var htmlStr = "<div class=\"scichart__legend\" style=\"height: 100%; position: absolute; display: flex; ".concat(positionStyle, " text-align: center;\">");
376
389
  var alignSelf = [ELegendPlacement.TopLeft, ELegendPlacement.TopRight].includes(placement)
377
390
  ? "flex-start"
378
391
  : "flex-end";
@@ -91,6 +91,7 @@ export declare abstract class BaseRenderableSeries extends DeletableEntity imple
91
91
  private isHoveredProperty;
92
92
  private resamplingModeProperty;
93
93
  private resamplingPrecisionProperty;
94
+ private clipToYRangeProperty;
94
95
  /**
95
96
  * Creates an instance of the {@link BaseRenderableSeries}
96
97
  * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
@@ -186,6 +187,12 @@ export declare abstract class BaseRenderableSeries extends DeletableEntity imple
186
187
  */
187
188
  get resamplingPrecision(): number;
188
189
  set resamplingPrecision(value: number);
190
+ /**
191
+ * If true, the drawing will be clipped to the visibleRange of the associated Y Axis.
192
+ * 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
193
+ */
194
+ get clipToYRange(): boolean;
195
+ set clipToYRange(value: boolean);
189
196
  /** @inheritDoc */
190
197
  get isSpline(): boolean;
191
198
  /** @inheritDoc */
@@ -50,6 +50,7 @@ var SeriesHoveredArgs_1 = require("./SeriesHoveredArgs");
50
50
  var SeriesSelectedArgs_1 = require("./SeriesSelectedArgs");
51
51
  var SeriesVisibleChangedArgs_1 = require("./SeriesVisibleChangedArgs");
52
52
  var DataLabelProviderType_1 = require("../../../types/DataLabelProviderType");
53
+ var Rect_1 = require("../../../Core/Rect");
53
54
  var DeletableEntity_1 = require("../../../Core/DeletableEntity");
54
55
  var XyzSeriesInfo_1 = require("../../Model/ChartData/XyzSeriesInfo");
55
56
  /**
@@ -72,7 +73,7 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
72
73
  */
73
74
  function BaseRenderableSeries(webAssemblyContext, options) {
74
75
  var _this = this;
75
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
76
77
  _this = _super.call(this) || this;
77
78
  /** @inheritDoc */
78
79
  _this.rolloverModifierProps = new RolloverModifierRenderableSeriesProps_1.RolloverModifierRenderableSeriesProps(_this);
@@ -99,6 +100,7 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
99
100
  _this.isDigitalLineProperty = false;
100
101
  _this.resamplingModeProperty = ResamplingMode_1.EResamplingMode.Auto;
101
102
  _this.resamplingPrecisionProperty = 0;
103
+ _this.clipToYRangeProperty = false;
102
104
  _this.isStacked = false;
103
105
  _this.webAssemblyContext = webAssemblyContext;
104
106
  _this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
@@ -155,6 +157,7 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
155
157
  _this.hitTestProvider = _this.newHitTestProvider();
156
158
  _this.isSelected = (_q = options === null || options === void 0 ? void 0 : options.isSelected) !== null && _q !== void 0 ? _q : false;
157
159
  _this.isHovered = (_r = options === null || options === void 0 ? void 0 : options.isHovered) !== null && _r !== void 0 ? _r : false;
160
+ _this.clipToYRangeProperty = (_s = options === null || options === void 0 ? void 0 : options.clipToYRange) !== null && _s !== void 0 ? _s : _this.clipToYRangeProperty;
158
161
  if (options === null || options === void 0 ? void 0 : options.onIsVisibleChanged) {
159
162
  if (typeof options.onIsVisibleChanged === "string") {
160
163
  _this.typeMap.set("onIsVisibleChanged", options.onIsVisibleChanged);
@@ -563,6 +566,23 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
563
566
  enumerable: false,
564
567
  configurable: true
565
568
  });
569
+ Object.defineProperty(BaseRenderableSeries.prototype, "clipToYRange", {
570
+ /**
571
+ * If true, the drawing will be clipped to the visibleRange of the associated Y Axis.
572
+ * 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
573
+ */
574
+ get: function () {
575
+ return this.clipToYRangeProperty;
576
+ },
577
+ set: function (value) {
578
+ if (this.clipToYRangeProperty !== value) {
579
+ this.clipToYRangeProperty = value;
580
+ this.notifyPropertyChanged(constants_1.PROPERTY.CLIPTOYRANGE);
581
+ }
582
+ },
583
+ enumerable: false,
584
+ configurable: true
585
+ });
566
586
  Object.defineProperty(BaseRenderableSeries.prototype, "isSpline", {
567
587
  /** @inheritDoc */
568
588
  get: function () {
@@ -573,29 +593,33 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
573
593
  });
574
594
  /** @inheritDoc */
575
595
  BaseRenderableSeries.prototype.draw = function (renderContext, renderPassData) {
576
- var _a;
596
+ var _a, _b;
577
597
  this.currentRenderPassData = renderPassData;
578
598
  (_a = this.hitTestProvider) === null || _a === void 0 ? void 0 : _a.update(renderPassData);
579
599
  if (this.canDraw) {
580
- // const nativeContext = renderContext.getNativeContext();
581
- // const viewRect = this.parentSurface.seriesViewRect;
600
+ var nativeContext = renderContext.getNativeContext();
601
+ var viewRect = (_b = this.parentSurface) === null || _b === void 0 ? void 0 : _b.seriesViewRect;
582
602
  try {
583
603
  renderContext.pushShaderEffect(this.effect);
584
- // This is prep for clipping series to the axis range. Need to add an option to AxisBase to drive it.
585
- // need to handle case where clipping is only set for one axis
586
- // const { offset: x, viewportDimension: width } = renderPassData.xCoordinateCalculator;
587
- // const { offset: y, viewportDimension: height } = renderPassData.yCoordinateCalculator;
588
- // if (renderPassData.isVerticalChart) {
589
- // const clipRect = new Rect(viewRect.x + y, viewRect.y + x, height, width);
590
- // nativeContext.SetClipRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
591
- // } else {
592
- // const clipRect = new Rect(viewRect.x + x, viewRect.y + y, width, height);
593
- // nativeContext.SetClipRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
594
- // }
604
+ if (this.clipToYRange) {
605
+ var _c = renderPassData.xCoordinateCalculator, x = _c.offset, width = _c.viewportDimension;
606
+ var _d = renderPassData.yCoordinateCalculator, y = _d.offset, height = _d.viewportDimension;
607
+ if (renderPassData.isVerticalChart) {
608
+ var clipRect = new Rect_1.Rect(viewRect.x + y, viewRect.y + x, height, width);
609
+ nativeContext.SetClipRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
610
+ }
611
+ else {
612
+ var clipRect = new Rect_1.Rect(viewRect.x + x, viewRect.y + y, width, height);
613
+ nativeContext.SetClipRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
614
+ }
615
+ }
595
616
  this.drawingProviders.forEach(function (dp) { return dp.draw(renderContext, renderPassData); });
596
617
  }
597
618
  finally {
598
- //nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
619
+ if (this.clipToYRange) {
620
+ // Reset clip rect
621
+ nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
622
+ }
599
623
  renderContext.popShaderEffect();
600
624
  }
601
625
  if (this.dataLabelProvider) {
@@ -774,6 +798,7 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
774
798
  animation: this.animation,
775
799
  resamplingMode: this.resamplingMode,
776
800
  resamplingPrecision: this.resamplingPrecision,
801
+ clipToYRange: this.clipToYRange,
777
802
  // @ts-ignore
778
803
  dataLabelProvider: (_c = this.dataLabelProvider) === null || _c === void 0 ? void 0 : _c.toJSON()
779
804
  // onSelectedChanged: this.onSelectedChanged
@@ -271,7 +271,7 @@ var DataLabelProvider = /** @class */ (function (_super) {
271
271
  var firstlabel = this.getText(state);
272
272
  var bounds = (0, NativeObject_1.getTextBounds)(this.webAssemblyContext);
273
273
  state.font.CalculateStringBounds(firstlabel !== null && firstlabel !== void 0 ? firstlabel : "", bounds, (_b = (_a = this.style) === null || _a === void 0 ? void 0 : _a.lineSpacing) !== null && _b !== void 0 ? _b : 2);
274
- return state.pointGap > bounds.m_fWidth * this.pointGapThreshold;
274
+ return state.pointGap >= bounds.m_fWidth * this.pointGapThreshold;
275
275
  };
276
276
  DataLabelProvider.prototype.getPosition = function (state, textBounds) {
277
277
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -83,12 +83,23 @@ var ScatterSeriesHitTestProvider = /** @class */ (function (_super) {
83
83
  var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
84
84
  var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
85
85
  if (nearestPointIndex >= 0) {
86
- var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
87
- var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
88
- var xFirstCoord = xCoordinateCalculator.getCoordinate(xFirstValue);
89
- var xLastValue = isCategoryAxis ? xNativeValues.size() - 1 : xNativeValues.get(xNativeValues.size() - 1);
90
- var xLastCoord = xCoordinateCalculator.getCoordinate(xLastValue);
91
86
  var width = this.parentSeries.pointMarker.width;
87
+ var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
88
+ var xFirstCoord = void 0;
89
+ var xLastCoord = void 0;
90
+ if (dataSeries.dataDistributionCalculator.isSortedAscending) {
91
+ var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
92
+ xFirstCoord = xCoordinateCalculator.getCoordinate(xFirstValue);
93
+ var xLastValue = isCategoryAxis
94
+ ? xNativeValues.size() - 1
95
+ : xNativeValues.get(xNativeValues.size() - 1);
96
+ xLastCoord = xCoordinateCalculator.getCoordinate(xLastValue);
97
+ }
98
+ else {
99
+ var xRange = dataSeries.getXRange();
100
+ xFirstCoord = xCoordinateCalculator.getCoordinate(xRange.min);
101
+ xLastCoord = xCoordinateCalculator.getCoordinate(xRange.max);
102
+ }
92
103
  hitTestInfo.isWithinDataBounds = (0, pointUtil_1.testIsInInterval)(xHitCoord, xFirstCoord, xLastCoord, width / 2);
93
104
  hitTestInfo.isHit = hitTestInfo.isWithinDataBounds;
94
105
  }
@@ -180,4 +180,9 @@ export interface IBaseRenderableSeriesOptions {
180
180
  * A {@link SeriesTextProvider} used for creating and drawing per-point text.
181
181
  */
182
182
  dataLabelProvider?: BaseDataLabelProvider | TDataLabelProviderDefinition;
183
+ /**
184
+ * If true, the drawing will be clipped to the visibleRange of the associated Y Axis.
185
+ * 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
+ clipToYRange?: boolean;
183
188
  }
@@ -126,9 +126,14 @@ var RolloverModifierRenderableSeriesProps = /** @class */ (function () {
126
126
  configurable: true
127
127
  });
128
128
  RolloverModifierRenderableSeriesProps.prototype.delete = function () {
129
+ var _a, _b;
129
130
  this.rolloverModifier = undefined;
130
- this.marker = (0, Deleter_1.deleteSafe)(this.marker);
131
- this.tooltip = (0, Deleter_1.deleteSafe)(this.tooltip);
131
+ if (!((_a = this.marker) === null || _a === void 0 ? void 0 : _a.isDeleted)) {
132
+ this.marker = (0, Deleter_1.deleteSafe)(this.marker);
133
+ }
134
+ if (!((_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.isDeleted)) {
135
+ this.tooltip = (0, Deleter_1.deleteSafe)(this.tooltip);
136
+ }
132
137
  };
133
138
  RolloverModifierRenderableSeriesProps.prototype.notifyPropertyChanged = function (propertyName) {
134
139
  if (this.invalidateParentCallback) {
@@ -61,5 +61,6 @@ export declare enum PROPERTY {
61
61
  Z_MIN = "Z_MIN",
62
62
  Z_MULTIPLIER = "Z_MULTIPLIER",
63
63
  Z_LABEL_PROVIDER = "Z_LABEL_PROVIDER",
64
- SERIES_TEXT_PROVIDER = "SERIES_TEXT_PROVIDER"
64
+ SERIES_TEXT_PROVIDER = "SERIES_TEXT_PROVIDER",
65
+ CLIPTOYRANGE = "CLIPTOYRANGE"
65
66
  }
@@ -66,4 +66,5 @@ var PROPERTY;
66
66
  PROPERTY["Z_MULTIPLIER"] = "Z_MULTIPLIER";
67
67
  PROPERTY["Z_LABEL_PROVIDER"] = "Z_LABEL_PROVIDER";
68
68
  PROPERTY["SERIES_TEXT_PROVIDER"] = "SERIES_TEXT_PROVIDER";
69
+ PROPERTY["CLIPTOYRANGE"] = "CLIPTOYRANGE";
69
70
  })(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));