scichart 2.0.0-alpha.1930 → 2.0.0-alpha.1991
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/buildAxis.d.ts +3 -3
- package/Builder/buildDataSeries.d.ts +44 -4
- package/Builder/buildDataSeries.js +66 -0
- package/Builder/buildSeries.d.ts +7 -5
- package/Builder/buildSeries.js +3 -4
- package/Builder/buildSurface.d.ts +14 -6
- package/Builder/buildSurface.js +13 -8
- package/Builder/chartBuilder.d.ts +14 -8
- package/Builder/chartBuilder.js +6 -6
- package/Charting/ChartModifiers/ChartModifierBase.d.ts +37 -81
- package/Charting/ChartModifiers/ChartModifierBase.js +28 -73
- package/Charting/ChartModifiers/ChartModifierBase2D.d.ts +5 -1
- package/Charting/ChartModifiers/ChartModifierBase2D.js +6 -17
- package/Charting/ChartModifiers/CursorModifier.d.ts +4 -2
- package/Charting/ChartModifiers/CursorModifier.js +1 -1
- package/Charting/ChartModifiers/DataPointSelectionModifier.d.ts +3 -1
- package/Charting/ChartModifiers/DataPointSelectionModifier.js +62 -27
- package/Charting/ChartModifiers/LegendModifier.d.ts +5 -1
- package/Charting/ChartModifiers/LegendModifier.js +2 -1
- package/Charting/ChartModifiers/MouseWheelZoomModifier.d.ts +1 -1
- package/Charting/ChartModifiers/PinchZoomModifier.d.ts +1 -1
- package/Charting/ChartModifiers/RolloverModifier.d.ts +1 -1
- package/Charting/ChartModifiers/RolloverModifier.js +44 -58
- package/Charting/ChartModifiers/RubberBandXyZoomModifier.d.ts +1 -1
- package/Charting/ChartModifiers/SeriesSelectionModifier.d.ts +15 -7
- package/Charting/ChartModifiers/SeriesSelectionModifier.js +10 -10
- package/Charting/ChartModifiers/XAxisDragModifier.d.ts +1 -1
- package/Charting/ChartModifiers/YAxisDragModifier.d.ts +1 -1
- package/Charting/ChartModifiers/ZoomExtentsModifier.d.ts +14 -1
- package/Charting/ChartModifiers/ZoomExtentsModifier.js +16 -4
- package/Charting/Drawing/BrushCache.js +6 -8
- package/Charting/Drawing/Pen2DCache.d.ts +4 -6
- package/Charting/Drawing/Pen2DCache.js +14 -11
- package/Charting/Drawing/WebGlPen.d.ts +2 -1
- package/Charting/Drawing/WebGlPen.js +3 -2
- package/Charting/LayoutManager/BottomAlignedOuterAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +3 -2
- package/Charting/LayoutManager/LeftAlignedOuterAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +3 -2
- package/Charting/LayoutManager/RightAlignedOuterAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +3 -2
- package/Charting/LayoutManager/TopAlignedOuterAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +3 -2
- package/Charting/Model/BaseDataSeries.d.ts +64 -52
- package/Charting/Model/BaseDataSeries.js +158 -84
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +2 -2
- package/Charting/Model/DataPointSelectionPaletteProvider.d.ts +22 -10
- package/Charting/Model/DataPointSelectionPaletteProvider.js +35 -5
- package/Charting/Model/Filters/OhlcScaleOffsetFilter.d.ts +106 -0
- package/Charting/Model/Filters/OhlcScaleOffsetFilter.js +21 -0
- package/Charting/Model/Filters/XyLinearTrendFilter.d.ts +112 -1
- package/Charting/Model/Filters/XyLinearTrendFilter.js +21 -0
- package/Charting/Model/Filters/XyMovingAverageFilter.d.ts +110 -1
- package/Charting/Model/Filters/XyMovingAverageFilter.js +21 -0
- package/Charting/Model/Filters/XyRatioFilter.d.ts +111 -2
- package/Charting/Model/Filters/XyRatioFilter.js +34 -3
- package/Charting/Model/Filters/XyScaleOffsetFilter.d.ts +112 -1
- package/Charting/Model/Filters/XyScaleOffsetFilter.js +21 -0
- package/Charting/Model/Filters/XyyScaleOffsetFilter.d.ts +116 -0
- package/Charting/Model/Filters/XyyScaleOffsetFilter.js +21 -0
- package/Charting/Model/Filters/XyzScaleOffsetFilter.d.ts +116 -0
- package/Charting/Model/Filters/XyzScaleOffsetFilter.js +21 -0
- package/Charting/Model/IDataSeries.d.ts +18 -3
- package/Charting/Model/IDataSeries.js +12 -1
- package/Charting/Model/IPaletteProvider.d.ts +8 -8
- package/Charting/Model/OhlcDataSeries.d.ts +39 -10
- package/Charting/Model/OhlcDataSeries.js +106 -19
- package/Charting/Model/UniformHeatmapDataSeries.d.ts +2 -2
- package/Charting/Model/XyyDataSeries.d.ts +21 -12
- package/Charting/Model/XyyDataSeries.js +70 -16
- package/Charting/Model/XyzDataSeries.d.ts +20 -5
- package/Charting/Model/XyzDataSeries.js +63 -7
- package/Charting/Numerics/TickProviders/LogarithmicTickProvider.d.ts +24 -0
- package/Charting/Numerics/TickProviders/LogarithmicTickProvider.js +26 -4
- package/Charting/Services/SciChartRenderer.js +4 -2
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +7 -21
- package/Charting/Visuals/Annotations/AnnotationBase.js +28 -42
- package/Charting/Visuals/Annotations/AxisMarkerAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/AxisMarkerAnnotation.js +2 -4
- package/Charting/Visuals/Annotations/BoxAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/BoxAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/CustomAnnotation.js +2 -2
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +0 -3
- package/Charting/Visuals/Annotations/IAnnotation.d.ts +4 -0
- package/Charting/Visuals/Annotations/LineAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/LineAnnotation.js +2 -4
- package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +1 -1
- package/Charting/Visuals/Annotations/SvgAnnotationBase.d.ts +1 -1
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +3 -2
- package/Charting/Visuals/Annotations/TextAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/TextAnnotation.js +1 -1
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +0 -3
- package/Charting/Visuals/Annotations/annotationHelpers.d.ts +21 -0
- package/Charting/Visuals/Annotations/annotationHelpers.js +19 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +21 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +81 -14
- package/Charting/Visuals/Axis/AxisCore.d.ts +5 -5
- package/Charting/Visuals/Axis/AxisCore.js +50 -55
- package/Charting/Visuals/Axis/AxisRenderer.js +1 -1
- package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +13 -0
- package/Charting/Visuals/Axis/LabelProvider/LabelProvider.d.ts +1 -1
- package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.d.ts +3 -2
- package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +13 -0
- package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.d.ts +1 -1
- package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +53 -0
- package/Charting/Visuals/Axis/LogarithmicAxis.js +107 -3
- package/Charting/Visuals/Axis/constants.d.ts +2 -1
- package/Charting/Visuals/Axis/constants.js +1 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +1 -1
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +11 -0
- package/Charting/Visuals/Legend/SciChartLegendBase.js +45 -16
- package/Charting/Visuals/PointMarkers/IPointMarker.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/Animations/BaseAnimation.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +9 -2
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +65 -4
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +0 -11
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +0 -29
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -1
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +0 -37
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +0 -120
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +4 -24
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +65 -91
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +26 -2
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +55 -3
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +3 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +7 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +66 -64
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +12 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +6 -6
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +12 -0
- package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.d.ts +0 -6
- package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.js +0 -42
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +0 -17
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +0 -71
- package/Charting/Visuals/RenderableSeries/FastCandlestickRenderableSeries.js +1 -1
- package/Charting/Visuals/RenderableSeries/FastOhlcRenderableSeries.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +7 -0
- package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +2 -1
- package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +7 -0
- package/Charting/Visuals/RenderableSeries/HitTest/IHitTestProvider.d.ts +13 -0
- package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +7 -0
- package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +7 -0
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +17 -5
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +10 -32
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +4 -0
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +11 -21
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +10 -21
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.d.ts +18 -5
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +16 -35
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +4 -5
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -5
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +2 -35
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +3 -1
- package/Charting/Visuals/SciChartOverview.d.ts +1 -1
- package/Charting/Visuals/SciChartOverview.js +1 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +3 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +9 -8
- package/Charting/Visuals/SciChartSurface.d.ts +20 -3
- package/Charting/Visuals/SciChartSurface.js +36 -8
- package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -3
- package/Charting/Visuals/SciChartSurfaceBase.js +2 -6
- package/Charting/Visuals/TextureManager/DpiHelper.d.ts +1 -1
- package/Charting/Visuals/TextureManager/DpiHelper.js +5 -3
- package/Charting/Visuals/TextureManager/TextureManager.d.ts +7 -1
- package/Charting/Visuals/TextureManager/TextureManager.js +14 -7
- package/Charting/Visuals/licenseManager2D.js +35 -28
- package/Charting/Visuals/loader.d.ts +3 -0
- package/Charting/Visuals/loader.js +3 -0
- package/Charting3D/Visuals/Primitives/BaseSceneEntity3D.d.ts +21 -45
- package/Charting3D/Visuals/Primitives/BaseSceneEntity3D.js +15 -36
- package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.d.ts +35 -73
- package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.js +25 -66
- package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +13 -1
- package/Charting3D/Visuals/SciChart3DSurface.js +13 -1
- package/Core/ObservableArray.d.ts +8 -1
- package/Core/ObservableArray.js +7 -0
- 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/AnchorPoint.d.ts +0 -3
- package/types/AnchorPoint.js +0 -3
- package/types/BaseType.d.ts +3 -1
- package/types/BaseType.js +2 -0
- package/types/DataFilterType.d.ts +9 -0
- package/types/DataFilterType.js +13 -0
- package/types/HelperTypes.d.ts +5 -0
- package/types/HelperTypes.js +2 -0
- package/types/SeriesType.d.ts +17 -17
- package/types/SeriesType.js +17 -17
- package/utils/font.d.ts +8 -0
- package/utils/font.js +15 -0
- package/utils/imageUtil.d.ts +6 -0
- package/utils/imageUtil.js +11 -1
|
@@ -162,8 +162,10 @@ export declare class CursorModifier extends ChartModifierBase2D implements IIncl
|
|
|
162
162
|
*/
|
|
163
163
|
hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
|
|
164
164
|
toJSON(): {
|
|
165
|
-
type: string;
|
|
166
|
-
|
|
165
|
+
type: string; /**
|
|
166
|
+
* Gets or sets the legend Y offset
|
|
167
|
+
*/
|
|
168
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
167
169
|
};
|
|
168
170
|
protected notifyPropertyChanged(propertyName: string): void;
|
|
169
171
|
private getSeriesInfos;
|
|
@@ -468,7 +468,7 @@ var defaultTooltipTemplate = function (seriesInfos, svgAnnotation) {
|
|
|
468
468
|
});
|
|
469
469
|
var tooltipFill = svgAnnotation.containerBackground;
|
|
470
470
|
var tooltipStroke = svgAnnotation.textStroke;
|
|
471
|
-
return "<svg width=\"" + width + "\" height=\"" + height + "\">\n <defs>\n <filter id=\"" + id + "\" x=\"0\" y=\"0\" width=\"200%\" height=\"200%\">\n <feOffset result=\"offOut\" in=\"SourceAlpha\" dx=\"3\" dy=\"3\" />\n <feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"3\" />\n <feBlend in=\"SourceGraphic\" in2=\"blurOut\" mode=\"normal\" />\n </filter>\n </defs>\n <rect rx=\"4\" ry=\"4\" width=\"95%\" height=\"90%\" fill=\"" + tooltipFill + "\" filter=\"url(#" + id + ")\" />\n <svg width=\"100%\">\n <text x=\"8\" y=\"3\" font-size=\"13\" font-family=\"Verdana\" dy=\"0\" fill=\"" + tooltipStroke + "\">" + valuesBlock + "</text>\n </svg>\n </svg>";
|
|
471
|
+
return "<svg class=\"scichart__cursor-tooltip\" width=\"" + width + "\" height=\"" + height + "\">\n <defs>\n <filter id=\"" + id + "\" x=\"0\" y=\"0\" width=\"200%\" height=\"200%\">\n <feOffset result=\"offOut\" in=\"SourceAlpha\" dx=\"3\" dy=\"3\" />\n <feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"3\" />\n <feBlend in=\"SourceGraphic\" in2=\"blurOut\" mode=\"normal\" />\n </filter>\n </defs>\n <rect rx=\"4\" ry=\"4\" width=\"95%\" height=\"90%\" fill=\"" + tooltipFill + "\" filter=\"url(#" + id + ")\" />\n <svg width=\"100%\">\n <text x=\"8\" y=\"3\" font-size=\"13\" font-family=\"Verdana\" dy=\"0\" fill=\"" + tooltipStroke + "\">" + valuesBlock + "</text>\n </svg>\n </svg>";
|
|
472
472
|
};
|
|
473
473
|
/** @ignore */
|
|
474
474
|
var calcTooltipWidth = function (textLength, fontSize) {
|
|
@@ -106,6 +106,7 @@ export declare class DataPointSelectionModifier extends ChartModifierBase2D impl
|
|
|
106
106
|
private isClicked;
|
|
107
107
|
private includedSeriesMap;
|
|
108
108
|
private selectedDataPointsMap;
|
|
109
|
+
private selectionHasChanged;
|
|
109
110
|
/**
|
|
110
111
|
* Creates an instances of DataPointSelectionModifier
|
|
111
112
|
* @param options Optional parameters of type {@link IDataPointSelectionModifierOptions} used to configure the modifier
|
|
@@ -198,7 +199,7 @@ export declare class DataPointSelectionModifier extends ChartModifierBase2D impl
|
|
|
198
199
|
getSelectionMode(modifierKeys: TModifierKeys, isAreaSelection: boolean): ESelectionMode;
|
|
199
200
|
toJSON(): {
|
|
200
201
|
type: string;
|
|
201
|
-
options: IChartModifierBaseOptions
|
|
202
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
202
203
|
};
|
|
203
204
|
/**
|
|
204
205
|
* Selects all points inside the {@link Rect}, according to the {@link ESelectionMode} passed in
|
|
@@ -224,4 +225,5 @@ export declare class DataPointSelectionModifier extends ChartModifierBase2D impl
|
|
|
224
225
|
private removeSelectedDataPoint;
|
|
225
226
|
private clearSelectedDataPoints;
|
|
226
227
|
private removeSelectedDataPointsForSeries;
|
|
228
|
+
private raiseSelectionChanged;
|
|
227
229
|
}
|
|
@@ -22,6 +22,7 @@ var ChartModifierType_1 = require("../../types/ChartModifierType");
|
|
|
22
22
|
var pointUtil_1 = require("../../utils/pointUtil");
|
|
23
23
|
var translate_1 = require("../../utils/translate");
|
|
24
24
|
var IDataSeries_1 = require("../Model/IDataSeries");
|
|
25
|
+
var IPointMetadata_1 = require("../Model/IPointMetadata");
|
|
25
26
|
var BaseHitTestProvider_1 = require("../Visuals/RenderableSeries/HitTest/BaseHitTestProvider");
|
|
26
27
|
var RubberBandSvgRect_1 = require("../Visuals/RubberBandSvgRect/RubberBandSvgRect");
|
|
27
28
|
var ChartModifierBase2D_1 = require("./ChartModifierBase2D");
|
|
@@ -54,7 +55,7 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
54
55
|
* @param options Optional parameters of type {@link IDataPointSelectionModifierOptions} used to configure the modifier
|
|
55
56
|
*/
|
|
56
57
|
function DataPointSelectionModifier(options) {
|
|
57
|
-
var _a, _b, _c
|
|
58
|
+
var _a, _b, _c;
|
|
58
59
|
var _this = _super.call(this, options) || this;
|
|
59
60
|
_this.type = ChartModifierType_1.EChart2DModifierType.DataPointSelection;
|
|
60
61
|
/**
|
|
@@ -64,30 +65,35 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
64
65
|
_this.selectionChanged = new EventHandler_1.EventHandler();
|
|
65
66
|
_this.includedSeriesMap = new Map();
|
|
66
67
|
_this.selectedDataPointsMap = new Map();
|
|
68
|
+
_this.selectionHasChanged = false;
|
|
67
69
|
_this.allowClickSelect = (_a = options === null || options === void 0 ? void 0 : options.allowClickSelect) !== null && _a !== void 0 ? _a : true;
|
|
68
70
|
_this.allowDragSelect = (_b = options === null || options === void 0 ? void 0 : options.allowDragSelect) !== null && _b !== void 0 ? _b : true;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
if (options === null || options === void 0 ? void 0 : options.selectionStroke) {
|
|
72
|
+
_this.selectionStroke = options.selectionStroke;
|
|
73
|
+
}
|
|
74
|
+
if (options === null || options === void 0 ? void 0 : options.selectionFill) {
|
|
75
|
+
_this.selectionFill = options === null || options === void 0 ? void 0 : options.selectionFill;
|
|
76
|
+
}
|
|
77
|
+
_this.selectionStrokeThicknessProperty = (_c = options === null || options === void 0 ? void 0 : options.selectionStrokeThickness) !== null && _c !== void 0 ? _c : 1;
|
|
72
78
|
if (options === null || options === void 0 ? void 0 : options.onSelectionChanged) {
|
|
73
79
|
if (typeof options.onSelectionChanged === "string") {
|
|
74
80
|
_this.typeMap.set("onSelectionChanged", options.onSelectionChanged);
|
|
75
|
-
|
|
81
|
+
// @ts-ignore
|
|
76
82
|
_this.selectionChanged.subscribe(classFactory_1.getFunction(BaseType_1.EBaseType.OptionFunction, options.onSelectionChanged));
|
|
77
83
|
}
|
|
78
84
|
else {
|
|
79
|
-
|
|
85
|
+
// @ts-ignore
|
|
80
86
|
_this.selectionChanged.subscribe(options.onSelectionChanged);
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
if (options === null || options === void 0 ? void 0 : options.getSelectionMode) {
|
|
84
90
|
if (typeof options.getSelectionMode === "string") {
|
|
85
91
|
_this.typeMap.set("getSelectionMode", options.getSelectionMode);
|
|
86
|
-
|
|
92
|
+
// @ts-ignore
|
|
87
93
|
_this.getSelectionMode = classFactory_1.getFunction(BaseType_1.EBaseType.OptionFunction, options.getSelectionMode);
|
|
88
94
|
}
|
|
89
95
|
else {
|
|
90
|
-
|
|
96
|
+
// @ts-ignore
|
|
91
97
|
_this.getSelectionMode = options.getSelectionMode;
|
|
92
98
|
}
|
|
93
99
|
}
|
|
@@ -97,10 +103,10 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
97
103
|
* @inheritDoc
|
|
98
104
|
*/
|
|
99
105
|
DataPointSelectionModifier.prototype.applyTheme = function (themeProvider) {
|
|
100
|
-
if (!this.testPropertyChanged(constants_1.PROPERTY.
|
|
106
|
+
if (!this.testPropertyChanged(constants_1.PROPERTY.SELECTION_FILL)) {
|
|
101
107
|
this.selectionFill = themeProvider.rubberBandFillBrush;
|
|
102
108
|
}
|
|
103
|
-
if (!this.testPropertyChanged(constants_1.PROPERTY.
|
|
109
|
+
if (!this.testPropertyChanged(constants_1.PROPERTY.SELECTION_STROKE)) {
|
|
104
110
|
this.selectionStroke = themeProvider.rubberBandStrokeBrush;
|
|
105
111
|
}
|
|
106
112
|
};
|
|
@@ -149,6 +155,10 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
149
155
|
}
|
|
150
156
|
// Build selected points list from attached series
|
|
151
157
|
var baseDataSeries = rs.dataSeries;
|
|
158
|
+
// Add metadata to series
|
|
159
|
+
if (!baseDataSeries.hasMetadataGenerator()) {
|
|
160
|
+
baseDataSeries.setMetadataGenerator(new IPointMetadata_1.TemplateMetadataGenerator({ isSelected: false }));
|
|
161
|
+
}
|
|
152
162
|
for (var i = 0; i < baseDataSeries.getMetadataLength(); i++) {
|
|
153
163
|
var metadata = baseDataSeries.getMetadataAt(i);
|
|
154
164
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.isSelected) {
|
|
@@ -156,7 +166,7 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
156
166
|
this.addSelectedDataPoint(rs, i, dataPoint);
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
|
-
this.
|
|
169
|
+
this.raiseSelectionChanged(false);
|
|
160
170
|
};
|
|
161
171
|
/**
|
|
162
172
|
* @inheritDoc
|
|
@@ -168,7 +178,7 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
168
178
|
}
|
|
169
179
|
// Remove selected points from selected points list
|
|
170
180
|
this.removeSelectedDataPointsForSeries(rs);
|
|
171
|
-
this.
|
|
181
|
+
this.raiseSelectionChanged(false);
|
|
172
182
|
};
|
|
173
183
|
/**
|
|
174
184
|
* @inheritDoc
|
|
@@ -367,7 +377,6 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
367
377
|
*/
|
|
368
378
|
DataPointSelectionModifier.prototype.selectManyPoints = function (rect, selectionMode) {
|
|
369
379
|
var _this = this;
|
|
370
|
-
var _a;
|
|
371
380
|
if (this.parentSurface) {
|
|
372
381
|
var multiSelect = selectionMode !== ESelectionMode.Replace;
|
|
373
382
|
if (!multiSelect) {
|
|
@@ -409,14 +418,25 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
409
418
|
var y = baseDataSeries.getNativeYValues().get(i);
|
|
410
419
|
if (pointUtil_1.testIsInBounds(x, y, leftXData, topYData, rightXData, bottomYData)) {
|
|
411
420
|
var metadata = baseDataSeries.getMetadataAt(i);
|
|
412
|
-
|
|
413
|
-
|
|
421
|
+
if (selectionMode !== ESelectionMode.Inverse) {
|
|
422
|
+
metadata.isSelected = true;
|
|
423
|
+
_this.addSelectedDataPoint(rs, i, new DataPointInfo_1.DataPointInfo(rs, metadata, i));
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
if (metadata.isSelected) {
|
|
427
|
+
metadata.isSelected = false;
|
|
428
|
+
_this.removeSelectedDataPoint(rs, i);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
metadata.isSelected = true;
|
|
432
|
+
_this.addSelectedDataPoint(rs, i, new DataPointInfo_1.DataPointInfo(rs, metadata, i));
|
|
433
|
+
}
|
|
434
|
+
}
|
|
414
435
|
}
|
|
415
436
|
}
|
|
416
437
|
}
|
|
417
438
|
});
|
|
418
|
-
this.
|
|
419
|
-
(_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.invalidateElement();
|
|
439
|
+
this.raiseSelectionChanged(true);
|
|
420
440
|
}
|
|
421
441
|
};
|
|
422
442
|
/**
|
|
@@ -427,14 +447,13 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
427
447
|
*/
|
|
428
448
|
DataPointSelectionModifier.prototype.selectSinglePoint = function (point, selectionMode) {
|
|
429
449
|
var _this = this;
|
|
430
|
-
var _a;
|
|
431
450
|
if (this.parentSurface) {
|
|
432
451
|
// Perform hit-test at the x-y point
|
|
433
452
|
var hitTestResults = this.getIncludedRenderableSeries()
|
|
434
453
|
.filter(function (rs) { return rs.isVisible && rs.dataSeries; }) // todo && included series
|
|
435
454
|
.map(function (rs) { return ({
|
|
436
455
|
renderableSeries: rs,
|
|
437
|
-
hitTestInfo: rs.hitTestProvider.
|
|
456
|
+
hitTestInfo: rs.hitTestProvider.hitTestForDataPointSelectionModifier(point.x, point.y, BaseHitTestProvider_1.BaseHitTestProvider.DEFAULT_HIT_TEST_RADIUS)
|
|
438
457
|
}); });
|
|
439
458
|
var multiSelect = selectionMode !== ESelectionMode.Replace;
|
|
440
459
|
if (!multiSelect) {
|
|
@@ -443,9 +462,12 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
443
462
|
hitTestResults.forEach(function (htResult) {
|
|
444
463
|
var ht = htResult.hitTestInfo;
|
|
445
464
|
var rs = htResult.renderableSeries;
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
465
|
+
if (!ht.isHit) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
// Metadata can't be auto-created if the renderableSeries is added to the surface without a dataSeries
|
|
469
|
+
if (!ht.metadata) {
|
|
470
|
+
console.warn("Cannot select datapoint for series " + ht.dataSeriesName + " as it does not have metadata. To solve this either:\nConfigure metadata when you create the series or when you add data eg renderableSeries.dataSeries = new XyDataSeries(wasmContext, { metadata: { isSelected: false }}), or:\nAdd the DataPointSelectionModifier after all series have had their dataSeries set.");
|
|
449
471
|
return;
|
|
450
472
|
}
|
|
451
473
|
if (selectionMode === ESelectionMode.Union) {
|
|
@@ -465,8 +487,7 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
465
487
|
}
|
|
466
488
|
}
|
|
467
489
|
});
|
|
468
|
-
this.
|
|
469
|
-
(_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.invalidateElement();
|
|
490
|
+
this.raiseSelectionChanged(true);
|
|
470
491
|
}
|
|
471
492
|
};
|
|
472
493
|
/**
|
|
@@ -475,7 +496,6 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
475
496
|
* @protected
|
|
476
497
|
*/
|
|
477
498
|
DataPointSelectionModifier.prototype.deselectAllPoints = function (invalidate) {
|
|
478
|
-
var _a;
|
|
479
499
|
if (invalidate === void 0) { invalidate = true; }
|
|
480
500
|
// Deselect all datapoints
|
|
481
501
|
this.selectedDataPoints.forEach(function (dp) {
|
|
@@ -485,17 +505,21 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
485
505
|
});
|
|
486
506
|
this.clearSelectedDataPoints();
|
|
487
507
|
if (invalidate) {
|
|
488
|
-
this.
|
|
489
|
-
(_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.invalidateElement();
|
|
508
|
+
this.raiseSelectionChanged(true);
|
|
490
509
|
}
|
|
491
510
|
};
|
|
492
511
|
DataPointSelectionModifier.prototype.addSelectedDataPoint = function (rs, index, value) {
|
|
493
512
|
this.selectedDataPointsMap.set(getKey(rs, index), value);
|
|
513
|
+
this.selectionHasChanged = true;
|
|
494
514
|
};
|
|
495
515
|
DataPointSelectionModifier.prototype.removeSelectedDataPoint = function (rs, index) {
|
|
496
516
|
this.selectedDataPointsMap.delete(getKey(rs, index));
|
|
517
|
+
this.selectionHasChanged = true;
|
|
497
518
|
};
|
|
498
519
|
DataPointSelectionModifier.prototype.clearSelectedDataPoints = function () {
|
|
520
|
+
if (this.selectedDataPointsMap.size > 0) {
|
|
521
|
+
this.selectionHasChanged = true;
|
|
522
|
+
}
|
|
499
523
|
this.selectedDataPointsMap.clear();
|
|
500
524
|
};
|
|
501
525
|
DataPointSelectionModifier.prototype.removeSelectedDataPointsForSeries = function (rs) {
|
|
@@ -503,9 +527,20 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
503
527
|
this.selectedDataPointsMap.forEach(function (dp, key) {
|
|
504
528
|
if (dp.renderableSeries === rs) {
|
|
505
529
|
_this.selectedDataPointsMap.delete(key);
|
|
530
|
+
_this.selectionHasChanged = true;
|
|
506
531
|
}
|
|
507
532
|
});
|
|
508
533
|
};
|
|
534
|
+
DataPointSelectionModifier.prototype.raiseSelectionChanged = function (invalidate) {
|
|
535
|
+
var _a;
|
|
536
|
+
if (this.selectionHasChanged) {
|
|
537
|
+
this.selectionChanged.raiseEvent(new DataPointSelectionChangedArgs_1.DataPointSelectionChangedArgs(this, this.selectedDataPoints));
|
|
538
|
+
this.selectionHasChanged = false;
|
|
539
|
+
if (invalidate) {
|
|
540
|
+
(_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.invalidateElement();
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
};
|
|
509
544
|
return DataPointSelectionModifier;
|
|
510
545
|
}(ChartModifierBase2D_1.ChartModifierBase2D));
|
|
511
546
|
exports.DataPointSelectionModifier = DataPointSelectionModifier;
|
|
@@ -33,6 +33,10 @@ export interface ILegendModifierOptions extends IChartModifierBaseOptions {
|
|
|
33
33
|
* Sets the margin for the legend control
|
|
34
34
|
*/
|
|
35
35
|
margin?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The parent div element Id, the Legend will be appended to this element
|
|
38
|
+
*/
|
|
39
|
+
placementDivId?: string;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* The LegendModifier provides interactive legend behavior on a 2D {@link SciChartSurface}
|
|
@@ -93,7 +97,7 @@ export declare class LegendModifier extends ChartModifierBase2D implements IIncl
|
|
|
93
97
|
getIncludedRenderableSeries(): IRenderableSeries[];
|
|
94
98
|
toJSON(): {
|
|
95
99
|
type: string;
|
|
96
|
-
options: IChartModifierBaseOptions
|
|
100
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
97
101
|
};
|
|
98
102
|
/**
|
|
99
103
|
* Test if the series is included or excluded, by default it is included
|
|
@@ -37,7 +37,7 @@ var LegendModifier = /** @class */ (function (_super) {
|
|
|
37
37
|
* @param options Optional parameters {@link ILegendModifierOptions} used to configure the modifier
|
|
38
38
|
*/
|
|
39
39
|
function LegendModifier(options) {
|
|
40
|
-
var _a, _b, _c, _d, _e, _f;
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
41
41
|
var _this = _super.call(this, options) || this;
|
|
42
42
|
_this.type = ChartModifierType_1.EChart2DModifierType.Legend;
|
|
43
43
|
_this.includedSeriesMap = new Map();
|
|
@@ -48,6 +48,7 @@ var LegendModifier = /** @class */ (function (_super) {
|
|
|
48
48
|
_this.sciChartLegend.showSeriesMarkers = (_d = options === null || options === void 0 ? void 0 : options.showSeriesMarkers) !== null && _d !== void 0 ? _d : _this.sciChartLegend.showSeriesMarkers;
|
|
49
49
|
_this.sciChartLegend.placement = (_e = options === null || options === void 0 ? void 0 : options.placement) !== null && _e !== void 0 ? _e : _this.sciChartLegend.placement;
|
|
50
50
|
_this.sciChartLegend.margin = (_f = options === null || options === void 0 ? void 0 : options.margin) !== null && _f !== void 0 ? _f : _this.sciChartLegend.margin;
|
|
51
|
+
_this.sciChartLegend.placementDivId = (_g = options === null || options === void 0 ? void 0 : options.placementDivId) !== null && _g !== void 0 ? _g : _this.sciChartLegend.placementDivId;
|
|
51
52
|
return _this;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
@@ -78,7 +78,7 @@ export declare class MouseWheelZoomModifier extends ChartModifierBase2D {
|
|
|
78
78
|
performPan(wheelDelta: number): void;
|
|
79
79
|
toJSON(): {
|
|
80
80
|
type: string;
|
|
81
|
-
options: IChartModifierBaseOptions
|
|
81
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
84
84
|
* Gets the axis size for scroll calculations
|
|
@@ -75,7 +75,7 @@ export declare class PinchZoomModifier extends ChartModifierBase2D {
|
|
|
75
75
|
modifierPointerCancel(args: ModifierMouseArgs): void;
|
|
76
76
|
toJSON(): {
|
|
77
77
|
type: string;
|
|
78
|
-
options: IChartModifierBaseOptions
|
|
78
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
81
|
* Performs the zoom operation around the mouse point
|
|
@@ -128,7 +128,7 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
128
128
|
hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo;
|
|
129
129
|
toJSON(): {
|
|
130
130
|
type: string;
|
|
131
|
-
options: IChartModifierBaseOptions
|
|
131
|
+
options: Required<Pick<IChartModifierBaseOptions, "id" | "xAxisId" | "yAxisId" | "executeOn" | "xyDirection" | "modifierGroup">>;
|
|
132
132
|
};
|
|
133
133
|
protected notifyPropertyChanged(propertyName: string): void;
|
|
134
134
|
private isVerticalChart;
|
|
@@ -36,6 +36,7 @@ var RolloverLegendSvgAnnotation_1 = require("../Visuals/Annotations/RolloverLege
|
|
|
36
36
|
var RolloverMarkerSvgAnnotation_1 = require("../Visuals/Annotations/RolloverMarkerSvgAnnotation");
|
|
37
37
|
var RolloverTooltipSvgAnnotation_1 = require("../Visuals/Annotations/RolloverTooltipSvgAnnotation");
|
|
38
38
|
var SciChartSurfaceBase_1 = require("../Visuals/SciChartSurfaceBase");
|
|
39
|
+
var DpiHelper_1 = require("../Visuals/TextureManager/DpiHelper");
|
|
39
40
|
var ChartModifierBase2D_1 = require("./ChartModifierBase2D");
|
|
40
41
|
var constants_1 = require("./constants");
|
|
41
42
|
/**
|
|
@@ -439,16 +440,16 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
439
440
|
var x = translate_1.translateToNotScaled(translatedMousePoint.x);
|
|
440
441
|
var y = translate_1.translateToNotScaled(translatedMousePoint.y);
|
|
441
442
|
if (this.isVerticalChart()) {
|
|
442
|
-
this.rolloverLineAnnotation.
|
|
443
|
-
this.rolloverLineAnnotation.
|
|
444
|
-
this.rolloverLineAnnotation.
|
|
445
|
-
this.rolloverLineAnnotation.
|
|
443
|
+
this.rolloverLineAnnotation.x1 = y;
|
|
444
|
+
this.rolloverLineAnnotation.x2 = y;
|
|
445
|
+
this.rolloverLineAnnotation.y1 = 0;
|
|
446
|
+
this.rolloverLineAnnotation.y2 = translate_1.translateToNotScaled(this.parentSurface.seriesViewRect.right);
|
|
446
447
|
}
|
|
447
448
|
else {
|
|
448
|
-
this.rolloverLineAnnotation.y1 = 0;
|
|
449
|
-
this.rolloverLineAnnotation.y2 = translate_1.translateToNotScaled(this.parentSurface.seriesViewRect.bottom);
|
|
450
449
|
this.rolloverLineAnnotation.x1 = x;
|
|
451
450
|
this.rolloverLineAnnotation.x2 = x;
|
|
451
|
+
this.rolloverLineAnnotation.y1 = 0;
|
|
452
|
+
this.rolloverLineAnnotation.y2 = translate_1.translateToNotScaled(this.parentSurface.seriesViewRect.bottom);
|
|
452
453
|
}
|
|
453
454
|
}
|
|
454
455
|
};
|
|
@@ -473,17 +474,10 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
473
474
|
if (this.mousePosition !== EMousePosition.SeriesArea) {
|
|
474
475
|
return;
|
|
475
476
|
}
|
|
476
|
-
var tooltipPositions = calcTooltipPositions(this.mousePoint, rsList, this.parentSurface.seriesViewRect, TOOLTIP_PADDING_TOP, this.hitTestRenderableSeries, this.allowTooltipOverlapping);
|
|
477
|
+
var tooltipPositions = calcTooltipPositions(this.mousePoint, rsList, this.parentSurface.seriesViewRect, TOOLTIP_PADDING_TOP * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.hitTestRenderableSeries, this.allowTooltipOverlapping, DpiHelper_1.DpiHelper.PIXEL_RATIO);
|
|
477
478
|
tooltipPositions.forEach(function (el) {
|
|
478
479
|
var rs = rsList[el.index];
|
|
479
|
-
// const isOutOfDataRange =
|
|
480
|
-
// !el.hitTestPointValues || rs.checkIsOutOfDataRange(el.hitTestPointValues.x, el.hitTestPointValues.y);
|
|
481
|
-
// if mouse value is out of [xMin, xMax] hide tooltips
|
|
482
|
-
// for StackedColumnSeries because of the specific we always show the tooltips
|
|
483
|
-
// const showTooltip =
|
|
484
|
-
// this.showTooltip && (rs.type === ESeriesType.StackedColumnSeries ? true : !isOutOfDataRange);
|
|
485
480
|
var showTooltip = _this.showTooltip && el.seriesInfo.isHit;
|
|
486
|
-
// const showMarker = rs.type === ESeriesType.StackedColumnSeries ? true : !isOutOfDataRange;
|
|
487
481
|
var showMarker = el.seriesInfo.isHit;
|
|
488
482
|
if (el.isY1) {
|
|
489
483
|
updateRolloverModifierProps(rs.rolloverModifierProps1, rs, el, showTooltip, showMarker);
|
|
@@ -518,15 +512,17 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
518
512
|
exports.RolloverModifier = RolloverModifier;
|
|
519
513
|
// TODO: write tests
|
|
520
514
|
/** @ignore */
|
|
521
|
-
var calcTooltipPositions = function (mousePoint, rsList, seriesViewRect, paddingTop, hitTestRenderableSeries, allowTooltipOverlapping) {
|
|
515
|
+
var calcTooltipPositions = function (mousePoint, rsList, seriesViewRect, paddingTop, hitTestRenderableSeries, allowTooltipOverlapping, pixelRatio) {
|
|
522
516
|
var res = [];
|
|
523
517
|
rsList.forEach(function (rs, index) {
|
|
524
518
|
var hitTestInfo = hitTestRenderableSeries(rs, mousePoint);
|
|
525
519
|
if (hitTestInfo) {
|
|
526
520
|
var seriesInfo = rs.getSeriesInfo(hitTestInfo);
|
|
527
521
|
var width = rs.rolloverModifierProps.tooltip.width;
|
|
522
|
+
var scaledWidth = width * pixelRatio;
|
|
528
523
|
var height = rs.rolloverModifierProps.tooltip.height;
|
|
529
|
-
var
|
|
524
|
+
var scaledHeight = height * pixelRatio;
|
|
525
|
+
var xDeltaCoord = seriesViewRect.width - hitTestInfo.xCoord < scaledWidth ? -width : 5;
|
|
530
526
|
var newRecord = {
|
|
531
527
|
index: index,
|
|
532
528
|
xValue: hitTestInfo.xValue,
|
|
@@ -535,10 +531,10 @@ var calcTooltipPositions = function (mousePoint, rsList, seriesViewRect, padding
|
|
|
535
531
|
yCoord: hitTestInfo.yCoord,
|
|
536
532
|
hitTestPointValues: hitTestInfo.hitTestPointValues,
|
|
537
533
|
isCategoryAxis: hitTestInfo.isCategoryAxis,
|
|
538
|
-
|
|
539
|
-
|
|
534
|
+
xCoordShift: xDeltaCoord,
|
|
535
|
+
yCoordShift: -height / 2,
|
|
540
536
|
isY1: false,
|
|
541
|
-
height:
|
|
537
|
+
height: scaledHeight,
|
|
542
538
|
seriesInfo: seriesInfo
|
|
543
539
|
};
|
|
544
540
|
if (rs.type !== SeriesType_1.ESeriesType.StackedColumnSeries || hitTestInfo.isHit) {
|
|
@@ -546,54 +542,44 @@ var calcTooltipPositions = function (mousePoint, rsList, seriesViewRect, padding
|
|
|
546
542
|
}
|
|
547
543
|
if (rs.type === SeriesType_1.ESeriesType.BandSeries) {
|
|
548
544
|
var width1 = rs.rolloverModifierProps1.tooltip.width;
|
|
545
|
+
var scaledWidth1 = width1 * pixelRatio;
|
|
549
546
|
var height1 = rs.rolloverModifierProps1.tooltip.height;
|
|
547
|
+
var scaledHeight1 = height1 * pixelRatio;
|
|
550
548
|
var seriesInfo1 = rs.getSeriesInfo(hitTestInfo);
|
|
551
549
|
seriesInfo1.isFirstSeries = false;
|
|
552
|
-
res.push(__assign(__assign({}, newRecord), { isY1: true, yValue: hitTestInfo.y1Value, yCoord: hitTestInfo.y1Coord,
|
|
550
|
+
res.push(__assign(__assign({}, newRecord), { isY1: true, yValue: hitTestInfo.y1Value, yCoord: hitTestInfo.y1Coord, xCoordShift: seriesViewRect.width - hitTestInfo.xCoord < scaledWidth1 ? -width1 : 5, yCoordShift: -height1 / 2, height: scaledHeight1, seriesInfo: seriesInfo1 }));
|
|
553
551
|
}
|
|
554
552
|
}
|
|
555
553
|
});
|
|
556
554
|
var orderedRes = res.sort(function (a, b) { return (a.yCoord > b.yCoord ? 1 : b.yCoord > a.yCoord ? -1 : 0); });
|
|
557
555
|
var length = res.length;
|
|
558
556
|
if (!allowTooltipOverlapping && length >= 2) {
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (orderedRes[i + 1].yCoord - orderedRes[i].yCoord < minDist) {
|
|
571
|
-
hasOverlap = true;
|
|
572
|
-
break;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
if (hasOverlap) {
|
|
576
|
-
var totalHeight = orderedRes.reduce(function (prev, cur) {
|
|
577
|
-
var res2 = prev + cur.height;
|
|
578
|
-
if (prev !== 0) {
|
|
579
|
-
res2 += paddingTop;
|
|
557
|
+
var checkHasOverlap = function () {
|
|
558
|
+
for (var i = 0; i < length - 1; i++) {
|
|
559
|
+
var orderedRes0 = orderedRes[i];
|
|
560
|
+
var orderedResRS0 = rsList[orderedRes0.index];
|
|
561
|
+
var orderedRes1 = orderedRes[i + 1];
|
|
562
|
+
var orderedResRS1 = rsList[orderedRes1.index];
|
|
563
|
+
var scaledHeightTooltip0 = orderedResRS0.rolloverModifierProps.tooltip.height * pixelRatio;
|
|
564
|
+
var scaledHeightTooltip1 = orderedResRS1.rolloverModifierProps.tooltip.height * pixelRatio;
|
|
565
|
+
var minDist = paddingTop + scaledHeightTooltip0 / 2 + scaledHeightTooltip1 / 2;
|
|
566
|
+
if (orderedRes1.yCoord - orderedRes0.yCoord < minDist) {
|
|
567
|
+
return true;
|
|
580
568
|
}
|
|
581
|
-
|
|
582
|
-
|
|
569
|
+
}
|
|
570
|
+
return false;
|
|
571
|
+
};
|
|
572
|
+
if (checkHasOverlap()) {
|
|
573
|
+
var totalHeight = orderedRes.reduce(function (prev, cur) { return (prev !== 0 ? prev + paddingTop + cur.height : prev + cur.height); }, 0);
|
|
574
|
+
var deltaYCoord = res[length - 1].yCoord - res[0].yCoord;
|
|
575
|
+
var centerY = res[0].yCoord + deltaYCoord / 2;
|
|
583
576
|
var initialY_1 = centerY - totalHeight / 2;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
prevSum_1 += prevEl_1.height + paddingTop;
|
|
593
|
-
el.yDeltaCoord = prevSum_1 - el.yCoord;
|
|
594
|
-
}
|
|
595
|
-
prevEl_1 = el;
|
|
596
|
-
});
|
|
577
|
+
orderedRes.reduce(function (prevSum, cur, index, arr) {
|
|
578
|
+
var sum = index === 0 ? initialY_1 : prevSum + arr[index - 1].height + paddingTop;
|
|
579
|
+
// need to get not scaled value
|
|
580
|
+
cur.yCoordShift = (sum - cur.yCoord) / pixelRatio;
|
|
581
|
+
return sum;
|
|
582
|
+
}, 0);
|
|
597
583
|
}
|
|
598
584
|
}
|
|
599
585
|
return orderedRes;
|
|
@@ -654,7 +640,7 @@ var updateRolloverModifierProps = function (rolloverRSProps, rs, tooltipProps, s
|
|
|
654
640
|
rolloverRSProps.tooltip.isHidden = false;
|
|
655
641
|
rolloverRSProps.tooltip.x1 = tooltipProps.xValue;
|
|
656
642
|
rolloverRSProps.tooltip.y1 = tooltipProps.yValue;
|
|
657
|
-
rolloverRSProps.tooltip.xCoordShift = tooltipProps.
|
|
658
|
-
rolloverRSProps.tooltip.yCoordShift = tooltipProps.
|
|
643
|
+
rolloverRSProps.tooltip.xCoordShift = tooltipProps.xCoordShift;
|
|
644
|
+
rolloverRSProps.tooltip.yCoordShift = tooltipProps.yCoordShift;
|
|
659
645
|
}
|
|
660
646
|
};
|