scichart 2.0.2204 → 2.1.2267
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/DataPointSelectionModifier.js +0 -1
- package/Charting/ChartModifiers/LegendModifier.d.ts +2 -2
- package/Charting/ChartModifiers/RolloverModifier.d.ts +5 -3
- package/Charting/ChartModifiers/RolloverModifier.js +38 -80
- package/Charting/Drawing/BrushCache.d.ts +8 -2
- package/Charting/Drawing/BrushCache.js +16 -8
- package/Charting/Drawing/WebGlRenderContext2D.d.ts +1 -0
- package/Charting/Drawing/WebGlRenderContext2D.js +4 -1
- package/Charting/LayoutManager/BaseAxisLayoutStrategy.d.ts +2 -0
- package/Charting/LayoutManager/BaseAxisLayoutStrategy.js +33 -0
- package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +19 -2
- package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +18 -2
- package/Charting/Model/BaseDataSeries.d.ts +42 -15
- package/Charting/Model/BaseDataSeries.js +77 -28
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +31 -23
- package/Charting/Model/BaseHeatmapDataSeries.js +45 -18
- package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.d.ts +23 -0
- package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +122 -0
- package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.d.ts +57 -0
- package/Charting/Model/DataDistributionCalculator/IDataDistributionCalculator.js +2 -0
- package/Charting/Model/Filters/OhlcFilterBase.d.ts +2 -2
- package/Charting/Model/Filters/XyFilterBase.d.ts +3 -3
- package/Charting/Model/Filters/XyMovingAverageFilter.js +1 -1
- package/Charting/Model/Filters/XyyFilterBase.d.ts +4 -4
- package/Charting/Model/Filters/XyzFilterBase.d.ts +4 -4
- package/Charting/Model/IDataSeries.d.ts +37 -5
- package/Charting/Model/OhlcDataSeries.d.ts +12 -11
- package/Charting/Model/OhlcDataSeries.js +47 -44
- package/Charting/Model/PointSeries/BasePointSeriesResampled.d.ts +21 -0
- package/Charting/Model/PointSeries/BasePointSeriesResampled.js +56 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +14 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +23 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +31 -0
- package/Charting/Model/PointSeries/IPointSeries.js +2 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesResampled.d.ts +13 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesResampled.js +59 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.d.ts +11 -0
- package/Charting/Model/PointSeries/OhlcPointSeriesWrapped.js +32 -0
- package/Charting/Model/PointSeries/XyPointSeriesResampled.d.ts +7 -0
- package/Charting/Model/PointSeries/XyPointSeriesResampled.js +27 -0
- package/Charting/Model/PointSeries/XyPointSeriesWrapped.d.ts +6 -0
- package/Charting/Model/PointSeries/XyPointSeriesWrapped.js +27 -0
- package/Charting/Model/PointSeries/XyyPointSeriesResampled.d.ts +10 -0
- package/Charting/Model/PointSeries/XyyPointSeriesResampled.js +48 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +8 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +29 -0
- package/Charting/Model/PointSeries/XyzPointSeriesWrapped.d.ts +8 -0
- package/Charting/Model/PointSeries/XyzPointSeriesWrapped.js +29 -0
- package/Charting/Model/XyDataSeries.d.ts +3 -2
- package/Charting/Model/XyDataSeries.js +26 -26
- package/Charting/Model/XyyDataSeries.d.ts +5 -5
- package/Charting/Model/XyyDataSeries.js +30 -27
- package/Charting/Model/XyzDataSeries.d.ts +5 -5
- package/Charting/Model/XyzDataSeries.js +30 -27
- package/Charting/Numerics/CoordinateCalculators/CategoryCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/FlippedCategoryCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.d.ts +2 -1
- package/Charting/Numerics/CoordinateCalculators/FlippedNumericCoordinateCalculator.js +6 -2
- package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.d.ts +2 -1
- package/Charting/Numerics/CoordinateCalculators/NumericCoordinateCalculator.js +6 -2
- package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.d.ts +54 -0
- package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +234 -0
- package/Charting/Numerics/Resamplers/ResamplingMode.d.ts +37 -0
- package/Charting/Numerics/Resamplers/ResamplingMode.js +41 -0
- package/Charting/Numerics/Resamplers/ResamplingParams.d.ts +39 -0
- package/Charting/Numerics/Resamplers/ResamplingParams.js +52 -0
- package/Charting/Services/RenderPassData.d.ts +6 -1
- package/Charting/Services/RenderPassData.js +5 -1
- package/Charting/Services/RenderPassInfo.d.ts +18 -0
- package/Charting/Services/RenderPassInfo.js +14 -0
- package/Charting/Services/SciChartRenderer.d.ts +14 -1
- package/Charting/Services/SciChartRenderer.js +125 -31
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +1 -1
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +1 -1
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +7 -2
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +23 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +71 -24
- package/Charting/Visuals/Axis/AxisCore.d.ts +11 -0
- package/Charting/Visuals/Axis/AxisCore.js +39 -18
- package/Charting/Visuals/Axis/AxisRenderer.d.ts +1 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +37 -10
- package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +51 -0
- package/Charting/Visuals/Axis/CategoryAxisBase.js +85 -20
- package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +5 -0
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +7 -4
- package/Charting/Visuals/Axis/NumericAxis.js +2 -2
- package/Charting/Visuals/Axis/constants.d.ts +1 -0
- package/Charting/Visuals/Axis/constants.js +1 -0
- package/Charting/Visuals/Legend/SciChartLegend.d.ts +6 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +30 -13
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +20 -6
- package/Charting/Visuals/Legend/SciChartLegendBase.js +22 -4
- package/Charting/Visuals/Legend/SciChartPieLegend.d.ts +2 -0
- package/Charting/Visuals/Legend/SciChartPieLegend.js +17 -6
- package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/Animations/SweepAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +6 -6
- package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +2 -2
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +9 -2
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +45 -1
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +12 -5
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +113 -0
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +42 -6
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +129 -21
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +36 -4
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +51 -3
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +38 -4
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +54 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +8 -14
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +4 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +5 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +31 -19
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +2 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +17 -21
- package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +16 -15
- package/Charting/Visuals/RenderableSeries/DrawingProviders/OhlcSeriesDrawingProvider.js +9 -15
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +4 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +16 -21
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +2 -9
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +0 -7
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +11 -2
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +17 -0
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +1 -0
- package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/BubbleSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/ColumnSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/OhlcSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/ScatterSeriesHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/StackedColumnSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/StackedMountainSeriesHitTestProvider.js +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -6
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +1 -1
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -1
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +38 -2
- package/Charting/Visuals/RenderableSeries/ISpline.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +4 -4
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +5 -5
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +3 -3
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -3
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +3 -3
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +0 -6
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +1 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +1 -7
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +6 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -3
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +6 -3
- package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/constants.js +3 -0
- package/Charting/Visuals/SciChartDefaults.d.ts +9 -1
- package/Charting/Visuals/SciChartDefaults.js +9 -1
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +4 -2
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +46 -32
- package/Charting/Visuals/SciChartSurface.d.ts +4 -4
- package/Charting/Visuals/SciChartSurface.js +18 -11
- package/Charting/Visuals/SciChartSurfaceBase.d.ts +3 -2
- package/Charting/Visuals/SciChartSurfaceBase.js +4 -4
- package/Charting/Visuals/createMaster.d.ts +1 -1
- package/Charting/Visuals/createMaster.js +11 -6
- package/Charting/Visuals/createSingle.d.ts +1 -1
- package/Charting/Visuals/createSingle.js +2 -2
- package/Charting/Visuals/licenseManager2D.js +21 -20
- package/Charting/Visuals/licenseManager2dState.d.ts +4 -0
- package/Charting/Visuals/licenseManager2dState.js +12 -0
- package/Charting/Visuals/loader.js +2 -0
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +22 -12
- package/Charting3D/Model/DataSeries/XyzDataSeries3D.d.ts +7 -7
- package/Charting3D/Model/DataSeries/XyzDataSeries3D.js +3 -3
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
- package/Charting3D/Visuals/SciChart3DSurface.js +3 -3
- package/Charting3D/Visuals/createMaster3d.d.ts +1 -1
- package/Charting3D/Visuals/createMaster3d.js +11 -6
- package/Charting3D/Visuals/createSingle3d.d.ts +1 -1
- package/Charting3D/Visuals/createSingle3d.js +2 -2
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/NumberRange.d.ts +1 -0
- package/Core/NumberRange.js +8 -0
- package/Core/OneTimePerformanceWarning.d.ts +6 -0
- package/Core/OneTimePerformanceWarning.js +19 -0
- package/Core/storage/localStorageApi.d.ts +9 -0
- package/Core/storage/localStorageApi.js +32 -0
- package/README.md +223 -1
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +95 -95
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +13 -13
- package/_wasm/scichart3d.wasm +0 -0
- package/constants/performanceWarnings.d.ts +5 -0
- package/constants/performanceWarnings.js +8 -0
- package/package.json +1 -1
- package/types/NumberArray.d.ts +1 -0
- package/types/NumberArray.js +5 -1
- package/types/SearchMode.d.ts +21 -0
- package/types/SearchMode.js +25 -0
- package/types/TSciChart.d.ts +144 -40
- package/types/TSciChart3D.d.ts +66 -28
- package/types/TStackedAxisLength.d.ts +4 -0
- package/types/TStackedAxisLength.js +4 -0
- package/utils/array.d.ts +7 -0
- package/utils/array.js +19 -1
- package/utils/calcAverage.d.ts +2 -2
- package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +19 -0
- package/utils/ccall/appendDoubleVectorFromJsArray.js +91 -0
- package/utils/hash.d.ts +7 -0
- package/utils/hash.js +35 -0
- package/utils/tooltip.d.ts +42 -0
- package/utils/tooltip.js +119 -0
- package/utils/ccall/fillDoubleVectorFromJsArray.d.ts +0 -3
- package/utils/ccall/fillDoubleVectorFromJsArray.js +0 -33
- package/utils/performance.d.ts +0 -5
- package/utils/performance.js +0 -11
|
@@ -410,7 +410,6 @@ var DataPointSelectionModifier = /** @class */ (function (_super) {
|
|
|
410
410
|
topYData = yCalc.getDataValue(_this.startPoint.y);
|
|
411
411
|
}
|
|
412
412
|
if (rs.dataSeries.type === IDataSeries_1.EDataSeriesType.HeatmapUniform) {
|
|
413
|
-
var heatmapSeries = rs.dataSeries;
|
|
414
413
|
// TODO: Heatmap series
|
|
415
414
|
}
|
|
416
415
|
else {
|
|
@@ -34,9 +34,9 @@ export interface ILegendModifierOptions extends IChartModifierBaseOptions {
|
|
|
34
34
|
*/
|
|
35
35
|
margin?: number;
|
|
36
36
|
/**
|
|
37
|
-
* The parent div element Id, the Legend will be appended to this element
|
|
37
|
+
* The parent div element Id or reference, the Legend will be appended to this element
|
|
38
38
|
*/
|
|
39
|
-
placementDivId?: string;
|
|
39
|
+
placementDivId?: string | HTMLDivElement;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* The LegendModifier provides interactive legend behavior on a 2D {@link SciChartSurface}
|
|
@@ -49,6 +49,7 @@ export declare type TTooltipProps = {
|
|
|
49
49
|
isCategoryAxis: boolean;
|
|
50
50
|
isY1: boolean;
|
|
51
51
|
height: number;
|
|
52
|
+
width: number;
|
|
52
53
|
seriesInfo: SeriesInfo;
|
|
53
54
|
};
|
|
54
55
|
/**
|
|
@@ -237,15 +238,16 @@ export declare class RolloverModifier extends ChartModifierBase2D implements IIn
|
|
|
237
238
|
* @param pixelRatio
|
|
238
239
|
* @param isY1
|
|
239
240
|
*/
|
|
240
|
-
export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, rolloverProps: RolloverModifierRenderableSeriesProps, seriesViewRect: Rect, xValue: number, yValue: number, absoluteXCoord: number, absoluteYCoord: number, hitTestInfo: HitTestInfo, pixelRatio: number, isY1?: boolean) => TTooltipProps;
|
|
241
|
+
export declare const calcTooltipProps: (index: number, rs: IRenderableSeries, rolloverProps: RolloverModifierRenderableSeriesProps, seriesViewRect: Rect, xValue: number, yValue: number, absoluteXCoord: number, absoluteYCoord: number, hitTestInfo: HitTestInfo, pixelRatio: number, isY1?: boolean, isVerticalChart?: boolean) => TTooltipProps;
|
|
241
242
|
/**
|
|
242
243
|
* @ignore
|
|
243
244
|
* @description Used internally, calculates tooltip positions to avoid overlapping
|
|
244
245
|
* @param tooltipArray
|
|
245
246
|
* @param allowTooltipOverlapping
|
|
246
|
-
* @param
|
|
247
|
+
* @param spacing
|
|
247
248
|
* @param seriesViewRect
|
|
248
249
|
* @param pixelRatio
|
|
250
|
+
* @param isVerticalChart
|
|
249
251
|
*/
|
|
250
|
-
export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean,
|
|
252
|
+
export declare const calcTooltipPositions: (tooltipArray: TTooltipProps[], allowTooltipOverlapping: boolean, spacing: number, seriesViewRect: Rect, pixelRatio: number, isVerticalChart?: boolean) => TTooltipProps[];
|
|
251
253
|
export {};
|
|
@@ -20,6 +20,7 @@ var classFactory_1 = require("../../Builder/classFactory");
|
|
|
20
20
|
var BaseType_1 = require("../../types/BaseType");
|
|
21
21
|
var ChartModifierType_1 = require("../../types/ChartModifierType");
|
|
22
22
|
var SeriesType_1 = require("../../types/SeriesType");
|
|
23
|
+
var tooltip_1 = require("../../utils/tooltip");
|
|
23
24
|
var translate_1 = require("../../utils/translate");
|
|
24
25
|
var AnnotationBase_1 = require("../Visuals/Annotations/AnnotationBase");
|
|
25
26
|
var LineAnnotation_1 = require("../Visuals/Annotations/LineAnnotation");
|
|
@@ -50,7 +51,7 @@ var EMousePosition;
|
|
|
50
51
|
EMousePosition["SeriesArea"] = "SeriesArea";
|
|
51
52
|
})(EMousePosition || (EMousePosition = {}));
|
|
52
53
|
/** @ignore */
|
|
53
|
-
var
|
|
54
|
+
var TOOLTIP_SPACING = 4;
|
|
54
55
|
/**
|
|
55
56
|
* The RolloverModifier provides tooltip and cursor behavior on a 2D {@link SciChartSurface}
|
|
56
57
|
* within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
|
|
@@ -518,7 +519,7 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
518
519
|
if (isVisible) {
|
|
519
520
|
var absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.yCoord : hitTestInfo.xCoord;
|
|
520
521
|
var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.yCoord;
|
|
521
|
-
var tooltipProps = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO);
|
|
522
|
+
var tooltipProps = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, false, _this.isVerticalChart());
|
|
522
523
|
if (tooltipProps)
|
|
523
524
|
tooltipArray.push(tooltipProps);
|
|
524
525
|
}
|
|
@@ -528,7 +529,7 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
528
529
|
if (isVisibleY1) {
|
|
529
530
|
var absoluteXCoord = _this.isVerticalChart() ? hitTestInfo.y1Coord : hitTestInfo.xCoord;
|
|
530
531
|
var absoluteYCoord = _this.isVerticalChart() ? hitTestInfo.xCoord : hitTestInfo.y1Coord;
|
|
531
|
-
var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps1, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.y1Value, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, true);
|
|
532
|
+
var tooltipY1Props = (0, exports.calcTooltipProps)(index, rs, rs.rolloverModifierProps1, _this.parentSurface.seriesViewRect, hitTestInfo.xValue, hitTestInfo.y1Value, absoluteXCoord, absoluteYCoord, hitTestInfo, DpiHelper_1.DpiHelper.PIXEL_RATIO, true, _this.isVerticalChart());
|
|
532
533
|
if (tooltipY1Props)
|
|
533
534
|
tooltipArray.push(tooltipY1Props);
|
|
534
535
|
}
|
|
@@ -538,7 +539,7 @@ var RolloverModifier = /** @class */ (function (_super) {
|
|
|
538
539
|
var orderedTooltipArray = tooltipArray.sort(function (a, b) {
|
|
539
540
|
return a.yCoord > b.yCoord ? 1 : b.yCoord > a.yCoord ? -1 : 0;
|
|
540
541
|
});
|
|
541
|
-
var tooltipPositions = (0, exports.calcTooltipPositions)(orderedTooltipArray, this.allowTooltipOverlapping,
|
|
542
|
+
var tooltipPositions = (0, exports.calcTooltipPositions)(orderedTooltipArray, this.allowTooltipOverlapping, TOOLTIP_SPACING * DpiHelper_1.DpiHelper.PIXEL_RATIO, this.parentSurface.seriesViewRect, DpiHelper_1.DpiHelper.PIXEL_RATIO, this.isVerticalChart());
|
|
542
543
|
tooltipPositions.forEach(function (el) {
|
|
543
544
|
var rs = rsList[el.index];
|
|
544
545
|
var showTooltip = _this.showTooltip && el.seriesInfo.isHit;
|
|
@@ -589,8 +590,9 @@ exports.RolloverModifier = RolloverModifier;
|
|
|
589
590
|
* @param pixelRatio
|
|
590
591
|
* @param isY1
|
|
591
592
|
*/
|
|
592
|
-
var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValue, yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, pixelRatio, isY1) {
|
|
593
|
+
var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValue, yValue, absoluteXCoord, absoluteYCoord, hitTestInfo, pixelRatio, isY1, isVerticalChart) {
|
|
593
594
|
if (isY1 === void 0) { isY1 = false; }
|
|
595
|
+
if (isVerticalChart === void 0) { isVerticalChart = false; }
|
|
594
596
|
var visibleRange = rs.yAxis.visibleRange;
|
|
595
597
|
var isVisible = visibleRange.min <= yValue && yValue <= visibleRange.max;
|
|
596
598
|
if (isVisible) {
|
|
@@ -601,13 +603,21 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
|
|
|
601
603
|
var scaledHeight = height * pixelRatio;
|
|
602
604
|
var distTop = absoluteYCoord;
|
|
603
605
|
var distBottom = seriesViewRect.height - absoluteYCoord;
|
|
606
|
+
var defaultVerticalShift = 5 * pixelRatio;
|
|
604
607
|
var xCoordShift = seriesViewRect.width - absoluteXCoord < scaledWidth ? -width : 5;
|
|
605
|
-
var yCoordShift = -height / 2;
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
+
var yCoordShift = isVerticalChart ? defaultVerticalShift : -height / 2;
|
|
609
|
+
if (isVerticalChart) {
|
|
610
|
+
if (distBottom < scaledHeight + defaultVerticalShift) {
|
|
611
|
+
yCoordShift = ((scaledHeight + defaultVerticalShift) / pixelRatio) * -1;
|
|
612
|
+
}
|
|
608
613
|
}
|
|
609
|
-
else
|
|
610
|
-
|
|
614
|
+
else {
|
|
615
|
+
if (distTop < scaledHeight / 2) {
|
|
616
|
+
yCoordShift = -distTop / pixelRatio;
|
|
617
|
+
}
|
|
618
|
+
else if (distBottom < scaledHeight / 2) {
|
|
619
|
+
yCoordShift = -(scaledHeight - distBottom) / pixelRatio;
|
|
620
|
+
}
|
|
611
621
|
}
|
|
612
622
|
var newRecord = {
|
|
613
623
|
index: index,
|
|
@@ -621,6 +631,7 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
|
|
|
621
631
|
xCoordShift: xCoordShift,
|
|
622
632
|
yCoordShift: yCoordShift,
|
|
623
633
|
height: scaledHeight,
|
|
634
|
+
width: scaledWidth,
|
|
624
635
|
seriesInfo: seriesInfo
|
|
625
636
|
};
|
|
626
637
|
return newRecord;
|
|
@@ -628,85 +639,32 @@ var calcTooltipProps = function (index, rs, rolloverProps, seriesViewRect, xValu
|
|
|
628
639
|
return undefined;
|
|
629
640
|
};
|
|
630
641
|
exports.calcTooltipProps = calcTooltipProps;
|
|
631
|
-
/** @ignore */
|
|
632
|
-
var spreadTooltips = function (tooltipArray, totalTooltipsHeight, startY, endY, pixelRatio) {
|
|
633
|
-
var currentTotalPadding = endY - startY - totalTooltipsHeight;
|
|
634
|
-
var currentPadding = currentTotalPadding / (tooltipArray.length - 1);
|
|
635
|
-
tooltipArray.reduce(function (tooltipTopYCoord, tooltip) {
|
|
636
|
-
tooltip.yCoordShift = (tooltipTopYCoord - tooltip.yCoord) / pixelRatio;
|
|
637
|
-
return tooltipTopYCoord + tooltip.height + currentPadding;
|
|
638
|
-
}, startY);
|
|
639
|
-
};
|
|
640
642
|
/**
|
|
641
643
|
* @ignore
|
|
642
644
|
* @description Used internally, calculates tooltip positions to avoid overlapping
|
|
643
645
|
* @param tooltipArray
|
|
644
646
|
* @param allowTooltipOverlapping
|
|
645
|
-
* @param
|
|
647
|
+
* @param spacing
|
|
646
648
|
* @param seriesViewRect
|
|
647
649
|
* @param pixelRatio
|
|
650
|
+
* @param isVerticalChart
|
|
648
651
|
*/
|
|
649
|
-
var calcTooltipPositions = function (tooltipArray, allowTooltipOverlapping,
|
|
652
|
+
var calcTooltipPositions = function (tooltipArray, allowTooltipOverlapping, spacing, seriesViewRect, pixelRatio, isVerticalChart) {
|
|
653
|
+
if (isVerticalChart === void 0) { isVerticalChart = false; }
|
|
654
|
+
var positionProperties = (0, tooltip_1.getTooltipPositionProperties)(isVerticalChart);
|
|
655
|
+
var hasOverlap = (0, tooltip_1.checkHasOverlap)(tooltipArray, spacing, pixelRatio, positionProperties);
|
|
650
656
|
var length = tooltipArray.length;
|
|
651
|
-
if (!allowTooltipOverlapping && length >= 2) {
|
|
652
|
-
var
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
if (diff < tooltipPaddingTop)
|
|
663
|
-
return true;
|
|
664
|
-
}
|
|
665
|
-
return false;
|
|
666
|
-
};
|
|
667
|
-
if (checkHasOverlap()) {
|
|
668
|
-
var totalTooltipsHeight = tooltipArray.reduce(function (prev, cur) { return prev + cur.height; }, 0);
|
|
669
|
-
var totalPadding = (length - 1) * tooltipPaddingTop;
|
|
670
|
-
var totalTooltipsHeightWithPadding = totalTooltipsHeight + totalPadding;
|
|
671
|
-
var notEnoughViewRectHeight = seriesViewRect.height <= totalTooltipsHeightWithPadding;
|
|
672
|
-
if (notEnoughViewRectHeight) {
|
|
673
|
-
var deltaYCoord = tooltipArray[length - 1].yCoord - tooltipArray[0].yCoord;
|
|
674
|
-
var centerY = tooltipArray[0].yCoord + deltaYCoord / 2;
|
|
675
|
-
var initialY_1 = centerY - totalTooltipsHeight / 2;
|
|
676
|
-
tooltipArray.reduce(function (prevSum, cur, index, arr) {
|
|
677
|
-
var sum = index === 0 ? initialY_1 : prevSum + arr[index - 1].height + tooltipPaddingTop;
|
|
678
|
-
// need to get not scaled value
|
|
679
|
-
cur.yCoordShift = (sum - cur.yCoord) / pixelRatio;
|
|
680
|
-
return sum;
|
|
681
|
-
}, 0);
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
var firstTooltip = tooltipArray[0];
|
|
685
|
-
var lastTooltip = tooltipArray[length - 1];
|
|
686
|
-
var startY = firstTooltip.yCoord + firstTooltip.yCoordShift * pixelRatio;
|
|
687
|
-
var endY = lastTooltip.yCoord + lastTooltip.yCoordShift * pixelRatio + lastTooltip.height;
|
|
688
|
-
var isEnoughHeight = endY - startY >= totalTooltipsHeightWithPadding;
|
|
689
|
-
if (isEnoughHeight) {
|
|
690
|
-
spreadTooltips(tooltipArray, totalTooltipsHeight, startY, endY, pixelRatio);
|
|
691
|
-
}
|
|
692
|
-
else {
|
|
693
|
-
var additionalHeightNeeded = totalTooltipsHeightWithPadding - (endY - startY);
|
|
694
|
-
var availableHeightFromStart = startY;
|
|
695
|
-
var availableHeightFromEnd = seriesViewRect.height - endY;
|
|
696
|
-
var newStartY = startY - additionalHeightNeeded / 2;
|
|
697
|
-
var newEndY = endY + additionalHeightNeeded / 2;
|
|
698
|
-
if (availableHeightFromStart < additionalHeightNeeded / 2) {
|
|
699
|
-
newStartY = 0;
|
|
700
|
-
newEndY = endY + (additionalHeightNeeded - availableHeightFromStart);
|
|
701
|
-
}
|
|
702
|
-
else if (availableHeightFromEnd < additionalHeightNeeded / 2) {
|
|
703
|
-
newStartY = startY - (additionalHeightNeeded - availableHeightFromEnd);
|
|
704
|
-
newEndY = seriesViewRect.height;
|
|
705
|
-
}
|
|
706
|
-
spreadTooltips(tooltipArray, totalTooltipsHeight, newStartY, newEndY, pixelRatio);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
}
|
|
657
|
+
if (!allowTooltipOverlapping && length >= 2 && hasOverlap) {
|
|
658
|
+
var spreadMap_1 = (0, tooltip_1.spreadTooltips)(tooltipArray, pixelRatio, positionProperties, spacing, seriesViewRect);
|
|
659
|
+
tooltipArray.forEach(function (tooltip) {
|
|
660
|
+
tooltip[positionProperties.shiftPropertyName] = spreadMap_1.get(tooltip.index);
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
// centering for vertical charts without overlapping
|
|
664
|
+
if (isVerticalChart && !hasOverlap) {
|
|
665
|
+
tooltipArray.forEach(function (tooltip) {
|
|
666
|
+
return (tooltip[positionProperties.shiftPropertyName] = -(tooltip.width / 2) / pixelRatio);
|
|
667
|
+
});
|
|
710
668
|
}
|
|
711
669
|
return tooltipArray;
|
|
712
670
|
};
|
|
@@ -10,14 +10,18 @@ export declare class BrushCache extends BaseCache<WebGlBrush> {
|
|
|
10
10
|
private opacity;
|
|
11
11
|
private fillLinearGradient;
|
|
12
12
|
private canvasTexture;
|
|
13
|
+
private textureHeightRatio;
|
|
14
|
+
private textureWidthRatio;
|
|
13
15
|
get value(): WebGlBrush;
|
|
14
16
|
/**
|
|
15
17
|
* Creates or fetches a new brush with the specified params
|
|
16
18
|
* @param fill
|
|
17
19
|
* @param opacity
|
|
20
|
+
* @param textureHeightRatio
|
|
21
|
+
* @param textureWidthRatio
|
|
18
22
|
* @param fillLinearGradient
|
|
19
23
|
*/
|
|
20
|
-
create(fill: string, opacity: number, fillLinearGradient?: GradientParams): WebGlBrush;
|
|
24
|
+
create(fill: string, opacity: number, textureHeightRatio?: number, textureWidthRatio?: number, fillLinearGradient?: GradientParams): WebGlBrush;
|
|
21
25
|
invalidateCache(): void;
|
|
22
26
|
reset(): void;
|
|
23
27
|
delete(): void;
|
|
@@ -43,7 +47,9 @@ export declare const getScrtBrushFromCache: (cache: BrushCache) => SCRTBrush;
|
|
|
43
47
|
* @param cache The object that will store a brush
|
|
44
48
|
* @param fill The HTML Color code
|
|
45
49
|
* @param opacity The opacity factor.
|
|
50
|
+
* @param textureHeightRatio The height ratio of the main canvas to the WebGl canvas.
|
|
51
|
+
* @param textureWidthRatio The width ratio of the main canvas to the WebGl canvas.
|
|
46
52
|
* @param fillGradientLinear The gradient params.
|
|
47
53
|
* @returns new or existing instance of {@link SCRTBrush}}
|
|
48
54
|
*/
|
|
49
|
-
export declare const createBrushInCache: (cache: BrushCache, fill: string, opacity: number, fillGradientLinear?: GradientParams) => SCRTBrush;
|
|
55
|
+
export declare const createBrushInCache: (cache: BrushCache, fill: string, opacity: number, textureHeightRatio?: number, textureWidthRatio?: number, fillGradientLinear?: GradientParams) => SCRTBrush;
|
|
@@ -35,7 +35,7 @@ var BrushCache = /** @class */ (function (_super) {
|
|
|
35
35
|
Object.defineProperty(BrushCache.prototype, "value", {
|
|
36
36
|
get: function () {
|
|
37
37
|
if (!this.cachedEntity && (this.fill || this.fillLinearGradient)) {
|
|
38
|
-
this.cachedEntity = this.create(this.fill, this.opacity, this.fillLinearGradient);
|
|
38
|
+
this.cachedEntity = this.create(this.fill, this.opacity, this.textureHeightRatio, this.textureWidthRatio, this.fillLinearGradient);
|
|
39
39
|
}
|
|
40
40
|
return this.cachedEntity;
|
|
41
41
|
},
|
|
@@ -46,18 +46,24 @@ var BrushCache = /** @class */ (function (_super) {
|
|
|
46
46
|
* Creates or fetches a new brush with the specified params
|
|
47
47
|
* @param fill
|
|
48
48
|
* @param opacity
|
|
49
|
+
* @param textureHeightRatio
|
|
50
|
+
* @param textureWidthRatio
|
|
49
51
|
* @param fillLinearGradient
|
|
50
52
|
*/
|
|
51
|
-
BrushCache.prototype.create = function (fill, opacity, fillLinearGradient) {
|
|
53
|
+
BrushCache.prototype.create = function (fill, opacity, textureHeightRatio, textureWidthRatio, fillLinearGradient) {
|
|
52
54
|
if (this.cachedEntity &&
|
|
53
55
|
fill === this.fill &&
|
|
54
56
|
opacity === this.opacity &&
|
|
57
|
+
textureHeightRatio === this.textureHeightRatio &&
|
|
58
|
+
textureWidthRatio === this.textureWidthRatio &&
|
|
55
59
|
fillLinearGradient === this.fillLinearGradient) {
|
|
56
60
|
return this.cachedEntity;
|
|
57
61
|
}
|
|
58
62
|
this.invalidateCache();
|
|
59
63
|
this.fill = fill;
|
|
60
64
|
this.opacity = opacity;
|
|
65
|
+
this.textureHeightRatio = textureHeightRatio;
|
|
66
|
+
this.textureWidthRatio = textureWidthRatio;
|
|
61
67
|
this.fillLinearGradient = fillLinearGradient;
|
|
62
68
|
var brush = fillLinearGradient ? this.createGradientBrush() : this.createSolidBrush(fill, opacity);
|
|
63
69
|
return (this.cachedEntity = new WebGlBrush_1.WebGlBrush(brush));
|
|
@@ -89,10 +95,10 @@ var BrushCache = /** @class */ (function (_super) {
|
|
|
89
95
|
this.canvasTexture.clear();
|
|
90
96
|
var ctx = this.canvasTexture.getContext();
|
|
91
97
|
// BEGIN: Drawing gradient rectangle on canvas2D
|
|
92
|
-
var x1 = convertRelativeToAbsolute(startPoint.x, TEXTURE_SIZE);
|
|
93
|
-
var y1 = convertRelativeToAbsolute(startPoint.y, TEXTURE_SIZE);
|
|
94
|
-
var x2 = convertRelativeToAbsolute(endPoint.x, TEXTURE_SIZE);
|
|
95
|
-
var y2 = convertRelativeToAbsolute(endPoint.y, TEXTURE_SIZE);
|
|
98
|
+
var x1 = convertRelativeToAbsolute(startPoint.x, TEXTURE_SIZE * this.textureWidthRatio);
|
|
99
|
+
var y1 = convertRelativeToAbsolute(startPoint.y, TEXTURE_SIZE * this.textureHeightRatio);
|
|
100
|
+
var x2 = convertRelativeToAbsolute(endPoint.x, TEXTURE_SIZE * this.textureWidthRatio);
|
|
101
|
+
var y2 = convertRelativeToAbsolute(endPoint.y, TEXTURE_SIZE * this.textureHeightRatio);
|
|
96
102
|
var gradient = ctx.createLinearGradient(x1, y1, x2, y2);
|
|
97
103
|
gradientStops.forEach(function (el) {
|
|
98
104
|
gradient.addColorStop(el.offset, el.color);
|
|
@@ -133,12 +139,14 @@ exports.getScrtBrushFromCache = getScrtBrushFromCache;
|
|
|
133
139
|
* @param cache The object that will store a brush
|
|
134
140
|
* @param fill The HTML Color code
|
|
135
141
|
* @param opacity The opacity factor.
|
|
142
|
+
* @param textureHeightRatio The height ratio of the main canvas to the WebGl canvas.
|
|
143
|
+
* @param textureWidthRatio The width ratio of the main canvas to the WebGl canvas.
|
|
136
144
|
* @param fillGradientLinear The gradient params.
|
|
137
145
|
* @returns new or existing instance of {@link SCRTBrush}}
|
|
138
146
|
*/
|
|
139
|
-
var createBrushInCache = function (cache, fill, opacity, fillGradientLinear) {
|
|
147
|
+
var createBrushInCache = function (cache, fill, opacity, textureHeightRatio, textureWidthRatio, fillGradientLinear) {
|
|
140
148
|
Guard_1.Guard.notNull(cache, "brushCache");
|
|
141
|
-
var brush = cache.create(fill, opacity, fillGradientLinear);
|
|
149
|
+
var brush = cache.create(fill, opacity, textureHeightRatio, textureWidthRatio, fillGradientLinear);
|
|
142
150
|
return brush.scrtBrush;
|
|
143
151
|
};
|
|
144
152
|
exports.createBrushInCache = createBrushInCache;
|
|
@@ -39,6 +39,7 @@ export declare class WebGlRenderContext2D implements IRenderContext2D {
|
|
|
39
39
|
private readonly layers;
|
|
40
40
|
private readonly webAssemblyContext;
|
|
41
41
|
private readonly effects;
|
|
42
|
+
private nativeContext;
|
|
42
43
|
/**
|
|
43
44
|
* Creates an instance of the WebGlRenderContext2D
|
|
44
45
|
* @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing native methods and access to our WebGL2 Engine
|
|
@@ -43,7 +43,10 @@ var WebGlRenderContext2D = /** @class */ (function () {
|
|
|
43
43
|
* Get the native {@link SCRTRenderContext} for direct access to SciChart's WebAssembly Visual Xccelerator engine
|
|
44
44
|
*/
|
|
45
45
|
WebGlRenderContext2D.prototype.getNativeContext = function () {
|
|
46
|
-
|
|
46
|
+
if (!this.nativeContext) {
|
|
47
|
+
this.nativeContext = this.webAssemblyContext.SCRTGetMainRenderContext2D();
|
|
48
|
+
}
|
|
49
|
+
return this.nativeContext;
|
|
47
50
|
};
|
|
48
51
|
/**
|
|
49
52
|
* Draw lines: grid lines, etc.
|
|
@@ -36,4 +36,6 @@ export declare abstract class BaseAxisLayoutStrategy {
|
|
|
36
36
|
protected layoutAxesFromTopToBottom(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
|
|
37
37
|
protected layoutAxesFromLeftToRight(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
|
|
38
38
|
protected layoutAxesFromRightToLeft(left: number, top: number, right: number, bottom: number, axes: AxisBase2D[]): void;
|
|
39
|
+
protected calculateTotalAxisHeight(axis: AxisBase2D, totalAxisAreaHeight: number): number;
|
|
40
|
+
protected calculateTotalAxisWidth(axis: AxisBase2D, totalAxisAreaHeight: number): number;
|
|
39
41
|
}
|
|
@@ -56,6 +56,39 @@ var BaseAxisLayoutStrategy = /** @class */ (function () {
|
|
|
56
56
|
(0, AxisLayoutHelpers_1.layoutAxisParts)(axis, _this.layoutAxisPartsStrategy);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
+
BaseAxisLayoutStrategy.prototype.calculateTotalAxisHeight = function (axis, totalAxisAreaHeight) {
|
|
60
|
+
return (parseSize(axis.stackedAxisLength, totalAxisAreaHeight) +
|
|
61
|
+
axis.axisLayoutState.additionalBottomSize +
|
|
62
|
+
axis.axisLayoutState.additionalTopSize);
|
|
63
|
+
};
|
|
64
|
+
BaseAxisLayoutStrategy.prototype.calculateTotalAxisWidth = function (axis, totalAxisAreaHeight) {
|
|
65
|
+
return (parseSize(axis.stackedAxisLength, totalAxisAreaHeight) +
|
|
66
|
+
axis.axisLayoutState.additionalRightSize +
|
|
67
|
+
axis.axisLayoutState.additionalLeftSize);
|
|
68
|
+
};
|
|
59
69
|
return BaseAxisLayoutStrategy;
|
|
60
70
|
}());
|
|
61
71
|
exports.BaseAxisLayoutStrategy = BaseAxisLayoutStrategy;
|
|
72
|
+
var parseSize = function (value, containerSize) {
|
|
73
|
+
if (typeof value === "number") {
|
|
74
|
+
if (value < 0) {
|
|
75
|
+
throw new Error("stackedAxisLength must be a positive value!");
|
|
76
|
+
}
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
if (value.includes("%")) {
|
|
80
|
+
return parsePc(value, containerSize);
|
|
81
|
+
}
|
|
82
|
+
var parsedValue = parseFloat(value);
|
|
83
|
+
if (!isNaN(parsedValue)) {
|
|
84
|
+
return parsedValue;
|
|
85
|
+
}
|
|
86
|
+
throw new Error("stackedAxisLength must be a number or a percentage");
|
|
87
|
+
};
|
|
88
|
+
var parsePc = function (value, containerSize) {
|
|
89
|
+
var parsedPercentageValue = parseFloat(value);
|
|
90
|
+
if (parsedPercentageValue < 0 || parsedPercentageValue > 100) {
|
|
91
|
+
throw new Error("stackedAxisLength percentage must be from 0 to 100");
|
|
92
|
+
}
|
|
93
|
+
return Math.round((containerSize * parsedPercentageValue) / 10) / 10;
|
|
94
|
+
};
|
|
@@ -50,14 +50,30 @@ var BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy = /** @class */ (fun
|
|
|
50
50
|
BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
|
|
51
51
|
var _this = this;
|
|
52
52
|
var totalAxisAreaWidth = right - left;
|
|
53
|
-
var singleAxisReservedWidth = totalAxisAreaWidth / axes.length;
|
|
54
53
|
var firstAxis = axes[0];
|
|
54
|
+
var lastAxis = axes[axes.length - 1];
|
|
55
|
+
var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
|
|
56
|
+
var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaWidth +
|
|
57
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
|
|
58
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize));
|
|
59
|
+
var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisWidth(axis, spaceWithoutBorders); }, 0);
|
|
60
|
+
var availableSpaceForAxes = totalAxisAreaWidth +
|
|
61
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
|
|
62
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize) -
|
|
63
|
+
totalDefinedAxesLength;
|
|
64
|
+
if (availableSpaceForAxes < 0) {
|
|
65
|
+
throw new Error("Bottom stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
|
|
66
|
+
}
|
|
67
|
+
var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
|
|
55
68
|
var leftOffset = left - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize);
|
|
56
69
|
axes.forEach(function (axis) {
|
|
57
70
|
var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalRightSize = _a.additionalRightSize, additionalTopSize = _a.additionalTopSize;
|
|
58
71
|
var topOffset = top + additionalTopSize;
|
|
59
72
|
var bottomOffset = topOffset + axisSize;
|
|
60
|
-
var
|
|
73
|
+
var axisReservedHeight = axis.stackedAxisLength
|
|
74
|
+
? _this.calculateTotalAxisWidth(axis, spaceWithoutBorders)
|
|
75
|
+
: defaultAxisReservedHeight;
|
|
76
|
+
var rightOffset = leftOffset + axisReservedHeight - additionalRightSize;
|
|
61
77
|
leftOffset += additionalLeftSize;
|
|
62
78
|
axis.offset = leftOffset - left;
|
|
63
79
|
axis.axisLength = rightOffset - leftOffset;
|
|
@@ -49,15 +49,32 @@ var LeftAlignedOuterVerticallyStackedAxisLayoutStrategy = /** @class */ (functio
|
|
|
49
49
|
};
|
|
50
50
|
LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
|
|
51
51
|
var _this = this;
|
|
52
|
+
// doesn't include top border of the first and bottom border of the last axis
|
|
52
53
|
var totalAxisAreaHeight = bottom - top;
|
|
53
|
-
var singleAxisReservedHeight = totalAxisAreaHeight / axes.length;
|
|
54
54
|
var firstAxis = axes[0];
|
|
55
|
+
var lastAxis = axes[axes.length - 1];
|
|
56
|
+
var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
|
|
57
|
+
var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaHeight +
|
|
58
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
|
|
59
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize));
|
|
60
|
+
var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisHeight(axis, spaceWithoutBorders); }, 0);
|
|
61
|
+
var availableSpaceForAxes = totalAxisAreaHeight +
|
|
62
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
|
|
63
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize) -
|
|
64
|
+
totalDefinedAxesLength;
|
|
65
|
+
if (availableSpaceForAxes < 0) {
|
|
66
|
+
throw new Error("Left stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
|
|
67
|
+
}
|
|
68
|
+
var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
|
|
55
69
|
var topOffset = top - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize);
|
|
56
70
|
axes.forEach(function (axis) {
|
|
57
71
|
var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalRightSize = _a.additionalRightSize, additionalBottomSize = _a.additionalBottomSize, additionalTopSize = _a.additionalTopSize;
|
|
58
72
|
var rightOffset = right - additionalRightSize;
|
|
59
73
|
var leftOffset = rightOffset - axisSize;
|
|
60
|
-
var
|
|
74
|
+
var axisReservedHeight = axis.stackedAxisLength
|
|
75
|
+
? _this.calculateTotalAxisHeight(axis, spaceWithoutBorders)
|
|
76
|
+
: defaultAxisReservedHeight;
|
|
77
|
+
var bottomOffset = topOffset + axisReservedHeight - additionalBottomSize;
|
|
61
78
|
topOffset += additionalTopSize;
|
|
62
79
|
axis.offset = topOffset - top;
|
|
63
80
|
axis.axisLength = bottomOffset - topOffset;
|
|
@@ -50,14 +50,30 @@ var RightAlignedOuterVerticallyStackedAxisLayoutStrategy = /** @class */ (functi
|
|
|
50
50
|
RightAlignedOuterVerticallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
|
|
51
51
|
var _this = this;
|
|
52
52
|
var totalAxisAreaHeight = bottom - top;
|
|
53
|
-
var singleAxisReservedHeight = totalAxisAreaHeight / axes.length;
|
|
54
53
|
var firstAxis = axes[0];
|
|
54
|
+
var lastAxis = axes[axes.length - 1];
|
|
55
|
+
var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
|
|
56
|
+
var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaHeight +
|
|
57
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
|
|
58
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize));
|
|
59
|
+
var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisHeight(axis, spaceWithoutBorders); }, 0);
|
|
60
|
+
var availableSpaceForAxes = totalAxisAreaHeight +
|
|
61
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize) +
|
|
62
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalBottomSize) -
|
|
63
|
+
totalDefinedAxesLength;
|
|
64
|
+
if (availableSpaceForAxes < 0) {
|
|
65
|
+
throw new Error("Right stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
|
|
66
|
+
}
|
|
67
|
+
var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
|
|
55
68
|
var topOffset = top - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalTopSize);
|
|
56
69
|
axes.forEach(function (axis) {
|
|
57
70
|
var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalBottomSize = _a.additionalBottomSize, additionalTopSize = _a.additionalTopSize;
|
|
58
71
|
var leftOffset = left + additionalLeftSize;
|
|
59
72
|
var rightOffset = leftOffset + axisSize;
|
|
60
|
-
var
|
|
73
|
+
var axisReservedHeight = axis.stackedAxisLength
|
|
74
|
+
? _this.calculateTotalAxisHeight(axis, spaceWithoutBorders)
|
|
75
|
+
: defaultAxisReservedHeight;
|
|
76
|
+
var bottomOffset = topOffset + axisReservedHeight - additionalBottomSize;
|
|
61
77
|
topOffset += additionalTopSize;
|
|
62
78
|
axis.offset = topOffset - top;
|
|
63
79
|
axis.axisLength = bottomOffset - topOffset;
|
|
@@ -50,14 +50,30 @@ var TopAlignedOuterHorizontallyStackedAxisLayoutStrategy = /** @class */ (functi
|
|
|
50
50
|
TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.prototype.layoutAxes = function (left, top, right, bottom, axes) {
|
|
51
51
|
var _this = this;
|
|
52
52
|
var totalAxisAreaWidth = right - left;
|
|
53
|
-
var singleAxisReservedWidth = totalAxisAreaWidth / axes.length;
|
|
54
53
|
var firstAxis = axes[0];
|
|
54
|
+
var lastAxis = axes[axes.length - 1];
|
|
55
|
+
var axesWithDefinedLength = axes.filter(function (axis) { return axis.stackedAxisLength; });
|
|
56
|
+
var spaceWithoutBorders = axes.reduce(function (acc, axis) { return acc - axis.axisLayoutState.additionalBottomSize - axis.axisLayoutState.additionalTopSize; }, totalAxisAreaWidth +
|
|
57
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
|
|
58
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize));
|
|
59
|
+
var totalDefinedAxesLength = axesWithDefinedLength.reduce(function (acc, axis) { return acc + _this.calculateTotalAxisWidth(axis, spaceWithoutBorders); }, 0);
|
|
60
|
+
var availableSpaceForAxes = totalAxisAreaWidth +
|
|
61
|
+
(firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize) +
|
|
62
|
+
(lastAxis === null || lastAxis === void 0 ? void 0 : lastAxis.axisLayoutState.additionalRightSize) -
|
|
63
|
+
totalDefinedAxesLength;
|
|
64
|
+
if (availableSpaceForAxes < 0) {
|
|
65
|
+
throw new Error("Top stacked axes with defined size total ".concat(totalDefinedAxesLength, " pixels which is ").concat(-availableSpaceForAxes, " more than the space available"));
|
|
66
|
+
}
|
|
67
|
+
var defaultAxisReservedHeight = availableSpaceForAxes / (axes.length - axesWithDefinedLength.length);
|
|
55
68
|
var leftOffset = left - (firstAxis === null || firstAxis === void 0 ? void 0 : firstAxis.axisLayoutState.additionalLeftSize);
|
|
56
69
|
axes.forEach(function (axis) {
|
|
57
70
|
var _a = axis.axisLayoutState, axisSize = _a.axisSize, additionalLeftSize = _a.additionalLeftSize, additionalRightSize = _a.additionalRightSize, additionalBottomSize = _a.additionalBottomSize;
|
|
58
71
|
var bottomOffset = bottom - additionalBottomSize;
|
|
59
72
|
var topOffset = bottomOffset - axisSize;
|
|
60
|
-
var
|
|
73
|
+
var axisReservedHeight = axis.stackedAxisLength
|
|
74
|
+
? _this.calculateTotalAxisWidth(axis, spaceWithoutBorders)
|
|
75
|
+
: defaultAxisReservedHeight;
|
|
76
|
+
var rightOffset = leftOffset + axisReservedHeight - additionalRightSize;
|
|
61
77
|
leftOffset += additionalLeftSize;
|
|
62
78
|
axis.offset = leftOffset - left;
|
|
63
79
|
axis.axisLength = rightOffset - leftOffset;
|