scichart 2.1.2267 → 2.1.2294

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 (35) hide show
  1. package/Builder/buildSeries.d.ts +5 -0
  2. package/Builder/buildSeries.js +4 -0
  3. package/Charting/Themes/IThemeProvider.d.ts +6 -0
  4. package/Charting/Themes/SciChartJSDarkTheme.d.ts +2 -0
  5. package/Charting/Themes/SciChartJSDarkTheme.js +2 -0
  6. package/Charting/Themes/SciChartJSLightTheme.d.ts +2 -0
  7. package/Charting/Themes/SciChartJSLightTheme.js +2 -0
  8. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +6 -0
  9. package/Charting/Visuals/Axis/CategoryAxisBase.js +35 -16
  10. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +1 -1
  11. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +30 -8
  12. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +6 -2
  13. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -1
  14. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.d.ts +84 -0
  15. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +179 -0
  16. package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.d.ts +20 -0
  17. package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.js +100 -0
  18. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +2 -0
  19. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +14 -1
  20. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +2 -1
  21. package/Charting/Visuals/SciChartSurface.d.ts +6 -1
  22. package/Charting/Visuals/SciChartSurface.js +10 -1
  23. package/Core/BuildStamp.d.ts +1 -1
  24. package/Core/BuildStamp.js +2 -2
  25. package/_wasm/scichart.browser.js +1 -1
  26. package/_wasm/scichart2d.js +1 -1
  27. package/_wasm/scichart2d.wasm +0 -0
  28. package/_wasm/scichart3d.js +95 -95
  29. package/_wasm/scichart3d.wasm +0 -0
  30. package/constants/performanceWarnings.js +2 -2
  31. package/package.json +1 -1
  32. package/types/SeriesType.d.ts +2 -0
  33. package/types/SeriesType.js +2 -0
  34. package/utils/pointUtil.d.ts +1 -1
  35. package/utils/pointUtil.js +3 -2
@@ -0,0 +1,100 @@
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.ImpulseSeriesHitTestProvider = void 0;
19
+ var pointUtil_1 = require("../../../../utils/pointUtil");
20
+ var DpiHelper_1 = require("../../TextureManager/DpiHelper");
21
+ var BaseHitTestProvider_1 = require("./BaseHitTestProvider");
22
+ var hitTestHelpers_1 = require("./hitTestHelpers");
23
+ var HitTestInfo_1 = require("./HitTestInfo");
24
+ /**
25
+ * Hit-test provider for {@link FastColumnRenderableSeries}. See base class {@link BaseHitTestProvider} for further info
26
+ */
27
+ var ImpulseSeriesHitTestProvider = /** @class */ (function (_super) {
28
+ __extends(ImpulseSeriesHitTestProvider, _super);
29
+ function ImpulseSeriesHitTestProvider() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ ImpulseSeriesHitTestProvider.prototype.hitTest = function (x, y, hitTestRadius) {
36
+ if (hitTestRadius === void 0) { hitTestRadius = BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS; }
37
+ var hitTestPoint = this.getTranslatedHitTestPoint(x, y);
38
+ if (!hitTestPoint) {
39
+ return HitTestInfo_1.HitTestInfo.empty();
40
+ }
41
+ var _a = this.currentRenderPassData, xCoordinateCalculator = _a.xCoordinateCalculator, yCoordinateCalculator = _a.yCoordinateCalculator, isVerticalChart = _a.isVerticalChart;
42
+ var xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
43
+ var yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
44
+ var dataSeries = this.parentSeries.dataSeries;
45
+ var nearestXyPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord);
46
+ var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
47
+ var xNativeValues = dataSeries.getNativeXValues();
48
+ var yNativeValues = dataSeries.getNativeYValues();
49
+ var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
50
+ if (nearestPointIndex >= 0 || nearestXyPointIndex >= 0) {
51
+ hitTestInfo.isHit =
52
+ hitTestHelpers_1.hitTestHelpers.testIsHitForImpulse(xCoordinateCalculator, yCoordinateCalculator, this.parentSeries, xNativeValues, yNativeValues, nearestPointIndex, xHitCoord, yHitCoord, hitTestRadius) ||
53
+ hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues, nearestXyPointIndex, xHitCoord, yHitCoord, this.parentSeries.size);
54
+ }
55
+ else {
56
+ hitTestInfo.isHit = false;
57
+ }
58
+ return hitTestInfo;
59
+ };
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ ImpulseSeriesHitTestProvider.prototype.hitTestForDataPointSelectionModifier = function (x, y, hitTestRadius) {
64
+ if (hitTestRadius === void 0) { hitTestRadius = BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS; }
65
+ return this.hitTest(x, y, hitTestRadius);
66
+ };
67
+ /**
68
+ * @inheritDoc
69
+ */
70
+ ImpulseSeriesHitTestProvider.prototype.hitTestXSlice = function (x, y) {
71
+ var _a;
72
+ var hitTestPoint = this.getTranslatedHitTestPoint(x, y);
73
+ if (!hitTestPoint) {
74
+ return HitTestInfo_1.HitTestInfo.empty();
75
+ }
76
+ var _b = this.currentRenderPassData, xCoordinateCalculator = _b.xCoordinateCalculator, yCoordinateCalculator = _b.yCoordinateCalculator, isVerticalChart = _b.isVerticalChart;
77
+ var xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
78
+ var yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
79
+ var dataSeries = this.parentSeries.dataSeries;
80
+ var xNativeValues = dataSeries.getNativeXValues();
81
+ var yNativeValues = dataSeries.getNativeYValues();
82
+ var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
83
+ var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
84
+ var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
85
+ var markerWidth = ((_a = this.parentSeries.size) !== null && _a !== void 0 ? _a : 0) * DpiHelper_1.DpiHelper.PIXEL_RATIO;
86
+ var markerDataWidth = Math.abs(xCoordinateCalculator.getDataValue(markerWidth) - xCoordinateCalculator.getDataValue(0));
87
+ if (nearestPointIndex >= 0) {
88
+ var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
89
+ var xLastValue = isCategoryAxis ? xNativeValues.size() - 1 : xNativeValues.get(xNativeValues.size() - 1);
90
+ hitTestInfo.isWithinDataBounds = (0, pointUtil_1.testIsInInterval)(hitTestInfo.hitTestPointValues.x, xFirstValue, xLastValue, markerDataWidth / 2);
91
+ hitTestInfo.isHit = hitTestInfo.isWithinDataBounds;
92
+ }
93
+ else {
94
+ hitTestInfo.isHit = false;
95
+ }
96
+ return hitTestInfo;
97
+ };
98
+ return ImpulseSeriesHitTestProvider;
99
+ }(BaseHitTestProvider_1.BaseHitTestProvider));
100
+ exports.ImpulseSeriesHitTestProvider = ImpulseSeriesHitTestProvider;
@@ -8,6 +8,7 @@ import { XyyDataSeries } from "../../../Model/XyyDataSeries";
8
8
  import { CoordinateCalculatorBase } from "../../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
9
9
  import { BaseOhlcRenderableSeries } from "../BaseOhlcRenderableSeries";
10
10
  import { FastColumnRenderableSeries } from "../FastColumnRenderableSeries";
11
+ import { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
11
12
  import { IRenderableSeries } from "../IRenderableSeries";
12
13
  import { HitTestInfo } from "./HitTestInfo";
13
14
  export declare const hitTestHelpers: {
@@ -41,4 +42,5 @@ export declare const hitTestHelpers: {
41
42
  isHit: boolean;
42
43
  secondPointIndex: number;
43
44
  };
45
+ testIsHitForImpulse: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, renderableSeries: FastImpulseRenderableSeries, xValues: SCRTDoubleVector, yValues: SCRTDoubleVector, pointIndex: number, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => boolean;
44
46
  };
@@ -268,6 +268,18 @@ var testIsHitForColumn = function (xCoordinateCalculator, yCoordinateCalculator,
268
268
  var bottomColumnSide = zeroLineYCoord > yCoord ? yCoord : zeroLineYCoord;
269
269
  return (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord - halfWidth, topColumnSide, xCoord + halfWidth, bottomColumnSide);
270
270
  };
271
+ var testIsHitForImpulse = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, xValues, yValues, pointIndex, xHitCoord, yHitCoord, hitTestRadius) {
272
+ var zeroLineY = renderableSeries.zeroLineY;
273
+ var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
274
+ var xValue = isCategoryAxis ? pointIndex : xValues.get(pointIndex);
275
+ var yValue = yValues.get(pointIndex);
276
+ var xCoord = xCoordinateCalculator.getCoordinate(xValue);
277
+ var yCoord = yCoordinateCalculator.getCoordinate(yValue);
278
+ var zeroLineYCoord = yCoordinateCalculator.getCoordinate(zeroLineY);
279
+ var topColumnSide = zeroLineYCoord > yCoord ? zeroLineYCoord : yCoord;
280
+ var bottomColumnSide = zeroLineYCoord > yCoord ? yCoord : zeroLineYCoord;
281
+ return (0, pointUtil_1.testIsInBounds)(xHitCoord, yHitCoord, xCoord, topColumnSide, xCoord, bottomColumnSide, hitTestRadius);
282
+ };
271
283
  var testIsHitForOHLC = function (xCoordinateCalculator, yCoordinateCalculator, renderableSeries, dataSeries, pointIndex, xHitCoord, yHitCoord, hitTestRadius) {
272
284
  var getDataPointWidth = renderableSeries.getDataPointWidth, dataPointWidth = renderableSeries.dataPointWidth;
273
285
  var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
@@ -344,5 +356,6 @@ exports.hitTestHelpers = {
344
356
  testIsHitForBand: testIsHitForBand,
345
357
  testIsHitForColumn: testIsHitForColumn,
346
358
  testIsHitForOHLC: testIsHitForOHLC,
347
- testIsHitForMountain: testIsHitForMountain
359
+ testIsHitForMountain: testIsHitForMountain,
360
+ testIsHitForImpulse: testIsHitForImpulse
348
361
  };
@@ -275,7 +275,8 @@ var StackedColumnCollection = /** @class */ (function (_super) {
275
275
  StackedColumnCollection.prototype.checkXValuesCorrect = function () {
276
276
  var length = this.getDataSeriesValuesCount();
277
277
  this.getVisibleSeries().forEach(function (el) {
278
- if (!(el.dataSeries.count() === length)) {
278
+ var _a;
279
+ if (!(((_a = el.dataSeries) === null || _a === void 0 ? void 0 : _a.count()) === length)) {
279
280
  throw Error("All stacked series in on collection should have the same amount of X Values");
280
281
  }
281
282
  });
@@ -65,7 +65,8 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
65
65
  static createSingle(divElement: string | HTMLDivElement, options?: I2DSurfaceOptions): Promise<TWebAssemblyChart>;
66
66
  /**
67
67
  * Allows setting of web URL for Wasm and Data files, in the case you are loading SciChart outside of npm/webpack environment.
68
- * Note if loading from CDN the version number of data/wasm Urls must match the version number of SciChart.js you are using.
68
+ * Note the version number of data/wasm Urls must match the version number of SciChart.js you are using.
69
+ * To use the default CDN, just call SciChart.SciChartSurface.useWasmFromCDN();
69
70
  * @example
70
71
  * ```ts
71
72
  * SciChart.SciChartSurface.configure({
@@ -76,6 +77,10 @@ export declare class SciChartSurface extends SciChartSurfaceBase {
76
77
  * @param config
77
78
  */
78
79
  static configure(config: TSciChartConfig): void;
80
+ /**
81
+ * Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.
82
+ */
83
+ static useWasmFromCDN(): void;
79
84
  private static createTest;
80
85
  readonly renderSurface: RenderSurface;
81
86
  /**
@@ -31,6 +31,7 @@ var chartBuilder_1 = require("../../Builder/chartBuilder");
31
31
  var classFactory_1 = require("../../Builder/classFactory");
32
32
  var app_1 = require("../../constants/app");
33
33
  var EasingFunctions_1 = require("../../Core/Animations/EasingFunctions");
34
+ var BuildStamp_1 = require("../../Core/BuildStamp");
34
35
  var Deleter_1 = require("../../Core/Deleter");
35
36
  var Dictionary_1 = require("../../Core/Dictionary");
36
37
  var EventHandler_1 = require("../../Core/EventHandler");
@@ -231,7 +232,8 @@ var SciChartSurface = /** @class */ (function (_super) {
231
232
  };
232
233
  /**
233
234
  * Allows setting of web URL for Wasm and Data files, in the case you are loading SciChart outside of npm/webpack environment.
234
- * Note if loading from CDN the version number of data/wasm Urls must match the version number of SciChart.js you are using.
235
+ * Note the version number of data/wasm Urls must match the version number of SciChart.js you are using.
236
+ * To use the default CDN, just call SciChart.SciChartSurface.useWasmFromCDN();
235
237
  * @example
236
238
  * ```ts
237
239
  * SciChart.SciChartSurface.configure({
@@ -246,6 +248,13 @@ var SciChartSurface = /** @class */ (function (_super) {
246
248
  exports.sciChartConfig.dataUrl = (_a = config === null || config === void 0 ? void 0 : config.dataUrl) !== null && _a !== void 0 ? _a : undefined;
247
249
  exports.sciChartConfig.wasmUrl = (_b = config === null || config === void 0 ? void 0 : config.wasmUrl) !== null && _b !== void 0 ? _b : undefined;
248
250
  };
251
+ /**
252
+ * Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.
253
+ */
254
+ SciChartSurface.useWasmFromCDN = function () {
255
+ exports.sciChartConfig.dataUrl = "https://cdn.jsdelivr.net/npm/scichart@".concat(BuildStamp_1.libraryVersion, "/_wasm/scichart2d.data");
256
+ exports.sciChartConfig.wasmUrl = "https://cdn.jsdelivr.net/npm/scichart@".concat(BuildStamp_1.libraryVersion, "/_wasm/scichart2d.wasm");
257
+ };
249
258
  SciChartSurface.createTest = function (divElement, options) {
250
259
  var _a, _b;
251
260
  var canvases = sciChartInitCommon_1.default.initCanvas(divElement, (_a = options === null || options === void 0 ? void 0 : options.widthAspect) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.heightAspect) !== null && _b !== void 0 ? _b : 0, sciChartInitCommon_1.default.ECanvasType.canvas2D);
@@ -1,4 +1,4 @@
1
1
  import { TSciChart } from "../types/TSciChart";
2
2
  import { TSciChart3D } from "../types/TSciChart3D";
3
- export declare const libraryVersion = "2.1.2267";
3
+ export declare const libraryVersion = "2.1.2294";
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-02-01T00:00:00";
4
+ var buildStamp = "2022-03-16T00:00:00";
5
5
  var result;
6
6
  // tslint:disable-next-line:no-var-requires
7
- exports.libraryVersion = "2.1.2267";
7
+ exports.libraryVersion = "2.1.2294";
8
8
  var checkBuildStamp = function (wasmContext) {
9
9
  if (result !== undefined)
10
10
  return result;