scichart 2.0.2195 → 2.0.2204

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.
@@ -1,6 +1,7 @@
1
1
  import { IIncludeSeries } from "../../Core/IIncludeSeries";
2
2
  import { Point } from "../../Core/Point";
3
3
  import { EChart2DModifierType } from "../../types/ChartModifierType";
4
+ import { EMousePosition } from "../../types/MousePosition";
4
5
  import { SeriesInfo } from "../Model/ChartData/SeriesInfo";
5
6
  import { IThemeProvider } from "../Themes/IThemeProvider";
6
7
  import { CursorTooltipSvgAnnotation } from "../Visuals/Annotations/CursorTooltipSvgAnnotation";
@@ -176,6 +177,9 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
176
177
  * @inheritDoc
177
178
  */
178
179
  getIncludedRenderableSeries(): IRenderableSeries[];
180
+ /**
181
+ * Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
182
+ */
179
183
  get tooltipDataTemplate(): TCursorTooltipDataTemplate;
180
184
  set tooltipDataTemplate(value: TCursorTooltipDataTemplate);
181
185
  /**
@@ -184,6 +188,11 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
184
188
  * @param mousePoint
185
189
  */
186
190
  hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
191
+ /**
192
+ * Returns current mouse position
193
+ */
194
+ getMousePosition(): EMousePosition;
195
+ /** @inheritDoc */
187
196
  toJSON(): {
188
197
  type: string;
189
198
  options: Required<Omit<IChartModifierBaseOptions, never>>;
@@ -300,6 +300,9 @@ var CursorModifier = /** @class */ (function (_super) {
300
300
  return allSeries;
301
301
  };
302
302
  Object.defineProperty(CursorModifier.prototype, "tooltipDataTemplate", {
303
+ /**
304
+ * Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
305
+ */
303
306
  get: function () {
304
307
  return this.tooltipDataTemplateProperty;
305
308
  },
@@ -321,6 +324,13 @@ var CursorModifier = /** @class */ (function (_super) {
321
324
  }
322
325
  return rs.hitTestProvider.hitTestXSlice(mousePoint.x, mousePoint.y);
323
326
  };
327
+ /**
328
+ * Returns current mouse position
329
+ */
330
+ CursorModifier.prototype.getMousePosition = function () {
331
+ return this.mousePosition;
332
+ };
333
+ /** @inheritDoc */
324
334
  CursorModifier.prototype.toJSON = function () {
325
335
  var json = _super.prototype.toJSON.call(this);
326
336
  var options = {
@@ -51,6 +51,24 @@ export declare type TTooltipProps = {
51
51
  height: number;
52
52
  seriesInfo: SeriesInfo;
53
53
  };
54
+ /**
55
+ * @ignore
56
+ * Defines the MousePosition enum constants, used by the {@link RolloverModifier}
57
+ */
58
+ declare enum EMousePosition {
59
+ /**
60
+ * The mouse position is outside the main canvas
61
+ */
62
+ OutOfCanvas = "OutOfCanvas",
63
+ /**
64
+ * The mouse position is in the Axis area
65
+ */
66
+ AxisArea = "AxisArea",
67
+ /**
68
+ * The mouse position is in the Series area
69
+ */
70
+ SeriesArea = "SeriesArea"
71
+ }
54
72
  /**
55
73
  * Optional parameters used to configure a {@link RolloverModifier} at construct time
56
74
  */
@@ -173,10 +191,16 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
173
191
  * @param mousePoint
174
192
  */
175
193
  hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
194
+ /**
195
+ * Returns current mouse position
196
+ */
197
+ getMousePosition(): EMousePosition;
198
+ /** @inheritDoc */
176
199
  toJSON(): {
177
200
  type: string;
178
201
  options: Required<Omit<IChartModifierBaseOptions, never>>;
179
202
  };
203
+ /** @inheritDoc */
180
204
  protected notifyPropertyChanged(propertyName: string): void;
181
205
  private isVerticalChart;
182
206
  private removeSeriesAnnotationsFromParentSurface;
@@ -224,3 +248,4 @@ export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, ro
224
248
  * @param pixelRatio
225
249
  */
226
250
  export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, tooltipPaddingTop: number, seriesViewRect: Rect, pixelRatio: number) => TTooltipProps[];
251
+ export {};
@@ -346,6 +346,13 @@ var RolloverModifier = /** @class */ (function (_super) {
346
346
  }
347
347
  return rs.hitTestProvider.hitTestXSlice(mousePoint.x, mousePoint.y);
348
348
  };
349
+ /**
350
+ * Returns current mouse position
351
+ */
352
+ RolloverModifier.prototype.getMousePosition = function () {
353
+ return this.mousePosition;
354
+ };
355
+ /** @inheritDoc */
349
356
  RolloverModifier.prototype.toJSON = function () {
350
357
  var json = _super.prototype.toJSON.call(this);
351
358
  var options = {
@@ -361,6 +368,7 @@ var RolloverModifier = /** @class */ (function (_super) {
361
368
  Object.assign(json.options, options);
362
369
  return json;
363
370
  };
371
+ /** @inheritDoc */
364
372
  RolloverModifier.prototype.notifyPropertyChanged = function (propertyName) {
365
373
  _super.prototype.notifyPropertyChanged.call(this, propertyName);
366
374
  if (propertyName === constants_1.PROPERTY.X_AXIS_ID) {
@@ -80,7 +80,9 @@ var SciChartRenderer = /** @class */ (function () {
80
80
  el.type === IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation ||
81
81
  el.type === IAnnotation_1.EAnnotationType.RenderContextAxisMarkerAnnotation);
82
82
  });
83
- this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
83
+ renderContext.enqueueLayeredDraw(function () {
84
+ _this.drawRenderContextAnnotations(renderContextAnnotations, xyAxesById[0], xyAxesById[1], IAnnotation_1.EAnnotationLayer.BelowChart, renderContext, seriesViewRect);
85
+ }, RenderLayer_1.ERenderLayer.Third);
84
86
  // queue series rendering after grid lines and bands, but before the axes
85
87
  renderContext.enqueueLayeredDraw(function () { return _this.drawSeries(_this.sciChartSurface, _this.sciChartSurface.renderableSeries.asArray(), renderContext); }, RenderLayer_1.ERenderLayer.Third);
86
88
  // Execute rendering of queued elements
@@ -30,6 +30,7 @@ export declare class CursorTooltipSvgAnnotation extends SvgAnnotationBase {
30
30
  private tooltipLegendOffsetXProperty;
31
31
  private tooltipLegendOffsetYProperty;
32
32
  private svgLegend;
33
+ private previousMousePosition;
33
34
  /**
34
35
  * Creates an instance of the {@link CursorTooltipSvgAnnotation}
35
36
  * @param options
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CursorTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var constants_1 = require("./constants");
20
21
  var IAnnotation_1 = require("./IAnnotation");
21
22
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
@@ -164,6 +165,11 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
164
165
  * @inheritDoc
165
166
  */
166
167
  CursorTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
168
+ var currentMousePosition = this.cursorModifier.getMousePosition();
169
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
170
+ return;
171
+ }
172
+ this.previousMousePosition = this.cursorModifier.getMousePosition();
167
173
  if (this.svg) {
168
174
  this.delete();
169
175
  }
@@ -1,3 +1,4 @@
1
+ import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
1
2
  import { RolloverModifierRenderableSeriesProps } from "../RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps";
2
3
  import { EAnnotationType } from "./IAnnotation";
3
4
  import { SvgAnnotationBase } from "./SvgAnnotationBase";
@@ -5,6 +6,10 @@ export declare class RolloverMarkerSvgAnnotation extends SvgAnnotationBase {
5
6
  /** @inheritDoc */
6
7
  readonly type = EAnnotationType.SVG;
7
8
  private tooltipProps;
9
+ private previousMousePosition;
8
10
  constructor(renderableSeriesProps: RolloverModifierRenderableSeriesProps);
11
+ /** @inheritDoc */
12
+ update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
13
+ /** @inheritDoc */
9
14
  protected create(): void;
10
15
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverMarkerSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IAnnotation_1 = require("./IAnnotation");
20
21
  var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
21
22
  var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
@@ -32,6 +33,16 @@ var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
32
33
  _this.yCoordShift = -4;
33
34
  return _this;
34
35
  }
36
+ /** @inheritDoc */
37
+ RolloverMarkerSvgAnnotation.prototype.update = function (xCalc, yCalc) {
38
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
39
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
40
+ return;
41
+ }
42
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
43
+ _super.prototype.update.call(this, xCalc, yCalc);
44
+ };
45
+ /** @inheritDoc */
35
46
  RolloverMarkerSvgAnnotation.prototype.create = function () {
36
47
  if (this.svg) {
37
48
  this.delete();
@@ -19,6 +19,7 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
19
19
  height: number;
20
20
  private svgLegend;
21
21
  private seriesInfoProperty;
22
+ private previousMousePosition;
22
23
  /**
23
24
  * Creates an instance of the {@link RolloverTooltipSvgAnnotation}
24
25
  * @param renderableSeriesProps The {@link RolloverModifierRenderableSeriesProps | props} pass
@@ -33,18 +34,15 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
33
34
  * Gets or sets seriesInfo {@link SeriesInfo} value on the tooltip
34
35
  */
35
36
  set seriesInfo(value: SeriesInfo);
36
- /**
37
- * @inheritDoc
38
- */
37
+ /** @inheritDoc */
39
38
  delete(): void;
40
- /**
41
- * @inheritDoc
42
- */
39
+ /** @inheritDoc */
43
40
  update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
44
- updateSize(width: number, height: number): void;
45
41
  /**
46
- * @inheritDoc
42
+ * Updates size of the tooltip
47
43
  */
44
+ updateSize(width: number, height: number): void;
45
+ /** @inheritDoc */
48
46
  protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
49
47
  private updateLegendTooltip;
50
48
  }
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.RolloverTooltipSvgAnnotation = void 0;
19
+ var MousePosition_1 = require("../../../types/MousePosition");
19
20
  var IDataSeries_1 = require("../../Model/IDataSeries");
20
21
  var AnnotationBase_1 = require("./AnnotationBase");
21
22
  var constants_1 = require("./constants");
@@ -64,9 +65,7 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
64
65
  enumerable: false,
65
66
  configurable: true
66
67
  });
67
- /**
68
- * @inheritDoc
69
- */
68
+ /** @inheritDoc */
70
69
  RolloverTooltipSvgAnnotation.prototype.delete = function () {
71
70
  var _a;
72
71
  if (!this.parentSurface || this.parentSurface.isDeleted)
@@ -76,23 +75,27 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
76
75
  this.svgRoot.removeChild(this.svgLegend);
77
76
  }
78
77
  };
79
- /**
80
- * @inheritDoc
81
- */
78
+ /** @inheritDoc */
82
79
  RolloverTooltipSvgAnnotation.prototype.update = function (xCalc, yCalc) {
80
+ var currentMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
81
+ if (this.previousMousePosition === currentMousePosition && currentMousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
82
+ return;
83
+ }
84
+ this.previousMousePosition = this.tooltipProps.rolloverModifier.getMousePosition();
83
85
  if (this.svg) {
84
86
  this.delete();
85
87
  }
86
88
  _super.prototype.update.call(this, xCalc, yCalc);
87
89
  this.updateLegendTooltip();
88
90
  };
91
+ /**
92
+ * Updates size of the tooltip
93
+ */
89
94
  RolloverTooltipSvgAnnotation.prototype.updateSize = function (width, height) {
90
95
  this.width = width;
91
96
  this.height = height;
92
97
  };
93
- /**
94
- * @inheritDoc
95
- */
98
+ /** @inheritDoc */
96
99
  RolloverTooltipSvgAnnotation.prototype.create = function (xCalc, yCalc) {
97
100
  var _a;
98
101
  var svgString;
@@ -72,7 +72,7 @@ var clearCacheByStyle = function (styleId) {
72
72
  }
73
73
  }
74
74
  };
75
- var maxSize = 100;
75
+ var maxSize = 200;
76
76
  var minAge = 1000 * 60;
77
77
  var lastUsed = 0;
78
78
  var getMaxSize = function () { return maxSize; };
@@ -88,7 +88,7 @@ var pruneCache = function () {
88
88
  if (labelCacheByTextAndStyle.size > maxSize && lastUsed < latest) {
89
89
  try {
90
90
  // remove more than we need so we do this less.
91
- var toRemove = (labelCacheByTextAndStyle.size - maxSize) * 2;
91
+ var toRemove = Math.min(Math.floor(labelCacheByTextAndStyle.size / 2), (labelCacheByTextAndStyle.size - maxSize) * 2);
92
92
  // Sort the items by LastUsed ascending
93
93
  var labels = Array.from(labelCacheByTextAndStyle.entries());
94
94
  labels.sort(function (a, b) { return a[1].lastUsed - b[1].lastUsed; });
@@ -148,11 +148,16 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
148
148
  var cachedLabel = void 0;
149
149
  if (cachedLabelText) {
150
150
  cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
151
- labels.push(cachedLabelText);
151
+ if (cachedLabel) {
152
+ labels.push(cachedLabelText);
153
+ }
152
154
  }
153
- else {
154
- var text = this.formatLabel(tick);
155
- this.tickToText.set(tick, text);
155
+ if (!cachedLabel) {
156
+ var text = cachedLabelText;
157
+ if (!cachedLabelText) {
158
+ text = this.formatLabel(tick);
159
+ this.tickToText.set(tick, text);
160
+ }
156
161
  var texture = this.getCachedLabelTexture(text, axis.axisRenderer.textureManager, axis.dpiAdjustedLabelStyle);
157
162
  if (texture.textureWidth !== null) {
158
163
  cachedLabel = new LabelInfo(tick, text, texture.bitmapTexture, texture.textureHeight, texture.textureWidth);
@@ -512,7 +512,8 @@ var BaseRenderableSeries = /** @class */ (function () {
512
512
  };
513
513
  /** @inheritDoc */
514
514
  BaseRenderableSeries.prototype.getDataSeriesName = function () {
515
- return this.dataSeries.dataSeriesName;
515
+ var _a;
516
+ return (_a = this.dataSeries) === null || _a === void 0 ? void 0 : _a.dataSeriesName;
516
517
  };
517
518
  /** @inheritDoc */
518
519
  BaseRenderableSeries.prototype.getNativeXValues = function () {
@@ -377,7 +377,9 @@ var applyLicense = function (licenseContext) {
377
377
  debug("Initial license status is " + licensingClasses_1.LicenseType[convertLicenseType(lt, licenseContext)]);
378
378
  // Get from global store
379
379
  var runtimelicense = getRuntimeLicenseKey();
380
- if ((checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense || checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK) &&
380
+ if ((checkStatus === licensingClasses_1.LicenseCheckStatus.NoLicense ||
381
+ checkStatus === licensingClasses_1.LicenseCheckStatus.LicenseOK ||
382
+ checkStatus === licensingClasses_1.LicenseCheckStatus.LookingForLicenseWizard) &&
381
383
  lt === licenseContext.SCRTLicenseType.LICENSE_TYPE_NO_LICENSE &&
382
384
  runtimelicense) {
383
385
  debug("Runtime license found");
@@ -1,4 +1,4 @@
1
1
  import { TSciChart } from "../types/TSciChart";
2
2
  import { TSciChart3D } from "../types/TSciChart3D";
3
- export declare const libraryVersion = "2.0.2195";
3
+ export declare const libraryVersion = "2.0.2204";
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-01-05T00:00:00";
4
+ var buildStamp = "2022-01-11T00:00:00";
5
5
  var result;
6
6
  // tslint:disable-next-line:no-var-requires
7
- exports.libraryVersion = "2.0.2195";
7
+ exports.libraryVersion = "2.0.2204";
8
8
  var checkBuildStamp = function (wasmContext) {
9
9
  if (result !== undefined)
10
10
  return result;