scichart 3.2.476 → 3.2.481
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 +4 -0
- package/Builder/buildModifiers.js +2 -0
- package/Charting/ChartModifiers/RolloverModifier.d.ts +20 -10
- package/Charting/ChartModifiers/RolloverModifier.js +108 -91
- package/Charting/ChartModifiers/VerticalSliceModifier.d.ts +76 -0
- package/Charting/ChartModifiers/VerticalSliceModifier.js +247 -0
- package/Charting/ChartModifiers/constants.d.ts +6 -1
- package/Charting/ChartModifiers/constants.js +5 -0
- package/Charting/Drawing/RenderSurface.js +1 -0
- package/Charting/Model/OhlcDataSeries.js +3 -3
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +5 -1
- package/Charting/Visuals/Annotations/SvgAnnotationBase.d.ts +2 -0
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +21 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +1 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +18 -5
- package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.js +14 -3
- package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.js +14 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +7 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.wasm +0 -0
- package/index.d.ts +2 -0
- package/index.dev.js +417 -106
- package/index.js +16 -14
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/types/ChartModifierType.d.ts +1 -0
- package/types/ChartModifierType.js +1 -0
|
@@ -6,6 +6,7 @@ import { IMouseWheelZoomModifierOptions } from "../Charting/ChartModifiers/Mouse
|
|
|
6
6
|
import { IRangeSelectionModifierOptions } from "../Charting/ChartModifiers/OverviewRangeSelectionModifier";
|
|
7
7
|
import { IPinchZoomModifierOptions } from "../Charting/ChartModifiers/PinchZoomModifier";
|
|
8
8
|
import { IRolloverModifierOptions } from "../Charting/ChartModifiers/RolloverModifier";
|
|
9
|
+
import { IVerticalSliceOptions } from "../Charting/ChartModifiers/VerticalSliceModifier";
|
|
9
10
|
import { IRubberBandXyZoomModifierOptions } from "../Charting/ChartModifiers/RubberBandXyZoomModifier";
|
|
10
11
|
import { ISeriesSelectionModifierOptions } from "../Charting/ChartModifiers/SeriesSelectionModifier";
|
|
11
12
|
import { IXAxisDragModifierOptions } from "../Charting/ChartModifiers/XAxisDragModifier";
|
|
@@ -32,6 +33,9 @@ export declare type TModifierDefinition = {
|
|
|
32
33
|
} | {
|
|
33
34
|
type: EChart2DModifierType.Rollover;
|
|
34
35
|
options?: IRolloverModifierOptions;
|
|
36
|
+
} | {
|
|
37
|
+
type: EChart2DModifierType.VerticalSlice;
|
|
38
|
+
options?: IVerticalSliceOptions;
|
|
35
39
|
} | {
|
|
36
40
|
type: EChart2DModifierType.RubberBandXYZoom;
|
|
37
41
|
options?: IRubberBandXyZoomModifierOptions;
|
|
@@ -8,6 +8,7 @@ var MouseWheelZoomModifier_1 = require("../Charting/ChartModifiers/MouseWheelZoo
|
|
|
8
8
|
var OverviewRangeSelectionModifier_1 = require("../Charting/ChartModifiers/OverviewRangeSelectionModifier");
|
|
9
9
|
var PinchZoomModifier_1 = require("../Charting/ChartModifiers/PinchZoomModifier");
|
|
10
10
|
var RolloverModifier_1 = require("../Charting/ChartModifiers/RolloverModifier");
|
|
11
|
+
var VerticalSliceModifier_1 = require("../Charting/ChartModifiers/VerticalSliceModifier");
|
|
11
12
|
var RubberBandXyZoomModifier_1 = require("../Charting/ChartModifiers/RubberBandXyZoomModifier");
|
|
12
13
|
var SeriesSelectionModifier_1 = require("../Charting/ChartModifiers/SeriesSelectionModifier");
|
|
13
14
|
var XAxisDragModifier_1 = require("../Charting/ChartModifiers/XAxisDragModifier");
|
|
@@ -24,6 +25,7 @@ var classFactory_1 = require("./classFactory");
|
|
|
24
25
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.MouseWheelZoom, function (options) { return new MouseWheelZoomModifier_1.MouseWheelZoomModifier(options); }, true);
|
|
25
26
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.PinchZoom, function (options) { return new PinchZoomModifier_1.PinchZoomModifier(options); }, true);
|
|
26
27
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.Rollover, function (options) { return new RolloverModifier_1.RolloverModifier(options); }, true);
|
|
28
|
+
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.VerticalSlice, function (options) { return new VerticalSliceModifier_1.VerticalSliceModifier(options); }, true);
|
|
27
29
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.RubberBandXYZoom, function (options) { return new RubberBandXyZoomModifier_1.RubberBandXyZoomModifier(options); }, true);
|
|
28
30
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.SeriesSelection, function (options) { return new SeriesSelectionModifier_1.SeriesSelectionModifier(options); }, true);
|
|
29
31
|
(0, classFactory_1.registerType)(BaseType_1.EBaseType.Chart2DModifier, ChartModifierType_1.EChart2DModifierType.XAxisDrag, function (options) { return new XAxisDragModifier_1.XAxisDragModifier(options); }, true);
|
|
@@ -5,6 +5,7 @@ import { EChart2DModifierType } from "../../types/ChartModifierType";
|
|
|
5
5
|
import { EMousePosition } from "../../types/MousePosition";
|
|
6
6
|
import { SeriesInfo } from "../Model/ChartData/SeriesInfo";
|
|
7
7
|
import { IThemeProvider } from "../Themes/IThemeProvider";
|
|
8
|
+
import { LineAnnotation } from "../Visuals/Annotations/LineAnnotation";
|
|
8
9
|
import { RolloverLegendSvgAnnotation } from "../Visuals/Annotations/RolloverLegendSvgAnnotation";
|
|
9
10
|
import { HitTestInfo } from "../Visuals/RenderableSeries/HitTest/HitTestInfo";
|
|
10
11
|
import { IRenderableSeries } from "../Visuals/RenderableSeries/IRenderableSeries";
|
|
@@ -53,6 +54,8 @@ export declare type TTooltipProps = {
|
|
|
53
54
|
width: number;
|
|
54
55
|
seriesInfo: SeriesInfo;
|
|
55
56
|
};
|
|
57
|
+
/** @ignore */
|
|
58
|
+
export declare const TOOLTIP_SPACING = 4;
|
|
56
59
|
/**
|
|
57
60
|
* Optional parameters used to configure a {@link RolloverModifier} at construct time
|
|
58
61
|
*/
|
|
@@ -127,9 +130,10 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
127
130
|
hitTestRadius: number;
|
|
128
131
|
protected showRolloverLineProperty: boolean;
|
|
129
132
|
protected showTooltipProperty: boolean;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
protected absoluteXCoord: number;
|
|
134
|
+
readonly rolloverLineAnnotation: LineAnnotation | undefined;
|
|
135
|
+
protected mousePosition: EMousePosition;
|
|
136
|
+
protected readonly legendAnnotation: RolloverLegendSvgAnnotation | undefined;
|
|
133
137
|
private tooltipDataTemplateProperty?;
|
|
134
138
|
private allowTooltipOverlappingProperty;
|
|
135
139
|
private includedSeriesMap;
|
|
@@ -139,6 +143,7 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
139
143
|
* @param options Optional parameters {@link IRolloverModifierOptions} used to configure the modifier
|
|
140
144
|
*/
|
|
141
145
|
constructor(options?: IRolloverModifierOptions);
|
|
146
|
+
protected createLine(options?: IRolloverModifierOptions): LineAnnotation;
|
|
142
147
|
/**
|
|
143
148
|
* @inheritDoc
|
|
144
149
|
*/
|
|
@@ -175,6 +180,7 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
175
180
|
* @inheritDoc
|
|
176
181
|
*/
|
|
177
182
|
onAttach(): void;
|
|
183
|
+
protected addLineAnnotationToSurface(): void;
|
|
178
184
|
/**
|
|
179
185
|
* @inheritDoc
|
|
180
186
|
*/
|
|
@@ -235,25 +241,27 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
235
241
|
protected CalculateTooltipPositions(tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, spacing: number, seriesViewRect: Rect, pixelRatio: number, isVerticalChart?: boolean): TTooltipProps[];
|
|
236
242
|
/** @inheritDoc */
|
|
237
243
|
protected notifyPropertyChanged(propertyName: string): void;
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
protected isVerticalChart(): boolean;
|
|
245
|
+
protected removeSeriesAnnotationsFromParentSurface(rs: IRenderableSeries): void;
|
|
240
246
|
/**
|
|
241
247
|
* @param rs
|
|
242
248
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
protected addSeriesAnnotationsToParentSurface(rs: IRenderableSeries): void;
|
|
250
|
+
protected getRolloverProps(rs: IRenderableSeries): RolloverModifierRenderableSeriesProps;
|
|
251
|
+
protected getRolloverProps1(rs: IRenderableSeries): RolloverModifierRenderableSeriesProps;
|
|
252
|
+
protected update(): void;
|
|
253
|
+
protected updateLine(): void;
|
|
246
254
|
/**
|
|
247
255
|
* @description Update Markers and Tooltips
|
|
248
256
|
*/
|
|
249
|
-
|
|
257
|
+
protected updateSeriesAnnotations(): void;
|
|
250
258
|
/**
|
|
251
259
|
* Test if the series is included or excluded, by default it is included
|
|
252
260
|
* @param series
|
|
253
261
|
* @private
|
|
254
262
|
*/
|
|
255
263
|
private testIsIncludedSeries;
|
|
256
|
-
|
|
264
|
+
protected getSeriesInfos(): SeriesInfo[];
|
|
257
265
|
/**
|
|
258
266
|
* Gets or sets the parent div element reference or id for the Tooltip
|
|
259
267
|
*/
|
|
@@ -290,3 +298,5 @@ export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, ro
|
|
|
290
298
|
* @param isVerticalChart
|
|
291
299
|
*/
|
|
292
300
|
export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, spacing: number, seriesViewRect: Rect, pixelRatio: number, isVerticalChart?: boolean) => TTooltipProps[];
|
|
301
|
+
/** @ignore */
|
|
302
|
+
export declare const updateRolloverModifierProps: (rolloverRSProps: RolloverModifierRenderableSeriesProps, rs: IRenderableSeries, tooltipProps: TTooltipProps, showTooltip: boolean, showMarker: boolean, placementDivId?: string) => void;
|
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.calcTooltipPositions = exports.calcTooltipProps = exports.RolloverModifier = void 0;
|
|
18
|
+
exports.updateRolloverModifierProps = exports.calcTooltipPositions = exports.calcTooltipProps = exports.RolloverModifier = exports.TOOLTIP_SPACING = void 0;
|
|
19
19
|
var classFactory_1 = require("../../Builder/classFactory");
|
|
20
20
|
var BaseType_1 = require("../../types/BaseType");
|
|
21
21
|
var ChartModifierType_1 = require("../../types/ChartModifierType");
|
|
@@ -34,7 +34,7 @@ var DpiHelper_1 = require("../Visuals/TextureManager/DpiHelper");
|
|
|
34
34
|
var ChartModifierBase2D_1 = require("./ChartModifierBase2D");
|
|
35
35
|
var constants_1 = require("./constants");
|
|
36
36
|
/** @ignore */
|
|
37
|
-
|
|
37
|
+
exports.TOOLTIP_SPACING = 4;
|
|
38
38
|
/**
|
|
39
39
|
* The RolloverModifier provides tooltip and cursor behavior on a 2D {@link SciChartSurface}
|
|
40
40
|
* within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
@@ -56,7 +56,7 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
56
56
|
*/
|
|
57
57
|
function RolloverModifier(options) {
|
|
58
58
|
var _this = this;
|
|
59
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
59
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
60
60
|
_this = _super.call(this, options) || this;
|
|
61
61
|
_this.type = ChartModifierType_1.EChart2DModifierType.Rollover;
|
|
62
62
|
/**
|
|
@@ -78,21 +78,13 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
78
78
|
_this.hitTestRadius = 0;
|
|
79
79
|
_this.showRolloverLineProperty = true;
|
|
80
80
|
_this.showTooltipProperty = true;
|
|
81
|
+
_this.absoluteXCoord = 0;
|
|
81
82
|
_this.mousePosition = MousePosition_1.EMousePosition.OutOfCanvas;
|
|
82
83
|
_this.allowTooltipOverlappingProperty = false;
|
|
83
84
|
_this.includedSeriesMap = new Map();
|
|
84
85
|
_this.hitTestRenderableSeries = _this.hitTestRenderableSeries.bind(_this);
|
|
85
86
|
_this.placementDivIdProperty = (_a = options === null || options === void 0 ? void 0 : options.placementDivId) !== null && _a !== void 0 ? _a : _this.placementDivIdProperty;
|
|
86
|
-
_this.rolloverLineAnnotation =
|
|
87
|
-
xCoordinateMode: AnnotationBase_1.ECoordinateMode.Pixel,
|
|
88
|
-
yCoordinateMode: AnnotationBase_1.ECoordinateMode.Pixel,
|
|
89
|
-
strokeDashArray: options === null || options === void 0 ? void 0 : options.rolloverLineStrokeDashArray,
|
|
90
|
-
strokeThickness: (_b = options === null || options === void 0 ? void 0 : options.rolloverLineStrokeThickness) !== null && _b !== void 0 ? _b : 2,
|
|
91
|
-
stroke: (_c = options === null || options === void 0 ? void 0 : options.rolloverLineStroke) !== null && _c !== void 0 ? _c : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.cursorLineBrush,
|
|
92
|
-
isHidden: true,
|
|
93
|
-
xAxisId: _this.xAxisId,
|
|
94
|
-
yAxisId: _this.yAxisId
|
|
95
|
-
});
|
|
87
|
+
_this.rolloverLineAnnotation = _this.createLine(options);
|
|
96
88
|
if (options === null || options === void 0 ? void 0 : options.tooltipLegendTemplate) {
|
|
97
89
|
if (typeof options.tooltipLegendTemplate === "string") {
|
|
98
90
|
_this.typeMap.set("tooltipLegendTemplate", options.tooltipLegendTemplate);
|
|
@@ -100,9 +92,9 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
100
92
|
}
|
|
101
93
|
}
|
|
102
94
|
_this.tooltipLegendTemplate =
|
|
103
|
-
(
|
|
104
|
-
_this.tooltipLegendOffsetX = (
|
|
105
|
-
_this.tooltipLegendOffsetY = (
|
|
95
|
+
(_b = options === null || options === void 0 ? void 0 : options.tooltipLegendTemplate) !== null && _b !== void 0 ? _b : _this.tooltipLegendTemplate;
|
|
96
|
+
_this.tooltipLegendOffsetX = (_c = options === null || options === void 0 ? void 0 : options.tooltipLegendOffsetX) !== null && _c !== void 0 ? _c : _this.tooltipLegendOffsetX;
|
|
97
|
+
_this.tooltipLegendOffsetY = (_d = options === null || options === void 0 ? void 0 : options.tooltipLegendOffsetY) !== null && _d !== void 0 ? _d : _this.tooltipLegendOffsetY;
|
|
106
98
|
if (options === null || options === void 0 ? void 0 : options.tooltipDataTemplate) {
|
|
107
99
|
if (typeof options.tooltipDataTemplate === "string") {
|
|
108
100
|
_this.typeMap.set("tooltipDataTemplate", options.tooltipDataTemplate);
|
|
@@ -110,9 +102,9 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
110
102
|
}
|
|
111
103
|
}
|
|
112
104
|
_this.tooltipDataTemplateProperty =
|
|
113
|
-
(
|
|
114
|
-
_this.showRolloverLineProperty = (
|
|
115
|
-
_this.showTooltipProperty = (
|
|
105
|
+
(_e = options === null || options === void 0 ? void 0 : options.tooltipDataTemplate) !== null && _e !== void 0 ? _e : _this.tooltipDataTemplateProperty;
|
|
106
|
+
_this.showRolloverLineProperty = (_f = options === null || options === void 0 ? void 0 : options.showRolloverLine) !== null && _f !== void 0 ? _f : _this.showRolloverLineProperty;
|
|
107
|
+
_this.showTooltipProperty = (_g = options === null || options === void 0 ? void 0 : options.showTooltip) !== null && _g !== void 0 ? _g : _this.showTooltipProperty;
|
|
116
108
|
_this.legendAnnotation = new RolloverLegendSvgAnnotation_1.RolloverLegendSvgAnnotation({
|
|
117
109
|
tooltipLegendTemplate: _this.tooltipLegendTemplate,
|
|
118
110
|
tooltipLegendOffsetX: _this.tooltipLegendOffsetX,
|
|
@@ -120,11 +112,23 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
120
112
|
xAxisId: _this.xAxisId,
|
|
121
113
|
yAxisId: _this.yAxisId
|
|
122
114
|
});
|
|
123
|
-
_this.allowTooltipOverlappingProperty = (
|
|
124
|
-
_this.snapToDataPoint = (
|
|
125
|
-
_this.hitTestRadius = (
|
|
115
|
+
_this.allowTooltipOverlappingProperty = (_h = options === null || options === void 0 ? void 0 : options.allowTooltipOverlapping) !== null && _h !== void 0 ? _h : _this.allowTooltipOverlappingProperty;
|
|
116
|
+
_this.snapToDataPoint = (_j = options === null || options === void 0 ? void 0 : options.snapToDataPoint) !== null && _j !== void 0 ? _j : _this.snapToDataPoint;
|
|
117
|
+
_this.hitTestRadius = (_k = options === null || options === void 0 ? void 0 : options.hitTestRadius) !== null && _k !== void 0 ? _k : _this.hitTestRadius;
|
|
126
118
|
return _this;
|
|
127
119
|
}
|
|
120
|
+
RolloverModifier.prototype.createLine = function (options) {
|
|
121
|
+
var _a, _b;
|
|
122
|
+
return new LineAnnotation_1.LineAnnotation({
|
|
123
|
+
xCoordinateMode: AnnotationBase_1.ECoordinateMode.Pixel,
|
|
124
|
+
yCoordinateMode: AnnotationBase_1.ECoordinateMode.Pixel,
|
|
125
|
+
strokeDashArray: options === null || options === void 0 ? void 0 : options.rolloverLineStrokeDashArray,
|
|
126
|
+
strokeThickness: (_a = options === null || options === void 0 ? void 0 : options.rolloverLineStrokeThickness) !== null && _a !== void 0 ? _a : 2,
|
|
127
|
+
stroke: (_b = options === null || options === void 0 ? void 0 : options.rolloverLineStroke) !== null && _b !== void 0 ? _b : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.cursorLineBrush,
|
|
128
|
+
xAxisId: this.xAxisId,
|
|
129
|
+
yAxisId: this.yAxisId
|
|
130
|
+
});
|
|
131
|
+
};
|
|
128
132
|
/**
|
|
129
133
|
* @inheritDoc
|
|
130
134
|
*/
|
|
@@ -233,10 +237,13 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
233
237
|
RolloverModifier.prototype.onAttach = function () {
|
|
234
238
|
var _this = this;
|
|
235
239
|
_super.prototype.onAttach.call(this);
|
|
236
|
-
this.
|
|
240
|
+
this.addLineAnnotationToSurface();
|
|
237
241
|
this.parentSurface.modifierAnnotations.add(this.legendAnnotation);
|
|
238
242
|
this.getIncludedRenderableSeries().forEach(function (rs) { return _this.addSeriesAnnotationsToParentSurface(rs); });
|
|
239
243
|
};
|
|
244
|
+
RolloverModifier.prototype.addLineAnnotationToSurface = function () {
|
|
245
|
+
this.parentSurface.modifierAnnotations.add(this.rolloverLineAnnotation);
|
|
246
|
+
};
|
|
240
247
|
/**
|
|
241
248
|
* @inheritDoc
|
|
242
249
|
*/
|
|
@@ -432,19 +439,19 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
432
439
|
if (rs.isStacked) {
|
|
433
440
|
var stackedSeries = rs;
|
|
434
441
|
stackedSeries.asArray().forEach(function (childRs) {
|
|
435
|
-
_this.parentSurface.modifierAnnotations.remove(childRs.
|
|
436
|
-
_this.parentSurface.modifierAnnotations.remove(childRs.
|
|
437
|
-
childRs.
|
|
442
|
+
_this.parentSurface.modifierAnnotations.remove(_this.getRolloverProps(childRs).marker);
|
|
443
|
+
_this.parentSurface.modifierAnnotations.remove(_this.getRolloverProps(childRs).tooltip);
|
|
444
|
+
_this.getRolloverProps(childRs).delete();
|
|
438
445
|
});
|
|
439
446
|
}
|
|
440
447
|
else {
|
|
441
|
-
this.parentSurface.modifierAnnotations.remove(rs.
|
|
442
|
-
this.parentSurface.modifierAnnotations.remove(rs.
|
|
443
|
-
rs.
|
|
448
|
+
this.parentSurface.modifierAnnotations.remove(this.getRolloverProps(rs).marker);
|
|
449
|
+
this.parentSurface.modifierAnnotations.remove(this.getRolloverProps(rs).tooltip);
|
|
450
|
+
this.getRolloverProps(rs).delete();
|
|
444
451
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
445
|
-
this.parentSurface.modifierAnnotations.remove(rs.
|
|
446
|
-
this.parentSurface.modifierAnnotations.remove(rs.
|
|
447
|
-
rs.
|
|
452
|
+
this.parentSurface.modifierAnnotations.remove(this.getRolloverProps1(rs).marker);
|
|
453
|
+
this.parentSurface.modifierAnnotations.remove(this.getRolloverProps1(rs).tooltip);
|
|
454
|
+
this.getRolloverProps1(rs).delete();
|
|
448
455
|
}
|
|
449
456
|
}
|
|
450
457
|
};
|
|
@@ -457,16 +464,22 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
457
464
|
rs.type === SeriesType_1.ESeriesType.StackedColumnCollection) {
|
|
458
465
|
return;
|
|
459
466
|
}
|
|
460
|
-
rs.
|
|
461
|
-
createAnnotations(rs, this.placementDivIdProperty);
|
|
462
|
-
this.parentSurface.modifierAnnotations.add(rs.
|
|
463
|
-
this.parentSurface.modifierAnnotations.add(rs.
|
|
467
|
+
this.getRolloverProps(rs).rolloverModifier = this;
|
|
468
|
+
createAnnotations(rs, this.getRolloverProps(rs), this.getRolloverProps1(rs), this.placementDivIdProperty);
|
|
469
|
+
this.parentSurface.modifierAnnotations.add(this.getRolloverProps(rs).marker);
|
|
470
|
+
this.parentSurface.modifierAnnotations.add(this.getRolloverProps(rs).tooltip);
|
|
464
471
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
465
|
-
rs.
|
|
466
|
-
this.parentSurface.modifierAnnotations.add(rs.
|
|
467
|
-
this.parentSurface.modifierAnnotations.add(rs.
|
|
472
|
+
this.getRolloverProps1(rs).rolloverModifier = this;
|
|
473
|
+
this.parentSurface.modifierAnnotations.add(this.getRolloverProps1(rs).marker);
|
|
474
|
+
this.parentSurface.modifierAnnotations.add(this.getRolloverProps1(rs).tooltip);
|
|
468
475
|
}
|
|
469
476
|
};
|
|
477
|
+
RolloverModifier.prototype.getRolloverProps = function (rs) {
|
|
478
|
+
return rs.rolloverModifierProps;
|
|
479
|
+
};
|
|
480
|
+
RolloverModifier.prototype.getRolloverProps1 = function (rs) {
|
|
481
|
+
return rs.rolloverModifierProps1;
|
|
482
|
+
};
|
|
470
483
|
RolloverModifier.prototype.update = function () {
|
|
471
484
|
this.updateLine();
|
|
472
485
|
this.updateSeriesAnnotations();
|
|
@@ -533,32 +546,35 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
533
546
|
var _this = this;
|
|
534
547
|
var rsList = this.getIncludedRenderableSeries();
|
|
535
548
|
rsList.forEach(function (rs) {
|
|
536
|
-
|
|
549
|
+
var props = _this.getRolloverProps(rs);
|
|
550
|
+
if (!props.marker) {
|
|
537
551
|
_this.addSeriesAnnotationsToParentSurface(rs);
|
|
538
552
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
553
|
+
props.marker.suspendInvalidate();
|
|
554
|
+
props.tooltip.suspendInvalidate();
|
|
555
|
+
props.marker.isHidden = true;
|
|
556
|
+
props.tooltip.isHidden = true;
|
|
557
|
+
props.tooltip.x1 = undefined;
|
|
558
|
+
props.tooltip.y1 = undefined;
|
|
545
559
|
// TODO should be more general than looking at series type
|
|
546
560
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
561
|
+
props.marker.suspendInvalidate();
|
|
562
|
+
props.tooltip.suspendInvalidate();
|
|
563
|
+
props.marker.isHidden = true;
|
|
564
|
+
props.tooltip.isHidden = true;
|
|
565
|
+
props.tooltip.x1 = undefined;
|
|
566
|
+
props.tooltip.y1 = undefined;
|
|
553
567
|
}
|
|
554
568
|
});
|
|
555
569
|
if (this.mousePosition !== MousePosition_1.EMousePosition.SeriesArea) {
|
|
556
570
|
rsList.forEach(function (rs) {
|
|
557
|
-
|
|
558
|
-
|
|
571
|
+
var props = _this.getRolloverProps(rs);
|
|
572
|
+
props.marker.resumeInvalidate();
|
|
573
|
+
props.tooltip.resumeInvalidate();
|
|
559
574
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
560
|
-
|
|
561
|
-
rs.
|
|
575
|
+
// leave for now
|
|
576
|
+
_this.getRolloverProps1(rs).marker.resumeInvalidate();
|
|
577
|
+
_this.getRolloverProps1(rs).tooltip.resumeInvalidate();
|
|
562
578
|
}
|
|
563
579
|
});
|
|
564
580
|
return;
|
|
@@ -573,9 +589,9 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
573
589
|
if (rs.type !== SeriesType_1.ESeriesType.StackedColumnSeries || hitTestInfo.isHit) {
|
|
574
590
|
var isVisible = 0 <= hitTestInfo.yCoord && hitTestInfo.yCoord <= height;
|
|
575
591
|
if (isVisible) {
|
|
576
|
-
|
|
592
|
+
_this.absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.yCoord : hitTestInfo.xCoord;
|
|
577
593
|
var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.yCoord;
|
|
578
|
-
var tooltipProps = (0, exports.calcTooltipProps)(index, rs, rs
|
|
594
|
+
var tooltipProps = (0, exports.calcTooltipProps)(index, rs, _this.getRolloverProps(rs), _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.yValue, _this.absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, false, _this.isVerticalChart());
|
|
579
595
|
if (tooltipProps)
|
|
580
596
|
tooltipArray.push(tooltipProps);
|
|
581
597
|
}
|
|
@@ -585,7 +601,7 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
585
601
|
if (isVisibleY1) {
|
|
586
602
|
var absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.y1Coord : hitTestInfo.xCoord;
|
|
587
603
|
var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.y1Coord;
|
|
588
|
-
var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, rs
|
|
604
|
+
var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, _this.getRolloverProps1(rs), _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.y1Value, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, true, _this.isVerticalChart());
|
|
589
605
|
if (tooltipY1Props)
|
|
590
606
|
tooltipArray.push(tooltipY1Props);
|
|
591
607
|
}
|
|
@@ -595,24 +611,24 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
595
611
|
var orderedTooltipArray = tooltipArray.sort(function (a, b) {
|
|
596
612
|
return a.yCoord > b.yCoord ? 1 : b.yCoord > a.yCoord ? -1 : 0;
|
|
597
613
|
});
|
|
598
|
-
var tooltipPositions = this.CalculateTooltipPositions(orderedTooltipArray, this.allowTooltipOverlapping, TOOLTIP_SPACING * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.parentSurface.seriesViewRect, DpiHelper_1.DpiHelper.PIXEL_RATIO, this.isVerticalChart());
|
|
614
|
+
var tooltipPositions = this.CalculateTooltipPositions(orderedTooltipArray, this.allowTooltipOverlapping, exports.TOOLTIP_SPACING * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.parentSurface.seriesViewRect, DpiHelper_1.DpiHelper.PIXEL_RATIO, this.isVerticalChart());
|
|
599
615
|
tooltipPositions.forEach(function (el) {
|
|
600
616
|
var rs = rsList[el.index];
|
|
601
617
|
var showTooltip = _this.showTooltip && el.seriesInfo.isHit;
|
|
602
618
|
var showMarker = el.seriesInfo.isHit;
|
|
603
619
|
if (el.isY1) {
|
|
604
|
-
updateRolloverModifierProps(rs
|
|
620
|
+
(0, exports.updateRolloverModifierProps)(_this.getRolloverProps1(rs), rs, el, showTooltip, showMarker, _this.placementDivId);
|
|
605
621
|
}
|
|
606
622
|
else {
|
|
607
|
-
updateRolloverModifierProps(rs
|
|
623
|
+
(0, exports.updateRolloverModifierProps)(_this.getRolloverProps(rs), rs, el, showTooltip, showMarker, _this.placementDivId);
|
|
608
624
|
}
|
|
609
625
|
});
|
|
610
626
|
rsList.forEach(function (rs) {
|
|
611
|
-
rs.
|
|
612
|
-
rs.
|
|
627
|
+
_this.getRolloverProps(rs).marker.resumeInvalidate();
|
|
628
|
+
_this.getRolloverProps(rs).tooltip.resumeInvalidate();
|
|
613
629
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
614
|
-
rs.
|
|
615
|
-
rs.
|
|
630
|
+
_this.getRolloverProps1(rs).marker.resumeInvalidate();
|
|
631
|
+
_this.getRolloverProps1(rs).tooltip.resumeInvalidate();
|
|
616
632
|
}
|
|
617
633
|
});
|
|
618
634
|
};
|
|
@@ -652,8 +668,8 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
652
668
|
if (this.placementDivIdProperty !== value) {
|
|
653
669
|
this.placementDivIdProperty = value;
|
|
654
670
|
(_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.renderableSeries.asArray().forEach(function (rs) {
|
|
655
|
-
rs.
|
|
656
|
-
rs.
|
|
671
|
+
_this.getRolloverProps(rs).tooltip.placementDivId = _this.placementDivIdProperty;
|
|
672
|
+
_this.getRolloverProps1(rs).tooltip.placementDivId = _this.placementDivIdProperty;
|
|
657
673
|
});
|
|
658
674
|
}
|
|
659
675
|
},
|
|
@@ -763,45 +779,45 @@ exports.calcTooltipPositions = calcTooltipPositions;
|
|
|
763
779
|
* @description Creates MarkerAnnotation and TooltipAnnotation and assigns to rolloverSeries properties
|
|
764
780
|
* @param rs RenderableSeries
|
|
765
781
|
*/
|
|
766
|
-
var createAnnotations = function (rs, placementDivId) {
|
|
782
|
+
var createAnnotations = function (rs, rolloverModifierProps, rolloverModifierProps1, placementDivId) {
|
|
767
783
|
var _a, _b, _c, _d;
|
|
768
|
-
if (!
|
|
769
|
-
|
|
784
|
+
if (!rolloverModifierProps.marker) {
|
|
785
|
+
rolloverModifierProps.marker = new RolloverMarkerSvgAnnotation_1.RolloverMarkerSvgAnnotation(rolloverModifierProps);
|
|
770
786
|
// Rollover tooltips for multiple Y-Axes are not supported for stacked series
|
|
771
787
|
if (!rs.isStacked) {
|
|
772
|
-
|
|
773
|
-
|
|
788
|
+
rolloverModifierProps.marker.xAxisId = rs.xAxisId;
|
|
789
|
+
rolloverModifierProps.marker.yAxisId = rs.yAxisId;
|
|
774
790
|
}
|
|
775
791
|
}
|
|
776
|
-
if (!
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
792
|
+
if (!rolloverModifierProps.tooltip) {
|
|
793
|
+
rolloverModifierProps.tooltipTitle = (_b = (_a = rolloverModifierProps.tooltipTitle) !== null && _a !== void 0 ? _a : rs.getDataSeriesName()) !== null && _b !== void 0 ? _b : "";
|
|
794
|
+
rolloverModifierProps.tooltipColor = rolloverModifierProps.tooltipColor;
|
|
795
|
+
rolloverModifierProps.tooltip = new RolloverTooltipSvgAnnotation_1.RolloverTooltipSvgAnnotation(rolloverModifierProps, {
|
|
780
796
|
seriesType: rs.type,
|
|
781
797
|
placementDivId: placementDivId
|
|
782
798
|
});
|
|
783
799
|
// Rollover tooltips for multiple Y-Axes are not supported for stacked series
|
|
784
800
|
if (!rs.isStacked) {
|
|
785
|
-
|
|
786
|
-
|
|
801
|
+
rolloverModifierProps.tooltip.xAxisId = rs.xAxisId;
|
|
802
|
+
rolloverModifierProps.tooltip.yAxisId = rs.yAxisId;
|
|
787
803
|
}
|
|
788
804
|
}
|
|
789
805
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
790
806
|
var bandRs = rs;
|
|
791
|
-
if (!
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
if (!
|
|
797
|
-
|
|
798
|
-
(_d = (_c =
|
|
799
|
-
|
|
800
|
-
|
|
807
|
+
if (!rolloverModifierProps1.marker) {
|
|
808
|
+
rolloverModifierProps1.marker = new RolloverMarkerSvgAnnotation_1.RolloverMarkerSvgAnnotation(rolloverModifierProps1);
|
|
809
|
+
rolloverModifierProps1.marker.xAxisId = bandRs.xAxisId;
|
|
810
|
+
rolloverModifierProps1.marker.yAxisId = bandRs.yAxisId;
|
|
811
|
+
}
|
|
812
|
+
if (!rolloverModifierProps1.tooltip) {
|
|
813
|
+
rolloverModifierProps1.tooltipTitle =
|
|
814
|
+
(_d = (_c = rolloverModifierProps1.tooltipTitle) !== null && _c !== void 0 ? _c : bandRs.getDataSeriesName()) !== null && _d !== void 0 ? _d : "";
|
|
815
|
+
rolloverModifierProps1.tooltipColor = rolloverModifierProps1.tooltipColor;
|
|
816
|
+
rolloverModifierProps1.tooltip = new RolloverTooltipSvgAnnotation_1.RolloverTooltipSvgAnnotation(rolloverModifierProps1, {
|
|
801
817
|
placementDivId: placementDivId
|
|
802
818
|
});
|
|
803
|
-
|
|
804
|
-
|
|
819
|
+
rolloverModifierProps1.tooltip.xAxisId = bandRs.xAxisId;
|
|
820
|
+
rolloverModifierProps1.tooltip.yAxisId = bandRs.yAxisId;
|
|
805
821
|
}
|
|
806
822
|
}
|
|
807
823
|
};
|
|
@@ -836,3 +852,4 @@ var updateRolloverModifierProps = function (rolloverRSProps, rs, tooltipProps, s
|
|
|
836
852
|
}
|
|
837
853
|
}
|
|
838
854
|
};
|
|
855
|
+
exports.updateRolloverModifierProps = updateRolloverModifierProps;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RolloverModifier, IRolloverModifierOptions } from "./RolloverModifier";
|
|
2
|
+
import { ModifierMouseArgs } from "./ModifierMouseArgs";
|
|
3
|
+
import { RolloverModifierRenderableSeriesProps } from "../Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps";
|
|
4
|
+
import { IRenderableSeries } from "../Visuals/RenderableSeries/IRenderableSeries";
|
|
5
|
+
import { ECoordinateMode } from "../Visuals/Annotations/AnnotationBase";
|
|
6
|
+
import { LineAnnotation } from "../Visuals/Annotations/LineAnnotation";
|
|
7
|
+
import { IChartModifierBaseOptions } from "./ChartModifierBase2D";
|
|
8
|
+
/**
|
|
9
|
+
* Optional parameters used to configure a {@link RolloverModifier} at construct time
|
|
10
|
+
*/
|
|
11
|
+
export interface IVerticalSliceOptions extends IRolloverModifierOptions {
|
|
12
|
+
/**
|
|
13
|
+
* @description the X1 coordinate of the modifier
|
|
14
|
+
* @remarks The X1 coordinate obeys {@link xCoordinateMode} which defines whether the X1 coordinate is a pixel, data-value or relative coordinate
|
|
15
|
+
*/
|
|
16
|
+
x1?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The X-Coordinate mode. See {@link ECoordinateMode} for a list of values
|
|
19
|
+
* @remarks Want to display an annotation stretching across the entire width (or height) or the {@link SciChartSurface}?
|
|
20
|
+
* The {@link ECoordinateMode} enum has options which allow for relative, absolute or pixel coordinates which define annotation
|
|
21
|
+
* placement.
|
|
22
|
+
*/
|
|
23
|
+
xCoordinateMode?: ECoordinateMode;
|
|
24
|
+
/** Whether the annotation is draggable by the user. Default false */
|
|
25
|
+
isDraggable?: boolean;
|
|
26
|
+
/** If set and isDraggable is true, a selection box of this color will be shown around the line when it is clicked. */
|
|
27
|
+
lineSelectionColor?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class VerticalSliceModifier extends RolloverModifier {
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
get x1(): number;
|
|
32
|
+
/** @inheritDoc */
|
|
33
|
+
set x1(value: number);
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
get xCoordinateMode(): ECoordinateMode;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
set xCoordinateMode(value: ECoordinateMode);
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
get verticalLine(): LineAnnotation;
|
|
40
|
+
/** @inheritDoc */
|
|
41
|
+
get isDraggable(): boolean;
|
|
42
|
+
/** @inheritDoc */
|
|
43
|
+
set isDraggable(value: boolean);
|
|
44
|
+
/** @inheritDoc */
|
|
45
|
+
get lineSelectionColor(): string;
|
|
46
|
+
/** @inheritDoc */
|
|
47
|
+
set lineSelectionColor(value: string);
|
|
48
|
+
private x1Property;
|
|
49
|
+
private xCoordinateModeProperty;
|
|
50
|
+
private isDraggableProperty;
|
|
51
|
+
private lineSelectionColorProperty;
|
|
52
|
+
private rmrsProps;
|
|
53
|
+
private rmrsProps1;
|
|
54
|
+
constructor(options?: IVerticalSliceOptions);
|
|
55
|
+
modifierMouseMove(args: ModifierMouseArgs): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
modifierMouseLeave(args: ModifierMouseArgs): void;
|
|
60
|
+
toJSON(): {
|
|
61
|
+
type: string;
|
|
62
|
+
options: Required<Omit<IChartModifierBaseOptions, never>>;
|
|
63
|
+
};
|
|
64
|
+
protected getRolloverProps(rs: IRenderableSeries): RolloverModifierRenderableSeriesProps;
|
|
65
|
+
protected getRolloverProps1(rs: IRenderableSeries): RolloverModifierRenderableSeriesProps;
|
|
66
|
+
protected removeSeriesAnnotationsFromParentSurface(rs: IRenderableSeries): void;
|
|
67
|
+
/**
|
|
68
|
+
* @param rs
|
|
69
|
+
*/
|
|
70
|
+
protected addSeriesAnnotationsToParentSurface(rs: IRenderableSeries): void;
|
|
71
|
+
protected createLine(options?: IRolloverModifierOptions): LineAnnotation;
|
|
72
|
+
protected update(): void;
|
|
73
|
+
/** @inheritDoc */
|
|
74
|
+
protected notifyPropertyChanged(propertyName: string): void;
|
|
75
|
+
private calculateXPosition;
|
|
76
|
+
}
|