scichart 2.2.2389 → 2.2.2397

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.
@@ -102,6 +102,7 @@ var SciChartRenderer = /** @class */ (function () {
102
102
  if (this.sciChartSurface.isDeleted) {
103
103
  return;
104
104
  }
105
+ // console.log("render");
105
106
  var nativeContext = renderContext.getNativeContext();
106
107
  var wasmContext = this.sciChartSurface.webAssemblyContext2D;
107
108
  var oldBlendMode = nativeContext.GetBlendMode();
@@ -110,7 +111,6 @@ var SciChartRenderer = /** @class */ (function () {
110
111
  this.validate();
111
112
  // Animation Step
112
113
  var timeElapsed = this.previousTime ? Date.now() - this.previousTime : undefined;
113
- // console.log("draw ", timeElapsed);
114
114
  this.previousTime = Date.now();
115
115
  this.sciChartSurface.onAnimate(timeElapsed);
116
116
  this.sciChartSurface.updateBackground();
@@ -665,7 +665,7 @@ var AnnotationBase = /** @class */ (function () {
665
665
  AnnotationBase.prototype.getXYCoordinatesFromValues = function (xyDataPoint) {
666
666
  var viewRect = this.parentSurface.seriesViewRect;
667
667
  var pointWithAbsoluteCoordinates = this.getAbsoluteCoordinates(xyDataPoint);
668
- var translatedPoint = (0, translate_1.translateFromSeriesViewRectToCanvas)(pointWithAbsoluteCoordinates, viewRect);
668
+ var translatedPoint = (0, translate_1.translateFromSeriesViewRectToCanvas)(pointWithAbsoluteCoordinates, viewRect, true);
669
669
  if (!translatedPoint) {
670
670
  return undefined;
671
671
  }
@@ -44,6 +44,7 @@ export declare class BoxAnnotation extends RenderContextAnnotationBase {
44
44
  private strokeThicknessProperty;
45
45
  private strokeProperty;
46
46
  private fillProperty;
47
+ private nativeDrawingProvider;
47
48
  private strokePenCache;
48
49
  private fillBrushCache;
49
50
  /**
@@ -83,6 +84,7 @@ export declare class BoxAnnotation extends RenderContextAnnotationBase {
83
84
  delete(): void;
84
85
  /** @inheritDoc */
85
86
  drawWithContext(renderContext: IRenderContext2D, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, viewRect: Rect): void;
87
+ private drawWithProvider;
86
88
  /** @inheritDoc */
87
89
  onAttach(scs: SciChartSurface): void;
88
90
  onDragStarted(args: ModifierMouseArgs): boolean;
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.BoxAnnotation = void 0;
19
+ var app_1 = require("../../../constants/app");
19
20
  var Deleter_1 = require("../../../Core/Deleter");
20
21
  var Guard_1 = require("../../../Core/Guard");
21
22
  var Point_1 = require("../../../Core/Point");
@@ -119,6 +120,7 @@ var BoxAnnotation = /** @class */ (function (_super) {
119
120
  BoxAnnotation.prototype.delete = function () {
120
121
  this.strokePenCache = (0, Deleter_1.deleteSafe)(this.strokePenCache);
121
122
  this.fillBrushCache = (0, Deleter_1.deleteSafe)(this.fillBrushCache);
123
+ this.nativeDrawingProvider = (0, Deleter_1.deleteSafe)(this.nativeDrawingProvider);
122
124
  };
123
125
  /** @inheritDoc */
124
126
  BoxAnnotation.prototype.drawWithContext = function (renderContext, xCalc, yCalc, viewRect) {
@@ -135,12 +137,58 @@ var BoxAnnotation = /** @class */ (function (_super) {
135
137
  var y2 = this.getY2Coordinate(xCalc, yCalc);
136
138
  this.setAnnotationBorders(x1, x2, y1, y2);
137
139
  var rect = Rect_1.Rect.createWithPoints(new Point_1.Point(x1, y1), new Point_1.Point(x2, y2));
138
- renderContext.drawRect(rect, viewRect, strokePen, fillBrush);
140
+ // Temporary HAX! drawRect is rubbish with large strokeThickness, whereas the columnDrawingProvider does a nice
141
+ // outlined rectangle, but the code is ugly. In 2.3 we will improve the native drawRect to do the outline properly.
142
+ if (!app_1.IS_TEST_ENV) {
143
+ this.drawWithProvider(renderContext, strokePen.scrtPen, fillBrush.scrtBrush, xCalc, yCalc, rect, viewRect);
144
+ }
145
+ //renderContext.drawRect(rect, viewRect, strokePen, fillBrush);
139
146
  this.updateAdornerInner();
140
147
  };
148
+ BoxAnnotation.prototype.drawWithProvider = function (renderContext, linesPen, fillBrush, xCalc, yCalc, rect, viewRect) {
149
+ var webAssemblyContext = this.parentSurface.webAssemblyContext2D;
150
+ var args = new webAssemblyContext.SCRTColumnDrawingParams();
151
+ args.forceShaderMethod = true;
152
+ args.verticalChart = this.isVerticalChart;
153
+ args.zeroLineY = this.isVerticalChart ? yCalc.getDataValue(rect.left) : yCalc.getDataValue(rect.bottom);
154
+ args.columnWidth = this.isVerticalChart ? rect.height : rect.width;
155
+ // ISSUE: If the strokeThickness property is not provided,
156
+ // the fill will be disappeared with large zoom (when the column width will be small or zero)
157
+ // if (args.columnWidth === 0 && this.strokeThickness === 0) {
158
+ // strokePenCache = this.strokePenFillColoredCache;
159
+ // }
160
+ if (linesPen) {
161
+ args.SetLinesPen(linesPen);
162
+ }
163
+ if (fillBrush) {
164
+ args.SetFillBrush(fillBrush);
165
+ }
166
+ args.viewportWidth = viewRect.width;
167
+ args.viewportHeight = viewRect.height;
168
+ var xMid = this.isVerticalChart ? (rect.top + rect.bottom) / 2 : (rect.left + rect.right) / 2;
169
+ var xVal = xCalc.getDataValue(xMid);
170
+ var xValues = new webAssemblyContext.SCRTDoubleVector();
171
+ xValues.push_back(xVal);
172
+ var yVal = this.isVerticalChart ? yCalc.getDataValue(rect.right) : yCalc.getDataValue(rect.top);
173
+ var yValues = new webAssemblyContext.SCRTDoubleVector();
174
+ yValues.push_back(yVal);
175
+ args.count = yValues.size();
176
+ var nativeContext = renderContext.getNativeContext();
177
+ nativeContext.PushMatrix();
178
+ nativeContext.PushState();
179
+ nativeContext.Translate(viewRect.x, viewRect.y);
180
+ nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
181
+ this.nativeDrawingProvider.DrawPointsVec(nativeContext, xValues, yValues, xCalc.nativeCalculator, yCalc.nativeCalculator, args);
182
+ nativeContext.PopMatrix();
183
+ nativeContext.PopState();
184
+ xValues.delete();
185
+ yValues.delete();
186
+ args.delete();
187
+ };
141
188
  /** @inheritDoc */
142
189
  BoxAnnotation.prototype.onAttach = function (scs) {
143
190
  _super.prototype.onAttach.call(this, scs);
191
+ this.nativeDrawingProvider = new scs.webAssemblyContext2D.SCRTColumnSeriesDrawingProvider();
144
192
  if (!this.strokePenCache) {
145
193
  this.strokePenCache = new Pen2DCache_1.Pen2DCache(scs.webAssemblyContext2D);
146
194
  }
@@ -295,6 +295,27 @@ var BaseRenderableSeries = /** @class */ (function () {
295
295
  var _a;
296
296
  if (this.valueChanged(this.isVisibleProperty, isVisible)) {
297
297
  this.isVisibleProperty = isVisible;
298
+ if (!isVisible) {
299
+ if (this.rolloverModifierProps.marker && this.rolloverModifierProps.tooltip) {
300
+ this.rolloverModifierProps.marker.suspendInvalidate();
301
+ this.rolloverModifierProps.tooltip.suspendInvalidate();
302
+ this.rolloverModifierProps.marker.isHidden = true;
303
+ this.rolloverModifierProps.tooltip.isHidden = true;
304
+ this.rolloverModifierProps.tooltip.x1 = undefined;
305
+ this.rolloverModifierProps.tooltip.y1 = undefined;
306
+ }
307
+ // TODO should be more general than looking at series type
308
+ if (this.type === SeriesType_1.ESeriesType.BandSeries &&
309
+ this.rolloverModifierProps1.marker &&
310
+ this.rolloverModifierProps1.tooltip) {
311
+ this.rolloverModifierProps1.marker.suspendInvalidate();
312
+ this.rolloverModifierProps1.tooltip.suspendInvalidate();
313
+ this.rolloverModifierProps1.marker.isHidden = true;
314
+ this.rolloverModifierProps1.tooltip.isHidden = true;
315
+ this.rolloverModifierProps1.tooltip.x1 = undefined;
316
+ this.rolloverModifierProps1.tooltip.y1 = undefined;
317
+ }
318
+ }
298
319
  (_a = this.isVisibleChanged) === null || _a === void 0 ? void 0 : _a.raiseEvent(new SeriesVisibleChangedArgs_1.SeriesVisibleChangedArgs(this, isVisible));
299
320
  this.notifyPropertyChanged(constants_1.PROPERTY.IS_VISIBLE);
300
321
  }
@@ -259,7 +259,7 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
259
259
  /**
260
260
  * @inheritDoc
261
261
  */
262
- delete(): void;
262
+ delete(clearHtml?: boolean): void;
263
263
  /**
264
264
  * @inheritDoc
265
265
  */
@@ -397,7 +397,7 @@ var SciChartSurface = /** @class */ (function (_super) {
397
397
  // Logger.log("SciChartSurface.isSuspended = true. Ignoring invalidateElement() call");
398
398
  return;
399
399
  }
400
- // console.log("Invalidating ", this.domChartRoot.id);
400
+ // console.trace("Invalidating ", this.domChartRoot.id);
401
401
  var canvasId = this.domCanvas2D ? this.domCanvas2D.id : "undefinedCanvasId";
402
402
  this.renderSurface.invalidateElement(canvasId);
403
403
  };
@@ -415,7 +415,8 @@ var SciChartSurface = /** @class */ (function (_super) {
415
415
  /**
416
416
  * @inheritDoc
417
417
  */
418
- SciChartSurface.prototype.delete = function () {
418
+ SciChartSurface.prototype.delete = function (clearHtml) {
419
+ if (clearHtml === void 0) { clearHtml = true; }
419
420
  _super.prototype.delete.call(this);
420
421
  this.renderableSeries.asArray().forEach(function (rs) { return rs.delete(); });
421
422
  this.renderableSeries.clear();
@@ -428,7 +429,7 @@ var SciChartSurface = /** @class */ (function (_super) {
428
429
  this.watermarkProperties = (0, Deleter_1.deleteSafe)(this.watermarkProperties);
429
430
  this.watermarkPropertyPosition = (0, Deleter_1.deleteSafe)(this.watermarkPropertyPosition);
430
431
  this.chartModifiers.asArray().forEach(function (chm) { return chm.delete(); });
431
- if (this.domChartRoot) {
432
+ if (clearHtml && this.domChartRoot) {
432
433
  var style = this.domChartRoot.style;
433
434
  if (style) {
434
435
  style.background = "";
@@ -259,7 +259,7 @@ export declare abstract class SciChartSurfaceBase implements ISciChartSurfaceBas
259
259
  /**
260
260
  * @inheritDoc
261
261
  */
262
- delete(): void;
262
+ delete(clearHtml?: boolean): void;
263
263
  addDeletable(deletable: IDeletable): void;
264
264
  /**
265
265
  * Call invalidateElement() to trigger a redraw of the {@link SciChartSurfaceBase}. SciChart's WebGL WebAssembly rendering
@@ -286,9 +286,10 @@ var SciChartSurfaceBase = /** @class */ (function () {
286
286
  /**
287
287
  * @inheritDoc
288
288
  */
289
- SciChartSurfaceBase.prototype.delete = function () {
289
+ SciChartSurfaceBase.prototype.delete = function (clearHtml) {
290
290
  var _this = this;
291
291
  var _a;
292
+ if (clearHtml === void 0) { clearHtml = true; }
292
293
  this.isDeletedProperty = true;
293
294
  var currentSurfaceIndex = (_a = this.destinations) === null || _a === void 0 ? void 0 : _a.findIndex(function (dest) { return dest.sciChartSurface === _this; });
294
295
  if (currentSurfaceIndex >= 0) {
@@ -171,7 +171,7 @@ var createMaster = function () {
171
171
  Guard_1.Guard.notNull(theme, "theme");
172
172
  var canvas2dId = sciChartInitCommon_1.default.getCanvas2dId(divElementId);
173
173
  var sameIdDestinations = exports.sciChartDestinations.filter(function (el) { return el.canvasElementId === canvas2dId; });
174
- sameIdDestinations.forEach(function (el) { return el.sciChartSurface.delete(); });
174
+ sameIdDestinations.forEach(function (el) { return el.sciChartSurface.delete(false); });
175
175
  var otherDestinations = exports.sciChartDestinations.filter(function (el) { return el.canvasElementId !== canvas2dId; });
176
176
  chartInitObj.ClearDestinations();
177
177
  while (exports.sciChartDestinations.length > 0) {
@@ -415,7 +415,9 @@ var applyLicense = function (licenseContext) {
415
415
  var licenseKey = "";
416
416
  var lt = licenseContext.SCRTCredentials.GetLicenseType();
417
417
  debug("Initial license status is " + licensingClasses_1.LicenseType[convertLicenseType(lt, licenseContext)]);
418
- if (window.location.hostname.includes(".csb.app") || window.location.hostname.includes(".codesandbox.io")) {
418
+ if (window.location.hostname.includes(".csb.app") ||
419
+ window.location.hostname === "codesandbox.io" ||
420
+ window.location.hostname.includes(".codesandbox.io")) {
419
421
  runtimeLicenseKey = "csb";
420
422
  }
421
423
  // Get from global store
@@ -128,9 +128,9 @@ var createMaster = function () {
128
128
  exports.sciChartDestinations.push({ canvasElementId: canvasElementId, sciChartSurface: sciChartSurface, width: width, height: height });
129
129
  };
130
130
  return new Promise(function (resolve, reject) {
131
- var locateFile3d = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
131
+ var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
132
132
  // @ts-ignore
133
- new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
133
+ new WasmModule3D({ locateFile: locateFile, noInitialRun: true })
134
134
  .then(function (wasmContext) {
135
135
  var getChildSurfaces = function () { return exports.sciChartDestinations.map(function (el) { return el.sciChartSurface; }); };
136
136
  // Create of replace child surface
@@ -21,9 +21,9 @@ var createSingle3dInternal = function (divElement, options) {
21
21
  var webGLSupport = WebGlHelper_1.WebGlHelper.getWebGlSupport();
22
22
  // console.log("webGLSupport", webGLSupport);
23
23
  if (webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL2 || webGLSupport === WebGlHelper_1.EWebGLSupport.WebGL1) {
24
- var locateFile3d = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
24
+ var locateFile = (0, SciChartSurfaceBase_1.getLocateFile)(SciChart3DSurface_1.sciChartConfig3D);
25
25
  // @ts-ignore
26
- new WasmModule3D({ locateFile3d: locateFile3d, noInitialRun: true })
26
+ new WasmModule3D({ locateFile: locateFile, noInitialRun: true })
27
27
  .then(function (wasmContext) {
28
28
  var _a;
29
29
  loader.removeChartLoader(canvases.domDivContainer, loaderDiv);
@@ -1,4 +1,4 @@
1
1
  import { TSciChart } from "../types/TSciChart";
2
2
  import { TSciChart3D } from "../types/TSciChart3D";
3
- export declare const libraryVersion = "2.2.2389";
3
+ export declare const libraryVersion = "2.2.2397";
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-06-08T00:00:00";
4
+ var buildStamp = "2022-07-01T00:00:00";
5
5
  var result;
6
6
  // tslint:disable-next-line:no-var-requires
7
- exports.libraryVersion = "2.2.2389";
7
+ exports.libraryVersion = "2.2.2397";
8
8
  var checkBuildStamp = function (wasmContext) {
9
9
  if (result !== undefined)
10
10
  return result;