scichart 3.2.0-beta → 3.2.434

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 (111) hide show
  1. package/Builder/buildSurface.d.ts +2 -2
  2. package/Builder/chartBuilder.d.ts +4 -4
  3. package/Charting/ChartModifiers/ChartModifierBase.d.ts +5 -5
  4. package/Charting/ChartModifiers/ChartModifierBase.js +2 -3
  5. package/Charting/ChartModifiers/CursorModifier.d.ts +9 -9
  6. package/Charting/ChartModifiers/CursorModifier.js +1 -1
  7. package/Charting/ChartModifiers/DataPointSelectionModifier.d.ts +1 -0
  8. package/Charting/ChartModifiers/DataPointSelectionModifier.js +6 -1
  9. package/Charting/ChartModifiers/LegendModifier.d.ts +9 -24
  10. package/Charting/ChartModifiers/LegendModifier.js +9 -21
  11. package/Charting/ChartModifiers/MouseWheelZoomModifier.js +20 -11
  12. package/Charting/ChartModifiers/OverviewRangeSelectionModifier.d.ts +5 -5
  13. package/Charting/ChartModifiers/PinchZoomModifier.js +9 -9
  14. package/Charting/ChartModifiers/RubberBandXyZoomModifier.d.ts +4 -7
  15. package/Charting/ChartModifiers/RubberBandXyZoomModifier.js +6 -8
  16. package/Charting/ChartModifiers/SeriesSelectionModifier.js +10 -8
  17. package/Charting/ChartModifiers/XAxisDragModifier.d.ts +1 -1
  18. package/Charting/ChartModifiers/XAxisDragModifier.js +3 -3
  19. package/Charting/ChartModifiers/YAxisDragModifier.d.ts +2 -4
  20. package/Charting/ChartModifiers/YAxisDragModifier.js +7 -8
  21. package/Charting/Drawing/BaseCache.js +13 -8
  22. package/Charting/Model/BaseDataSeries.d.ts +2 -2
  23. package/Charting/Model/Filters/HlcFilterBase.d.ts +6 -2
  24. package/Charting/Model/Filters/HlcFilterBase.js +17 -1
  25. package/Charting/Model/Filters/IFilterBase.d.ts +24 -0
  26. package/Charting/Model/Filters/IFilterBase.js +2 -0
  27. package/Charting/Model/Filters/OhlcFilterBase.d.ts +6 -2
  28. package/Charting/Model/Filters/OhlcFilterBase.js +17 -1
  29. package/Charting/Model/Filters/XyFilterBase.d.ts +6 -5
  30. package/Charting/Model/Filters/XyFilterBase.js +17 -1
  31. package/Charting/Model/Filters/XyyFilterBase.d.ts +6 -2
  32. package/Charting/Model/Filters/XyyFilterBase.js +17 -1
  33. package/Charting/Model/Filters/XyzFilterBase.d.ts +6 -2
  34. package/Charting/Model/Filters/XyzFilterBase.js +17 -1
  35. package/Charting/Model/XyyDataSeries.js +15 -16
  36. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +0 -4
  37. package/Charting/Visuals/Annotations/NativeTextAnnotation.js +4 -0
  38. package/Charting/Visuals/Axis/AxisBase2D.d.ts +3 -3
  39. package/Charting/Visuals/Axis/AxisCore.d.ts +2 -2
  40. package/Charting/Visuals/Legend/ManualLegend.d.ts +56 -0
  41. package/Charting/Visuals/Legend/ManualLegend.js +138 -0
  42. package/Charting/Visuals/Legend/SciChartLegend.js +4 -3
  43. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +62 -3
  44. package/Charting/Visuals/Legend/SciChartLegendBase.js +78 -11
  45. package/Charting/Visuals/PointMarkers/BasePointMarker.js +13 -8
  46. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +1 -1
  47. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +3 -3
  48. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -3
  49. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +3 -3
  50. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +8 -0
  51. package/Charting/Visuals/RenderableSeries/HoveredChangedArgs.d.ts +6 -1
  52. package/Charting/Visuals/RenderableSeries/HoveredChangedArgs.js +2 -1
  53. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +1 -1
  54. package/Charting/Visuals/RenderableSeries/SelectionChangedArgs.d.ts +6 -1
  55. package/Charting/Visuals/RenderableSeries/SelectionChangedArgs.js +2 -1
  56. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +43 -1
  57. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +6 -1
  58. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +6 -1
  59. package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.d.ts +4 -0
  60. package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.js +8 -2
  61. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +6 -0
  62. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +7 -0
  63. package/Charting/Visuals/SciChartSurface.d.ts +0 -5
  64. package/Charting/Visuals/SciChartSurface.js +11 -12
  65. package/Charting/Visuals/SciChartSurfaceBase.d.ts +19 -1
  66. package/Charting/Visuals/SciChartSurfaceBase.js +45 -23
  67. package/Charting/Visuals/createMaster.d.ts +3 -0
  68. package/Charting/Visuals/createMaster.js +54 -23
  69. package/Charting/Visuals/createSingle.js +2 -2
  70. package/Charting/Visuals/licenseManager2D.js +2 -2
  71. package/Charting3D/ChartModifiers/ResetCamera3DModifier.d.ts +1 -1
  72. package/Charting3D/ChartModifiers/ResetCamera3DModifier.js +1 -2
  73. package/Charting3D/ChartModifiers/TooltipModifier3D.d.ts +35 -0
  74. package/Charting3D/ChartModifiers/TooltipModifier3D.js +41 -5
  75. package/Charting3D/Model/DataSeries/BaseGridDataSeries3D.d.ts +1 -1
  76. package/Charting3D/Model/DataSeries/BaseGridDataSeries3D.js +2 -2
  77. package/Charting3D/Model/DataSeries/IPointMetadata3D.d.ts +7 -2
  78. package/Charting3D/Visuals/Axis/AxisBase3D.d.ts +8 -1
  79. package/Charting3D/Visuals/Axis/AxisBase3D.js +0 -2
  80. package/Charting3D/Visuals/Axis/NumericAxis3D.d.ts +3 -2
  81. package/Charting3D/Visuals/Axis/NumericAxis3D.js +7 -3
  82. package/Charting3D/Visuals/Primitives/PointLine3DSceneEntity.js +4 -2
  83. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +5 -2
  84. package/Charting3D/Visuals/Primitives/SurfaceMeshSceneEntity.js +2 -1
  85. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.d.ts +5 -0
  86. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.js +19 -5
  87. package/Charting3D/Visuals/SciChart3DRenderer.d.ts +0 -1
  88. package/Charting3D/Visuals/SciChart3DRenderer.js +3 -26
  89. package/Charting3D/Visuals/SciChart3DSurface.d.ts +12 -5
  90. package/Charting3D/Visuals/SciChart3DSurface.js +35 -6
  91. package/Charting3D/Visuals/createMaster3d.js +9 -4
  92. package/Core/BuildStamp.d.ts +1 -1
  93. package/Core/BuildStamp.js +2 -2
  94. package/Core/DeletableEntity.d.ts +11 -5
  95. package/Core/DeletableEntity.js +42 -45
  96. package/Core/Mouse/MouseManager.js +6 -0
  97. package/_wasm/scichart.browser.js +1 -1
  98. package/_wasm/scichart2d.js +1 -1
  99. package/_wasm/scichart2d.wasm +0 -0
  100. package/_wasm/scichart3d.js +1 -1
  101. package/_wasm/scichart3d.wasm +0 -0
  102. package/index.d.ts +5 -6
  103. package/index.dev.js +68876 -0
  104. package/index.js +13 -21
  105. package/index.min.js +1 -1
  106. package/package.json +1 -1
  107. package/utils/MemoryUsageHelper.d.ts +55 -8
  108. package/utils/MemoryUsageHelper.js +64 -14
  109. package/utils/colorUtil.d.ts +7 -0
  110. package/utils/colorUtil.js +13 -1
  111. package/utils/parseColor.js +19 -4
@@ -0,0 +1,56 @@
1
+ import { ISciChartSurfaceBase } from "../SciChartSurfaceBase";
2
+ import { ELegendType, ILegendOptionsBase, SciChartLegendBase, TLegendItem } from "./SciChartLegendBase";
3
+ export interface IManualLegendOptions extends ILegendOptionsBase {
4
+ /**
5
+ * Sets whether the legend has visibility checkboxes in it or not
6
+ */
7
+ showCheckboxes?: boolean;
8
+ /**
9
+ * Sets whether Series markers are visible or not
10
+ */
11
+ showSeriesMarkers?: boolean;
12
+ items?: TLegendItem[];
13
+ /**
14
+ * Callback when a legend item checkbox is checked or unchecked
15
+ * @param item
16
+ * @param isChecked
17
+ */
18
+ isCheckedChangedCallback?: (item: TLegendItem, isChecked: boolean) => void;
19
+ }
20
+ export declare class ManualLegend extends SciChartLegendBase {
21
+ type: ELegendType;
22
+ legendItemCheckedChangedCallback: (item: TLegendItem, isChecked: boolean) => void;
23
+ private itemsProperty;
24
+ private showCheckboxesProperty;
25
+ private showSeriesMarkersProperty;
26
+ constructor(options?: IManualLegendOptions, sciChartSurface?: ISciChartSurfaceBase);
27
+ /**
28
+ * Gets or sets whether series visibility checkboxes should be shown
29
+ */
30
+ get showCheckboxes(): boolean;
31
+ /**
32
+ * Gets or sets whether series visibility checkboxes should be shown
33
+ */
34
+ set showCheckboxes(value: boolean);
35
+ /**
36
+ * Gets or sets whether series markers should be shown
37
+ */
38
+ get showSeriesMarkers(): boolean;
39
+ /**
40
+ * Gets or sets whether series markers should be shown
41
+ */
42
+ set showSeriesMarkers(value: boolean);
43
+ /**
44
+ * Gets or sets the items to be displayed in the legend
45
+ */
46
+ get items(): TLegendItem[];
47
+ /**
48
+ * Gets or sets the items to be displayed in the legend
49
+ */
50
+ set items(value: TLegendItem[]);
51
+ applyTheme(): void;
52
+ protected getInnerHTML(): string;
53
+ protected addEventListeners(): void;
54
+ protected addEventListenerToItem(item: TLegendItem): void;
55
+ protected removeEventListeners(): void;
56
+ }
@@ -0,0 +1,138 @@
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.ManualLegend = void 0;
19
+ var Thickness_1 = require("../../../Core/Thickness");
20
+ var SciChartLegendBase_1 = require("./SciChartLegendBase");
21
+ var ManualLegend = /** @class */ (function (_super) {
22
+ __extends(ManualLegend, _super);
23
+ function ManualLegend(options, sciChartSurface) {
24
+ var _this = this;
25
+ var _a, _b, _c;
26
+ _this = _super.call(this, options) || this;
27
+ _this.type = SciChartLegendBase_1.ELegendType.ManualLegend;
28
+ _this.itemsProperty = [];
29
+ _this.showCheckboxesProperty = false;
30
+ _this.showSeriesMarkersProperty = true;
31
+ _this.showCheckboxesProperty = (_a = options === null || options === void 0 ? void 0 : options.showCheckboxes) !== null && _a !== void 0 ? _a : _this.showCheckboxes;
32
+ _this.showSeriesMarkersProperty = (_b = options === null || options === void 0 ? void 0 : options.showSeriesMarkers) !== null && _b !== void 0 ? _b : _this.showSeriesMarkers;
33
+ _this.itemsProperty = (_c = options === null || options === void 0 ? void 0 : options.items) !== null && _c !== void 0 ? _c : _this.items;
34
+ _this.legendItemCheckedChangedCallback = options === null || options === void 0 ? void 0 : options.isCheckedChangedCallback;
35
+ if (sciChartSurface) {
36
+ _this.attachTo(sciChartSurface);
37
+ }
38
+ return _this;
39
+ }
40
+ Object.defineProperty(ManualLegend.prototype, "showCheckboxes", {
41
+ /**
42
+ * Gets or sets whether series visibility checkboxes should be shown
43
+ */
44
+ get: function () {
45
+ return this.showCheckboxesProperty;
46
+ },
47
+ /**
48
+ * Gets or sets whether series visibility checkboxes should be shown
49
+ */
50
+ set: function (value) {
51
+ this.showCheckboxesProperty = value;
52
+ this.notifyPropertyChanged();
53
+ },
54
+ enumerable: false,
55
+ configurable: true
56
+ });
57
+ Object.defineProperty(ManualLegend.prototype, "showSeriesMarkers", {
58
+ /**
59
+ * Gets or sets whether series markers should be shown
60
+ */
61
+ get: function () {
62
+ return this.showSeriesMarkersProperty;
63
+ },
64
+ /**
65
+ * Gets or sets whether series markers should be shown
66
+ */
67
+ set: function (value) {
68
+ this.showSeriesMarkersProperty = value;
69
+ this.notifyPropertyChanged();
70
+ },
71
+ enumerable: false,
72
+ configurable: true
73
+ });
74
+ Object.defineProperty(ManualLegend.prototype, "items", {
75
+ /**
76
+ * Gets or sets the items to be displayed in the legend
77
+ */
78
+ get: function () {
79
+ return this.itemsProperty;
80
+ },
81
+ /**
82
+ * Gets or sets the items to be displayed in the legend
83
+ */
84
+ set: function (value) {
85
+ this.itemsProperty = value;
86
+ this.notifyPropertyChanged();
87
+ },
88
+ enumerable: false,
89
+ configurable: true
90
+ });
91
+ ManualLegend.prototype.applyTheme = function () { };
92
+ ManualLegend.prototype.getInnerHTML = function () {
93
+ var _a, _b;
94
+ var backgroundColor = (_a = this.backgroundColor) !== null && _a !== void 0 ? _a : this.parentSurfaceProperty.themeProvider.legendBackgroundBrush;
95
+ var color = (_b = this.textColor) !== null && _b !== void 0 ? _b : this.parentSurfaceProperty.themeProvider.labelForegroundBrush;
96
+ var _c = this.parentSurfaceProperty.getSeriesViewRectPadding(false), left = _c.left, top = _c.top, right = _c.right, bottom = _c.bottom;
97
+ var margin = this.isExternal()
98
+ ? new Thickness_1.Thickness(this.margin, this.margin, this.margin, this.margin)
99
+ : new Thickness_1.Thickness(top + this.margin, right + this.margin, bottom + this.margin, left + this.margin);
100
+ return this.getLegendHTML(this.placement, color, backgroundColor, margin, this.orientation, this.showCheckboxes, this.showSeriesMarkers, this.items);
101
+ };
102
+ ManualLegend.prototype.addEventListeners = function () {
103
+ var _this = this;
104
+ this.items.forEach(function (item) { return _this.addEventListenerToItem(item); });
105
+ };
106
+ ManualLegend.prototype.addEventListenerToItem = function (item) {
107
+ var _this = this;
108
+ var el = this.parentDiv.querySelector("[id='".concat(item.id, "']"));
109
+ if (el) {
110
+ var onChangeEventListener_1 = function (e) {
111
+ item.checked = el.checked;
112
+ if (_this.legendItemCheckedChangedCallback) {
113
+ _this.legendItemCheckedChangedCallback(item, item.checked);
114
+ }
115
+ };
116
+ el.addEventListener("change", onChangeEventListener_1);
117
+ var eventSubscriptionItem = {
118
+ element: el,
119
+ eventType: "change",
120
+ eventListener: onChangeEventListener_1,
121
+ delete: function () { return el.removeEventListener("change", onChangeEventListener_1); }
122
+ };
123
+ var eventListenersForRenderableSeries = this.eventListenersCollection.get(item.id);
124
+ if (eventListenersForRenderableSeries) {
125
+ eventListenersForRenderableSeries.push(eventSubscriptionItem);
126
+ }
127
+ else {
128
+ this.eventListenersCollection.set(item.id, [eventSubscriptionItem]);
129
+ }
130
+ }
131
+ };
132
+ ManualLegend.prototype.removeEventListeners = function () {
133
+ var _this = this;
134
+ this.items.forEach(function (item) { return _this.removeEventListenerFromSeries(item.id); });
135
+ };
136
+ return ManualLegend;
137
+ }(SciChartLegendBase_1.SciChartLegendBase));
138
+ exports.ManualLegend = ManualLegend;
@@ -118,8 +118,9 @@ var SciChartLegend = /** @class */ (function (_super) {
118
118
  };
119
119
  /** @inheritDoc */
120
120
  SciChartLegend.prototype.getInnerHTML = function () {
121
- var backgroundColor = this.parentSurfaceProperty.themeProvider.legendBackgroundBrush;
122
- var color = this.parentSurfaceProperty.themeProvider.labelForegroundBrush;
121
+ var _a, _b;
122
+ var backgroundColor = (_a = this.backgroundColor) !== null && _a !== void 0 ? _a : this.parentSurfaceProperty.themeProvider.legendBackgroundBrush;
123
+ var color = (_b = this.textColor) !== null && _b !== void 0 ? _b : this.parentSurfaceProperty.themeProvider.labelForegroundBrush;
123
124
  var legendItems = this.renderableSeriesArray.map(function (rs, index) {
124
125
  var _a;
125
126
  return ({
@@ -130,7 +131,7 @@ var SciChartLegend = /** @class */ (function (_super) {
130
131
  gradient: undefined
131
132
  });
132
133
  });
133
- var _a = this.parentSurfaceProperty.getSeriesViewRectPadding(false), left = _a.left, top = _a.top, right = _a.right, bottom = _a.bottom;
134
+ var _c = this.parentSurfaceProperty.getSeriesViewRectPadding(false), left = _c.left, top = _c.top, right = _c.right, bottom = _c.bottom;
134
135
  var margin = this.isExternal()
135
136
  ? new Thickness_1.Thickness(this.margin, this.margin, this.margin, this.margin)
136
137
  : new Thickness_1.Thickness(top + this.margin, right + this.margin, bottom + this.margin, left + this.margin);
@@ -10,6 +10,7 @@ export declare type TLegendItem = {
10
10
  color: string;
11
11
  checked: boolean;
12
12
  gradient?: GradientParams;
13
+ showMarker?: boolean;
13
14
  };
14
15
  export interface IEventSubscriptionItem extends IDeletable {
15
16
  element: HTMLElement;
@@ -37,8 +38,43 @@ export declare enum ELegendPlacement {
37
38
  */
38
39
  export declare enum ELegendType {
39
40
  SciChartLegend = "SciChartLegend",
41
+ ManualLegend = "ManualLegend",
40
42
  SciChartPieLegend = "SciChartPieLegend"
41
43
  }
44
+ export interface ILegendOptionsBase {
45
+ /**
46
+ * Sets the initial orientation of the legend. See {@link ELegendOrientation} for a list of values
47
+ */
48
+ orientation?: ELegendOrientation;
49
+ /**
50
+ * Sets whether the legend is initially visible or not
51
+ */
52
+ showLegend?: boolean;
53
+ /**
54
+ * Sets whether the legend has visibility checkboxes in it or not
55
+ */
56
+ showCheckboxes?: boolean;
57
+ /**
58
+ * Sets whether Series markers are visible or not
59
+ */
60
+ showSeriesMarkers?: boolean;
61
+ /**
62
+ * Sets the initial legend placement in the parent chart surface. See {@link ELegendPlacement} for a list of values
63
+ */
64
+ placement?: ELegendPlacement;
65
+ /**
66
+ * Sets the margin for the legend control
67
+ */
68
+ margin?: number;
69
+ /**
70
+ * The parent div element Id or reference, the Legend will be appended to this element
71
+ */
72
+ placementDivId?: string | HTMLDivElement;
73
+ /** Sets the legend background color. Defaults to theme.legendBackgroundBrush */
74
+ backgroundColor?: string;
75
+ /** Sets the legend text color. Defaults to theme.labelForegroundBrush */
76
+ textColor?: string;
77
+ }
42
78
  /**
43
79
  * Base class for legends in the SciChart library
44
80
  */
@@ -47,7 +83,6 @@ export declare abstract class SciChartLegendBase extends DeletableEntity impleme
47
83
  protected rootDiv: HTMLDivElement;
48
84
  protected parentDiv: HTMLDivElement;
49
85
  protected div: HTMLDivElement;
50
- protected seriesViewRect: Rect;
51
86
  protected invalidateParentSurface: () => void;
52
87
  protected orientationProperty: ELegendOrientation;
53
88
  protected showLegendProperty: boolean;
@@ -56,7 +91,10 @@ export declare abstract class SciChartLegendBase extends DeletableEntity impleme
56
91
  protected isDirty: boolean;
57
92
  protected parentSurfaceProperty: ISciChartSurfaceBase;
58
93
  protected placementDivIdProperty: string | HTMLDivElement;
94
+ protected backgroundColorProperty: string;
95
+ protected textColorProperty: string;
59
96
  protected eventListenersCollection: Map<string, IEventSubscriptionItem[]>;
97
+ constructor(options?: ILegendOptionsBase);
60
98
  /** @inheritDoc */
61
99
  abstract applyTheme(): void;
62
100
  setInvalidateParentSurface(value: () => void): void;
@@ -66,14 +104,19 @@ export declare abstract class SciChartLegendBase extends DeletableEntity impleme
66
104
  */
67
105
  setRootDiv(rootDivProperty: HTMLDivElement): void;
68
106
  /**
69
- * Set the series view rect - a rectangle defining where on the parent chart the legend is shown
70
- * @param seriesViewRect
107
+ * @deprecated
71
108
  */
72
109
  setSeriesViewRect(seriesViewRect: Rect): void;
73
110
  /**
74
111
  * Sets the parent {@link ISciChartSurfaceBase}
75
112
  */
76
113
  setParentSurface(scs: ISciChartSurfaceBase): void;
114
+ /**
115
+ * Attach this legend to a SciChartSurfaceBase
116
+ * @param sciChartSurface
117
+ */
118
+ attachTo(sciChartSurface: ISciChartSurfaceBase): void;
119
+ detach(): void;
77
120
  /**
78
121
  * Update the legend
79
122
  */
@@ -122,6 +165,22 @@ export declare abstract class SciChartLegendBase extends DeletableEntity impleme
122
165
  * Gets or sets the parent div element reference or id for the Legend
123
166
  */
124
167
  set placementDivId(value: string | HTMLDivElement);
168
+ /**
169
+ * Gets or sets the backgroundColor as an html color code
170
+ */
171
+ get backgroundColor(): string;
172
+ /**
173
+ * Gets or sets the backgroundColor as an html color code
174
+ */
175
+ set backgroundColor(value: string);
176
+ /**
177
+ * Gets or sets the textColor as an html color code
178
+ */
179
+ get textColor(): string;
180
+ /**
181
+ * Gets or sets the textColor as an html color code
182
+ */
183
+ set textColor(value: string);
125
184
  clear(): void;
126
185
  /** @inheritDoc */
127
186
  delete(): void;
@@ -44,6 +44,7 @@ var ELegendPlacement;
44
44
  var ELegendType;
45
45
  (function (ELegendType) {
46
46
  ELegendType["SciChartLegend"] = "SciChartLegend";
47
+ ELegendType["ManualLegend"] = "ManualLegend";
47
48
  ELegendType["SciChartPieLegend"] = "SciChartPieLegend";
48
49
  })(ELegendType = exports.ELegendType || (exports.ELegendType = {}));
49
50
  /**
@@ -51,8 +52,10 @@ var ELegendType;
51
52
  */
52
53
  var SciChartLegendBase = /** @class */ (function (_super) {
53
54
  __extends(SciChartLegendBase, _super);
54
- function SciChartLegendBase() {
55
- var _this = _super !== null && _super.apply(this, arguments) || this;
55
+ function SciChartLegendBase(options) {
56
+ var _this = this;
57
+ var _a, _b, _c, _d, _e;
58
+ _this = _super.call(this) || this;
56
59
  _this.orientationProperty = ELegendOrientation.Vertical;
57
60
  _this.showLegendProperty = true;
58
61
  _this.placementProperty = ELegendPlacement.TopLeft;
@@ -70,6 +73,14 @@ var SciChartLegendBase = /** @class */ (function (_super) {
70
73
  });
71
74
  _this.eventListenersCollection.delete(renderableSeriesId);
72
75
  };
76
+ _this.orientationProperty = (_a = options === null || options === void 0 ? void 0 : options.orientation) !== null && _a !== void 0 ? _a : _this.orientationProperty;
77
+ _this.showLegendProperty = (_b = options === null || options === void 0 ? void 0 : options.showLegend) !== null && _b !== void 0 ? _b : _this.showLegend;
78
+ _this.placementProperty = (_c = options === null || options === void 0 ? void 0 : options.placement) !== null && _c !== void 0 ? _c : _this.placement;
79
+ _this.marginProperty = (_d = options === null || options === void 0 ? void 0 : options.margin) !== null && _d !== void 0 ? _d : _this.margin;
80
+ _this.placementDivIdProperty = (_e = options === null || options === void 0 ? void 0 : options.placementDivId) !== null && _e !== void 0 ? _e : _this.placementDivId;
81
+ // No default here as need theme from parent surface
82
+ _this.backgroundColorProperty = options === null || options === void 0 ? void 0 : options.backgroundColor;
83
+ _this.textColorProperty = options === null || options === void 0 ? void 0 : options.textColor;
73
84
  return _this;
74
85
  }
75
86
  SciChartLegendBase.prototype.setInvalidateParentSurface = function (value) {
@@ -83,21 +94,42 @@ var SciChartLegendBase = /** @class */ (function (_super) {
83
94
  this.rootDiv = rootDivProperty;
84
95
  };
85
96
  /**
86
- * Set the series view rect - a rectangle defining where on the parent chart the legend is shown
87
- * @param seriesViewRect
97
+ * @deprecated
88
98
  */
89
- SciChartLegendBase.prototype.setSeriesViewRect = function (seriesViewRect) {
90
- if (this.seriesViewRect !== seriesViewRect) {
91
- this.seriesViewRect = seriesViewRect;
92
- this.notifyPropertyChanged();
93
- }
94
- };
99
+ SciChartLegendBase.prototype.setSeriesViewRect = function (seriesViewRect) { };
95
100
  /**
96
101
  * Sets the parent {@link ISciChartSurfaceBase}
97
102
  */
98
103
  SciChartLegendBase.prototype.setParentSurface = function (scs) {
99
104
  this.parentSurfaceProperty = scs;
100
105
  };
106
+ /**
107
+ * Attach this legend to a SciChartSurfaceBase
108
+ * @param sciChartSurface
109
+ */
110
+ SciChartLegendBase.prototype.attachTo = function (sciChartSurface) {
111
+ var _this = this;
112
+ this.setParentSurface(sciChartSurface);
113
+ this.setRootDiv(sciChartSurface.domDivContainer);
114
+ this.setInvalidateParentSurface(sciChartSurface.invalidateElement);
115
+ sciChartSurface.rendered.subscribe(function () {
116
+ _this.update();
117
+ });
118
+ sciChartSurface.addDeletable({
119
+ delete: function () {
120
+ _this.delete();
121
+ _this.setRootDiv(undefined);
122
+ _this.setInvalidateParentSurface(undefined);
123
+ _this.setParentSurface(undefined);
124
+ }
125
+ });
126
+ };
127
+ SciChartLegendBase.prototype.detach = function () {
128
+ this.setRootDiv(undefined);
129
+ this.setInvalidateParentSurface(undefined);
130
+ this.setParentSurface(undefined);
131
+ this.delete();
132
+ };
101
133
  /**
102
134
  * Update the legend
103
135
  */
@@ -203,6 +235,40 @@ var SciChartLegendBase = /** @class */ (function (_super) {
203
235
  enumerable: false,
204
236
  configurable: true
205
237
  });
238
+ Object.defineProperty(SciChartLegendBase.prototype, "backgroundColor", {
239
+ /**
240
+ * Gets or sets the backgroundColor as an html color code
241
+ */
242
+ get: function () {
243
+ return this.backgroundColorProperty;
244
+ },
245
+ /**
246
+ * Gets or sets the backgroundColor as an html color code
247
+ */
248
+ set: function (value) {
249
+ this.backgroundColorProperty = value;
250
+ this.notifyPropertyChanged();
251
+ },
252
+ enumerable: false,
253
+ configurable: true
254
+ });
255
+ Object.defineProperty(SciChartLegendBase.prototype, "textColor", {
256
+ /**
257
+ * Gets or sets the textColor as an html color code
258
+ */
259
+ get: function () {
260
+ return this.textColorProperty;
261
+ },
262
+ /**
263
+ * Gets or sets the textColor as an html color code
264
+ */
265
+ set: function (value) {
266
+ this.textColorProperty = value;
267
+ this.notifyPropertyChanged();
268
+ },
269
+ enumerable: false,
270
+ configurable: true
271
+ });
206
272
  SciChartLegendBase.prototype.clear = function () {
207
273
  var _a;
208
274
  if (this.div) {
@@ -236,7 +302,8 @@ var SciChartLegendBase = /** @class */ (function (_super) {
236
302
  SciChartLegendBase.prototype.getLegendHTML = function (placement, textColor, backgroundColor, margin, orientation, showCheckboxes, showSeriesMarkers, items) {
237
303
  var _this = this;
238
304
  var body = items.reduce(function (prev, curr) {
239
- return prev + _this.getLegendItemHTML(orientation, showCheckboxes, showSeriesMarkers, curr);
305
+ var _a;
306
+ return (prev + _this.getLegendItemHTML(orientation, showCheckboxes, (_a = curr.showMarker) !== null && _a !== void 0 ? _a : showSeriesMarkers, curr));
240
307
  }, "");
241
308
  return (0, exports.getLegendContainerHtml)(placement, textColor, backgroundColor, margin, body);
242
309
  };
@@ -265,16 +265,21 @@ var BasePointMarker = /** @class */ (function (_super) {
265
265
  var _this = this;
266
266
  this.invalidateCache();
267
267
  WebGlRenderContext2D_1.WebGlRenderContext2D.webGlResourcesRefs.delete(this);
268
- if (process.env.NODE_ENV !== "production") {
269
- // resolve memory debug issue when comparing to proxy object
270
- if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
271
- WebGlRenderContext2D_1.WebGlRenderContext2D.webGlResourcesRefs.forEach(function (ref) {
272
- if (ref.resetCache === _this.resetCache) {
273
- WebGlRenderContext2D_1.WebGlRenderContext2D.webGlResourcesRefs.delete(ref);
274
- }
275
- });
268
+ try {
269
+ if (process.env.NODE_ENV !== "production") {
270
+ // resolve memory debug issue when comparing to proxy object
271
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
272
+ WebGlRenderContext2D_1.WebGlRenderContext2D.webGlResourcesRefs.forEach(function (ref) {
273
+ if (ref.resetCache === _this.resetCache) {
274
+ WebGlRenderContext2D_1.WebGlRenderContext2D.webGlResourcesRefs.delete(ref);
275
+ }
276
+ });
277
+ }
276
278
  }
277
279
  }
280
+ catch (err) {
281
+ console.warn(err);
282
+ }
278
283
  };
279
284
  /**
280
285
  * Called internally - creates the {@link CanvasTexture} object and calls {@link drawSprite} for creating the cached texture to draw
@@ -131,7 +131,7 @@ export declare abstract class BaseRenderableSeries extends DeletableEntity imple
131
131
  /** @inheritDoc */
132
132
  get pointMarker(): IPointMarker;
133
133
  /** @inheritDoc */
134
- set pointMarker(pointMarker: IPointMarker);
134
+ set pointMarker(pointMarker: IPointMarker | undefined);
135
135
  /** @inheritDoc */
136
136
  get drawNaNAs(): ELineDrawMode;
137
137
  /** @inheritDoc */
@@ -863,6 +863,9 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
863
863
  }
864
864
  if (!this.animationFSM)
865
865
  return;
866
+ if (!this.dataSeries.xInitialAnimationValues) {
867
+ this.dataSeries.createAnimationVectors();
868
+ }
866
869
  animationHelpers_1.animationHelpers.animationUpdate(this.animationFSM, timeElapsed, this.beforeAnimationStart, this.afterAnimationComplete, this.updateAnimationProperties);
867
870
  };
868
871
  /** @inheritDoc */
@@ -967,9 +970,6 @@ var BaseRenderableSeries = /** @class */ (function (_super) {
967
970
  */
968
971
  BaseRenderableSeries.prototype.setAnimationVectors = function (animation) {
969
972
  var ds = this.dataSeries;
970
- if (!ds.xInitialAnimationValues) {
971
- ds.createAnimationVectors();
972
- }
973
973
  if (animation.isOnStartAnimation) {
974
974
  ds.setFinalAnimationVectors(ds);
975
975
  }
@@ -73,11 +73,16 @@ var BaseStackedCollection = /** @class */ (function (_super) {
73
73
  _this.updateAnimationProperties = _this.updateAnimationProperties.bind(_this);
74
74
  _this.accumulatedValues0 = new _this.webAssemblyContext.SCRTDoubleVector();
75
75
  _this.accumulatedFinalAnimationValues0 = new _this.webAssemblyContext.SCRTDoubleVector();
76
- if (process.env.NODE_ENV !== "production") {
77
- if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
78
- return new Proxy(_this, new DeletableEntity_1.DeletableEntityProxyHandler(_this));
76
+ try {
77
+ if (process.env.NODE_ENV !== "production") {
78
+ if (MemoryUsageHelper_1.MemoryUsageHelper.isMemoryUsageDebugEnabled) {
79
+ return (0, DeletableEntity_1.createTrackableProxy)(_this);
80
+ }
79
81
  }
80
82
  }
83
+ catch (err) {
84
+ console.warn(err);
85
+ }
81
86
  return _this;
82
87
  }
83
88
  Object.defineProperty(BaseStackedCollection.prototype, "isVisibleChanged", {
@@ -67,7 +67,7 @@ export declare abstract class BaseSeriesDrawingProvider<T extends IRenderableSer
67
67
  * @returns the new {@link UIntVector} with ARGB colors
68
68
  */
69
69
  applyStrokePaletting(strokePen: ISCRTPen): void;
70
- applyStrokeFillPaletting(stroke: string, strokePen: ISCRTPen, fill: string, fillBrush: ISCRTBrush, opacity: number, usePalette?: boolean, resetPenBrushColors?: boolean): void;
70
+ applyStrokeFillPaletting(stroke: string, strokePen: ISCRTPen | undefined, fill: string, fillBrush: ISCRTBrush | undefined, opacity: number, usePalette?: boolean, resetPenBrushColors?: boolean): void;
71
71
  /**
72
72
  * Creates a native {@link SCRTBrush} Solid Color Brush from html color code string passed in
73
73
  * @param htmlColorCode The HTML Color code
@@ -100,8 +100,8 @@ export declare abstract class BaseSeriesDrawingProvider<T extends IRenderableSer
100
100
  onDetachSeries(): void;
101
101
  protected seriesHasDataChanges(): void;
102
102
  protected overridePaletteProviderColors(rs: IRenderableSeries, xValue: number, yValue: number, index: number, opacity?: number, metadata?: IPointMetadata): {
103
- stroke: number;
104
- fill: number;
103
+ stroke: number | undefined;
104
+ fill: number | undefined;
105
105
  };
106
106
  protected isGradientFillPaletting(rs: IRenderableSeries): boolean;
107
107
  }
@@ -97,6 +97,10 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
97
97
  strokePen.m_uiColor = 0xffffffff;
98
98
  for (var index = indexStart; index < indexStart + drawCount; index++) {
99
99
  var originalDataIndex = pointSeries ? pointSeries.indexes.get(index) : index;
100
+ if (originalDataIndex < 0)
101
+ originalDataIndex = 0;
102
+ else if (originalDataIndex >= dataSeries.count())
103
+ originalDataIndex = dataSeries.count() - 1;
100
104
  var overrideColor = strokePaletteProvider.overrideStrokeArgb(xValues.get(index), yValues.get(index), originalDataIndex, this.parentSeries.opacity, dataSeries.getMetadataAt(originalDataIndex));
101
105
  this.parentSeries.pushPalettedColors(overrideColor ? overrideColor : strokeColorArgb, this.palettingState);
102
106
  }
@@ -185,6 +189,10 @@ var BaseSeriesDrawingProvider = /** @class */ (function (_super) {
185
189
  var hashCode = 0;
186
190
  for (var index = indexStart; index < indexStart + drawCount; index++) {
187
191
  var originalDataIndex = pointSeries ? pointSeries.indexes.get(index) : index;
192
+ if (originalDataIndex < 0)
193
+ originalDataIndex = 0;
194
+ else if (originalDataIndex >= dataSeries.count())
195
+ originalDataIndex = dataSeries.count() - 1;
188
196
  var xValue = xValues.get(index);
189
197
  var yValue = yValues.get(index);
190
198
  var overriddenColors = this.overridePaletteProviderColors(this.parentSeries, xValue, yValue, originalDataIndex, opacity, dataSeries.getMetadataAt(originalDataIndex));
@@ -1,4 +1,5 @@
1
1
  import { SeriesSelectionModifier } from "../../ChartModifiers/SeriesSelectionModifier";
2
+ import { HitTestInfo } from "./HitTest/HitTestInfo";
2
3
  import { IRenderableSeries } from "./IRenderableSeries";
3
4
  /**
4
5
  * Arguments passed into the callback for {@link SeriesSelectionModifier.hoverChanged} event
@@ -16,6 +17,10 @@ export declare class HoveredChangedArgs {
16
17
  * The array of all series at the time of the event. Query {@link IRenderableSeries.isSelected} to determine if it is selected or not
17
18
  */
18
19
  readonly allSeries: IRenderableSeries[];
20
+ /**
21
+ * The hitTestInfo for this event, if available.
22
+ */
23
+ readonly hitTestInfo: HitTestInfo;
19
24
  /**
20
25
  * Creates an instance of SelectionChangedArgs -
21
26
  * arguments passed into the callback for {@link SeriesSelectionModifier.selectionChanged} event
@@ -23,5 +28,5 @@ export declare class HoveredChangedArgs {
23
28
  * @param hoveredSeries
24
29
  * @param allSeries
25
30
  */
26
- constructor(source: SeriesSelectionModifier, hoveredSeries: IRenderableSeries[], allSeries: IRenderableSeries[]);
31
+ constructor(source: SeriesSelectionModifier, hoveredSeries: IRenderableSeries[], allSeries: IRenderableSeries[], hitTestInfo: HitTestInfo);
27
32
  }
@@ -12,10 +12,11 @@ var HoveredChangedArgs = /** @class */ (function () {
12
12
  * @param hoveredSeries
13
13
  * @param allSeries
14
14
  */
15
- function HoveredChangedArgs(source, hoveredSeries, allSeries) {
15
+ function HoveredChangedArgs(source, hoveredSeries, allSeries, hitTestInfo) {
16
16
  this.source = source;
17
17
  this.hoveredSeries = hoveredSeries;
18
18
  this.allSeries = allSeries;
19
+ this.hitTestInfo = hitTestInfo;
19
20
  }
20
21
  return HoveredChangedArgs;
21
22
  }());
@@ -194,7 +194,7 @@ export interface IRenderableSeries extends IDeletable, IThemeable, INotifyOnDpiC
194
194
  /**
195
195
  * A {@link IPointMarker | Point Marker} which is used to draw an optional point-marker at each data-point. Applicable to some series types only
196
196
  */
197
- pointMarker: IPointMarker;
197
+ pointMarker: IPointMarker | undefined;
198
198
  /**
199
199
  * How to treat NAN (Not a number) values in the input {@link dataSeries}. See {@link ELineDrawMode} for a list of values.
200
200
  */
@@ -1,4 +1,5 @@
1
1
  import { SeriesSelectionModifier } from "../../ChartModifiers/SeriesSelectionModifier";
2
+ import { HitTestInfo } from "./HitTest/HitTestInfo";
2
3
  import { IRenderableSeries } from "./IRenderableSeries";
3
4
  /**
4
5
  * Arguments passed into the callback for {@link SeriesSelectionModifier.selectionChanged} event
@@ -16,6 +17,10 @@ export declare class SelectionChangedArgs {
16
17
  * The array of all series at the time of the event. Query {@link IRenderableSeries.isSelected} to determine if it is selected or not
17
18
  */
18
19
  readonly allSeries: IRenderableSeries[];
20
+ /**
21
+ * The hitTestInfo for this event, if available.
22
+ */
23
+ readonly hitTestInfo: HitTestInfo;
19
24
  /**
20
25
  * Creates an instance of SelectionChangedArgs -
21
26
  * arguments passed into the callback for {@link SeriesSelectionModifier.selectionChanged} event
@@ -23,5 +28,5 @@ export declare class SelectionChangedArgs {
23
28
  * @param selectedSeries
24
29
  * @param allSeries
25
30
  */
26
- constructor(source: SeriesSelectionModifier, selectedSeries: IRenderableSeries[], allSeries: IRenderableSeries[]);
31
+ constructor(source: SeriesSelectionModifier, selectedSeries: IRenderableSeries[], allSeries: IRenderableSeries[], hitTestInfo: HitTestInfo);
27
32
  }