scichart 3.0.300 → 3.0.317

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 (39) hide show
  1. package/Charting/ChartModifiers/ChartModifierBase.d.ts +2 -1
  2. package/Charting/ChartModifiers/ChartModifierBase.js +2 -1
  3. package/Charting/ChartModifiers/ChartModifierBase2D.d.ts +6 -0
  4. package/Charting/ChartModifiers/ChartModifierBase2D.js +9 -6
  5. package/Charting/ChartModifiers/CustomChartModifier2D.d.ts +16 -0
  6. package/Charting/ChartModifiers/CustomChartModifier2D.js +40 -0
  7. package/Charting/ChartModifiers/LegendModifier.d.ts +1 -1
  8. package/Charting/ChartModifiers/YAxisDragModifier.d.ts +3 -1
  9. package/Charting/Services/SciChartRenderer.js +6 -1
  10. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +12 -1
  11. package/Charting/Visuals/Annotations/AnnotationBase.js +25 -2
  12. package/Charting/Visuals/Annotations/BoxAnnotation.js +1 -1
  13. package/Charting/Visuals/Axis/AxisRenderer.d.ts +0 -1
  14. package/Charting/Visuals/Axis/AxisRenderer.js +5 -5
  15. package/Charting/Visuals/SciChartSurface.js +1 -1
  16. package/Charting3D/ChartModifiers/ChartModifierBase3D.d.ts +18 -0
  17. package/Charting3D/ChartModifiers/ChartModifierBase3D.js +8 -1
  18. package/Charting3D/ChartModifiers/CustomChartModifier3D.d.ts +16 -0
  19. package/Charting3D/ChartModifiers/CustomChartModifier3D.js +40 -0
  20. package/Charting3D/ChartModifiers/MouseWheelZoomModifier3D.d.ts +7 -5
  21. package/Charting3D/ChartModifiers/MouseWheelZoomModifier3D.js +9 -4
  22. package/Charting3D/ChartModifiers/OrbitModifier3D.d.ts +11 -5
  23. package/Charting3D/ChartModifiers/OrbitModifier3D.js +7 -5
  24. package/Charting3D/ChartModifiers/ResetCamera3DModifier.d.ts +11 -8
  25. package/Charting3D/ChartModifiers/ResetCamera3DModifier.js +16 -8
  26. package/Core/BuildStamp.d.ts +1 -1
  27. package/Core/BuildStamp.js +2 -2
  28. package/_wasm/scichart.browser.js +1 -1
  29. package/_wasm/scichart2d.js +1 -1
  30. package/_wasm/scichart2d.wasm +0 -0
  31. package/_wasm/scichart3d.js +10 -10
  32. package/_wasm/scichart3d.wasm +0 -0
  33. package/index.d.ts +3 -0
  34. package/index.js +17 -13
  35. package/index.min.js +1 -1
  36. package/package.json +1 -1
  37. package/types/ChartModifierType.d.ts +2 -1
  38. package/types/ChartModifierType.js +1 -0
  39. package/utils/imageUtil.js +1 -0
@@ -166,8 +166,9 @@ export declare abstract class ChartModifierBase<TSurfaceType extends SciChartSur
166
166
  protected mousePoint: Point;
167
167
  protected executeOnProperty: EExecuteOn;
168
168
  private parentSurfaceProperty;
169
- constructor(options?: {
169
+ protected constructor(options?: {
170
170
  id?: string;
171
+ executeOn?: EExecuteOn;
171
172
  });
172
173
  /** @inheritDoc */
173
174
  applyTheme(themeProvider: IThemeProvider): void;
@@ -17,10 +17,11 @@ var EModifierType;
17
17
  */
18
18
  var ChartModifierBase = /** @class */ (function () {
19
19
  function ChartModifierBase(options) {
20
- var _a;
20
+ var _a, _b;
21
21
  this.isEnabledProperty = true;
22
22
  this.executeOnProperty = ExecuteOn_1.EExecuteOn.MouseLeftButton;
23
23
  this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
24
+ this.executeOnProperty = (_b = options === null || options === void 0 ? void 0 : options.executeOn) !== null && _b !== void 0 ? _b : this.executeOn;
24
25
  }
25
26
  /** @inheritDoc */
26
27
  ChartModifierBase.prototype.applyTheme = function (themeProvider) {
@@ -45,6 +45,9 @@ export interface IChartModifierBaseOptions {
45
45
  * to SciChart - High Performance Realtime {@link https://www.scichart.com/javascript-chart-features | 2D JavaScript Charts}
46
46
  */
47
47
  export declare abstract class ChartModifierBase2D extends ChartModifierBase<SciChartSurface> {
48
+ /**
49
+ * The type of chartmodifier. See {@link EChart2DModifierType} for available options
50
+ */
48
51
  abstract readonly type: EChart2DModifierType | string;
49
52
  xyDirection: EXyDirection;
50
53
  protected changedPropertiesList: string[];
@@ -74,6 +77,9 @@ export declare abstract class ChartModifierBase2D extends ChartModifierBase<SciC
74
77
  * @remarks This function allows mocking in tests
75
78
  */
76
79
  getAllSeries(): IRenderableSeries[];
80
+ /**
81
+ * @inheritDoc
82
+ */
77
83
  toJSON(): {
78
84
  type: string;
79
85
  options: Required<Omit<IChartModifierBaseOptions, never>>;
@@ -33,7 +33,7 @@ var ChartModifierBase2D = /** @class */ (function (_super) {
33
33
  */
34
34
  function ChartModifierBase2D(options) {
35
35
  var _this = this;
36
- var _a, _b, _c, _d, _e;
36
+ var _a, _b, _c, _d;
37
37
  _this = _super.call(this, options) || this;
38
38
  _this.xyDirection = XyDirection_1.EXyDirection.XyDirection;
39
39
  _this.changedPropertiesList = [];
@@ -41,11 +41,10 @@ var ChartModifierBase2D = /** @class */ (function (_super) {
41
41
  _this.yAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
42
42
  // used to track if registered types were used for function properties, so they can be serialized
43
43
  _this.typeMap = new Map();
44
- _this.executeOn = (_a = options === null || options === void 0 ? void 0 : options.executeOn) !== null && _a !== void 0 ? _a : _this.executeOn;
45
- _this.xyDirection = (_b = options === null || options === void 0 ? void 0 : options.xyDirection) !== null && _b !== void 0 ? _b : _this.xyDirection;
46
- _this.modifierGroup = (_c = options === null || options === void 0 ? void 0 : options.modifierGroup) !== null && _c !== void 0 ? _c : _this.modifierGroup;
47
- _this.xAxisIdProperty = (_d = options === null || options === void 0 ? void 0 : options.xAxisId) !== null && _d !== void 0 ? _d : _this.xAxisIdProperty;
48
- _this.yAxisIdProperty = (_e = options === null || options === void 0 ? void 0 : options.yAxisId) !== null && _e !== void 0 ? _e : _this.yAxisIdProperty;
44
+ _this.xyDirection = (_a = options === null || options === void 0 ? void 0 : options.xyDirection) !== null && _a !== void 0 ? _a : _this.xyDirection;
45
+ _this.modifierGroup = (_b = options === null || options === void 0 ? void 0 : options.modifierGroup) !== null && _b !== void 0 ? _b : _this.modifierGroup;
46
+ _this.xAxisIdProperty = (_c = options === null || options === void 0 ? void 0 : options.xAxisId) !== null && _c !== void 0 ? _c : _this.xAxisIdProperty;
47
+ _this.yAxisIdProperty = (_d = options === null || options === void 0 ? void 0 : options.yAxisId) !== null && _d !== void 0 ? _d : _this.yAxisIdProperty;
49
48
  return _this;
50
49
  }
51
50
  Object.defineProperty(ChartModifierBase2D.prototype, "modifierType", {
@@ -92,6 +91,9 @@ var ChartModifierBase2D = /** @class */ (function (_super) {
92
91
  ChartModifierBase2D.prototype.getAllSeries = function () {
93
92
  return this.parentSurface.renderableSeries.asArray();
94
93
  };
94
+ /**
95
+ * @inheritDoc
96
+ */
95
97
  ChartModifierBase2D.prototype.toJSON = function () {
96
98
  var options = {
97
99
  id: this.id,
@@ -110,6 +112,7 @@ var ChartModifierBase2D = /** @class */ (function (_super) {
110
112
  if (!this.changedPropertiesList.includes(propertyName)) {
111
113
  this.changedPropertiesList.push(propertyName);
112
114
  }
115
+ _super.prototype.notifyPropertyChanged.call(this, propertyName);
113
116
  };
114
117
  /**
115
118
  * Grows the Axis by a fraction around the mouse point
@@ -0,0 +1,16 @@
1
+ import { EChart2DModifierType } from "../../types/ChartModifierType";
2
+ import { ChartModifierBase2D, IChartModifierBaseOptions } from "./ChartModifierBase2D";
3
+ /**
4
+ * Base class for custom Chart Modifiers (allows custom zooming, panning, interaction behaviour) on 2D Charts
5
+ */
6
+ export declare class CustomChartModifier2D extends ChartModifierBase2D {
7
+ /**
8
+ * @inheritDoc
9
+ */
10
+ readonly type: EChart2DModifierType;
11
+ /**
12
+ * @inheritDoc
13
+ * @param options
14
+ */
15
+ constructor(options?: IChartModifierBaseOptions);
16
+ }
@@ -0,0 +1,40 @@
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.CustomChartModifier2D = void 0;
19
+ var ChartModifierType_1 = require("../../types/ChartModifierType");
20
+ var ChartModifierBase2D_1 = require("./ChartModifierBase2D");
21
+ /**
22
+ * Base class for custom Chart Modifiers (allows custom zooming, panning, interaction behaviour) on 2D Charts
23
+ */
24
+ var CustomChartModifier2D = /** @class */ (function (_super) {
25
+ __extends(CustomChartModifier2D, _super);
26
+ /**
27
+ * @inheritDoc
28
+ * @param options
29
+ */
30
+ function CustomChartModifier2D(options) {
31
+ var _this = _super.call(this, options) || this;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ _this.type = ChartModifierType_1.EChart2DModifierType.Custom;
36
+ return _this;
37
+ }
38
+ return CustomChartModifier2D;
39
+ }(ChartModifierBase2D_1.ChartModifierBase2D));
40
+ exports.CustomChartModifier2D = CustomChartModifier2D;
@@ -105,7 +105,7 @@ export declare class LegendModifier extends ChartModifierBase2D implements IIncl
105
105
  getIncludedRenderableSeries(): IRenderableSeries[];
106
106
  /** @inheritDoc */
107
107
  toJSON(): {
108
- type: string;
108
+ type: string; /** @inheritDoc */
109
109
  options: Required<Omit<IChartModifierBaseOptions, never>>;
110
110
  };
111
111
  /** @inheritDoc */
@@ -72,7 +72,9 @@ export declare class YAxisDragModifier extends ChartModifierBase2D implements II
72
72
  */
73
73
  modifierMouseUp(args: ModifierMouseArgs): void;
74
74
  toJSON(): {
75
- type: string;
75
+ type: string; /**
76
+ * @inheritDoc
77
+ */
76
78
  options: Required<Omit<IChartModifierBaseOptions, never>>;
77
79
  };
78
80
  protected updateCursor(mousePoint: Point): void;
@@ -180,7 +180,12 @@ var SciChartRenderer = /** @class */ (function () {
180
180
  });
181
181
  this.drawSvgAnnotations(svgAnnotations, xAxesById, yAxesById, this.sciChartSurface.getCoordSvgTranslation());
182
182
  // Update watermark
183
- this.updateWatermark(renderContext, seriesViewRect);
183
+ if (!this.sciChartSurface.isSubSurface) {
184
+ this.updateWatermark(renderContext, seriesViewRect);
185
+ }
186
+ else if (renderContext.doDraw) {
187
+ this.updateWatermark(renderContext, this.sciChartSurface.parentSurface.seriesViewRect);
188
+ }
184
189
  // Step 10 Call OnParentSurfaceRendered
185
190
  this.onParentSurfaceRendered();
186
191
  if (!app_1.IS_TEST_ENV) {
@@ -10,6 +10,9 @@ import { AnnotationClickEventArgs } from "./AnnotationClickEventArgs";
10
10
  import { AnnotationDragDeltaEventArgs } from "./AnnotationDragDeltaEventArgs";
11
11
  import { IAdornerProvider } from "./IAdornerProvider";
12
12
  import { EAnnotationLayer, EAnnotationType, IAnnotation } from "./IAnnotation";
13
+ /**
14
+ * Defines possible parts of an annotation which could be interacted with a cursor to do dragging or resizing
15
+ */
13
16
  export declare enum EDraggingGripPoint {
14
17
  /** x1,y1 */
15
18
  x1y1 = "x1y1",
@@ -232,9 +235,9 @@ export declare abstract class AnnotationBase implements IAnnotation, IAdornerPro
232
235
  readonly isSvgAnnotation: boolean;
233
236
  /** @inheritDoc */
234
237
  invalidateParentCallback: () => void;
235
- adornerDraggingPoint: EDraggingGripPoint;
236
238
  selectedChanged: EventHandler<boolean>;
237
239
  clicked: EventHandler<AnnotationClickEventArgs>;
240
+ protected adornerDraggingPointProperty: EDraggingGripPoint;
238
241
  protected svgAdorner: SVGElement;
239
242
  protected prevIsSelected: boolean;
240
243
  /** the annotation absolute coordinates */
@@ -277,6 +280,14 @@ export declare abstract class AnnotationBase implements IAnnotation, IAdornerPro
277
280
  get annotationLayer(): EAnnotationLayer;
278
281
  /** @inheritDoc */
279
282
  set annotationLayer(annotationCanvas: EAnnotationLayer);
283
+ /**
284
+ * Gets or sets current {@link EDraggingGripPoint}
285
+ */
286
+ get adornerDraggingPoint(): EDraggingGripPoint;
287
+ /**
288
+ * Gets or sets current {@link EDraggingGripPoint}
289
+ */
290
+ protected set adornerDraggingPoint(value: EDraggingGripPoint);
280
291
  /** @inheritDoc */
281
292
  get parentSurface(): SciChartSurface;
282
293
  /** @inheritDoc */
@@ -16,6 +16,9 @@ var AnnotationClickEventArgs_1 = require("./AnnotationClickEventArgs");
16
16
  var AnnotationDragDeltaEventArgs_1 = require("./AnnotationDragDeltaEventArgs");
17
17
  var constants_1 = require("./constants");
18
18
  var IAnnotation_1 = require("./IAnnotation");
19
+ /**
20
+ * Defines possible parts of an annotation which could be interacted with a cursor to do dragging or resizing
21
+ */
19
22
  var EDraggingGripPoint;
20
23
  (function (EDraggingGripPoint) {
21
24
  /** x1,y1 */
@@ -177,6 +180,28 @@ var AnnotationBase = /** @class */ (function () {
177
180
  enumerable: false,
178
181
  configurable: true
179
182
  });
183
+ Object.defineProperty(AnnotationBase.prototype, "adornerDraggingPoint", {
184
+ /**
185
+ * Gets or sets current {@link EDraggingGripPoint}
186
+ */
187
+ get: function () {
188
+ return this.adornerDraggingPointProperty;
189
+ },
190
+ /**
191
+ * Gets or sets current {@link EDraggingGripPoint}
192
+ */
193
+ set: function (value) {
194
+ var _a;
195
+ if (this.adornerDraggingPointProperty !== value) {
196
+ this.adornerDraggingPointProperty = value;
197
+ if (value) {
198
+ (_a = this.dragStarted) === null || _a === void 0 ? void 0 : _a.raiseEvent();
199
+ }
200
+ }
201
+ },
202
+ enumerable: false,
203
+ configurable: true
204
+ });
180
205
  Object.defineProperty(AnnotationBase.prototype, "parentSurface", {
181
206
  /** @inheritDoc */
182
207
  get: function () {
@@ -563,8 +588,6 @@ var AnnotationBase = /** @class */ (function () {
563
588
  };
564
589
  AnnotationBase.prototype.calcDragDistance = function (xyPoint) { };
565
590
  AnnotationBase.prototype.onDragStarted = function (args) {
566
- var _a;
567
- (_a = this.dragStarted) === null || _a === void 0 ? void 0 : _a.raiseEvent();
568
591
  return false;
569
592
  };
570
593
  AnnotationBase.prototype.checkIsClickedOnAnnotation = function (x, y) {
@@ -166,7 +166,7 @@ var BoxAnnotation = /** @class */ (function (_super) {
166
166
  _super.prototype.onDragStarted.call(this, args);
167
167
  var _a = this.getAnnotationBorders(false, true), x1 = _a.x1, x2 = _a.x2, y1 = _a.y1, y2 = _a.y2;
168
168
  var _b = annotationHelpers_1.annotationHelpers.calcNewApex(x1, y1, x2, y2, this.isVerticalChart), x1y1 = _b.x1y1, x2y1 = _b.x2y1, x1y2 = _b.x1y2, x2y2 = _b.x2y2;
169
- var xyMousePoint = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(args.mousePoint.x, args.mousePoint.y), this.parentSurface.seriesViewRect);
169
+ var xyMousePoint = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(args.mousePoint.x, args.mousePoint.y), this.parentSurface.seriesViewRect, true);
170
170
  if (x1y1 && this.canDragPoint(AnnotationBase_1.EDraggingGripPoint.x1y1)) {
171
171
  var dist = (0, pointUtil_1.calcDistance)(x1y1.x, x1y1.y, xyMousePoint.x, xyMousePoint.y);
172
172
  if (dist < this.annotationsGripsRadius * DpiHelper_1.DpiHelper.PIXEL_RATIO) {
@@ -25,7 +25,6 @@ export declare class AxisRenderer implements IDeletable {
25
25
  private measureTextCanvas;
26
26
  private keepLabelsWithinAxisProperty;
27
27
  private hideOverlappingLabelsProperty;
28
- private vertices;
29
28
  /**
30
29
  * Creates an instance of a {@link AxisRenderer}
31
30
  * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
@@ -46,7 +46,6 @@ var AxisRenderer = /** @class */ (function () {
46
46
  this.hideOverlappingLabelsProperty = true;
47
47
  this.webAssemblyContext = webAssemblyContext;
48
48
  this.textureManager = new TextureManager_1.TextureManager(webAssemblyContext);
49
- this.vertices = (0, NativeObject_1.getVectorColorVertex)(webAssemblyContext);
50
49
  if (!app_1.IS_TEST_ENV) {
51
50
  this.measureTextCanvas = document.createElement("canvas");
52
51
  this.measureTextCanvas.width = 1;
@@ -389,7 +388,8 @@ var AxisRenderer = /** @class */ (function () {
389
388
  return;
390
389
  var viewRect = this.viewRect;
391
390
  var tickSize = tickStyle.tickSize;
392
- this.vertices.clear();
391
+ var vertices = (0, NativeObject_1.getVectorColorVertex)(this.webAssemblyContext);
392
+ vertices.clear();
393
393
  var isHorizontal = (0, AxisAlignment_1.getIsHorizontal)(axisAlignment);
394
394
  if (isHorizontal === undefined) {
395
395
  return;
@@ -425,13 +425,13 @@ var AxisRenderer = /** @class */ (function () {
425
425
  }
426
426
  }
427
427
  var vertex = (0, NativeObject_1.getVertex)(_this.webAssemblyContext, x1, y1);
428
- _this.vertices.push_back(vertex);
428
+ vertices.push_back(vertex);
429
429
  var vertex2 = (0, NativeObject_1.getVertex)(_this.webAssemblyContext, x2, y2);
430
- _this.vertices.push_back(vertex2);
430
+ vertices.push_back(vertex2);
431
431
  });
432
432
  var leftOffset = viewRect.left - (isHorizontal ? axisOffset : 0);
433
433
  var topOffset = viewRect.top - (isHorizontal ? 0 : axisOffset);
434
- renderContext.drawLinesNative(this.vertices, pen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, leftOffset, topOffset);
434
+ renderContext.drawLinesNative(vertices, pen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, leftOffset, topOffset);
435
435
  };
436
436
  /**
437
437
  * Called internally - draws axis labels when needed, for example for line annotations
@@ -630,7 +630,7 @@ var SciChartSurface = /** @class */ (function (_super) {
630
630
  if (err.name === "BindingError") {
631
631
  console.error(err);
632
632
  console.warn("Binding errors can occur if a previous chart using the same div id was not deleted correctly, or if you try to share data or series between charts that use different webassembly contexts.");
633
- (0, NativeObject_1.freeCache)(this.webAssemblyContext2D);
633
+ (0, NativeObject_1.freeCache)(this.webAssemblyContext2D).delete();
634
634
  }
635
635
  else if (this.domChartRoot) {
636
636
  console.error("Error from chart in div ".concat(this.domChartRoot.id), err);
@@ -1,12 +1,26 @@
1
1
  import { ChartModifierBase, EModifierType } from "../../Charting/ChartModifiers/ChartModifierBase";
2
+ import { EChart3DModifierType } from "../../types/ChartModifierType";
3
+ import { EExecuteOn } from "../../types/ExecuteOn";
2
4
  import { SciChart3DSurface } from "../Visuals/SciChart3DSurface";
3
5
  export interface IChartModifierBase3DOptions {
6
+ /**
7
+ * A unique Id for the {@link ChartModifierBase3D}
8
+ */
9
+ id?: string;
10
+ /**
11
+ * Defines the operation that modifier should respond to
12
+ */
13
+ executeOn?: EExecuteOn;
4
14
  }
5
15
  /**
6
16
  * Defines a base class to a ChartModifier3D - a class which provides Zoom, Pan, Tooltip or interaction behavior
7
17
  * to SciChart - High Performance Realtime {@link https://www.scichart.com/javascript-chart-features | JavaScript 3D Charts}
8
18
  */
9
19
  export declare abstract class ChartModifierBase3D extends ChartModifierBase<SciChart3DSurface> {
20
+ /**
21
+ * The type of chartmodifier. See {@link EChart3DModifierType} for available options
22
+ */
23
+ abstract readonly type: EChart3DModifierType | string;
10
24
  /**
11
25
  * Creates an instance of a {@link ChartModifierBase3D}
12
26
  * @param options Optional parameters of type {@link IChartModifierBase3DOptions} used to configure the modifier
@@ -16,4 +30,8 @@ export declare abstract class ChartModifierBase3D extends ChartModifierBase<SciC
16
30
  * @inheritDoc
17
31
  */
18
32
  get modifierType(): EModifierType;
33
+ toJSON(): {
34
+ type: string;
35
+ options: Required<Omit<IChartModifierBase3DOptions, never>>;
36
+ };
19
37
  }
@@ -28,7 +28,7 @@ var ChartModifierBase3D = /** @class */ (function (_super) {
28
28
  * @param options Optional parameters of type {@link IChartModifierBase3DOptions} used to configure the modifier
29
29
  */
30
30
  function ChartModifierBase3D(options) {
31
- return _super.call(this) || this;
31
+ return _super.call(this, options) || this;
32
32
  }
33
33
  Object.defineProperty(ChartModifierBase3D.prototype, "modifierType", {
34
34
  /**
@@ -40,6 +40,13 @@ var ChartModifierBase3D = /** @class */ (function (_super) {
40
40
  enumerable: false,
41
41
  configurable: true
42
42
  });
43
+ ChartModifierBase3D.prototype.toJSON = function () {
44
+ var options = {
45
+ id: this.id,
46
+ executeOn: this.executeOn
47
+ };
48
+ return { type: this.type, options: options };
49
+ };
43
50
  return ChartModifierBase3D;
44
51
  }(ChartModifierBase_1.ChartModifierBase));
45
52
  exports.ChartModifierBase3D = ChartModifierBase3D;
@@ -0,0 +1,16 @@
1
+ import { EChart3DModifierType } from "../../types/ChartModifierType";
2
+ import { ChartModifierBase3D, IChartModifierBase3DOptions } from "./ChartModifierBase3D";
3
+ /**
4
+ * Base class for custom Chart Modifiers (allows custom zooming, panning, interaction behaviour) on 2D Charts
5
+ */
6
+ export declare class CustomChartModifier3D extends ChartModifierBase3D {
7
+ /**
8
+ * @inheritDoc
9
+ */
10
+ readonly type: EChart3DModifierType;
11
+ /**
12
+ * @inheritDoc
13
+ * @param options
14
+ */
15
+ constructor(options?: IChartModifierBase3DOptions);
16
+ }
@@ -0,0 +1,40 @@
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.CustomChartModifier3D = void 0;
19
+ var ChartModifierType_1 = require("../../types/ChartModifierType");
20
+ var ChartModifierBase3D_1 = require("./ChartModifierBase3D");
21
+ /**
22
+ * Base class for custom Chart Modifiers (allows custom zooming, panning, interaction behaviour) on 2D Charts
23
+ */
24
+ var CustomChartModifier3D = /** @class */ (function (_super) {
25
+ __extends(CustomChartModifier3D, _super);
26
+ /**
27
+ * @inheritDoc
28
+ * @param options
29
+ */
30
+ function CustomChartModifier3D(options) {
31
+ var _this = _super.call(this, options) || this;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ _this.type = ChartModifierType_1.EChart3DModifierType.Custom;
36
+ return _this;
37
+ }
38
+ return CustomChartModifier3D;
39
+ }(ChartModifierBase3D_1.ChartModifierBase3D));
40
+ exports.CustomChartModifier3D = CustomChartModifier3D;
@@ -27,6 +27,7 @@ export interface IMouseWheelZoomModifier3DOptions extends IChartModifierBase3DOp
27
27
  * @remarks The speed of mouse-wheel zoom can be modified via the {@link MouseWheelZoomModifier3D.mouseWheelSensitivity} property.
28
28
  */
29
29
  export declare class MouseWheelZoomModifier3D extends ChartModifierBase3D {
30
+ readonly type = EChart3DModifierType.MouseWheelZoom;
30
31
  /**
31
32
  * The mouse wheel sensitifivity is a factor that determines how much the camera zooms when the mouse wheel scrolls.
32
33
  * Default value is 0.1
@@ -41,10 +42,11 @@ export declare class MouseWheelZoomModifier3D extends ChartModifierBase3D {
41
42
  * @inheritDoc
42
43
  */
43
44
  modifierMouseWheel(args: ModifierMouseArgs): void;
44
- toJSON?(): {
45
- type: EChart3DModifierType;
46
- options: {
47
- mouseWheelSensitivity: number;
48
- };
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ toJSON(): {
49
+ type: string;
50
+ options: Required<Omit<IChartModifierBase3DOptions, never>>;
49
51
  };
50
52
  }
@@ -42,6 +42,7 @@ var MouseWheelZoomModifier3D = /** @class */ (function (_super) {
42
42
  */
43
43
  function MouseWheelZoomModifier3D(options) {
44
44
  var _this = _super.call(this, options) || this;
45
+ _this.type = ChartModifierType_1.EChart3DModifierType.MouseWheelZoom;
45
46
  _this.mouseWheelSensitivity = (options === null || options === void 0 ? void 0 : options.mouseWheelSensitivity) || 0.1;
46
47
  return _this;
47
48
  }
@@ -70,12 +71,16 @@ var MouseWheelZoomModifier3D = /** @class */ (function (_super) {
70
71
  }
71
72
  args.handled = true;
72
73
  };
73
- //@ts-ignore
74
+ /**
75
+ * @inheritDoc
76
+ */
74
77
  MouseWheelZoomModifier3D.prototype.toJSON = function () {
75
- return {
76
- type: ChartModifierType_1.EChart3DModifierType.MouseWheelZoom,
77
- options: { mouseWheelSensitivity: this.mouseWheelSensitivity }
78
+ var json = _super.prototype.toJSON.call(this);
79
+ var options = {
80
+ mouseWheelSensitivity: this.mouseWheelSensitivity
78
81
  };
82
+ Object.assign(json.options, options);
83
+ return json;
79
84
  };
80
85
  return MouseWheelZoomModifier3D;
81
86
  }(ChartModifierBase3D_1.ChartModifierBase3D));
@@ -1,6 +1,11 @@
1
1
  import { ModifierMouseArgs } from "../../Charting/ChartModifiers/ModifierMouseArgs";
2
2
  import { EChart3DModifierType } from "../../types/ChartModifierType";
3
- import { ChartModifierBase3D } from "./ChartModifierBase3D";
3
+ import { ChartModifierBase3D, IChartModifierBase3DOptions } from "./ChartModifierBase3D";
4
+ /**
5
+ * Optional parameters passed to the constructor of {@link OrbitModifier3D} to configure it
6
+ */
7
+ export interface IOrbitModifier3DOptions extends IChartModifierBase3DOptions {
8
+ }
4
9
  /**
5
10
  * @summary The {@link OrbitModifier3D} provides behavior to orbit around a target point on a 3D {@link SciChart3DSurface}
6
11
  * within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript 3D Charts}
@@ -15,9 +20,13 @@ import { ChartModifierBase3D } from "./ChartModifierBase3D";
15
20
  * ```
16
21
  */
17
22
  export declare class OrbitModifier3D extends ChartModifierBase3D {
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ readonly type = EChart3DModifierType.Orbit;
18
27
  private pointStart;
19
28
  private isDragging;
20
- constructor();
29
+ constructor(options?: IOrbitModifier3DOptions);
21
30
  /**
22
31
  * @inheritDoc
23
32
  */
@@ -30,7 +39,4 @@ export declare class OrbitModifier3D extends ChartModifierBase3D {
30
39
  * @inheritDoc
31
40
  */
32
41
  modifierMouseUp(args: ModifierMouseArgs): void;
33
- toJSON(): {
34
- type: EChart3DModifierType;
35
- };
36
42
  }
@@ -34,8 +34,13 @@ var ChartModifierBase3D_1 = require("./ChartModifierBase3D");
34
34
  */
35
35
  var OrbitModifier3D = /** @class */ (function (_super) {
36
36
  __extends(OrbitModifier3D, _super);
37
- function OrbitModifier3D() {
38
- return _super.call(this) || this;
37
+ function OrbitModifier3D(options) {
38
+ var _this = _super.call(this, options) || this;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ _this.type = ChartModifierType_1.EChart3DModifierType.Orbit;
43
+ return _this;
39
44
  }
40
45
  /**
41
46
  * @inheritDoc
@@ -80,9 +85,6 @@ var OrbitModifier3D = /** @class */ (function (_super) {
80
85
  this.isDragging = false;
81
86
  this.pointStart = undefined;
82
87
  };
83
- OrbitModifier3D.prototype.toJSON = function () {
84
- return { type: ChartModifierType_1.EChart3DModifierType.Orbit };
85
- };
86
88
  return OrbitModifier3D;
87
89
  }(ChartModifierBase3D_1.ChartModifierBase3D));
88
90
  exports.OrbitModifier3D = OrbitModifier3D;
@@ -17,7 +17,7 @@ export interface IResetCamera3DOptions extends IChartModifierBase3DOptions {
17
17
  /**
18
18
  * Defines the easing function for animation. See {@link TEasingFn} for a range of functions
19
19
  */
20
- easingFunction?: TEasingFn;
20
+ easingFunction?: TEasingFn | string;
21
21
  /**
22
22
  * The camera settings to reset to. Defaults to the camera state when the modifier was attached to the chart.
23
23
  */
@@ -45,6 +45,10 @@ export declare type TCameraState = {
45
45
  *
46
46
  */
47
47
  export declare class ResetCamera3DModifier extends ChartModifierBase3D {
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ readonly type = EChart3DModifierType.ZoomExtents;
48
52
  /**
49
53
  * When true, the Zoom operations are animated. See also {@link animationDuration} and {@link easingFunction}
50
54
  */
@@ -68,12 +72,11 @@ export declare class ResetCamera3DModifier extends ChartModifierBase3D {
68
72
  * @inheritDoc
69
73
  */
70
74
  modifierDoubleClick(args: ModifierMouseArgs): void;
71
- toJSON?(): {
72
- type: EChart3DModifierType;
73
- options: {
74
- animationDuration: number;
75
- easingFunction: string;
76
- isAnimated: boolean;
77
- };
75
+ /**
76
+ * @inheritDoc
77
+ */
78
+ toJSON(): {
79
+ type: string;
80
+ options: Required<Omit<IChartModifierBase3DOptions, never>>;
78
81
  };
79
82
  }