scichart 2.1.2301 → 2.2.2351
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.
- package/Builder/buildModifiers.d.ts +2 -1
- package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
- package/Charting/ChartModifiers/CursorModifier.js +15 -10
- package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
- package/Charting/ChartModifiers/LegendModifier.js +22 -0
- package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
- package/Charting/ChartModifiers/RolloverModifier.js +76 -19
- package/Charting/LayoutManager/LayoutManager.js +6 -1
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
- package/Charting/Model/BaseHeatmapDataSeries.js +4 -1
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
- package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
- package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +63 -14
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/constants.d.ts +2 -1
- package/Charting/Visuals/Annotations/constants.js +1 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +10 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +72 -1
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +29 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +77 -0
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +21 -4
- package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
- package/Charting/Visuals/Helpers/drawLabel.js +38 -18
- package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
- package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +7 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +16 -7
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +56 -9
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -0
- package/Charting/Visuals/RenderableSeries/constants.js +2 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +24 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +4 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +13 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +66 -20
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +3 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +2 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +66 -2
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +304 -52
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +6 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +5 -0
- package/Charting/Visuals/SciChartSurface.d.ts +13 -2
- package/Charting/Visuals/SciChartSurface.js +39 -3
- package/Charting/Visuals/createMaster.js +2 -2
- package/Charting/Visuals/createSingle.js +2 -2
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +13 -9
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +95 -95
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/Color.d.ts +1 -0
- package/types/Color.js +1 -0
- package/types/LabelPlacement.d.ts +8 -0
- package/types/LabelPlacement.js +11 -1
- package/types/LabelProviderType.d.ts +5 -1
- package/types/LabelProviderType.js +4 -0
- package/types/TSciChartSurfaceCanvases.d.ts +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.PieLabelProvider = void 0;
|
|
30
|
+
var LabelProviderType_1 = require("../../../../types/LabelProviderType");
|
|
31
|
+
var NumericFormat_1 = require("../../../../types/NumericFormat");
|
|
32
|
+
var number_1 = require("../../../../utils/number");
|
|
33
|
+
var SciChartPieSurface_1 = require("../../SciChartPieSurface/SciChartPieSurface");
|
|
34
|
+
var LabelProvider_1 = require("./LabelProvider");
|
|
35
|
+
/**
|
|
36
|
+
* @summary A Label Provider for use with Pie Charts to allow customizing of segment labels
|
|
37
|
+
*/
|
|
38
|
+
var PieLabelProvider = /** @class */ (function (_super) {
|
|
39
|
+
__extends(PieLabelProvider, _super);
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
function PieLabelProvider(options) {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Decimal, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 2 }, options)) || this;
|
|
46
|
+
_this.type = LabelProviderType_1.ELabelProviderType.Pie;
|
|
47
|
+
_this.formatLabelProperty = function (dataValue) {
|
|
48
|
+
return _this.applyFormat((0, number_1.formatNumber)(dataValue, _this.numericFormat, _this.precision)) +
|
|
49
|
+
(_this.parentSurface.valueMode === SciChartPieSurface_1.EPieValueMode.Percentage ? "%" : "");
|
|
50
|
+
};
|
|
51
|
+
return _this;
|
|
52
|
+
}
|
|
53
|
+
PieLabelProvider.prototype.getSegmentText = function (segment, total) {
|
|
54
|
+
var labelValue = this.parentSurface.valueMode === SciChartPieSurface_1.EPieValueMode.Percentage ? segment.getPercentage(total) : segment.value;
|
|
55
|
+
return this.formatLabel(labelValue);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Called when the {@link LabelProvider} is attached to an {@link SciChartPieSurface }
|
|
59
|
+
* @param pieSurface The SciPieSurface we are attached to.
|
|
60
|
+
*/
|
|
61
|
+
PieLabelProvider.prototype.attachedToSurface = function (pieSurface) {
|
|
62
|
+
this.parentSurface = pieSurface;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
PieLabelProvider.prototype.onBeginAxisDraw = function () {
|
|
68
|
+
// TODO: user can override here if they want
|
|
69
|
+
};
|
|
70
|
+
PieLabelProvider.prototype.invalidateParent = function () {
|
|
71
|
+
if (this.parentSurface && this.parentSurface.invalidateElement) {
|
|
72
|
+
this.parentSurface.invalidateElement();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return PieLabelProvider;
|
|
76
|
+
}(LabelProvider_1.LabelProvider));
|
|
77
|
+
exports.PieLabelProvider = PieLabelProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ELabelProviderType } from "../../../../types/LabelProviderType";
|
|
2
2
|
import { ENumericFormat } from "../../../../types/NumericFormat";
|
|
3
|
-
import { LabelProviderBase2D } from "./LabelProviderBase2D";
|
|
3
|
+
import { LabelProviderBase2D, ILabel2DOptions } from "./LabelProviderBase2D";
|
|
4
4
|
/**
|
|
5
5
|
* The {@link SmartDateLabelProvider} formats Axis Labels and Cursor / Tooltips for {@link NumericAxis} types
|
|
6
6
|
*/
|
|
@@ -9,7 +9,7 @@ export declare class SmartDateLabelProvider extends LabelProviderBase2D {
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates an instance of {@link SmartDateLabelProvider}
|
|
11
11
|
*/
|
|
12
|
-
constructor();
|
|
12
|
+
constructor(options?: ILabel2DOptions);
|
|
13
13
|
/**
|
|
14
14
|
* @inheritDoc
|
|
15
15
|
*/
|
|
@@ -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.SmartDateLabelProvider = void 0;
|
|
19
30
|
var LabelProviderType_1 = require("../../../../types/LabelProviderType");
|
|
@@ -41,11 +52,17 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
|
|
|
41
52
|
/**
|
|
42
53
|
* Creates an instance of {@link SmartDateLabelProvider}
|
|
43
54
|
*/
|
|
44
|
-
function SmartDateLabelProvider() {
|
|
45
|
-
var
|
|
55
|
+
function SmartDateLabelProvider(options) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Date_DDMMYYYY, cursorLabelFormat: (_b = options === null || options === void 0 ? void 0 : options.cursorLabelFormat) !== null && _b !== void 0 ? _b : NumericFormat_1.ENumericFormat.Date_DDMMYYYY }, options)) || this;
|
|
46
58
|
_this.type = LabelProviderType_1.ELabelProviderType.SmartDate;
|
|
47
|
-
_this.formatLabelProperty = function (dataValue) {
|
|
48
|
-
|
|
59
|
+
_this.formatLabelProperty = function (dataValue) {
|
|
60
|
+
return _this.applyFormat((0, number_1.formatNumber)(dataValue, _this.numericFormat, _this.precision));
|
|
61
|
+
};
|
|
62
|
+
_this.formatCursorLabelProperty = function (dataValue) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return _this.applyFormat((0, number_1.formatNumber)(dataValue, (_a = _this.cursorNumericFormat) !== null && _a !== void 0 ? _a : _this.numericFormat, (_b = _this.cursorPrecision) !== null && _b !== void 0 ? _b : _this.precision));
|
|
65
|
+
};
|
|
49
66
|
return _this;
|
|
50
67
|
}
|
|
51
68
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rect } from "../../../Core/Rect";
|
|
2
|
-
import { ELabelPlacement } from "../../../types/LabelPlacement";
|
|
2
|
+
import { EHorizontalAlignment, ELabelPlacement, EVerticalAlignment } from "../../../types/LabelPlacement";
|
|
3
3
|
import { IPen2D } from "../../Drawing/IPen2D";
|
|
4
4
|
import { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
|
|
5
5
|
import { AxisBase2D } from "../Axis/AxisBase2D";
|
|
@@ -8,7 +8,7 @@ export declare const drawModifiersAxisLabel: (currentAxis: AxisBase2D, renderCon
|
|
|
8
8
|
/**
|
|
9
9
|
* Function to draw Vertical or Horizontal Line annotations with labels
|
|
10
10
|
*/
|
|
11
|
-
export declare const drawLineAnnotation: (currentAxis: AxisBase2D, renderContext: WebGlRenderContext2D, labelPlacement: ELabelPlacement, displayValue: string, x1Coord: number, x2Coord: number, y1Coord: number, y2Coord: number, textStyle: TTextStyle, fill: string, strokePen: IPen2D, viewRect: Rect, showLabel: boolean, opacity: number) => Rect;
|
|
11
|
+
export declare const drawLineAnnotation: (currentAxis: AxisBase2D, renderContext: WebGlRenderContext2D, labelPlacement: ELabelPlacement, displayValue: string, x1Coord: number, x2Coord: number, y1Coord: number, y2Coord: number, textStyle: TTextStyle, fill: string, strokePen: IPen2D, viewRect: Rect, showLabel: boolean, opacity: number, horizontalAlignment?: EHorizontalAlignment, verticalAlignment?: EVerticalAlignment) => Rect;
|
|
12
12
|
export declare const drawAxisMarkerAnnotation: (currentAxis: AxisBase2D, renderContext: WebGlRenderContext2D, displayValue: string, markerCoordinate: number, x1Coord: number, y1Coord: number, textStyle: TTextStyle, fill: string, opacity: number, image: HTMLImageElement, imageWidth: number, imageHeight: number) => {
|
|
13
13
|
xPosition: number;
|
|
14
14
|
yPosition: number;
|
|
@@ -19,7 +19,7 @@ export declare const drawAxisMarkerAnnotation: (currentAxis: AxisBase2D, renderC
|
|
|
19
19
|
* Calculates coordinates of the annotation label.
|
|
20
20
|
* The coordinates are defined as an absolute position on the whole SciChartSurface.
|
|
21
21
|
*/
|
|
22
|
-
export declare const getLabelCoordinates: (currentAxis: AxisBase2D, labelPlacement: ELabelPlacement, x1Coord: number, x2Coord: number, y1Coord: number, y2Coord: number, textureHeight: number, textureWidth: number) => {
|
|
22
|
+
export declare const getLabelCoordinates: (currentAxis: AxisBase2D, labelPlacement: ELabelPlacement, x1Coord: number, x2Coord: number, y1Coord: number, y2Coord: number, textureHeight: number, textureWidth: number, horizontalAlignment?: EHorizontalAlignment, verticalAlignment?: EVerticalAlignment) => {
|
|
23
23
|
xPosition: number;
|
|
24
24
|
yPosition: number;
|
|
25
25
|
};
|
|
@@ -27,7 +27,7 @@ exports.drawModifiersAxisLabel = drawModifiersAxisLabel;
|
|
|
27
27
|
/**
|
|
28
28
|
* Function to draw Vertical or Horizontal Line annotations with labels
|
|
29
29
|
*/
|
|
30
|
-
var drawLineAnnotation = function (currentAxis, renderContext, labelPlacement, displayValue, x1Coord, x2Coord, y1Coord, y2Coord, textStyle, fill, strokePen, viewRect, showLabel, opacity) {
|
|
30
|
+
var drawLineAnnotation = function (currentAxis, renderContext, labelPlacement, displayValue, x1Coord, x2Coord, y1Coord, y2Coord, textStyle, fill, strokePen, viewRect, showLabel, opacity, horizontalAlignment, verticalAlignment) {
|
|
31
31
|
var nativeContext = renderContext.getNativeContext();
|
|
32
32
|
var axisAlignment = currentAxis.axisAlignment;
|
|
33
33
|
var displayVertically = (axisAlignment === AxisAlignment_1.EAxisAlignment.Top || axisAlignment === AxisAlignment_1.EAxisAlignment.Bottom) &&
|
|
@@ -41,17 +41,17 @@ var drawLineAnnotation = function (currentAxis, renderContext, labelPlacement, d
|
|
|
41
41
|
var labelHeight = 0;
|
|
42
42
|
var labelWidth = 0;
|
|
43
43
|
var labelRect;
|
|
44
|
+
var _a = getLineCoordinates(x1Coord, y1Coord, x2Coord, y2Coord, labelHeight, labelWidth, labelPlacement, currentAxis), x1LineCoord = _a.x1LineCoord, y1LineCoord = _a.y1LineCoord, x2LineCoord = _a.x2LineCoord, y2LineCoord = _a.y2LineCoord;
|
|
45
|
+
renderContext.drawLine(x1LineCoord, y1LineCoord, x2LineCoord, y2LineCoord, strokePen, viewRect);
|
|
44
46
|
if (showLabel) {
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
+
var _b = currentAxis.axisRenderer.createAnnotationLabelTexture(text, labelTextStyle, labelBackgroundColor, displayVertically, displayMirrored, opacity), bitmapTexture = _b.bitmapTexture, textureHeight = _b.textureHeight, textureWidth = _b.textureWidth;
|
|
48
|
+
var _c = (0, exports.getLabelCoordinates)(currentAxis, labelPlacement, x1Coord, x2Coord, y1Coord, y2Coord, textureHeight, textureWidth, horizontalAlignment, verticalAlignment), xPosition = _c.xPosition, yPosition = _c.yPosition;
|
|
47
49
|
labelHeight = textureHeight;
|
|
48
50
|
labelWidth = textureWidth;
|
|
49
51
|
labelRect = new Rect_1.Rect(xPosition, yPosition, textureWidth, textureHeight);
|
|
50
52
|
nativeContext.DrawTexture(bitmapTexture, Math.round(xPosition), Math.round(yPosition), textureWidth, textureHeight);
|
|
51
53
|
bitmapTexture.delete();
|
|
52
54
|
}
|
|
53
|
-
var _c = getLineCoordinates(x1Coord, y1Coord, x2Coord, y2Coord, labelHeight, labelWidth, labelPlacement, currentAxis), x1LineCoord = _c.x1LineCoord, y1LineCoord = _c.y1LineCoord, x2LineCoord = _c.x2LineCoord, y2LineCoord = _c.y2LineCoord;
|
|
54
|
-
renderContext.drawLine(x1LineCoord, y1LineCoord, x2LineCoord, y2LineCoord, strokePen, viewRect);
|
|
55
55
|
return labelRect;
|
|
56
56
|
};
|
|
57
57
|
exports.drawLineAnnotation = drawLineAnnotation;
|
|
@@ -74,7 +74,7 @@ exports.drawAxisMarkerAnnotation = drawAxisMarkerAnnotation;
|
|
|
74
74
|
* Calculates coordinates of the annotation label.
|
|
75
75
|
* The coordinates are defined as an absolute position on the whole SciChartSurface.
|
|
76
76
|
*/
|
|
77
|
-
var getLabelCoordinates = function (currentAxis, labelPlacement, x1Coord, x2Coord, y1Coord, y2Coord, textureHeight, textureWidth) {
|
|
77
|
+
var getLabelCoordinates = function (currentAxis, labelPlacement, x1Coord, x2Coord, y1Coord, y2Coord, textureHeight, textureWidth, horizontalAlignment, verticalAlignment) {
|
|
78
78
|
var axisAlignment = currentAxis.axisAlignment, seriesViewRect = currentAxis.parentSurface.seriesViewRect, axisViewRect = currentAxis.viewRect;
|
|
79
79
|
var xPosition = 0;
|
|
80
80
|
var yPosition = 0;
|
|
@@ -166,26 +166,46 @@ var getLabelCoordinates = function (currentAxis, labelPlacement, x1Coord, x2Coor
|
|
|
166
166
|
switch (axisAlignment) {
|
|
167
167
|
case AxisAlignment_1.EAxisAlignment.Right:
|
|
168
168
|
centerVertically();
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
if (horizontalAlignment === LabelPlacement_1.EHorizontalAlignment.Left) {
|
|
170
|
+
xPosition = seriesViewRect.left;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
xPosition =
|
|
174
|
+
axisViewRect.width < textureWidth
|
|
175
|
+
? (xPosition = axisViewRect.right - textureWidth)
|
|
176
|
+
: axisViewRect.left;
|
|
177
|
+
}
|
|
173
178
|
break;
|
|
174
179
|
case AxisAlignment_1.EAxisAlignment.Left:
|
|
175
180
|
centerVertically();
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
if (horizontalAlignment === LabelPlacement_1.EHorizontalAlignment.Right) {
|
|
182
|
+
xPosition = seriesViewRect.left + seriesViewRect.width - textureWidth;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
xPosition =
|
|
186
|
+
axisViewRect.width < textureWidth
|
|
187
|
+
? (xPosition = axisViewRect.left)
|
|
188
|
+
: axisViewRect.right - textureWidth;
|
|
189
|
+
}
|
|
180
190
|
break;
|
|
181
191
|
case AxisAlignment_1.EAxisAlignment.Top:
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
if (verticalAlignment === LabelPlacement_1.EVerticalAlignment.Bottom) {
|
|
193
|
+
yPosition = seriesViewRect.top + seriesViewRect.height - textureHeight;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
yPosition =
|
|
197
|
+
axisViewRect.height < textureHeight ? axisViewRect.top : axisViewRect.bottom - textureHeight;
|
|
198
|
+
}
|
|
184
199
|
centerHorizontally();
|
|
185
200
|
break;
|
|
186
201
|
case AxisAlignment_1.EAxisAlignment.Bottom:
|
|
187
|
-
|
|
188
|
-
|
|
202
|
+
if (verticalAlignment === LabelPlacement_1.EVerticalAlignment.Top) {
|
|
203
|
+
yPosition = seriesViewRect.top;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
yPosition =
|
|
207
|
+
axisViewRect.height < textureHeight ? axisViewRect.bottom - textureHeight : axisViewRect.top;
|
|
208
|
+
}
|
|
189
209
|
centerHorizontally();
|
|
190
210
|
break;
|
|
191
211
|
}
|
|
@@ -16,6 +16,11 @@ export interface I2DSurfaceOptions extends ISurfaceOptionsBase {
|
|
|
16
16
|
* However if height of the div is not provided it will use width/height aspect ratio to calculate the height. The default ratio is 3/2.
|
|
17
17
|
*/
|
|
18
18
|
heightAspect?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Optional - the option of disabling / enabling scaling of the {@link SciChartSurface}.
|
|
21
|
+
* If false - the {@link SciChartSurface} will take the height and width of parent div without scaling.
|
|
22
|
+
*/
|
|
23
|
+
disableAspect?: boolean;
|
|
19
24
|
/**
|
|
20
25
|
* Optional - Prove a layoutManager to customise the axis layout. Use CentralAxesLayoutManager for an easy way to configure central axes.
|
|
21
26
|
*/
|
|
@@ -32,4 +37,5 @@ export interface I2DSurfaceOptions extends ISurfaceOptionsBase {
|
|
|
32
37
|
* Optional - Properties of the canvas border
|
|
33
38
|
*/
|
|
34
39
|
canvasBorder?: TBorder;
|
|
40
|
+
drawSeriesBehindAxis?: boolean;
|
|
35
41
|
}
|
|
@@ -5,6 +5,10 @@ import { ELegendType, SciChartLegendBase } from "./SciChartLegendBase";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class SciChartLegend extends SciChartLegendBase {
|
|
7
7
|
readonly type = ELegendType.SciChartLegend;
|
|
8
|
+
/**
|
|
9
|
+
* Checked changed callback - when a legend item row checkbox is checked or unchecked. Set by parent {@link LegendModifier}
|
|
10
|
+
*/
|
|
11
|
+
legendItemCheckedChangedCallback: (series: IRenderableSeries, isChecked: boolean) => void;
|
|
8
12
|
private renderableSeriesArray;
|
|
9
13
|
private showCheckboxesProperty;
|
|
10
14
|
private showSeriesMarkersProperty;
|
|
@@ -91,9 +91,15 @@ var SciChartLegend = /** @class */ (function (_super) {
|
|
|
91
91
|
* adds event listeners to a specific {@link IRenderableSeries} series
|
|
92
92
|
*/
|
|
93
93
|
SciChartLegend.prototype.addEventListenerToSeries = function (rs) {
|
|
94
|
+
var _this = this;
|
|
94
95
|
var el = this.getParentDiv().querySelector("[id='".concat(rs.id, "']"));
|
|
95
96
|
if (el) {
|
|
96
|
-
var onChangeEventListener_1 = function (e) {
|
|
97
|
+
var onChangeEventListener_1 = function (e) {
|
|
98
|
+
rs.isVisible = e.target.checked;
|
|
99
|
+
if (_this.legendItemCheckedChangedCallback) {
|
|
100
|
+
_this.legendItemCheckedChangedCallback(rs, rs.isVisible);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
97
103
|
el.addEventListener("change", onChangeEventListener_1);
|
|
98
104
|
var eventSubscriptionItem = {
|
|
99
105
|
element: el,
|
|
@@ -31,6 +31,7 @@ import { RolloverModifierRenderableSeriesProps } from "./RolloverModifier/Rollov
|
|
|
31
31
|
import { SeriesHoveredArgs } from "./SeriesHoveredArgs";
|
|
32
32
|
import { SeriesSelectedArgs } from "./SeriesSelectedArgs";
|
|
33
33
|
import { ShaderEffect } from "./ShaderEffect";
|
|
34
|
+
import { SeriesVisibleChangedArgs } from "./SeriesVisibleChangedArgs";
|
|
34
35
|
/**
|
|
35
36
|
* @summary Defines the base class to a Render Series (or Chart Type) in SciChart's High Performance Real-time
|
|
36
37
|
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
@@ -47,23 +48,21 @@ export declare abstract class BaseRenderableSeries implements IRenderableSeries
|
|
|
47
48
|
/** @inheritDoc */
|
|
48
49
|
readonly id: string;
|
|
49
50
|
/** @inheritDoc */
|
|
50
|
-
readonly isStacked
|
|
51
|
+
readonly isStacked: boolean;
|
|
51
52
|
/** @inheritDoc */
|
|
52
53
|
readonly rolloverModifierProps: RolloverModifierRenderableSeriesProps;
|
|
53
54
|
/** @inheritDoc */
|
|
54
55
|
readonly rolloverModifierProps1: RolloverModifierRenderableSeriesProps;
|
|
55
56
|
/** @inheritDoc */
|
|
56
|
-
parentSurface: SciChartSurface;
|
|
57
|
-
/** @inheritDoc */
|
|
58
57
|
invalidateParentCallback: () => void;
|
|
59
58
|
/** @inheritDoc */
|
|
60
|
-
drawingProviders: ISeriesDrawingProvider[];
|
|
61
|
-
/** @inheritDoc */
|
|
62
59
|
hitTestProvider: IHitTestProvider;
|
|
63
60
|
/** @inheritDoc */
|
|
64
61
|
selected: EventHandler<SeriesSelectedArgs>;
|
|
65
62
|
/** @inheritDoc */
|
|
66
63
|
hovered: EventHandler<SeriesHoveredArgs>;
|
|
64
|
+
/** @inheritDoc */
|
|
65
|
+
isVisibleChanged: EventHandler<SeriesVisibleChangedArgs>;
|
|
67
66
|
protected webAssemblyContext: TSciChart;
|
|
68
67
|
protected dataSeriesProperty: IDataSeries;
|
|
69
68
|
protected animationFSM: SeriesAnimationFiniteStateMachine;
|
|
@@ -72,11 +71,14 @@ export declare abstract class BaseRenderableSeries implements IRenderableSeries
|
|
|
72
71
|
protected typeMap: Map<string, string>;
|
|
73
72
|
protected resamplerHelper: ExtremeResamplerHelper;
|
|
74
73
|
protected pointSeries: XyPointSeriesResampled;
|
|
74
|
+
protected currentRenderPassData: RenderPassData;
|
|
75
|
+
protected opacityProperty: number;
|
|
76
|
+
private parentSurfaceProperty;
|
|
77
|
+
private drawingProvidersProperty;
|
|
75
78
|
private xAxisIdProperty;
|
|
76
79
|
private yAxisIdProperty;
|
|
77
80
|
private strokeThicknessProperty;
|
|
78
81
|
private strokeProperty;
|
|
79
|
-
private opacityProperty;
|
|
80
82
|
private pointMarkerProperty;
|
|
81
83
|
private drawNaNAsProperty;
|
|
82
84
|
private isVisibleProperty;
|
|
@@ -84,7 +86,6 @@ export declare abstract class BaseRenderableSeries implements IRenderableSeries
|
|
|
84
86
|
private isDigitalLineProperty;
|
|
85
87
|
private isSelectedProperty;
|
|
86
88
|
private isHoveredProperty;
|
|
87
|
-
private currentRenderPassData;
|
|
88
89
|
private resamplingModeProperty;
|
|
89
90
|
private resamplingPrecisionProperty;
|
|
90
91
|
/**
|
|
@@ -97,6 +98,14 @@ export declare abstract class BaseRenderableSeries implements IRenderableSeries
|
|
|
97
98
|
/** @inheritDoc */
|
|
98
99
|
applyTheme(themeProvider: IThemeProvider): void;
|
|
99
100
|
/** @inheritDoc */
|
|
101
|
+
get parentSurface(): SciChartSurface;
|
|
102
|
+
/** @inheritDoc */
|
|
103
|
+
set parentSurface(value: SciChartSurface);
|
|
104
|
+
/** @inheritDoc */
|
|
105
|
+
get drawingProviders(): ISeriesDrawingProvider[];
|
|
106
|
+
/** @inheritDoc */
|
|
107
|
+
set drawingProviders(value: ISeriesDrawingProvider[]);
|
|
108
|
+
/** @inheritDoc */
|
|
100
109
|
get isSelected(): boolean;
|
|
101
110
|
/** @inheritDoc */
|
|
102
111
|
set isSelected(isSelected: boolean);
|
|
@@ -30,6 +30,7 @@ var constants_1 = require("./constants");
|
|
|
30
30
|
var RolloverModifierRenderableSeriesProps_1 = require("./RolloverModifier/RolloverModifierRenderableSeriesProps");
|
|
31
31
|
var SeriesHoveredArgs_1 = require("./SeriesHoveredArgs");
|
|
32
32
|
var SeriesSelectedArgs_1 = require("./SeriesSelectedArgs");
|
|
33
|
+
var SeriesVisibleChangedArgs_1 = require("./SeriesVisibleChangedArgs");
|
|
33
34
|
/**
|
|
34
35
|
* @summary Defines the base class to a Render Series (or Chart Type) in SciChart's High Performance Real-time
|
|
35
36
|
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
@@ -50,31 +51,31 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
50
51
|
function BaseRenderableSeries(webAssemblyContext, options) {
|
|
51
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
52
53
|
/** @inheritDoc */
|
|
53
|
-
this.isStacked = false;
|
|
54
|
-
/** @inheritDoc */
|
|
55
54
|
this.rolloverModifierProps = new RolloverModifierRenderableSeriesProps_1.RolloverModifierRenderableSeriesProps(this);
|
|
56
55
|
/** @inheritDoc */
|
|
57
56
|
this.rolloverModifierProps1 = new RolloverModifierRenderableSeriesProps_1.RolloverModifierRenderableSeriesProps(this, true);
|
|
58
57
|
/** @inheritDoc */
|
|
59
|
-
this.drawingProviders = [];
|
|
60
|
-
/** @inheritDoc */
|
|
61
58
|
this.selected = new EventHandler_1.EventHandler();
|
|
62
59
|
/** @inheritDoc */
|
|
63
60
|
this.hovered = new EventHandler_1.EventHandler();
|
|
61
|
+
/** @inheritDoc */
|
|
62
|
+
this.isVisibleChanged = new EventHandler_1.EventHandler();
|
|
64
63
|
this.animationQueue = [];
|
|
65
64
|
this.paletteProviderProperty = IPaletteProvider_1.DefaultPaletteProvider.createEmpty();
|
|
66
|
-
// used to track if registered types were used for function
|
|
65
|
+
// used to track if registered types were used for function properties, so they can be serialized
|
|
67
66
|
this.typeMap = new Map();
|
|
67
|
+
this.opacityProperty = 1;
|
|
68
|
+
this.drawingProvidersProperty = [];
|
|
68
69
|
this.xAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
|
|
69
70
|
this.yAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
|
|
70
71
|
this.strokeThicknessProperty = 2;
|
|
71
72
|
this.strokeProperty = SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.lineSeriesColor;
|
|
72
|
-
this.opacityProperty = 1;
|
|
73
73
|
this.drawNaNAsProperty = WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine;
|
|
74
74
|
this.isVisibleProperty = true;
|
|
75
75
|
this.isDigitalLineProperty = false;
|
|
76
76
|
this.resamplingModeProperty = ResamplingMode_1.EResamplingMode.Auto;
|
|
77
77
|
this.resamplingPrecisionProperty = 0;
|
|
78
|
+
this.isStacked = false;
|
|
78
79
|
this.webAssemblyContext = webAssemblyContext;
|
|
79
80
|
this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
|
|
80
81
|
// It is very important to add bind(this) first line in constructor,
|
|
@@ -113,7 +114,7 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
113
114
|
options.effect = (0, classFactory_1.createType)(BaseType_1.EBaseType.ShaderEffect, options.effect.type, webAssemblyContext, options.effect.options);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
this.
|
|
117
|
+
this.effectProperty = options === null || options === void 0 ? void 0 : options.effect;
|
|
117
118
|
if (options === null || options === void 0 ? void 0 : options.paletteProvider) {
|
|
118
119
|
if (!("onAttached" in options.paletteProvider)) {
|
|
119
120
|
if (options.paletteProvider.type === PaletteProviderType_1.EPaletteProviderType.Custom) {
|
|
@@ -130,6 +131,21 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
130
131
|
this.hitTestProvider = this.newHitTestProvider();
|
|
131
132
|
this.isSelected = (_q = options === null || options === void 0 ? void 0 : options.isSelected) !== null && _q !== void 0 ? _q : false;
|
|
132
133
|
this.isHovered = (_r = options === null || options === void 0 ? void 0 : options.isHovered) !== null && _r !== void 0 ? _r : false;
|
|
134
|
+
if (options === null || options === void 0 ? void 0 : options.onIsVisibleChanged) {
|
|
135
|
+
if (typeof options.onIsVisibleChanged === "string") {
|
|
136
|
+
this.typeMap.set("onIsVisibleChanged", options.onIsVisibleChanged);
|
|
137
|
+
var visibleChanged_1 = (0, classFactory_1.getFunction)(BaseType_1.EBaseType.OptionFunction, options.onIsVisibleChanged);
|
|
138
|
+
this.isVisibleChanged.subscribe(function (args) {
|
|
139
|
+
return visibleChanged_1(args.sourceSeries, args.isVisible);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
var onIsVisibleChangedCallback_1 = options === null || options === void 0 ? void 0 : options.onIsVisibleChanged;
|
|
144
|
+
this.isVisibleChanged.subscribe(function (args) {
|
|
145
|
+
return onIsVisibleChangedCallback_1(args.sourceSeries, args.isVisible);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
133
149
|
if (options === null || options === void 0 ? void 0 : options.onSelectedChanged) {
|
|
134
150
|
if (typeof options.onSelectedChanged === "string") {
|
|
135
151
|
this.typeMap.set("onSelectedChanged", options.onSelectedChanged);
|
|
@@ -182,6 +198,32 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
182
198
|
this.rolloverModifierProps.markerColor = themeProvider.textAnnotationBackground;
|
|
183
199
|
}
|
|
184
200
|
};
|
|
201
|
+
Object.defineProperty(BaseRenderableSeries.prototype, "parentSurface", {
|
|
202
|
+
/** @inheritDoc */
|
|
203
|
+
get: function () {
|
|
204
|
+
return this.parentSurfaceProperty;
|
|
205
|
+
},
|
|
206
|
+
/** @inheritDoc */
|
|
207
|
+
set: function (value) {
|
|
208
|
+
this.parentSurfaceProperty = value;
|
|
209
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.PARENT_SURFACE);
|
|
210
|
+
},
|
|
211
|
+
enumerable: false,
|
|
212
|
+
configurable: true
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(BaseRenderableSeries.prototype, "drawingProviders", {
|
|
215
|
+
/** @inheritDoc */
|
|
216
|
+
get: function () {
|
|
217
|
+
return this.drawingProvidersProperty;
|
|
218
|
+
},
|
|
219
|
+
/** @inheritDoc */
|
|
220
|
+
set: function (value) {
|
|
221
|
+
this.drawingProvidersProperty = value;
|
|
222
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.DRAWING_PROVIDERS);
|
|
223
|
+
},
|
|
224
|
+
enumerable: false,
|
|
225
|
+
configurable: true
|
|
226
|
+
});
|
|
185
227
|
Object.defineProperty(BaseRenderableSeries.prototype, "isSelected", {
|
|
186
228
|
/** @inheritDoc */
|
|
187
229
|
get: function () {
|
|
@@ -248,8 +290,12 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
248
290
|
},
|
|
249
291
|
/** @inheritDoc */
|
|
250
292
|
set: function (isVisible) {
|
|
251
|
-
|
|
252
|
-
this.
|
|
293
|
+
var _a;
|
|
294
|
+
if (this.valueChanged(this.isVisibleProperty, isVisible)) {
|
|
295
|
+
this.isVisibleProperty = isVisible;
|
|
296
|
+
(_a = this.isVisibleChanged) === null || _a === void 0 ? void 0 : _a.raiseEvent(new SeriesVisibleChangedArgs_1.SeriesVisibleChangedArgs(this, isVisible));
|
|
297
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.IS_VISIBLE);
|
|
298
|
+
}
|
|
253
299
|
},
|
|
254
300
|
enumerable: false,
|
|
255
301
|
configurable: true
|
|
@@ -761,6 +807,7 @@ var BaseRenderableSeries = /** @class */ (function () {
|
|
|
761
807
|
return (seriesTypeSupportsResampling &&
|
|
762
808
|
SciChartDefaults_1.SciChartDefaults.enableResampling &&
|
|
763
809
|
this.enableDrawingOptimisations &&
|
|
810
|
+
!this.isStacked &&
|
|
764
811
|
this.dataSeries &&
|
|
765
812
|
this.dataSeries.count() > 0 &&
|
|
766
813
|
this.dataSeries.dataDistributionCalculator.isSortedAscending);
|
|
@@ -29,6 +29,7 @@ import { RolloverModifierRenderableSeriesProps } from "./RolloverModifier/Rollov
|
|
|
29
29
|
import { SeriesHoveredArgs } from "./SeriesHoveredArgs";
|
|
30
30
|
import { SeriesSelectedArgs } from "./SeriesSelectedArgs";
|
|
31
31
|
import { ShaderEffect } from "./ShaderEffect";
|
|
32
|
+
import { SeriesVisibleChangedArgs } from "./SeriesVisibleChangedArgs";
|
|
32
33
|
/**
|
|
33
34
|
* Options to pass to the {@link BaseStackedCollection} constructor
|
|
34
35
|
*/
|
|
@@ -99,6 +100,8 @@ export declare abstract class BaseStackedCollection<T extends BaseStackedRendera
|
|
|
99
100
|
*/
|
|
100
101
|
protected constructor(webAssemblyContext: TSciChart, options?: IBaseStackedCollectionOptions);
|
|
101
102
|
/** @inheritDoc */
|
|
103
|
+
get isVisibleChanged(): EventHandler<SeriesVisibleChangedArgs>;
|
|
104
|
+
/** @inheritDoc */
|
|
102
105
|
get selected(): EventHandler<SeriesSelectedArgs>;
|
|
103
106
|
/** @inheritDoc */
|
|
104
107
|
get hovered(): EventHandler<SeriesHoveredArgs>;
|
|
@@ -72,6 +72,14 @@ var BaseStackedCollection = /** @class */ (function (_super) {
|
|
|
72
72
|
_this.accumulatedFinalAnimationValues0 = new _this.webAssemblyContext.SCRTDoubleVector();
|
|
73
73
|
return _this;
|
|
74
74
|
}
|
|
75
|
+
Object.defineProperty(BaseStackedCollection.prototype, "isVisibleChanged", {
|
|
76
|
+
/** @inheritDoc */
|
|
77
|
+
get: function () {
|
|
78
|
+
throw new Error("getting visibleChanged event is not supported for BaseStackedCollection");
|
|
79
|
+
},
|
|
80
|
+
enumerable: false,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
75
83
|
Object.defineProperty(BaseStackedCollection.prototype, "selected", {
|
|
76
84
|
/** @inheritDoc */
|
|
77
85
|
get: function () {
|