scichart 2.1.2290 → 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 +3 -2
- package/Charting/Model/BaseHeatmapDataSeries.js +17 -5
- 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/DrawingProviders/UniformHeatmapDrawingProvider.js +1 -1
- 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/UniformHeatmapRenderableSeries.d.ts +13 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +23 -3
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/constants.js +3 -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 +19 -3
- package/Charting/Visuals/SciChartSurface.js +49 -4
- 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 +95 -95
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +1 -1
- 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
|
@@ -70,9 +70,9 @@ var AnnotationBase = /** @class */ (function () {
|
|
|
70
70
|
y2: 0
|
|
71
71
|
};
|
|
72
72
|
this.typeMap = new Map();
|
|
73
|
+
this.isHiddenProperty = false;
|
|
73
74
|
this.annotationLayerProperty = IAnnotation_1.EAnnotationLayer.AboveChart;
|
|
74
75
|
this.isEditableProperty = false;
|
|
75
|
-
this.isHiddenProperty = false;
|
|
76
76
|
this.xAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
|
|
77
77
|
this.yAxisIdProperty = AxisCore_1.AxisCore.DEFAULT_AXIS_ID;
|
|
78
78
|
this.xCoordinateModeProperty = ECoordinateMode.DataValue;
|
|
@@ -425,6 +425,27 @@ var AnnotationBase = /** @class */ (function () {
|
|
|
425
425
|
* @inheritDoc
|
|
426
426
|
*/
|
|
427
427
|
AnnotationBase.prototype.onDpiChanged = function (args) { };
|
|
428
|
+
/** Internal use. Captures the state of isHidden,x1,y1 and prevents invalidateParent being called on change to these properties */
|
|
429
|
+
AnnotationBase.prototype.suspendInvalidate = function () {
|
|
430
|
+
this.invalidateState = {
|
|
431
|
+
isHidden: this.isHidden,
|
|
432
|
+
x1: this.x1,
|
|
433
|
+
y1: this.y1
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/** Internal use. If isHidden,x1,y1 have change since suspendInvalidate was called, call invalidateParent */
|
|
437
|
+
AnnotationBase.prototype.resumeInvalidate = function () {
|
|
438
|
+
if (!this.invalidateState)
|
|
439
|
+
return;
|
|
440
|
+
if (this.isHidden !== this.invalidateState.isHidden ||
|
|
441
|
+
this.x1 !== this.invalidateState.x1 ||
|
|
442
|
+
this.y1 !== this.invalidateState.y1) {
|
|
443
|
+
if (this.invalidateParentCallback) {
|
|
444
|
+
this.invalidateParentCallback();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
this.invalidateState = undefined;
|
|
448
|
+
};
|
|
428
449
|
AnnotationBase.prototype.toJSON = function () {
|
|
429
450
|
var options = {
|
|
430
451
|
id: this.id,
|
|
@@ -497,7 +518,7 @@ var AnnotationBase = /** @class */ (function () {
|
|
|
497
518
|
* @param propertyName The name of the property which has changed
|
|
498
519
|
*/
|
|
499
520
|
AnnotationBase.prototype.notifyPropertyChanged = function (propertyName) {
|
|
500
|
-
if (this.invalidateParentCallback) {
|
|
521
|
+
if (this.invalidateParentCallback && !this.invalidateState) {
|
|
501
522
|
this.invalidateParentCallback();
|
|
502
523
|
}
|
|
503
524
|
};
|
|
@@ -13,6 +13,7 @@ export interface ICursorTooltipSvgAnnotationOptions extends ISvgAnnotationBaseOp
|
|
|
13
13
|
tooltipLegendOffsetX?: number;
|
|
14
14
|
tooltipLegendOffsetY?: number;
|
|
15
15
|
cursorModifier: CursorModifier;
|
|
16
|
+
placementDivId?: string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* A Tooltip Annotation which provides an SVG tooltip over the chart. Used by the {@link CursorModifier}
|
|
@@ -31,6 +32,8 @@ export declare class CursorTooltipSvgAnnotation extends SvgAnnotationBase {
|
|
|
31
32
|
private tooltipLegendOffsetYProperty;
|
|
32
33
|
private svgLegend;
|
|
33
34
|
private previousMousePosition;
|
|
35
|
+
private placementDivId?;
|
|
36
|
+
private svgDivRoot?;
|
|
34
37
|
/**
|
|
35
38
|
* Creates an instance of the {@link CursorTooltipSvgAnnotation}
|
|
36
39
|
* @param options
|
|
@@ -62,10 +65,13 @@ export declare class CursorTooltipSvgAnnotation extends SvgAnnotationBase {
|
|
|
62
65
|
* @inheritDoc
|
|
63
66
|
*/
|
|
64
67
|
update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
|
|
68
|
+
/** @inheritDoc */
|
|
69
|
+
delete(): void;
|
|
65
70
|
/**
|
|
66
71
|
* @inheritDoc
|
|
67
72
|
*/
|
|
68
73
|
protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
|
|
69
74
|
private updateTooltip;
|
|
70
75
|
private updateLegendTooltip;
|
|
76
|
+
private updateExternalLegendTooltip;
|
|
71
77
|
}
|
|
@@ -30,7 +30,7 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
30
30
|
* @param options
|
|
31
31
|
*/
|
|
32
32
|
function CursorTooltipSvgAnnotation(options) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
34
34
|
var _this = _super.call(this, options) || this;
|
|
35
35
|
/** @inheritDoc */
|
|
36
36
|
_this.type = IAnnotation_1.EAnnotationType.SVG;
|
|
@@ -45,6 +45,11 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
45
45
|
_this.tooltipLegendOffsetXProperty = (_g = options === null || options === void 0 ? void 0 : options.tooltipLegendOffsetX) !== null && _g !== void 0 ? _g : _this.tooltipLegendOffsetXProperty;
|
|
46
46
|
_this.tooltipLegendOffsetYProperty = (_h = options === null || options === void 0 ? void 0 : options.tooltipLegendOffsetY) !== null && _h !== void 0 ? _h : _this.tooltipLegendOffsetYProperty;
|
|
47
47
|
_this.cursorModifier = options.cursorModifier;
|
|
48
|
+
_this.placementDivId = (_j = options === null || options === void 0 ? void 0 : options.placementDivId) !== null && _j !== void 0 ? _j : _this.placementDivId;
|
|
49
|
+
if (_this.placementDivId) {
|
|
50
|
+
var svgRoot = document.getElementById(_this.placementDivId);
|
|
51
|
+
_this.svgDivRoot = svgRoot;
|
|
52
|
+
}
|
|
48
53
|
return _this;
|
|
49
54
|
}
|
|
50
55
|
Object.defineProperty(CursorTooltipSvgAnnotation.prototype, "seriesInfos", {
|
|
@@ -174,8 +179,25 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
174
179
|
this.delete();
|
|
175
180
|
}
|
|
176
181
|
this.create(xCalc, yCalc);
|
|
177
|
-
this.
|
|
178
|
-
|
|
182
|
+
if (this.placementDivId) {
|
|
183
|
+
this.updateExternalLegendTooltip();
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this.updateTooltip();
|
|
187
|
+
this.updateLegendTooltip();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
/** @inheritDoc */
|
|
191
|
+
CursorTooltipSvgAnnotation.prototype.delete = function () {
|
|
192
|
+
if (!this.parentSurface || this.parentSurface.isDeleted || !this.svg)
|
|
193
|
+
return;
|
|
194
|
+
if (this.placementDivId) {
|
|
195
|
+
this.svgDivRoot.removeChild(this.svg);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
this.svgRoot.removeChild(this.svg);
|
|
199
|
+
}
|
|
200
|
+
this.setSvg(undefined);
|
|
179
201
|
};
|
|
180
202
|
/**
|
|
181
203
|
* @inheritDoc
|
|
@@ -185,8 +207,14 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
185
207
|
throw Error("Please provide a tooltipSvgTemplate for CursorTooltipSvgAnnotation");
|
|
186
208
|
var svgString = this.tooltipSvgTemplate(this.seriesInfos, this);
|
|
187
209
|
var svgNode = document.createRange().createContextualFragment(svgString);
|
|
188
|
-
this.
|
|
189
|
-
|
|
210
|
+
if (this.placementDivId) {
|
|
211
|
+
this.svgDivRoot.appendChild(svgNode);
|
|
212
|
+
this.setSvg(this.svgDivRoot.lastChild);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.svgRoot.appendChild(svgNode);
|
|
216
|
+
this.setSvg(this.svgRoot.lastChild);
|
|
217
|
+
}
|
|
190
218
|
};
|
|
191
219
|
CursorTooltipSvgAnnotation.prototype.updateTooltip = function () {
|
|
192
220
|
var _a, _b, _c, _d;
|
|
@@ -218,6 +246,19 @@ var CursorTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
218
246
|
this.svgLegend.setAttribute("y", this.tooltipLegendOffsetY.toString());
|
|
219
247
|
}
|
|
220
248
|
};
|
|
249
|
+
CursorTooltipSvgAnnotation.prototype.updateExternalLegendTooltip = function () {
|
|
250
|
+
if (this.tooltipLegendTemplate) {
|
|
251
|
+
var svgString = this.seriesInfos
|
|
252
|
+
? this.tooltipLegendTemplate(this.seriesInfos, this)
|
|
253
|
+
: "<svg style='display: none'></svg>";
|
|
254
|
+
var svgNode = document.createRange().createContextualFragment(svgString);
|
|
255
|
+
if (this.svgLegend) {
|
|
256
|
+
this.svgLegend.removeChild(this.svgLegend);
|
|
257
|
+
}
|
|
258
|
+
this.svgDivRoot.appendChild(svgNode);
|
|
259
|
+
this.svgLegend = this.svgDivRoot.lastChild;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
221
262
|
return CursorTooltipSvgAnnotation;
|
|
222
263
|
}(SvgAnnotationBase_1.SvgAnnotationBase));
|
|
223
264
|
exports.CursorTooltipSvgAnnotation = CursorTooltipSvgAnnotation;
|
|
@@ -19,7 +19,7 @@ export declare class CustomAnnotation extends SvgAnnotationBase {
|
|
|
19
19
|
/**
|
|
20
20
|
* SVG dom element string provided by the user
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
svgStringProperty: string;
|
|
23
23
|
/**
|
|
24
24
|
* Creates an instance of the {@link CustomAnnotation}
|
|
25
25
|
* @param options The {@link ICustomAnnotationOptions} which contain optional parameters
|
|
@@ -32,4 +32,6 @@ export declare class CustomAnnotation extends SvgAnnotationBase {
|
|
|
32
32
|
};
|
|
33
33
|
/** @inheritDoc */
|
|
34
34
|
protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
|
|
35
|
+
get svgString(): string;
|
|
36
|
+
set svgString(value: string);
|
|
35
37
|
}
|
|
@@ -33,14 +33,14 @@ var CustomAnnotation = /** @class */ (function (_super) {
|
|
|
33
33
|
var _this = _super.call(this, options) || this;
|
|
34
34
|
/** @inheritDoc */
|
|
35
35
|
_this.type = IAnnotation_1.EAnnotationType.SVGCustomAnnotation;
|
|
36
|
-
_this.
|
|
36
|
+
_this.svgStringProperty = (_a = options === null || options === void 0 ? void 0 : options.svgString) !== null && _a !== void 0 ? _a : undefined;
|
|
37
37
|
return _this;
|
|
38
38
|
}
|
|
39
39
|
/** @inheritDoc */
|
|
40
40
|
CustomAnnotation.prototype.toJSON = function () {
|
|
41
41
|
var json = _super.prototype.toJSON.call(this);
|
|
42
42
|
var options = {
|
|
43
|
-
svgString: this.
|
|
43
|
+
svgString: this.svgStringProperty
|
|
44
44
|
};
|
|
45
45
|
Object.assign(json.options, options);
|
|
46
46
|
return json;
|
|
@@ -61,7 +61,7 @@ var CustomAnnotation = /** @class */ (function (_super) {
|
|
|
61
61
|
if (this.svg) {
|
|
62
62
|
this.delete();
|
|
63
63
|
}
|
|
64
|
-
this.setSvg(annotationHelpers_1.annotationHelpers.createSvg(this.
|
|
64
|
+
this.setSvg(annotationHelpers_1.annotationHelpers.createSvg(this.svgStringProperty, this.svgRoot));
|
|
65
65
|
this.calcAndSetAnnotationBorders(xCalc, yCalc);
|
|
66
66
|
this.updateAdornerInner();
|
|
67
67
|
this.prevIsSelected = this.isSelected;
|
|
@@ -74,6 +74,17 @@ var CustomAnnotation = /** @class */ (function (_super) {
|
|
|
74
74
|
this.prevIsSelected = this.isSelected;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
Object.defineProperty(CustomAnnotation.prototype, "svgString", {
|
|
78
|
+
get: function () {
|
|
79
|
+
return this.svgStringProperty;
|
|
80
|
+
},
|
|
81
|
+
set: function (value) {
|
|
82
|
+
this.delete();
|
|
83
|
+
this.svgStringProperty = value;
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
77
88
|
return CustomAnnotation;
|
|
78
89
|
}(SvgAnnotationBase_1.SvgAnnotationBase));
|
|
79
90
|
exports.CustomAnnotation = CustomAnnotation;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Rect } from "../../../Core/Rect";
|
|
2
|
+
import { EHorizontalAlignment, EVerticalAlignment } from "../../../types/LabelPlacement";
|
|
2
3
|
import { ModifierMouseArgs } from "../../ChartModifiers/ModifierMouseArgs";
|
|
3
4
|
import { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
|
|
4
5
|
import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
|
|
@@ -7,6 +8,8 @@ import { ILineAnnotationOptions, LineAnnotation } from "./LineAnnotation";
|
|
|
7
8
|
export interface IHVLineAnnotationOptions extends ILineAnnotationOptions {
|
|
8
9
|
dragOnLine?: boolean;
|
|
9
10
|
dragOnLabel?: boolean;
|
|
11
|
+
horizontalAlignment?: EHorizontalAlignment;
|
|
12
|
+
verticalAlignment?: EVerticalAlignment;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* @summary The {@link HorizontalLineAnnotation} provides an {@link AnnotationBase | Annotation} which draws a horizontal line at
|
|
@@ -25,6 +28,7 @@ export declare class HorizontalLineAnnotation extends LineAnnotation {
|
|
|
25
28
|
readonly type: EAnnotationType;
|
|
26
29
|
dragOnLine: boolean;
|
|
27
30
|
dragOnLabel: boolean;
|
|
31
|
+
horizontalAlignment: EHorizontalAlignment;
|
|
28
32
|
private labelRect;
|
|
29
33
|
/**
|
|
30
34
|
* Create an instance of a HorizontalLineAnnotation
|
|
@@ -58,7 +58,7 @@ var HorizontalLineAnnotation = /** @class */ (function (_super) {
|
|
|
58
58
|
* @param options Optional parameters of type {@link ILineAnnotationOptions} which configure the annotation upon construction
|
|
59
59
|
*/
|
|
60
60
|
function HorizontalLineAnnotation(options) {
|
|
61
|
-
var _a, _b;
|
|
61
|
+
var _a, _b, _c;
|
|
62
62
|
var _this = _super.call(this, options) || this;
|
|
63
63
|
/** @inheritDoc */
|
|
64
64
|
_this.type = IAnnotation_1.EAnnotationType.RenderContextHorizontalLineAnnotation;
|
|
@@ -72,6 +72,7 @@ var HorizontalLineAnnotation = /** @class */ (function (_super) {
|
|
|
72
72
|
}
|
|
73
73
|
_this.dragOnLine = (_a = options === null || options === void 0 ? void 0 : options.dragOnLine) !== null && _a !== void 0 ? _a : _this.dragOnLine;
|
|
74
74
|
_this.dragOnLabel = (_b = options === null || options === void 0 ? void 0 : options.dragOnLabel) !== null && _b !== void 0 ? _b : _this.dragOnLabel;
|
|
75
|
+
_this.horizontalAlignment = (_c = options === null || options === void 0 ? void 0 : options.horizontalAlignment) !== null && _c !== void 0 ? _c : _this.horizontalAlignment;
|
|
75
76
|
return _this;
|
|
76
77
|
}
|
|
77
78
|
Object.defineProperty(HorizontalLineAnnotation.prototype, "y2", {
|
|
@@ -136,7 +137,7 @@ var HorizontalLineAnnotation = /** @class */ (function (_super) {
|
|
|
136
137
|
var isLineAnnotationEdgeVisible = !isPartialLine || isLineAnnotationInHorizontalVisibleRange;
|
|
137
138
|
if (isAxisLabelInVerticalVisibleRange && isLineAnnotationEdgeVisible) {
|
|
138
139
|
var textStyle = __assign(__assign({}, verticalAxis.labelStyle), { color: this.axisLabelStroke, fontSize: this.axisFontSize * DpiHelper_1.DpiHelper.PIXEL_RATIO, fontFamily: this.axisFontFamily });
|
|
139
|
-
var labelRect = (0, drawLabel_1.drawLineAnnotation)(verticalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity);
|
|
140
|
+
var labelRect = (0, drawLabel_1.drawLineAnnotation)(verticalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity, this.horizontalAlignment);
|
|
140
141
|
if (labelRect) {
|
|
141
142
|
var point1 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.left, labelRect.top), viewRect, true);
|
|
142
143
|
var point2 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.right, labelRect.bottom), viewRect, true);
|
|
@@ -31,7 +31,7 @@ export declare class RolloverLegendSvgAnnotation extends SvgAnnotationBase {
|
|
|
31
31
|
/**
|
|
32
32
|
* Gets or sets seriesInfos {@link SeriesInfo} value on the tooltip
|
|
33
33
|
*/
|
|
34
|
-
set seriesInfos(
|
|
34
|
+
set seriesInfos(newSeriesInfos: SeriesInfo[]);
|
|
35
35
|
get tooltipLegendTemplate(): TRolloverLegendSvgTemplate;
|
|
36
36
|
set tooltipLegendTemplate(value: TRolloverLegendSvgTemplate);
|
|
37
37
|
get tooltipLegendOffsetX(): number;
|
|
@@ -50,9 +50,19 @@ var RolloverLegendSvgAnnotation = /** @class */ (function (_super) {
|
|
|
50
50
|
/**
|
|
51
51
|
* Gets or sets seriesInfos {@link SeriesInfo} value on the tooltip
|
|
52
52
|
*/
|
|
53
|
-
set: function (
|
|
54
|
-
this.seriesInfosProperty
|
|
55
|
-
|
|
53
|
+
set: function (newSeriesInfos) {
|
|
54
|
+
if (this.seriesInfosProperty && newSeriesInfos) {
|
|
55
|
+
// Compare infos against the ones for the matching series. See if any are different
|
|
56
|
+
if (newSeriesInfos.length !== this.seriesInfosProperty.length ||
|
|
57
|
+
this.seriesInfosProperty
|
|
58
|
+
.map(function (seriesInfo) {
|
|
59
|
+
return seriesInfo.equals(newSeriesInfos.find(function (newSeriesInfo) { return newSeriesInfo.renderableSeries.id === seriesInfo.renderableSeries.id; }));
|
|
60
|
+
})
|
|
61
|
+
.some(function (sameSeriesInfo) { return sameSeriesInfo === false; })) {
|
|
62
|
+
this.seriesInfosProperty = newSeriesInfos;
|
|
63
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.SERIES_INFOS);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
56
66
|
},
|
|
57
67
|
enumerable: false,
|
|
58
68
|
configurable: true
|
|
@@ -7,6 +7,7 @@ import { ISvgAnnotationBaseOptions, SvgAnnotationBase } from "./SvgAnnotationBas
|
|
|
7
7
|
export interface IRolloverTooltipSvgAnnotationOptions extends ISvgAnnotationBaseOptions {
|
|
8
8
|
height?: number;
|
|
9
9
|
seriesType?: ESeriesType;
|
|
10
|
+
placementDivId?: string;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* A Tooltip Annotation which provides an SVG tooltip over the chart. Used by the {@link RolloverModifier}
|
|
@@ -20,6 +21,8 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
|
|
|
20
21
|
private svgLegend;
|
|
21
22
|
private seriesInfoProperty;
|
|
22
23
|
private previousMousePosition;
|
|
24
|
+
private placementDivIdProperty;
|
|
25
|
+
private svgDivRoot;
|
|
23
26
|
/**
|
|
24
27
|
* Creates an instance of the {@link RolloverTooltipSvgAnnotation}
|
|
25
28
|
* @param renderableSeriesProps The {@link RolloverModifierRenderableSeriesProps | props} pass
|
|
@@ -44,5 +47,15 @@ export declare class RolloverTooltipSvgAnnotation extends SvgAnnotationBase {
|
|
|
44
47
|
updateSize(width: number, height: number): void;
|
|
45
48
|
/** @inheritDoc */
|
|
46
49
|
protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void;
|
|
50
|
+
private generateSvgString;
|
|
47
51
|
private updateLegendTooltip;
|
|
52
|
+
private updateExternalLegendTooltip;
|
|
53
|
+
/**
|
|
54
|
+
* Gets or sets the parent div element reference or id for the Tooltip
|
|
55
|
+
*/
|
|
56
|
+
get placementDivId(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Gets or sets the parent div element reference or id for the Tooltip
|
|
59
|
+
*/
|
|
60
|
+
set placementDivId(value: string);
|
|
48
61
|
}
|
|
@@ -34,7 +34,7 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
34
34
|
* @param options
|
|
35
35
|
*/
|
|
36
36
|
function RolloverTooltipSvgAnnotation(renderableSeriesProps, options) {
|
|
37
|
-
var _a;
|
|
37
|
+
var _a, _b;
|
|
38
38
|
var _this = _super.call(this, options) || this;
|
|
39
39
|
/** @inheritDoc */
|
|
40
40
|
_this.type = IAnnotation_1.EAnnotationType.SVG;
|
|
@@ -46,6 +46,7 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
46
46
|
_this.yCoordinateMode = AnnotationBase_1.ECoordinateMode.DataValue;
|
|
47
47
|
_this.isHidden = true;
|
|
48
48
|
_this.updateSize = _this.updateSize.bind(_this);
|
|
49
|
+
_this.placementDivIdProperty = (_b = options === null || options === void 0 ? void 0 : options.placementDivId) !== null && _b !== void 0 ? _b : _this.placementDivIdProperty;
|
|
49
50
|
return _this;
|
|
50
51
|
}
|
|
51
52
|
Object.defineProperty(RolloverTooltipSvgAnnotation.prototype, "seriesInfo", {
|
|
@@ -59,20 +60,28 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
59
60
|
* Gets or sets seriesInfo {@link SeriesInfo} value on the tooltip
|
|
60
61
|
*/
|
|
61
62
|
set: function (value) {
|
|
62
|
-
this.seriesInfoProperty
|
|
63
|
-
|
|
63
|
+
if ((value && !this.seriesInfoProperty) || !this.seriesInfoProperty.equals(value)) {
|
|
64
|
+
this.seriesInfoProperty = value;
|
|
65
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.SERIES_INFO);
|
|
66
|
+
}
|
|
64
67
|
},
|
|
65
68
|
enumerable: false,
|
|
66
69
|
configurable: true
|
|
67
70
|
});
|
|
68
71
|
/** @inheritDoc */
|
|
69
72
|
RolloverTooltipSvgAnnotation.prototype.delete = function () {
|
|
70
|
-
var _a;
|
|
73
|
+
var _a, _b, _c, _d;
|
|
71
74
|
if (!this.parentSurface || this.parentSurface.isDeleted)
|
|
72
75
|
return;
|
|
73
|
-
|
|
76
|
+
if (this.svg) {
|
|
77
|
+
if (this.placementDivId) {
|
|
78
|
+
(_b = (_a = this.svg) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.svg);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
(_c = this.svgRoot) === null || _c === void 0 ? void 0 : _c.removeChild(this.svg);
|
|
82
|
+
}
|
|
74
83
|
if (this.svgLegend) {
|
|
75
|
-
this.
|
|
84
|
+
(_d = this.svgLegend.parentNode) === null || _d === void 0 ? void 0 : _d.removeChild(this.svgLegend);
|
|
76
85
|
}
|
|
77
86
|
};
|
|
78
87
|
/** @inheritDoc */
|
|
@@ -85,8 +94,13 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
85
94
|
if (this.svg) {
|
|
86
95
|
this.delete();
|
|
87
96
|
}
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
if (this.placementDivId) {
|
|
98
|
+
this.updateExternalLegendTooltip();
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
_super.prototype.update.call(this, xCalc, yCalc);
|
|
102
|
+
this.updateLegendTooltip();
|
|
103
|
+
}
|
|
90
104
|
};
|
|
91
105
|
/**
|
|
92
106
|
* Updates size of the tooltip
|
|
@@ -97,22 +111,25 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
97
111
|
};
|
|
98
112
|
/** @inheritDoc */
|
|
99
113
|
RolloverTooltipSvgAnnotation.prototype.create = function (xCalc, yCalc) {
|
|
100
|
-
var _a;
|
|
101
114
|
var svgString;
|
|
102
115
|
if (!this.seriesInfo) {
|
|
103
116
|
svgString = "<svg></svg>";
|
|
104
117
|
}
|
|
105
118
|
else {
|
|
106
|
-
|
|
107
|
-
var idTitle = ("" + tooltipTitle).replace(/\s/g, "");
|
|
108
|
-
var id = "id".concat(Math.floor(this.y1), "_").concat(idTitle, "_").concat(Date.now());
|
|
109
|
-
var tooltipTemplate = (_a = this.tooltipProps.tooltipTemplate) !== null && _a !== void 0 ? _a : defaultTooltipTemplate;
|
|
110
|
-
svgString = tooltipTemplate(id, this.seriesInfo, this);
|
|
119
|
+
svgString = this.generateSvgString();
|
|
111
120
|
}
|
|
112
121
|
var svgNode = document.createRange().createContextualFragment(svgString);
|
|
113
122
|
this.svgRoot.appendChild(svgNode);
|
|
114
123
|
this.setSvg(this.svgRoot.lastChild);
|
|
115
124
|
};
|
|
125
|
+
RolloverTooltipSvgAnnotation.prototype.generateSvgString = function () {
|
|
126
|
+
var _a;
|
|
127
|
+
var tooltipTitle = this.tooltipProps.tooltipTitle;
|
|
128
|
+
var idTitle = ("" + tooltipTitle).replace(/\s/g, "");
|
|
129
|
+
var id = "id".concat(Math.floor(this.y1), "_").concat(idTitle, "_").concat(Date.now());
|
|
130
|
+
var tooltipTemplate = (_a = this.tooltipProps.tooltipTemplate) !== null && _a !== void 0 ? _a : defaultTooltipTemplate;
|
|
131
|
+
return tooltipTemplate(id, this.seriesInfo, this);
|
|
132
|
+
};
|
|
116
133
|
RolloverTooltipSvgAnnotation.prototype.updateLegendTooltip = function () {
|
|
117
134
|
if (this.tooltipProps.tooltipLegendTemplate) {
|
|
118
135
|
var svgString = this.seriesInfo
|
|
@@ -125,6 +142,38 @@ var RolloverTooltipSvgAnnotation = /** @class */ (function (_super) {
|
|
|
125
142
|
this.svgLegend.setAttribute("y", this.tooltipProps.tooltipLegendOffsetY.toString());
|
|
126
143
|
}
|
|
127
144
|
};
|
|
145
|
+
RolloverTooltipSvgAnnotation.prototype.updateExternalLegendTooltip = function () {
|
|
146
|
+
var svgString;
|
|
147
|
+
if (!this.seriesInfo) {
|
|
148
|
+
svgString = "<svg style='display: none;'></svg>";
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
svgString = this.generateSvgString();
|
|
152
|
+
}
|
|
153
|
+
var svgNode = document.createRange().createContextualFragment(svgString);
|
|
154
|
+
this.svgDivRoot = document.getElementById(this.placementDivId);
|
|
155
|
+
this.svgDivRoot.appendChild(svgNode);
|
|
156
|
+
this.setSvg(this.svgDivRoot.lastChild);
|
|
157
|
+
};
|
|
158
|
+
Object.defineProperty(RolloverTooltipSvgAnnotation.prototype, "placementDivId", {
|
|
159
|
+
/**
|
|
160
|
+
* Gets or sets the parent div element reference or id for the Tooltip
|
|
161
|
+
*/
|
|
162
|
+
get: function () {
|
|
163
|
+
return this.placementDivIdProperty;
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Gets or sets the parent div element reference or id for the Tooltip
|
|
167
|
+
*/
|
|
168
|
+
set: function (value) {
|
|
169
|
+
if (this.placementDivIdProperty !== value) {
|
|
170
|
+
this.placementDivIdProperty = value;
|
|
171
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.PLACEMENT_DIV_ID);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
enumerable: false,
|
|
175
|
+
configurable: true
|
|
176
|
+
});
|
|
128
177
|
return RolloverTooltipSvgAnnotation;
|
|
129
178
|
}(SvgAnnotationBase_1.SvgAnnotationBase));
|
|
130
179
|
exports.RolloverTooltipSvgAnnotation = RolloverTooltipSvgAnnotation;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Rect } from "../../../Core/Rect";
|
|
2
|
+
import { EVerticalAlignment } from "../../../types/LabelPlacement";
|
|
2
3
|
import { ModifierMouseArgs } from "../../ChartModifiers/ModifierMouseArgs";
|
|
3
4
|
import { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
|
|
4
5
|
import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
|
|
@@ -22,6 +23,7 @@ export declare class VerticalLineAnnotation extends LineAnnotation {
|
|
|
22
23
|
readonly type: EAnnotationType;
|
|
23
24
|
dragOnLine: boolean;
|
|
24
25
|
dragOnLabel: boolean;
|
|
26
|
+
verticalAlignment: EVerticalAlignment;
|
|
25
27
|
private labelRect;
|
|
26
28
|
/**
|
|
27
29
|
* Create an instance of a LineAnnotation
|
|
@@ -58,7 +58,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
58
58
|
* @param options Optional parameters of type {@link ILineAnnotationOptions} which configure the annotation upon construction
|
|
59
59
|
*/
|
|
60
60
|
function VerticalLineAnnotation(options) {
|
|
61
|
-
var _a, _b;
|
|
61
|
+
var _a, _b, _c;
|
|
62
62
|
var _this = _super.call(this, options) || this;
|
|
63
63
|
/** @inheritDoc */
|
|
64
64
|
_this.type = IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation;
|
|
@@ -72,6 +72,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
72
72
|
}
|
|
73
73
|
_this.dragOnLine = (_a = options === null || options === void 0 ? void 0 : options.dragOnLine) !== null && _a !== void 0 ? _a : _this.dragOnLine;
|
|
74
74
|
_this.dragOnLabel = (_b = options === null || options === void 0 ? void 0 : options.dragOnLabel) !== null && _b !== void 0 ? _b : _this.dragOnLabel;
|
|
75
|
+
_this.verticalAlignment = (_c = options === null || options === void 0 ? void 0 : options.verticalAlignment) !== null && _c !== void 0 ? _c : _this.verticalAlignment;
|
|
75
76
|
return _this;
|
|
76
77
|
}
|
|
77
78
|
Object.defineProperty(VerticalLineAnnotation.prototype, "y2", {
|
|
@@ -138,7 +139,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
138
139
|
var isLineAnnotationEdgeVisible = !isPartialLine || isLineAnnotationInVerticalVisibleRange;
|
|
139
140
|
if (isAxisLabelInHorizontalVisibleRange && isLineAnnotationEdgeVisible) {
|
|
140
141
|
var textStyle = __assign(__assign({}, verticalAxis.labelStyle), { color: this.axisLabelStroke, fontSize: this.axisFontSize * DpiHelper_1.DpiHelper.PIXEL_RATIO, fontFamily: this.axisFontFamily });
|
|
141
|
-
var labelRect = (0, drawLabel_1.drawLineAnnotation)(horizontalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity);
|
|
142
|
+
var labelRect = (0, drawLabel_1.drawLineAnnotation)(horizontalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity, null, this.verticalAlignment);
|
|
142
143
|
if (labelRect) {
|
|
143
144
|
var point1 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.left, labelRect.top), viewRect, true);
|
|
144
145
|
var point2 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.right, labelRect.bottom), viewRect, true);
|
|
@@ -51,7 +51,8 @@ export declare enum PROPERTY {
|
|
|
51
51
|
Y2 = "Y2",
|
|
52
52
|
YAXIS_ID = "YAXIS_ID",
|
|
53
53
|
Y_COORDINATE_MODE = "Y_COORDINATE_MODE",
|
|
54
|
-
Y_COORD_SHIFT = "Y_COORD_SHIFT"
|
|
54
|
+
Y_COORD_SHIFT = "Y_COORD_SHIFT",
|
|
55
|
+
PLACEMENT_DIV_ID = "PLACEMENT_DIV_ID"
|
|
55
56
|
}
|
|
56
57
|
export declare const ADORNER_GRIP_RADIUS = 10;
|
|
57
58
|
export declare const DISTANCE_TO_LINE = 10;
|
|
@@ -56,6 +56,7 @@ var PROPERTY;
|
|
|
56
56
|
PROPERTY["YAXIS_ID"] = "YAXIS_ID";
|
|
57
57
|
PROPERTY["Y_COORDINATE_MODE"] = "Y_COORDINATE_MODE";
|
|
58
58
|
PROPERTY["Y_COORD_SHIFT"] = "Y_COORD_SHIFT";
|
|
59
|
+
PROPERTY["PLACEMENT_DIV_ID"] = "PLACEMENT_DIV_ID";
|
|
59
60
|
})(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
|
|
60
61
|
exports.ADORNER_GRIP_RADIUS = 10;
|
|
61
62
|
exports.DISTANCE_TO_LINE = 10;
|
|
@@ -144,6 +144,7 @@ export interface IAxisBase2dOptions extends IAxisCoreOptions {
|
|
|
144
144
|
* Useful to align seriesViewRects for different charts
|
|
145
145
|
*/
|
|
146
146
|
axisThickness?: number;
|
|
147
|
+
backgroundColor?: string;
|
|
147
148
|
}
|
|
148
149
|
/**
|
|
149
150
|
* The base class for 2D Chart Axis within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}.
|
|
@@ -238,6 +239,14 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
|
|
|
238
239
|
* This is only used to allow multiple primary axes, so that all stacked axes can draw gridlines
|
|
239
240
|
*/
|
|
240
241
|
set isStackedAxis(value: boolean);
|
|
242
|
+
/**
|
|
243
|
+
* Gets the background color of separate Axis
|
|
244
|
+
*/
|
|
245
|
+
get backgroundColor(): string;
|
|
246
|
+
/**
|
|
247
|
+
* Sets the background color of separate Axis
|
|
248
|
+
*/
|
|
249
|
+
set backgroundColor(value: string);
|
|
241
250
|
/** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
|
|
242
251
|
* A plain number will be interpreted as a number of pixels.
|
|
243
252
|
* A number with % will take that percentage of the total length.
|
|
@@ -341,6 +350,7 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
|
|
|
341
350
|
private axisLengthProperty;
|
|
342
351
|
private offsetProperty;
|
|
343
352
|
private tickCache;
|
|
353
|
+
private backgroundColorProperty;
|
|
344
354
|
/**
|
|
345
355
|
* Creates an instance of the {@link AxisBase2D}
|
|
346
356
|
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
|