scichart 3.2.509 → 3.2.525
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/Charting/ChartModifiers/CursorModifier.d.ts +11 -0
- package/Charting/ChartModifiers/CursorModifier.js +67 -23
- package/Charting/ChartModifiers/RolloverModifier.js +18 -10
- package/Charting/ChartModifiers/constants.d.ts +2 -1
- package/Charting/ChartModifiers/constants.js +1 -0
- package/Charting/Model/ChartData/SeriesInfo.d.ts +1 -0
- package/Charting/Model/ChartData/SeriesInfo.js +1 -0
- package/Charting/Visuals/Annotations/AxisMarkerAnnotation.js +1 -2
- package/Charting/Visuals/Annotations/BoxAnnotation.js +1 -2
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +35 -6
- package/Charting/Visuals/Annotations/CustomAnnotation.js +54 -14
- package/Charting/Visuals/Annotations/LineAnnotation.js +1 -2
- package/Charting/Visuals/Annotations/NativeTextAnnotation.js +49 -3
- package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.js +1 -2
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +1 -0
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +9 -5
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +8 -2
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +2 -3
- package/Charting/Visuals/Annotations/TextAnnotation.d.ts +42 -0
- package/Charting/Visuals/Annotations/TextAnnotation.js +91 -12
- package/Charting/Visuals/Annotations/constants.d.ts +1 -0
- package/Charting/Visuals/Annotations/constants.js +1 -0
- package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +2 -2
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -1
- package/Charting/Visuals/Legend/SciChartLegendBase.js +8 -3
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.js +4 -4
- package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +5 -5
- package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +4 -4
- package/Charting/Visuals/RenderableSeries/HitTest/HitTestInfo.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/HitTest/HitTestInfo.js +13 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ImpulseSeriesHitTestProvider.js +3 -3
- package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +4 -4
- package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +3 -3
- package/Charting/Visuals/RenderableSeries/HitTest/TextSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +9 -3
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +39 -56
- package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.js +12 -0
- package/Charting/Visuals/RenderableSeries/RolloverModifier/constants.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/RolloverModifier/constants.js +1 -0
- package/Charting/Visuals/SciChartSurface.d.ts +14 -0
- package/Charting/Visuals/SciChartSurface.js +18 -0
- package/Charting/Visuals/createMaster.d.ts +1 -3
- package/Charting/Visuals/createMaster.js +4 -5
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Mouse/MouseManager.js +2 -2
- package/README.md +5 -1
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.wasm +0 -0
- package/index.d.ts +1 -0
- package/index.dev.js +425 -178
- package/index.js +13 -11
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/types/TSciChart.d.ts +9 -0
|
@@ -45,13 +45,17 @@ var RolloverMarkerSvgAnnotation = /** @class */ (function (_super) {
|
|
|
45
45
|
};
|
|
46
46
|
/** @inheritDoc */
|
|
47
47
|
RolloverMarkerSvgAnnotation.prototype.create = function (xCalc, yCalc, xCoordSvgTrans, yCoordSvgTrans) {
|
|
48
|
-
|
|
48
|
+
var _a = this.tooltipProps, tooltipColor = _a.tooltipColor, markerColor = _a.markerColor;
|
|
49
|
+
var color = markerColor !== null && markerColor !== void 0 ? markerColor : tooltipColor;
|
|
50
|
+
if (this.svg && this.currentColor !== color) {
|
|
49
51
|
this.clear();
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
if (!this.svg) {
|
|
54
|
+
this.currentColor === color;
|
|
55
|
+
var svgString = tooltipSvgTemplate(color);
|
|
56
|
+
var svgNode = annotationHelpers_1.annotationHelpers.createSvg(svgString, this.svgRoot);
|
|
57
|
+
this.setSvg(svgNode);
|
|
58
|
+
}
|
|
55
59
|
};
|
|
56
60
|
return RolloverMarkerSvgAnnotation;
|
|
57
61
|
}(SvgAnnotationBase_1.SvgAnnotationBase));
|
|
@@ -23,6 +23,7 @@ var annotationHelpers_1 = require("./annotationHelpers");
|
|
|
23
23
|
var constants_1 = require("./constants");
|
|
24
24
|
var IAnnotation_1 = require("./IAnnotation");
|
|
25
25
|
var SvgAnnotationBase_1 = require("./SvgAnnotationBase");
|
|
26
|
+
var parseColor_1 = require("../../../utils/parseColor");
|
|
26
27
|
// TODO: Rename to RolloverTooltipSvgAnnotation
|
|
27
28
|
/**
|
|
28
29
|
* A Tooltip Annotation which provides an SVG tooltip over the chart. Used by the {@link RolloverModifier}
|
|
@@ -238,7 +239,7 @@ var defaultTooltipTemplate = function (id, seriesInfo, rolloverTooltip) {
|
|
|
238
239
|
var _a, _b, _c, _d, _e;
|
|
239
240
|
var valuesBlock = "";
|
|
240
241
|
var tooltipProps = rolloverTooltip.tooltipProps;
|
|
241
|
-
var tooltipTitle = tooltipProps.tooltipTitle, tooltipColor = tooltipProps.tooltipColor, tooltipTextColor = tooltipProps.tooltipTextColor, tooltipLabelX = tooltipProps.tooltipLabelX, tooltipLabelY = tooltipProps.tooltipLabelY;
|
|
242
|
+
var tooltipTitle = tooltipProps.tooltipTitle, tooltipColor = tooltipProps.tooltipColor, tooltipTextColor = tooltipProps.tooltipTextColor, tooltipLabelX = tooltipProps.tooltipLabelX, tooltipLabelY = tooltipProps.tooltipLabelY, shadowColor = tooltipProps.shadowColor;
|
|
242
243
|
var tooltipDataTemplate = (_c = (_a = rolloverTooltip.tooltipProps.tooltipDataTemplate) !== null && _a !== void 0 ? _a : (_b = rolloverTooltip.tooltipProps.rolloverModifier) === null || _b === void 0 ? void 0 : _b.tooltipDataTemplate) !== null && _c !== void 0 ? _c : defaultTooltipDataTemplate;
|
|
243
244
|
var valuesWithLabels = tooltipDataTemplate(seriesInfo, tooltipTitle, tooltipLabelX, tooltipLabelY);
|
|
244
245
|
// tooltip width
|
|
@@ -249,7 +250,12 @@ var defaultTooltipTemplate = function (id, seriesInfo, rolloverTooltip) {
|
|
|
249
250
|
valuesWithLabels.forEach(function (val, index) {
|
|
250
251
|
valuesBlock += "<tspan x=\"8\" dy=\"1.2em\">".concat(val, "</tspan>");
|
|
251
252
|
});
|
|
252
|
-
|
|
253
|
+
var blur = "<feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"3\" />";
|
|
254
|
+
if (shadowColor !== undefined) {
|
|
255
|
+
var shadowRGBA = (0, parseColor_1.parseColorToTArgb)(shadowColor);
|
|
256
|
+
blur = "<feColorMatrix result=\"matrixOut\" in=\"offOut\" type=\"matrix\"\n values=\"0 0 0 0 ".concat(shadowRGBA.red / 255, "\n 0 0 0 0 ").concat(shadowRGBA.green / 255, "\n 0 0 0 0 ").concat(shadowRGBA.blue / 255, "\n 0 0 0 ").concat(shadowRGBA.opacity / 255, " 0\" />\n <feGaussianBlur result=\"blurOut\" in=\"matrixOut\" stdDeviation=\"3\" />");
|
|
257
|
+
}
|
|
258
|
+
return "<svg class=\"scichart__rollover-tooltip\" width=\"".concat(width, "\" height=\"").concat(height, "\">\n <defs>\n <filter id=\"").concat(id, "\" x=\"0\" y=\"0\" width=\"200%\" height=\"200%\">\n <feOffset result=\"offOut\" in=\"SourceAlpha\" dx=\"3\" dy=\"3\" />\n ").concat(blur, "\n <feBlend in=\"SourceGraphic\" in2=\"blurOut\" mode=\"normal\" />\n </filter>\n </defs>\n <rect rx=\"4\" ry=\"4\" width=\"90%\" height=\"90%\" fill=\"").concat(tooltipColor, "\" filter=\"url(#").concat(id, ")\" />\n <svg width=\"100%\">\n <text x=\"8\" y=\"3\" font-size=\"13\" font-family=\"Verdana\" dy=\"0\" fill=\"").concat(tooltipTextColor, "\">").concat(valuesBlock, "</text>\n </svg>\n </svg>");
|
|
253
259
|
};
|
|
254
260
|
/** @ignore */
|
|
255
261
|
var calcTooltipWidth = function (textLength, fontSize) {
|
|
@@ -289,12 +289,11 @@ var SvgAnnotationBase = /** @class */ (function (_super) {
|
|
|
289
289
|
return (0, pointUtil_1.testIsInBounds)(notScaledX, notScaledY, x1, y2, x2, y1);
|
|
290
290
|
};
|
|
291
291
|
SvgAnnotationBase.prototype.updateAdornerInner = function () {
|
|
292
|
-
var _a = this.getAdornerAnnotationBorders(true, true), x1 = _a.x1, x2 = _a.x2, y1 = _a.y1, y2 = _a.y2;
|
|
293
|
-
var adornerSvgRoot = this.parentSurface.domSvgAdornerLayer;
|
|
294
292
|
this.deleteAdorner();
|
|
295
293
|
if (this.isSelected) {
|
|
294
|
+
var _a = this.getAdornerAnnotationBorders(true, true), x1 = _a.x1, x2 = _a.x2, y1 = _a.y1, y2 = _a.y2;
|
|
296
295
|
var svgString = this.svgStringAdornerTemplate(x1, y1, x2, y2);
|
|
297
|
-
this.svgAdorner = annotationHelpers_1.annotationHelpers.createSvg(svgString,
|
|
296
|
+
this.svgAdorner = annotationHelpers_1.annotationHelpers.createSvg(svgString, this.svgAdornerRoot);
|
|
298
297
|
}
|
|
299
298
|
};
|
|
300
299
|
Object.defineProperty(SvgAnnotationBase.prototype, "svgRoot", {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Thickness } from "../../../Core/Thickness";
|
|
1
2
|
import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
|
|
2
3
|
import { EAnnotationType } from "./IAnnotation";
|
|
3
4
|
import { ISvgAnnotationBaseOptions, SvgAnnotationBase } from "./SvgAnnotationBase";
|
|
@@ -25,6 +26,18 @@ export interface ITextAnnotationOptions extends ISvgAnnotationBaseOptions {
|
|
|
25
26
|
* Font weight provided by the user
|
|
26
27
|
*/
|
|
27
28
|
fontWeight?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Text background color provided by the user
|
|
31
|
+
*/
|
|
32
|
+
background?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Text padding provided by the user
|
|
35
|
+
*/
|
|
36
|
+
padding?: Thickness;
|
|
37
|
+
/**
|
|
38
|
+
* Text SVG class provided by the user
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
28
41
|
}
|
|
29
42
|
/**
|
|
30
43
|
* A TextAnnotation presents text information over the chart at specific {@link X1}, {@link Y1} coordinates
|
|
@@ -37,6 +50,9 @@ export declare class TextAnnotation extends SvgAnnotationBase {
|
|
|
37
50
|
protected fontSizeProperty?: number;
|
|
38
51
|
protected fontFamilyProperty?: string;
|
|
39
52
|
protected fontWeightProperty?: string;
|
|
53
|
+
protected backgroundProperty?: string;
|
|
54
|
+
protected paddingProperty?: Thickness;
|
|
55
|
+
protected classNameProperty: string;
|
|
40
56
|
protected isDirty: boolean;
|
|
41
57
|
/**
|
|
42
58
|
* Creates an instance of the {@link CustomAnnotation}
|
|
@@ -48,6 +64,30 @@ export declare class TextAnnotation extends SvgAnnotationBase {
|
|
|
48
64
|
*/
|
|
49
65
|
get text(): string;
|
|
50
66
|
set text(text: string);
|
|
67
|
+
/**
|
|
68
|
+
* Gets or sets the background of {@link TextAnnotation}
|
|
69
|
+
*/
|
|
70
|
+
get background(): string;
|
|
71
|
+
/**
|
|
72
|
+
* Gets or sets the background of {@link TextAnnotation}
|
|
73
|
+
*/
|
|
74
|
+
set background(value: string);
|
|
75
|
+
/**
|
|
76
|
+
* Gets or sets the padding of {@link TextAnnotation}
|
|
77
|
+
*/
|
|
78
|
+
get padding(): Thickness;
|
|
79
|
+
/**
|
|
80
|
+
* Gets or sets the padding of {@link TextAnnotation}
|
|
81
|
+
*/
|
|
82
|
+
set padding(value: Thickness);
|
|
83
|
+
/**
|
|
84
|
+
* Gets or sets the class on underlying SVG element of {@link TextAnnotation}
|
|
85
|
+
*/
|
|
86
|
+
get className(): string;
|
|
87
|
+
/**
|
|
88
|
+
* Gets or sets the class on underlying SVG element of {@link TextAnnotation}
|
|
89
|
+
*/
|
|
90
|
+
set className(value: string);
|
|
51
91
|
/**
|
|
52
92
|
* text color provided by the user
|
|
53
93
|
*/
|
|
@@ -80,4 +120,6 @@ export declare class TextAnnotation extends SvgAnnotationBase {
|
|
|
80
120
|
* @inheritDoc
|
|
81
121
|
*/
|
|
82
122
|
protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, xCoordSvgTrans: number, yCoordSvgTrans: number): void;
|
|
123
|
+
protected createSvg(): SVGElement;
|
|
124
|
+
protected attachSvgBackgroundRect(svgRoot: SVGSVGElement, background: string, padding: Thickness): void;
|
|
83
125
|
}
|
|
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TextAnnotation = void 0;
|
|
19
|
+
var Thickness_1 = require("../../../Core/Thickness");
|
|
19
20
|
var annotationHelpers_1 = require("./annotationHelpers");
|
|
20
21
|
var constants_1 = require("./constants");
|
|
21
22
|
var IAnnotation_1 = require("./IAnnotation");
|
|
@@ -31,7 +32,7 @@ var TextAnnotation = /** @class */ (function (_super) {
|
|
|
31
32
|
*/
|
|
32
33
|
function TextAnnotation(options) {
|
|
33
34
|
var _this = this;
|
|
34
|
-
var _a, _b, _c, _d, _e;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
36
|
_this = _super.call(this, options) || this;
|
|
36
37
|
/** @inheritDoc */
|
|
37
38
|
_this.type = IAnnotation_1.EAnnotationType.SVGTextAnnotation;
|
|
@@ -40,12 +41,17 @@ var TextAnnotation = /** @class */ (function (_super) {
|
|
|
40
41
|
_this.fontSizeProperty = 14;
|
|
41
42
|
_this.fontFamilyProperty = "Arial";
|
|
42
43
|
_this.fontWeightProperty = "Normal";
|
|
44
|
+
_this.paddingProperty = Thickness_1.Thickness.fromNumber(0);
|
|
45
|
+
_this.classNameProperty = "scichart__text-annotation";
|
|
43
46
|
_this.isDirty = true;
|
|
44
47
|
_this.textProperty = (_a = options === null || options === void 0 ? void 0 : options.text) !== null && _a !== void 0 ? _a : _this.textProperty;
|
|
45
48
|
_this.textColorProperty = (_b = options === null || options === void 0 ? void 0 : options.textColor) !== null && _b !== void 0 ? _b : _this.textColorProperty;
|
|
46
49
|
_this.fontSizeProperty = (_c = options === null || options === void 0 ? void 0 : options.fontSize) !== null && _c !== void 0 ? _c : _this.fontSizeProperty;
|
|
47
50
|
_this.fontFamilyProperty = (_d = options === null || options === void 0 ? void 0 : options.fontFamily) !== null && _d !== void 0 ? _d : _this.fontFamilyProperty;
|
|
48
|
-
_this.
|
|
51
|
+
_this.backgroundProperty = (_e = options === null || options === void 0 ? void 0 : options.background) !== null && _e !== void 0 ? _e : _this.backgroundProperty;
|
|
52
|
+
_this.paddingProperty = (_f = options === null || options === void 0 ? void 0 : options.padding) !== null && _f !== void 0 ? _f : _this.paddingProperty;
|
|
53
|
+
_this.classNameProperty = (_g = options === null || options === void 0 ? void 0 : options.className) !== null && _g !== void 0 ? _g : _this.classNameProperty;
|
|
54
|
+
_this.fontWeight = (_h = options === null || options === void 0 ? void 0 : options.fontWeight) !== null && _h !== void 0 ? _h : _this.fontWeight;
|
|
49
55
|
return _this;
|
|
50
56
|
}
|
|
51
57
|
Object.defineProperty(TextAnnotation.prototype, "text", {
|
|
@@ -64,6 +70,63 @@ var TextAnnotation = /** @class */ (function (_super) {
|
|
|
64
70
|
enumerable: false,
|
|
65
71
|
configurable: true
|
|
66
72
|
});
|
|
73
|
+
Object.defineProperty(TextAnnotation.prototype, "background", {
|
|
74
|
+
/**
|
|
75
|
+
* Gets or sets the background of {@link TextAnnotation}
|
|
76
|
+
*/
|
|
77
|
+
get: function () {
|
|
78
|
+
return this.backgroundProperty;
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Gets or sets the background of {@link TextAnnotation}
|
|
82
|
+
*/
|
|
83
|
+
set: function (value) {
|
|
84
|
+
if (this.backgroundProperty !== value) {
|
|
85
|
+
this.backgroundProperty = value;
|
|
86
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.BACKGROUND_COLOR);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
enumerable: false,
|
|
90
|
+
configurable: true
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(TextAnnotation.prototype, "padding", {
|
|
93
|
+
/**
|
|
94
|
+
* Gets or sets the padding of {@link TextAnnotation}
|
|
95
|
+
*/
|
|
96
|
+
get: function () {
|
|
97
|
+
return this.paddingProperty;
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Gets or sets the padding of {@link TextAnnotation}
|
|
101
|
+
*/
|
|
102
|
+
set: function (value) {
|
|
103
|
+
if (this.paddingProperty !== value) {
|
|
104
|
+
this.paddingProperty = value;
|
|
105
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.PADDING);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
enumerable: false,
|
|
109
|
+
configurable: true
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(TextAnnotation.prototype, "className", {
|
|
112
|
+
/**
|
|
113
|
+
* Gets or sets the class on underlying SVG element of {@link TextAnnotation}
|
|
114
|
+
*/
|
|
115
|
+
get: function () {
|
|
116
|
+
return this.classNameProperty;
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* Gets or sets the class on underlying SVG element of {@link TextAnnotation}
|
|
120
|
+
*/
|
|
121
|
+
set: function (value) {
|
|
122
|
+
if (this.classNameProperty !== value) {
|
|
123
|
+
this.classNameProperty = value;
|
|
124
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.CLASS_NAME);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
67
130
|
Object.defineProperty(TextAnnotation.prototype, "textColor", {
|
|
68
131
|
/**
|
|
69
132
|
* text color provided by the user
|
|
@@ -149,7 +212,6 @@ var TextAnnotation = /** @class */ (function (_super) {
|
|
|
149
212
|
p !== constants_1.PROPERTY.Y_COORD_SHIFT &&
|
|
150
213
|
p !== constants_1.PROPERTY.HORIZONTAL_ANCHOR_POINT &&
|
|
151
214
|
p !== constants_1.PROPERTY.VERTICAL_ANCHOR_POINT &&
|
|
152
|
-
p !== constants_1.PROPERTY.IS_HIDDEN &&
|
|
153
215
|
p !== constants_1.PROPERTY.X1 &&
|
|
154
216
|
p !== constants_1.PROPERTY.X2 &&
|
|
155
217
|
p !== constants_1.PROPERTY.Y1 &&
|
|
@@ -169,20 +231,37 @@ var TextAnnotation = /** @class */ (function (_super) {
|
|
|
169
231
|
return;
|
|
170
232
|
}
|
|
171
233
|
if (this.svg) {
|
|
172
|
-
this.
|
|
234
|
+
this.clear();
|
|
173
235
|
}
|
|
174
|
-
this.setSvg(createSvg(
|
|
236
|
+
this.setSvg(this.createSvg());
|
|
175
237
|
this.calcAndSetAnnotationBorders(xCalc, yCalc);
|
|
176
238
|
this.updateAdornerInner();
|
|
177
239
|
this.isDirty = false;
|
|
178
240
|
};
|
|
241
|
+
TextAnnotation.prototype.createSvg = function () {
|
|
242
|
+
var x = this.padding.left;
|
|
243
|
+
var y = this.fontSize + this.padding.top;
|
|
244
|
+
//dominant-baseline="text-after-edge"
|
|
245
|
+
var svgString = "<svg id=\"scichart__text-annotation-".concat(this.id, "\" class=\"").concat(this.className, "\">\n <text x=\"").concat(x, "\" y=\"").concat(y, "\" fill=\"").concat(this.textColor, "\" font-size=\"").concat(this.fontSize, "\" font-family=\"").concat(this.fontFamily, "\" font-weight=\"").concat(this.fontWeight, "\">").concat(this.text, "</text>\n </svg>");
|
|
246
|
+
var svgNode = annotationHelpers_1.annotationHelpers.createSvg(svgString, this.svgRoot);
|
|
247
|
+
if (this.background) {
|
|
248
|
+
this.attachSvgBackgroundRect(svgNode, this.background, this.padding);
|
|
249
|
+
}
|
|
250
|
+
return svgNode;
|
|
251
|
+
};
|
|
252
|
+
TextAnnotation.prototype.attachSvgBackgroundRect = function (svgRoot, background, padding) {
|
|
253
|
+
var textAnnotationRect = svgRoot.getBoundingClientRect();
|
|
254
|
+
var rectWidth = textAnnotationRect.width + padding.left + padding.right;
|
|
255
|
+
var rectHeight = textAnnotationRect.height + padding.top + padding.bottom;
|
|
256
|
+
var namespace = "http://www.w3.org/2000/svg";
|
|
257
|
+
var newRect = document.createElementNS(namespace, "rect");
|
|
258
|
+
newRect.setAttribute("x", "0");
|
|
259
|
+
newRect.setAttribute("y", "0");
|
|
260
|
+
newRect.setAttribute("width", "".concat(rectWidth));
|
|
261
|
+
newRect.setAttribute("height", "".concat(rectHeight));
|
|
262
|
+
newRect.setAttribute("fill", "".concat(background));
|
|
263
|
+
svgRoot.insertBefore(newRect, svgRoot.firstChild);
|
|
264
|
+
};
|
|
179
265
|
return TextAnnotation;
|
|
180
266
|
}(SvgAnnotationBase_1.SvgAnnotationBase));
|
|
181
267
|
exports.TextAnnotation = TextAnnotation;
|
|
182
|
-
/** @ignore */
|
|
183
|
-
/** @ignore */
|
|
184
|
-
var createSvg = function (svgRoot, text, color, fontSize, fontFamily, fontWeight) {
|
|
185
|
-
var svgString = "<svg class=\"scichart__text-annotation\">\n <text x=\"0\" y=\"".concat(fontSize, "\" fill=\"").concat(color, "\" font-size=\"").concat(fontSize, "\" font-family=\"").concat(fontFamily, "\" font-weight=\"").concat(fontWeight, "\">").concat(text, "</text>\n </svg>");
|
|
186
|
-
var svgNode = annotationHelpers_1.annotationHelpers.createSvg(svgString, svgRoot);
|
|
187
|
-
return svgNode;
|
|
188
|
-
};
|
|
@@ -7,6 +7,7 @@ export declare enum PROPERTY {
|
|
|
7
7
|
AXIS_FONT_FAMILY = "AXIS_FONT_FAMILY",
|
|
8
8
|
AXIS_FONT_SIZE = "AXIS_FONT_SIZE",
|
|
9
9
|
BACKGROUND_COLOR = "BACKGROUND_COLOR",
|
|
10
|
+
CLASS_NAME = "CLASS_NAME",
|
|
10
11
|
COLOR = "COLOR",
|
|
11
12
|
CONTAINER_BACKGROUND = "CONTAINER_BACKGROUND",
|
|
12
13
|
FILL = "FILL",
|
|
@@ -11,6 +11,7 @@ var PROPERTY;
|
|
|
11
11
|
PROPERTY["AXIS_FONT_FAMILY"] = "AXIS_FONT_FAMILY";
|
|
12
12
|
PROPERTY["AXIS_FONT_SIZE"] = "AXIS_FONT_SIZE";
|
|
13
13
|
PROPERTY["BACKGROUND_COLOR"] = "BACKGROUND_COLOR";
|
|
14
|
+
PROPERTY["CLASS_NAME"] = "CLASS_NAME";
|
|
14
15
|
PROPERTY["COLOR"] = "COLOR";
|
|
15
16
|
PROPERTY["CONTAINER_BACKGROUND"] = "CONTAINER_BACKGROUND";
|
|
16
17
|
PROPERTY["FILL"] = "FILL";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NumberRange } from "../../../Core/NumberRange";
|
|
2
2
|
import { EAutoRange } from "../../../types/AutoRange";
|
|
3
|
-
import {
|
|
3
|
+
import { TAxisTitleStyle, TGridLineStyle, TTickLineStyle } from "./AxisCore";
|
|
4
4
|
/**
|
|
5
5
|
* Optional parameters passed to {@link AxisCore} constructor to set defaults at construction time
|
|
6
6
|
*/
|
|
@@ -70,7 +70,7 @@ export interface IAxisCoreOptions {
|
|
|
70
70
|
* @summary Sets the Axis Title style
|
|
71
71
|
* @remarks See {@link TTextStyle} for the type which contains style options
|
|
72
72
|
*/
|
|
73
|
-
axisTitleStyle?:
|
|
73
|
+
axisTitleStyle?: TAxisTitleStyle;
|
|
74
74
|
/**
|
|
75
75
|
* The maximum number of ticks on the axis when SciChart's Axis is in {@link AxisCore.autoTicks} mode
|
|
76
76
|
* @remarks
|
|
@@ -235,4 +235,4 @@ export declare abstract class SciChartLegendBase extends DeletableEntity impleme
|
|
|
235
235
|
protected getParentDiv(): HTMLDivElement;
|
|
236
236
|
}
|
|
237
237
|
export declare const getLegendItemHtml: (orientation: ELegendOrientation, showCheckboxes: boolean, showSeriesMarkers: boolean, item: TLegendItem) => string;
|
|
238
|
-
export declare const getLegendContainerHtml: (placement: ELegendPlacement, textColor: string, backgroundColor: string, margin: Thickness, body: string) => string;
|
|
238
|
+
export declare const getLegendContainerHtml: (placement: ELegendPlacement, textColor: string, backgroundColor: string, margin: Thickness, body: string, isExternal?: boolean) => string;
|
|
@@ -297,7 +297,7 @@ var SciChartLegendBase = /** @class */ (function (_super) {
|
|
|
297
297
|
var _a;
|
|
298
298
|
return (prev + _this.getLegendItemHTML(orientation, showCheckboxes, (_a = curr.showMarker) !== null && _a !== void 0 ? _a : showSeriesMarkers, curr));
|
|
299
299
|
}, "");
|
|
300
|
-
return (0, exports.getLegendContainerHtml)(placement, textColor, backgroundColor, margin, body);
|
|
300
|
+
return (0, exports.getLegendContainerHtml)(placement, textColor, backgroundColor, margin, body, this.isExternal());
|
|
301
301
|
};
|
|
302
302
|
/**
|
|
303
303
|
* Gets HTML string for legend items
|
|
@@ -368,11 +368,16 @@ var getLegendItemHtml = function (orientation, showCheckboxes, showSeriesMarkers
|
|
|
368
368
|
return str;
|
|
369
369
|
};
|
|
370
370
|
exports.getLegendItemHtml = getLegendItemHtml;
|
|
371
|
-
var getLegendContainerHtml = function (placement, textColor, backgroundColor, margin, body) {
|
|
371
|
+
var getLegendContainerHtml = function (placement, textColor, backgroundColor, margin, body, isExternal) {
|
|
372
|
+
if (isExternal === void 0) { isExternal = false; }
|
|
372
373
|
if (!body)
|
|
373
374
|
return "";
|
|
374
375
|
//const float = [ELegendPlacement.TopLeft, ELegendPlacement.BottomLeft].includes(placement) ? "left" : "right";
|
|
376
|
+
var position = "";
|
|
375
377
|
var positionStyle = "";
|
|
378
|
+
if (!isExternal) {
|
|
379
|
+
position = "position: absolute;";
|
|
380
|
+
}
|
|
376
381
|
if (placement === ELegendPlacement.TopLeft) {
|
|
377
382
|
positionStyle = "left: 0; top: 0;";
|
|
378
383
|
}
|
|
@@ -385,7 +390,7 @@ var getLegendContainerHtml = function (placement, textColor, backgroundColor, ma
|
|
|
385
390
|
else if (placement === ELegendPlacement.BottomRight) {
|
|
386
391
|
positionStyle = "right: 0; bottom: 0;";
|
|
387
392
|
}
|
|
388
|
-
var htmlStr = "<div class=\"scichart__legend\" style=\"height: 100%; position
|
|
393
|
+
var htmlStr = "<div class=\"scichart__legend\" style=\"height: 100%; ".concat(position, " display: flex; ").concat(positionStyle, " text-align: center;\">");
|
|
389
394
|
var alignSelf = [ELegendPlacement.TopLeft, ELegendPlacement.TopRight].includes(placement)
|
|
390
395
|
? "flex-start"
|
|
391
396
|
: "flex-end";
|
|
@@ -30,7 +30,7 @@ var DataLabelState = /** @class */ (function () {
|
|
|
30
30
|
var indicesRange = this.parentSeries.getIndicesRange(new NumberRange_1.NumberRange(renderPassData.xCoordinateCalculator.visibleMin, renderPassData.xCoordinateCalculator.visibleMax), isCategoryAxis);
|
|
31
31
|
this.indexStart = indicesRange.min;
|
|
32
32
|
this.indexEnd = indicesRange.max;
|
|
33
|
-
this.pointCount =
|
|
33
|
+
this.pointCount = renderPassData.indexRange.diff + 1;
|
|
34
34
|
if (this.pointCount > 1) {
|
|
35
35
|
this.pointGap = renderPassData.isVerticalChart
|
|
36
36
|
? Math.abs(this.yCoord(this.indexStart) - this.yCoord(this.indexEnd)) / this.pointCount
|
|
@@ -40,9 +40,9 @@ var DataLabelState = /** @class */ (function () {
|
|
|
40
40
|
this.pointGap = Infinity; // Single point
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
this.indexStart = renderPassData.indexRange.min;
|
|
44
|
-
this.pointCount = renderPassData.indexRange.diff + 1;
|
|
45
|
-
this.indexEnd = renderPassData.indexRange.max;
|
|
43
|
+
this.indexStart = pointSeries.resampled ? 0 : renderPassData.indexRange.min;
|
|
44
|
+
this.pointCount = pointSeries.resampled ? pointSeries.count : renderPassData.indexRange.diff + 1;
|
|
45
|
+
this.indexEnd = pointSeries.resampled ? pointSeries.count - 1 : renderPassData.indexRange.max;
|
|
46
46
|
if (this.pointCount > 1) {
|
|
47
47
|
this.pointGap = renderPassData.isVerticalChart
|
|
48
48
|
? Math.abs(this.yCoord(this.indexStart) - this.yCoord(this.indexEnd)) / this.pointCount
|
|
@@ -84,8 +84,8 @@ var BandSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
84
84
|
if (!dataSeries) {
|
|
85
85
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
86
86
|
}
|
|
87
|
-
var
|
|
88
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, dataSeries.getNativeXValues(), dataSeries.getNativeYValues(), xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
87
|
+
var _b = hitTestHelpers_1.hitTestHelpers.getNearestXyyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius), nearestPointIndex = _b.nearestPointIndex, distance = _b.distance;
|
|
88
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, dataSeries.getNativeXValues(), dataSeries.getNativeYValues(), xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius, distance);
|
|
89
89
|
if (nearestPointIndex >= 0) {
|
|
90
90
|
hitTestInfo.y1Value = dataSeries.getNativeY1Values().get(nearestPointIndex);
|
|
91
91
|
hitTestInfo.y1Coord = yCoordinateCalculator.getCoordinate(hitTestInfo.y1Value);
|
|
@@ -43,12 +43,12 @@ var BaseHitTestProvider = /** @class */ (function () {
|
|
|
43
43
|
if (!dataSeries) {
|
|
44
44
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
45
45
|
}
|
|
46
|
-
var
|
|
46
|
+
var nearest = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
47
47
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
48
48
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
49
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
50
|
-
if (nearestPointIndex >= 0) {
|
|
51
|
-
hitTestInfo.isHit = hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues, nearestPointIndex, xHitCoord, yHitCoord, hitTestRadius);
|
|
49
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearest.nearestPointIndex, hitTestRadius, nearest.distance);
|
|
50
|
+
if (nearest.nearestPointIndex >= 0) {
|
|
51
|
+
hitTestInfo.isHit = hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues, nearest.nearestPointIndex, xHitCoord, yHitCoord, hitTestRadius);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
hitTestInfo.isHit = false;
|
|
@@ -80,7 +80,7 @@ var BaseHitTestProvider = /** @class */ (function () {
|
|
|
80
80
|
var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
|
|
81
81
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
82
82
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
83
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
|
|
83
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0, undefined);
|
|
84
84
|
hitTestInfo.isHit = hitTestInfo.isWithinDataBounds;
|
|
85
85
|
if (dataSeries.dataDistributionCalculator.isSortedAscending && nearestPointIndex >= 0) {
|
|
86
86
|
var dataSeriesCount = xNativeValues.size();
|
|
@@ -45,13 +45,13 @@ var BubbleSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
45
45
|
if (!dataSeries) {
|
|
46
46
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var nearest = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
49
49
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
50
50
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
51
51
|
var zNativeValues = dataSeries.getNativeZValues();
|
|
52
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
53
|
-
if (nearestPointIndex >= 0) {
|
|
54
|
-
hitTestInfo.zValue = zNativeValues.get(nearestPointIndex);
|
|
52
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearest.nearestPointIndex, hitTestRadius);
|
|
53
|
+
if (nearest.nearestPointIndex >= 0) {
|
|
54
|
+
hitTestInfo.zValue = zNativeValues.get(nearest.nearestPointIndex);
|
|
55
55
|
var distance = (0, pointUtil_1.calcDistance)(xHitCoord, yHitCoord, hitTestInfo.xCoord, hitTestInfo.yCoord);
|
|
56
56
|
hitTestInfo.isHit = distance < (hitTestInfo.zValue * DpiHelper_1.DpiHelper.PIXEL_RATIO) / 2 + hitTestRadius;
|
|
57
57
|
var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
@@ -166,5 +166,9 @@ export declare class HitTestInfo {
|
|
|
166
166
|
* The point metadata for the second data point
|
|
167
167
|
*/
|
|
168
168
|
point2metadata: IPointMetadata;
|
|
169
|
+
private distanceProperty;
|
|
170
|
+
/** The distance from the hitTest coordinate to the point */
|
|
171
|
+
get distance(): number;
|
|
172
|
+
set distance(value: number);
|
|
169
173
|
constructor(renderableSeries: IRenderableSeries, isEmpty?: boolean);
|
|
170
174
|
}
|
|
@@ -25,6 +25,19 @@ var HitTestInfo = /** @class */ (function () {
|
|
|
25
25
|
var dy = ((_b = this.hitTestPoint) === null || _b === void 0 ? void 0 : _b.y) - this.yCoord;
|
|
26
26
|
return Math.sqrt(dx * dx + dy * dy);
|
|
27
27
|
};
|
|
28
|
+
Object.defineProperty(HitTestInfo.prototype, "distance", {
|
|
29
|
+
/** The distance from the hitTest coordinate to the point */
|
|
30
|
+
get: function () {
|
|
31
|
+
if (this.distanceProperty !== undefined)
|
|
32
|
+
return this.distanceProperty;
|
|
33
|
+
return this.getEuclideanDistance();
|
|
34
|
+
},
|
|
35
|
+
set: function (value) {
|
|
36
|
+
this.distanceProperty = value;
|
|
37
|
+
},
|
|
38
|
+
enumerable: false,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
28
41
|
return HitTestInfo;
|
|
29
42
|
}());
|
|
30
43
|
exports.HitTestInfo = HitTestInfo;
|
|
@@ -45,15 +45,15 @@ var ImpulseSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
45
45
|
if (!dataSeries) {
|
|
46
46
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var nearestXy = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
49
49
|
var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
|
|
50
50
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
51
51
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
52
52
|
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, 0);
|
|
53
|
-
if (nearestPointIndex >= 0 ||
|
|
53
|
+
if (nearestPointIndex >= 0 || nearestXy.nearestPointIndex >= 0) {
|
|
54
54
|
hitTestInfo.isHit =
|
|
55
55
|
hitTestHelpers_1.hitTestHelpers.testIsHitForImpulse(xCoordinateCalculator, yCoordinateCalculator, this.parentSeries, xNativeValues, yNativeValues, nearestPointIndex, xHitCoord, yHitCoord, hitTestRadius) ||
|
|
56
|
-
hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues,
|
|
56
|
+
hitTestHelpers_1.hitTestHelpers.testIsHitForPoint(xCoordinateCalculator, yCoordinateCalculator, xNativeValues, yNativeValues, nearestXy.nearestPointIndex, xHitCoord, yHitCoord, this.parentSeries.size);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
hitTestInfo.isHit = false;
|
|
@@ -57,7 +57,7 @@ var LineSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
57
57
|
var nearestPointIndex = hitTestHelpers_1.hitTestHelpers.getNearestXPoint(this.webAssemblyContext, xCoordinateCalculator, dataSeries, xHitCoord, dataSeries.dataDistributionCalculator.isSortedAscending);
|
|
58
58
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
59
59
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
60
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
60
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius, undefined);
|
|
61
61
|
if (nearestPointIndex >= 0) {
|
|
62
62
|
var dataSeriesCount = xNativeValues.size();
|
|
63
63
|
var nearestXCoord = xCoordinateCalculator.getCoordinate(xCoordinateCalculator.isCategoryCoordinateCalculator
|
|
@@ -95,11 +95,11 @@ var LineSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
95
95
|
if (!dataSeries) {
|
|
96
96
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
97
97
|
}
|
|
98
|
-
var
|
|
98
|
+
var nearest = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
99
99
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
100
100
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
101
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
102
|
-
if (nearestPointIndex >= 0) {
|
|
101
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearest.nearestPointIndex, hitTestRadius, nearest.distance);
|
|
102
|
+
if (nearest.nearestPointIndex >= 0) {
|
|
103
103
|
var dataSeriesCount = xNativeValues.size();
|
|
104
104
|
var minX = Number.MAX_VALUE;
|
|
105
105
|
var maxX = Number.MIN_VALUE;
|
|
@@ -44,11 +44,11 @@ var ScatterSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
44
44
|
if (!dataSeries) {
|
|
45
45
|
return HitTestInfo_1.HitTestInfo.empty();
|
|
46
46
|
}
|
|
47
|
-
var
|
|
47
|
+
var nearest = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
48
48
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
49
49
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
50
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
51
|
-
if (nearestPointIndex >= 0) {
|
|
50
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearest.nearestPointIndex, hitTestRadius);
|
|
51
|
+
if (nearest.nearestPointIndex >= 0) {
|
|
52
52
|
var _b = this.parentSeries.pointMarker, width = _b.width, height = _b.height;
|
|
53
53
|
var isCategoryAxis = xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
54
54
|
var xFirstValue = isCategoryAxis ? 0 : xNativeValues.get(0);
|
|
@@ -34,10 +34,10 @@ var TextSeriesHitTestProvider = /** @class */ (function (_super) {
|
|
|
34
34
|
var xHitCoord = isVerticalChart ? hitTestPoint.y : hitTestPoint.x;
|
|
35
35
|
var yHitCoord = isVerticalChart ? hitTestPoint.x : hitTestPoint.y;
|
|
36
36
|
var dataSeries = this.parentSeries.dataSeries;
|
|
37
|
-
var
|
|
37
|
+
var nearest = hitTestHelpers_1.hitTestHelpers.getNearestXyPoint(this.webAssemblyContext, xCoordinateCalculator, yCoordinateCalculator, dataSeries, xHitCoord, yHitCoord, hitTestRadius);
|
|
38
38
|
var xNativeValues = dataSeries.getNativeXValues();
|
|
39
39
|
var yNativeValues = dataSeries.getNativeYValues();
|
|
40
|
-
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearestPointIndex, hitTestRadius);
|
|
40
|
+
var hitTestInfo = hitTestHelpers_1.hitTestHelpers.createHitTestInfo(this.parentSeries, xCoordinateCalculator, yCoordinateCalculator, isVerticalChart, dataSeries, xNativeValues, yNativeValues, xHitCoord, yHitCoord, nearest.nearestPointIndex, hitTestRadius, nearest.distance);
|
|
41
41
|
var labels = this.parentSeries.dataLabelProvider.dataLabels;
|
|
42
42
|
var isHit = false;
|
|
43
43
|
for (var _i = 0, labels_1 = labels; _i < labels_1.length; _i++) {
|
|
@@ -14,10 +14,16 @@ import { FastImpulseRenderableSeries } from "../FastImpulseRenderableSeries";
|
|
|
14
14
|
import { IRenderableSeries } from "../IRenderableSeries";
|
|
15
15
|
import { HitTestInfo } from "./HitTestInfo";
|
|
16
16
|
export declare const hitTestHelpers: {
|
|
17
|
-
createHitTestInfo: (renderableSeries: IRenderableSeries, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, isVerticalChart: boolean, dataSeries: BaseDataSeries, xNativeValues: SCRTDoubleVector, yNativeValues: SCRTDoubleVector, xHitCoord: number, yHitCoord: number, nearestPointIndex: number, hitTestRadius: number) => HitTestInfo;
|
|
17
|
+
createHitTestInfo: (renderableSeries: IRenderableSeries, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, isVerticalChart: boolean, dataSeries: BaseDataSeries, xNativeValues: SCRTDoubleVector, yNativeValues: SCRTDoubleVector, xHitCoord: number, yHitCoord: number, nearestPointIndex: number, hitTestRadius: number, distance?: number) => HitTestInfo;
|
|
18
18
|
getNearestXPoint: (webAssemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, dataSeries: IDataSeries, xHitCoord: number, isSorted: boolean) => number;
|
|
19
|
-
getNearestXyPoint: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, dataSeries: IDataSeries, xHitCoord: number, yHitCoord: number) =>
|
|
20
|
-
|
|
19
|
+
getNearestXyPoint: (webassemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, dataSeries: IDataSeries, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => {
|
|
20
|
+
nearestPointIndex: number;
|
|
21
|
+
distance: number;
|
|
22
|
+
};
|
|
23
|
+
getNearestXyyPoint: (webassemblyContext: TSciChart, xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, dataSeries: XyyDataSeries, xHitCoord: number, yHitCoord: number, hitTestRadius: number) => {
|
|
24
|
+
nearestPointIndex: number;
|
|
25
|
+
distance: number;
|
|
26
|
+
};
|
|
21
27
|
getNearestUniformHeatmapPoint: (xCoordinateCalculator: CoordinateCalculatorBase, yCoordinateCalculator: CoordinateCalculatorBase, heatmapDataSeries: UniformHeatmapDataSeries, xHitCoord: number, yHitCoord: number) => {
|
|
22
28
|
xIndex: number;
|
|
23
29
|
yIndex: number;
|