scichart 3.0.0-beta.235 → 3.0.266

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 (42) hide show
  1. package/Builder/buildAnnotations.d.ts +4 -0
  2. package/Builder/buildAnnotations.js +2 -0
  3. package/Charting/Drawing/WebGlRenderContext2D.js +1 -1
  4. package/Charting/Visuals/Annotations/NativeTextAnnotation.d.ts +21 -0
  5. package/Charting/Visuals/Annotations/NativeTextAnnotation.js +45 -4
  6. package/Charting/Visuals/Annotations/constants.d.ts +3 -1
  7. package/Charting/Visuals/Annotations/constants.js +2 -0
  8. package/Charting/Visuals/Axis/AxisBase2D.js +4 -3
  9. package/Charting/Visuals/Axis/AxisRenderer.js +3 -3
  10. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.d.ts +15 -0
  11. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +29 -4
  12. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +4 -2
  13. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.d.ts +0 -13
  14. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.js +1 -21
  15. package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.js +1 -1
  16. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.d.ts +4 -4
  17. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.js +88 -38
  18. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +4 -3
  19. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.d.ts +2 -0
  20. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.js +10 -0
  21. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.d.ts +5 -2
  22. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.js +12 -5
  23. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -13
  24. package/Charting/Visuals/SciChartSurface.d.ts +7 -0
  25. package/Charting/Visuals/SciChartSurface.js +68 -16
  26. package/Charting/Visuals/createMaster.js +2 -1
  27. package/Core/BuildStamp.d.ts +1 -1
  28. package/Core/BuildStamp.js +2 -2
  29. package/Core/Mouse/MouseManager.js +1 -1
  30. package/README.md +60 -58
  31. package/_wasm/scichart.browser.js +1 -1
  32. package/_wasm/scichart2d.js +25 -25
  33. package/_wasm/scichart2d.wasm +0 -0
  34. package/_wasm/scichart3d.js +32 -32
  35. package/_wasm/scichart3d.wasm +0 -0
  36. package/package.json +1 -1
  37. package/types/TSciChart.d.ts +13 -0
  38. package/types/TSciChart3D.d.ts +11 -0
  39. package/types/TextPosition.d.ts +2 -2
  40. package/types/TextPosition.js +2 -2
  41. package/utils/pointUtil.d.ts +1 -1
  42. package/utils/pointUtil.js +2 -2
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  Object.defineProperty(exports, "__esModule", { value: true });
18
29
  exports.ColumnSeriesDataLabelProvider = exports.EColumnDataLabelPosition = void 0;
19
30
  var Point_1 = require("../../../../Core/Point");
@@ -24,14 +35,14 @@ var EColumnDataLabelPosition;
24
35
  (function (EColumnDataLabelPosition) {
25
36
  EColumnDataLabelPosition["Outside"] = "Outside";
26
37
  EColumnDataLabelPosition["Inside"] = "Inside";
27
- EColumnDataLabelPosition["VerticalPosition"] = "VerticalPosition";
38
+ EColumnDataLabelPosition["Position"] = "Position";
28
39
  })(EColumnDataLabelPosition = exports.EColumnDataLabelPosition || (exports.EColumnDataLabelPosition = {}));
29
40
  var ColumnSeriesDataLabelProvider = /** @class */ (function (_super) {
30
41
  __extends(ColumnSeriesDataLabelProvider, _super);
31
42
  function ColumnSeriesDataLabelProvider(options) {
32
43
  var _this = this;
33
44
  var _a;
34
- _this = _super.call(this, options) || this;
45
+ _this = _super.call(this, __assign({ horizontalTextPosition: TextPosition_1.EHorizontalTextPosition.Center, verticalTextPosition: TextPosition_1.EVerticalTextPosition.Center }, options)) || this;
35
46
  _this.type = DataLabelProviderType_1.EDataLabelProviderType.Column;
36
47
  _this.positionModeProperty = EColumnDataLabelPosition.Outside;
37
48
  _this.positionModeProperty = (_a = options === null || options === void 0 ? void 0 : options.positionMode) !== null && _a !== void 0 ? _a : _this.positionMode;
@@ -40,7 +51,7 @@ var ColumnSeriesDataLabelProvider = /** @class */ (function (_super) {
40
51
  Object.defineProperty(ColumnSeriesDataLabelProvider.prototype, "positionMode", {
41
52
  /**
42
53
  * Sets whether text should be positioned outside or inside the end of the column using {@link EColumnDataLabelPosition}.
43
- * If VerticalPosition then the {@link verticalPosition} property is used.
54
+ * If Position then the {@link verticalTextPosition} property is used, or {@link horizontalTextPosition} if it is a vertical chart.
44
55
  * Default Outside
45
56
  */
46
57
  get: function () {
@@ -48,7 +59,7 @@ var ColumnSeriesDataLabelProvider = /** @class */ (function (_super) {
48
59
  },
49
60
  /**
50
61
  * Sets whether text should be positioned outside or inside the end of the column using {@link EColumnDataLabelPosition}.
51
- * If VerticalPosition then the {@link verticalPosition} property is used.
62
+ * If Position then the {@link verticalTextPosition} property is used, or {@link horizontalTextPosition} if it is a vertical chart.
52
63
  * Default Outside
53
64
  */
54
65
  set: function (value) {
@@ -67,49 +78,88 @@ var ColumnSeriesDataLabelProvider = /** @class */ (function (_super) {
67
78
  _super.prototype.generateDataLabels.call(this, renderContext, renderPassData);
68
79
  };
69
80
  ColumnSeriesDataLabelProvider.prototype.getPosition = function (state, textBounds) {
70
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
81
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
71
82
  var x = state.xCoord();
72
- if (this.horizontalTextPosition === TextPosition_1.EHorizontalTextPosition.Center) {
73
- x -= textBounds.m_fWidth / 2;
74
- }
75
- else if (this.horizontalTextPosition === TextPosition_1.EHorizontalTextPosition.Left) {
76
- x -= textBounds.m_fWidth + ((_b = (_a = this.style.padding) === null || _a === void 0 ? void 0 : _a.right) !== null && _b !== void 0 ? _b : 0);
77
- }
78
- else {
79
- x += (_d = (_c = this.style.padding) === null || _c === void 0 ? void 0 : _c.left) !== null && _d !== void 0 ? _d : 0;
80
- }
81
- if (this.positionMode === EColumnDataLabelPosition.Outside) {
82
- // Handle multiline
83
- var yOffset = textBounds.m_fHeight - textBounds.GetLineBounds(0).m_fHeight;
84
- var y = state.yCoord() - yOffset;
85
- // Text anchor point is bottom left
86
- if (state.yVal() >= 0) {
87
- // positive - draw above
88
- y -= this.yAdj + ((_f = (_e = state.style.padding) === null || _e === void 0 ? void 0 : _e.bottom) !== null && _f !== void 0 ? _f : 1);
83
+ var yOffset = textBounds.m_fHeight - textBounds.GetLineBounds(0).m_fHeight;
84
+ // Handle multiline
85
+ var y = state.yCoord() - yOffset;
86
+ var flipX = state.isXFlipped ? -1 : 1;
87
+ var flipY = state.isYFlipped ? -1 : 1;
88
+ if (state.isVerticalChart) {
89
+ if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Center) {
90
+ y += textBounds.m_fHeight / 2;
91
+ }
92
+ else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Below) {
93
+ y += textBounds.m_fHeight + ((_b = (_a = this.style.padding) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 0);
89
94
  }
90
95
  else {
91
- // negative - draw below
92
- y += textBounds.m_fHeight + this.yAdj + ((_h = (_g = state.style.padding) === null || _g === void 0 ? void 0 : _g.top) !== null && _h !== void 0 ? _h : 1);
96
+ y -= (_d = (_c = this.style.padding) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 0;
93
97
  }
94
- return new Point_1.Point(x, y);
95
- }
96
- else if (this.positionMode === EColumnDataLabelPosition.Inside) {
97
- // Handle multiline
98
- var yOffset = textBounds.m_fHeight - textBounds.GetLineBounds(0).m_fHeight;
99
- var y = state.yCoord() - yOffset;
100
- // Text anchor point is bottom left
101
- if (state.yVal() >= 0) {
102
- y += textBounds.m_fHeight + this.yAdj + ((_k = (_j = state.style.padding) === null || _j === void 0 ? void 0 : _j.top) !== null && _k !== void 0 ? _k : 1);
103
- // positive - draw below
98
+ if (this.positionMode === EColumnDataLabelPosition.Outside) {
99
+ // Text anchor point is bottom left
100
+ if (state.yVal() * flipY >= 0) {
101
+ // positive - draw right
102
+ x += this.yAdj + ((_f = (_e = state.style.padding) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 1);
103
+ }
104
+ else {
105
+ // negative - draw left
106
+ x -= textBounds.m_fWidth + this.yAdj + ((_h = (_g = state.style.padding) === null || _g === void 0 ? void 0 : _g.right) !== null && _h !== void 0 ? _h : 1);
107
+ }
108
+ return new Point_1.Point(x, y);
109
+ }
110
+ else if (this.positionMode === EColumnDataLabelPosition.Inside) {
111
+ // Text anchor point is bottom left
112
+ if (state.yVal() * flipY >= 0) {
113
+ x -= textBounds.m_fWidth + this.yAdj + ((_k = (_j = state.style.padding) === null || _j === void 0 ? void 0 : _j.right) !== null && _k !== void 0 ? _k : 1);
114
+ // positive - draw left
115
+ }
116
+ else {
117
+ // negative - draw right
118
+ x += this.yAdj + ((_m = (_l = state.style.padding) === null || _l === void 0 ? void 0 : _l.left) !== null && _m !== void 0 ? _m : 1);
119
+ }
120
+ return new Point_1.Point(x, y);
104
121
  }
105
122
  else {
106
- // negative - draw above
107
- y -= this.yAdj + ((_m = (_l = state.style.padding) === null || _l === void 0 ? void 0 : _l.bottom) !== null && _m !== void 0 ? _m : 1);
123
+ return _super.prototype.getPosition.call(this, state, textBounds);
108
124
  }
109
- return new Point_1.Point(x, y);
110
125
  }
111
126
  else {
112
- return _super.prototype.getPosition.call(this, state, textBounds);
127
+ if (this.horizontalTextPosition === TextPosition_1.EHorizontalTextPosition.Center) {
128
+ x -= textBounds.m_fWidth / 2;
129
+ }
130
+ else if (this.horizontalTextPosition === TextPosition_1.EHorizontalTextPosition.Left) {
131
+ x -= textBounds.m_fWidth + ((_p = (_o = this.style.padding) === null || _o === void 0 ? void 0 : _o.right) !== null && _p !== void 0 ? _p : 0);
132
+ }
133
+ else {
134
+ x += (_r = (_q = this.style.padding) === null || _q === void 0 ? void 0 : _q.left) !== null && _r !== void 0 ? _r : 0;
135
+ }
136
+ if (this.positionMode === EColumnDataLabelPosition.Outside) {
137
+ // Text anchor point is bottom left
138
+ if (state.yVal() * flipY >= 0) {
139
+ // positive - draw above
140
+ y -= this.yAdj + ((_t = (_s = state.style.padding) === null || _s === void 0 ? void 0 : _s.bottom) !== null && _t !== void 0 ? _t : 1);
141
+ }
142
+ else {
143
+ // negative - draw below
144
+ y += textBounds.m_fHeight + this.yAdj + ((_v = (_u = state.style.padding) === null || _u === void 0 ? void 0 : _u.top) !== null && _v !== void 0 ? _v : 1);
145
+ }
146
+ return new Point_1.Point(x, y);
147
+ }
148
+ else if (this.positionMode === EColumnDataLabelPosition.Inside) {
149
+ // Text anchor point is bottom left
150
+ if (state.yVal() * flipY >= 0) {
151
+ y += textBounds.m_fHeight + this.yAdj + ((_x = (_w = state.style.padding) === null || _w === void 0 ? void 0 : _w.top) !== null && _x !== void 0 ? _x : 1);
152
+ // positive - draw below
153
+ }
154
+ else {
155
+ // negative - draw above
156
+ y -= this.yAdj + ((_z = (_y = state.style.padding) === null || _y === void 0 ? void 0 : _y.bottom) !== null && _z !== void 0 ? _z : 1);
157
+ }
158
+ return new Point_1.Point(x, y);
159
+ }
160
+ else {
161
+ return _super.prototype.getPosition.call(this, state, textBounds);
162
+ }
113
163
  }
114
164
  };
115
165
  ColumnSeriesDataLabelProvider.prototype.toJSON = function () {
@@ -65,7 +65,7 @@ var DataLabelProvider = /** @class */ (function (_super) {
65
65
  _this.skipModeProperty = DataLabelSkipMode_1.EDataLabelSkipMode.SkipIfOverlapPrevious;
66
66
  _this.skipNumberProperty = 0;
67
67
  _this.horizontalTextPositionProperty = TextPosition_1.EHorizontalTextPosition.Right;
68
- _this.verticalTextPositionProperty = TextPosition_1.EVerticalTextPosition.Top;
68
+ _this.verticalTextPositionProperty = TextPosition_1.EVerticalTextPosition.Above;
69
69
  _this.pointGapThresholdProperty = (_a = options === null || options === void 0 ? void 0 : options.pointGapThreshold) !== null && _a !== void 0 ? _a : _this.pointGapThresholdProperty;
70
70
  _this.pointCountThresholdProperty = (_b = options === null || options === void 0 ? void 0 : options.pointCountThreshold) !== null && _b !== void 0 ? _b : _this.pointCountThresholdProperty;
71
71
  _this.numericFormatProperty = (_c = options === null || options === void 0 ? void 0 : options.numericFormat) !== null && _c !== void 0 ? _c : _this.numericFormatProperty;
@@ -273,7 +273,7 @@ var DataLabelProvider = /** @class */ (function (_super) {
273
273
  if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Center) {
274
274
  y += textBounds.m_fHeight / 2;
275
275
  }
276
- else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Bottom) {
276
+ else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Below) {
277
277
  y += textBounds.m_fHeight + ((_f = (_e = this.style.padding) === null || _e === void 0 ? void 0 : _e.top) !== null && _f !== void 0 ? _f : 0);
278
278
  }
279
279
  else {
@@ -329,7 +329,8 @@ var DataLabelProvider = /** @class */ (function (_super) {
329
329
  if (!this.shouldGenerate(this.state))
330
330
  return;
331
331
  var skipCount = 0;
332
- for (var i = this.state.indexStart; i <= this.state.indexEnd; i += this.skipNumberProperty + 1) {
332
+ var skipNum = Math.max(0, this.skipNumberProperty);
333
+ for (var i = this.state.indexStart; i <= this.state.indexEnd; i += skipNum + 1) {
333
334
  this.state.index =
334
335
  this.skipModeProperty === DataLabelSkipMode_1.EDataLabelSkipMode.SkipIfOverlapNext
335
336
  ? this.state.indexEnd - (i - this.state.indexStart)
@@ -14,6 +14,7 @@ export declare class DataLabelState {
14
14
  readonly parentSeries: IRenderableSeries;
15
15
  readonly renderPassData: RenderPassData;
16
16
  readonly isXFlipped: boolean;
17
+ readonly isYFlipped: boolean;
17
18
  readonly pointCount: number;
18
19
  readonly xPadding: number;
19
20
  readonly yPadding: number;
@@ -35,6 +36,7 @@ export declare class DataLabelState {
35
36
  hasNext(index?: number): boolean;
36
37
  get lastLabel(): TDataLabel;
37
38
  getMetaData(): import("../../../Model/IPointMetadata").IPointMetadata;
39
+ get isVerticalChart(): boolean;
38
40
  private xCoordInternal;
39
41
  private yCoordInternal;
40
42
  }
@@ -23,6 +23,9 @@ var DataLabelState = /** @class */ (function () {
23
23
  this.isXFlipped = (renderPassData.isVerticalChart
24
24
  ? this.renderPassData.yCoordinateCalculator
25
25
  : this.renderPassData.xCoordinateCalculator).hasFlippedCoordinates;
26
+ this.isYFlipped = (renderPassData.isVerticalChart
27
+ ? this.renderPassData.xCoordinateCalculator
28
+ : this.renderPassData.yCoordinateCalculator).hasFlippedCoordinates;
26
29
  if (!renderPassData.indexRange) {
27
30
  var indicesRange = this.parentSeries.dataSeries.getIndicesRange(new NumberRange_1.NumberRange(renderPassData.xCoordinateCalculator.visibleMin, renderPassData.xCoordinateCalculator.visibleMax), isCategoryAxis);
28
31
  this.indexStart = indicesRange.min;
@@ -114,6 +117,13 @@ var DataLabelState = /** @class */ (function () {
114
117
  var index = this.renderPassData.pointSeries.indexes.get(this.index);
115
118
  return this.parentSeries.dataSeries.getMetadataAt(index);
116
119
  };
120
+ Object.defineProperty(DataLabelState.prototype, "isVerticalChart", {
121
+ get: function () {
122
+ return this.renderPassData.isVerticalChart;
123
+ },
124
+ enumerable: false,
125
+ configurable: true
126
+ });
117
127
  DataLabelState.prototype.xCoordInternal = function (index) {
118
128
  if (index !== undefined)
119
129
  return this.renderPassData.xCoordinateCalculator.getCoordinate(this.xVal(index));
@@ -1,7 +1,7 @@
1
1
  import { Point } from "../../../../Core/Point";
2
2
  import { WebGlRenderContext2D } from "../../../Drawing/WebGlRenderContext2D";
3
3
  import { RenderPassData } from "../../../Services/RenderPassData";
4
- import { BaseDataLabelProvider, IBaseDataLabelProviderOptions } from "./BaseDataLabelProvider";
4
+ import { BaseDataLabelProvider, IBaseDataLabelProviderOptions, TDataLabel } from "./BaseDataLabelProvider";
5
5
  import { EDataLabelProviderType } from "../../../../types/DataLabelProviderType";
6
6
  import { DataLabelState } from "./DataLabelState";
7
7
  import { EHorizontalTextPosition, EVerticalTextPosition } from "../../../../types/TextPosition";
@@ -25,7 +25,8 @@ export interface ITextDataLabelProviderOptions extends IBaseDataLabelProviderOpt
25
25
  export declare class TextDataLabelProvider extends BaseDataLabelProvider {
26
26
  type: EDataLabelProviderType;
27
27
  /**
28
- * If your labels are all the same size, or you are not changing the alignment, you can set this false to gain performance
28
+ * This default false for maximum performance. It will be true if you set the textPosition to something other than Above, Right.
29
+ * You can force it true if you want to make use of the text sizes in onAfterGenerate
29
30
  */
30
31
  calculateTextBounds: boolean;
31
32
  protected horizontalTextPositionProperty: EHorizontalTextPosition;
@@ -46,6 +47,8 @@ export declare class TextDataLabelProvider extends BaseDataLabelProvider {
46
47
  getPosition(state: DataLabelState, textBounds: TSRTextBounds): Point;
47
48
  getColor(state: DataLabelState, text: string): number;
48
49
  generateDataLabels(renderContext: WebGlRenderContext2D, renderPassData: RenderPassData): void;
50
+ /** Called after labels are generated but before they are drawn. */
51
+ onAfterGenerate(dataLabels: TDataLabel[]): void;
49
52
  toJSON(): {
50
53
  type: EDataLabelProviderType;
51
54
  options: {
@@ -46,11 +46,12 @@ var TextDataLabelProvider = /** @class */ (function (_super) {
46
46
  _this = _super.call(this, __assign(__assign({}, options), { style: __assign({ fontFamily: "Arial", fontSize: 12 }, options === null || options === void 0 ? void 0 : options.style) })) || this;
47
47
  _this.type = DataLabelProviderType_1.EDataLabelProviderType.Text;
48
48
  /**
49
- * If your labels are all the same size, or you are not changing the alignment, you can set this false to gain performance
49
+ * This default false for maximum performance. It will be true if you set the textPosition to something other than Above, Right.
50
+ * You can force it true if you want to make use of the text sizes in onAfterGenerate
50
51
  */
51
- _this.calculateTextBounds = true;
52
+ _this.calculateTextBounds = false;
52
53
  _this.horizontalTextPositionProperty = TextPosition_1.EHorizontalTextPosition.Right;
53
- _this.verticalTextPositionProperty = TextPosition_1.EVerticalTextPosition.Top;
54
+ _this.verticalTextPositionProperty = TextPosition_1.EVerticalTextPosition.Above;
54
55
  _this.calculateTextBounds = (_a = options === null || options === void 0 ? void 0 : options.calculateTextBounds) !== null && _a !== void 0 ? _a : _this.calculateTextBounds;
55
56
  _this.horizontalTextPositionProperty = (_b = options === null || options === void 0 ? void 0 : options.horizontalTextPosition) !== null && _b !== void 0 ? _b : _this.horizontalTextPosition;
56
57
  _this.verticalTextPositionProperty = (_c = options === null || options === void 0 ? void 0 : options.verticalTextPosition) !== null && _c !== void 0 ? _c : _this.verticalTextPosition;
@@ -103,7 +104,7 @@ var TextDataLabelProvider = /** @class */ (function (_super) {
103
104
  if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Center) {
104
105
  y += textBounds.m_fHeight / 2;
105
106
  }
106
- else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Bottom) {
107
+ else if (this.verticalTextPosition === TextPosition_1.EVerticalTextPosition.Below) {
107
108
  y += textBounds.m_fHeight + ((_f = (_e = this.style.padding) === null || _e === void 0 ? void 0 : _e.top) !== null && _f !== void 0 ? _f : 0);
108
109
  }
109
110
  else {
@@ -129,13 +130,16 @@ var TextDataLabelProvider = /** @class */ (function (_super) {
129
130
  var state = new DataLabelState_1.DataLabelState(renderContext, renderPassData, this.style, this.color, renderPassData.pointSeries.yValues, this.parentSeries);
130
131
  var bounds = (0, NativeObject_1.getTextBounds)(this.webAssemblyContext);
131
132
  var indexes = renderPassData.pointSeries.indexes;
133
+ var calcBounds = this.verticalTextPosition !== TextPosition_1.EVerticalTextPosition.Above ||
134
+ this.horizontalTextPosition !== TextPosition_1.EHorizontalTextPosition.Right ||
135
+ this.calculateTextBounds;
132
136
  if (textSeries) {
133
137
  state.font.CalculateStringBounds((_a = textSeries.textValues[0]) !== null && _a !== void 0 ? _a : "", bounds, (_c = (_b = this.style) === null || _b === void 0 ? void 0 : _b.lineSpacing) !== null && _c !== void 0 ? _c : 2);
134
138
  for (var i = 0; i < indexes.size(); i++) {
135
139
  state.index = i;
136
140
  var index = indexes.get(state.index);
137
141
  var text = textSeries.textValues[index];
138
- if (this.calculateTextBounds) {
142
+ if (calcBounds) {
139
143
  state.font.CalculateStringBounds(text !== null && text !== void 0 ? text : "", bounds, (_e = (_d = this.style) === null || _d === void 0 ? void 0 : _d.lineSpacing) !== null && _e !== void 0 ? _e : 2);
140
144
  }
141
145
  var position = this.getPosition(state, bounds);
@@ -151,7 +155,10 @@ var TextDataLabelProvider = /** @class */ (function (_super) {
151
155
  this.dataLabels.push(label);
152
156
  }
153
157
  }
158
+ this.onAfterGenerate(this.dataLabels);
154
159
  };
160
+ /** Called after labels are generated but before they are drawn. */
161
+ TextDataLabelProvider.prototype.onAfterGenerate = function (dataLabels) { };
155
162
  TextDataLabelProvider.prototype.toJSON = function () {
156
163
  var json = _super.prototype.toJSON.call(this);
157
164
  var options = {
@@ -14,22 +14,10 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
17
  Object.defineProperty(exports, "__esModule", { value: true });
29
18
  exports.getXRange = exports.FastColumnRenderableSeries = void 0;
30
19
  var NumberRange_1 = require("../../../Core/NumberRange");
31
20
  var SeriesType_1 = require("../../../types/SeriesType");
32
- var TextPosition_1 = require("../../../types/TextPosition");
33
21
  var IThemeProvider_1 = require("../../Themes/IThemeProvider");
34
22
  var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
35
23
  var BaseRenderableSeries_1 = require("./BaseRenderableSeries");
@@ -87,7 +75,7 @@ var FastColumnRenderableSeries = /** @class */ (function (_super) {
87
75
  (_g = _this.paletteProvider) === null || _g === void 0 ? void 0 : _g.onAttached(_this);
88
76
  }
89
77
  if (!_this.dataLabelProviderProperty) {
90
- _this.dataLabelProviderProperty = new ColumnSeriesDataLabelProvider_1.ColumnSeriesDataLabelProvider(__assign({ horizontalTextPosition: TextPosition_1.EHorizontalTextPosition.Center }, options === null || options === void 0 ? void 0 : options.dataLabels));
78
+ _this.dataLabelProviderProperty = new ColumnSeriesDataLabelProvider_1.ColumnSeriesDataLabelProvider(options === null || options === void 0 ? void 0 : options.dataLabels);
91
79
  _this.dataLabelProviderProperty.onAttach(_this.webAssemblyContext, _this);
92
80
  }
93
81
  _this.drawingProviders.push(new ColumnSeriesDrawingProvider_1.ColumnSeriesDrawingProvider(webAssemblyContext, _this));
@@ -457,6 +457,13 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
457
457
  getSeriesViewRectPadding(scaled?: boolean): Thickness;
458
458
  /** Calls resolveAutoColors on each series to resolve colors marked as auto based on the seriesColorPalette */
459
459
  resolveAutoColors(maxSeries?: number): void;
460
+ /**
461
+ *
462
+ * @param fontName Register a font to be used with native text.
463
+ * @param url
464
+ * @returns
465
+ */
466
+ registerFont(fontName: string, url: string): Promise<boolean>;
460
467
  /**
461
468
  * Used internally - sets SVG Canvas Translation
462
469
  * @param x
@@ -25,6 +25,42 @@ var __assign = (this && this.__assign) || function () {
25
25
  };
26
26
  return __assign.apply(this, arguments);
27
27
  };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __generator = (this && this.__generator) || function (thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (_) try {
44
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ };
28
64
  Object.defineProperty(exports, "__esModule", { value: true });
29
65
  exports.SciChartSubSurface = exports.SciChartSurface = exports.sciChartConfig = void 0;
30
66
  var chartBuilder_1 = require("../../Builder/chartBuilder");
@@ -983,6 +1019,36 @@ var SciChartSurface = /** @class */ (function (_super) {
983
1019
  }
984
1020
  }
985
1021
  };
1022
+ /**
1023
+ *
1024
+ * @param fontName Register a font to be used with native text.
1025
+ * @param url
1026
+ * @returns
1027
+ */
1028
+ SciChartSurface.prototype.registerFont = function (fontName, url) {
1029
+ return __awaiter(this, void 0, void 0, function () {
1030
+ var _this = this;
1031
+ return __generator(this, function (_a) {
1032
+ if (!fontName.includes(".")) {
1033
+ fontName += ".ttf";
1034
+ }
1035
+ return [2 /*return*/, new Promise(function (resolve, reject) {
1036
+ var callback = _this.webAssemblyContext2D.SCRTFileLoadCallbackInterface.implement({
1037
+ OnLoadComplete: function (success, message) {
1038
+ if (success) {
1039
+ resolve(true);
1040
+ }
1041
+ else {
1042
+ console.error("Failed to load ".concat(fontName, " from ").concat(url, ". Error: ").concat(message));
1043
+ resolve(false);
1044
+ }
1045
+ }
1046
+ });
1047
+ _this.webAssemblyContext2D.SCRTRegisterFile(fontName, url, callback);
1048
+ })];
1049
+ });
1050
+ });
1051
+ };
986
1052
  /**
987
1053
  * Used internally - sets SVG Canvas Translation
988
1054
  * @param x
@@ -1568,22 +1634,8 @@ var SciChartSubSurface = /** @class */ (function (_super) {
1568
1634
  else {
1569
1635
  theme = this.themeProvider;
1570
1636
  }
1571
- var options = {
1572
- canvasBorder: this.canvasBorder,
1573
- heightAspect: this.heightAspect,
1574
- widthAspect: this.widthAspect,
1575
- layoutManager: (_a = this.layoutManager) === null || _a === void 0 ? void 0 : _a.toJSON(),
1576
- padding: this.subPaddingProperty,
1577
- theme: theme,
1578
- viewportBorder: this.viewportBorder,
1579
- loader: this.loaderJson,
1580
- position: this.subPosition,
1581
- subChartContainerId: typeof this.subChartContainerId === "string" ? this.subChartContainerId : this.subChartContainerId.id,
1582
- subChartPadding: this.subChartPadding,
1583
- coordinateMode: this.coordinateMode,
1584
- parentXAxisId: this.parentXAxisId,
1585
- parentYAxisId: this.parentYAxisId
1586
- };
1637
+ var baseSurfaceDefinition = _super.prototype.toJSON.call(this);
1638
+ var options = __assign(__assign({}, baseSurfaceDefinition.surface), { isTransparent: this.isTransparent, isVisible: this.isVisible, sectionScale: this.sectionScale, subChartPadding: this.subPaddingProperty, position: this.subPosition, subChartContainerId: typeof this.subChartContainerId === "string" ? this.subChartContainerId : (_a = this.subChartContainerId) === null || _a === void 0 ? void 0 : _a.id, coordinateMode: this.coordinateMode, parentXAxisId: this.parentXAxisId, parentYAxisId: this.parentYAxisId });
1587
1639
  var definition = {
1588
1640
  surface: options,
1589
1641
  xAxes: this.xAxes.asArray().map(function (axis) { return axis.toJSON(); }),
@@ -221,7 +221,8 @@ var createMaster = function () {
221
221
  // @ts-ignore
222
222
  wasmContext.callMain();
223
223
  })
224
- .catch(function () {
224
+ .catch(function (err) {
225
+ console.error(err);
225
226
  reject("Could not load SciChart WebAssembly module.\n Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version");
226
227
  });
227
228
  });
@@ -1,4 +1,4 @@
1
1
  import { TSciChart } from "../types/TSciChart";
2
2
  import { TSciChart3D } from "../types/TSciChart3D";
3
- export declare const libraryVersion = "3.0.0-beta.235";
3
+ export declare const libraryVersion = "3.0.266";
4
4
  export declare const checkBuildStamp: (wasmContext: TSciChart | TSciChart3D) => boolean;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkBuildStamp = exports.libraryVersion = void 0;
4
- var buildStamp = "2022-12-21T00:00:00";
4
+ var buildStamp = "2023-01-16T00:00:00";
5
5
  var result;
6
6
  // tslint:disable-next-line:no-var-requires
7
- exports.libraryVersion = "3.0.0-beta.235";
7
+ exports.libraryVersion = "3.0.266";
8
8
  var checkBuildStamp = function (wasmContext) {
9
9
  if (result !== undefined)
10
10
  return result;
@@ -479,7 +479,7 @@ var MouseManager = /** @class */ (function () {
479
479
  MouseManager.prototype.updateSubCharts = function (args, eventType) {
480
480
  var _this = this;
481
481
  var subCharts = this.sciChartSurface.subCharts;
482
- var currentActiveSubChart = subCharts.find(function (scs) {
482
+ var currentActiveSubChart = subCharts === null || subCharts === void 0 ? void 0 : subCharts.find(function (scs) {
483
483
  var _a = scs.padding, top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right;
484
484
  var _b = args.mousePoint, x = _b.x, y = _b.y;
485
485
  var xns = x / DpiHelper_1.DpiHelper.PIXEL_RATIO;