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
|
@@ -361,7 +361,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
361
361
|
return this.textureManager.createAxisMarkerTexture(axisAlignment, text, fontStyle, fontWeight, fontSize, fontFamily, color, 2 * DpiHelper_1.DpiHelper.PIXEL_RATIO, backgroundColor, opacity);
|
|
362
362
|
};
|
|
363
363
|
AxisRenderer.prototype.createAxisMarkerFromImage = function (image, imageWidth, imageHeight) {
|
|
364
|
-
return this.textureManager.
|
|
364
|
+
return this.textureManager.createTextureFromImage(image, imageWidth, imageHeight);
|
|
365
365
|
};
|
|
366
366
|
AxisRenderer.prototype.createAnnotationLabelTexture = function (text, textStyle, backgroundColor, displayVertically, displayMirrored, opacity) {
|
|
367
367
|
return this.textureManager.createSimpleTextTexture(text, __assign(__assign({}, textStyle), { padding: new Thickness_1.Thickness(2, 2, 2, 2) }), backgroundColor, displayVertically, displayMirrored, opacity);
|
|
@@ -71,11 +71,24 @@ export interface IAxisCoreOptions {
|
|
|
71
71
|
* The number of ticks on the axis will never exceed this number, but may be smaller than this number when zooming or panning.
|
|
72
72
|
*/
|
|
73
73
|
maxAutoTicks?: number;
|
|
74
|
+
/**
|
|
75
|
+
* When {@link AxisCore.autoTicks} is true, minorsPerMajor is a hint of how many minor
|
|
76
|
+
* gridlines should be drawn between each major gridline
|
|
77
|
+
*/
|
|
78
|
+
minorsPerMajor?: number;
|
|
74
79
|
/**
|
|
75
80
|
* When true, the {@link AxisCore.majorDelta} and {@link AxisCore.minorDelta} values will be computed automatically.
|
|
76
81
|
* Else, the user may specify these values by setting the properties.
|
|
77
82
|
*/
|
|
78
83
|
autoTicks?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* The MajorDelta is the spacing between major gridlines and axis labels. Available when {@link AxisCore.autoTicks} is false
|
|
86
|
+
*/
|
|
87
|
+
majorDelta?: number;
|
|
88
|
+
/**
|
|
89
|
+
* The MinorDelta is the spacing between major gridlines and axis labels. Available when {@link AxisCore.autoTicks} is false
|
|
90
|
+
*/
|
|
91
|
+
minorDelta?: number;
|
|
79
92
|
/**
|
|
80
93
|
* When true, draw labels on the chart, else labels are hidden
|
|
81
94
|
* @remarks Default value when undefined is true
|
|
@@ -84,7 +84,7 @@ export declare abstract class LabelProvider {
|
|
|
84
84
|
applyFormat(value: string): string;
|
|
85
85
|
toJSON(): {
|
|
86
86
|
type: string;
|
|
87
|
-
options: ILabelOptions
|
|
87
|
+
options: Required<Pick<ILabelOptions, "labelFormat" | "labelPrecision" | "cursorLabelFormat" | "cursorLabelPrecision" | "labelPrefix" | "labelPostfix">>;
|
|
88
88
|
};
|
|
89
89
|
protected invalidateParent(): void;
|
|
90
90
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDeletable } from "../../../../Core/IDeletable";
|
|
2
2
|
import { TSRTexture } from "../../../../types/TSciChart";
|
|
3
|
-
import { TextureManager } from "../../TextureManager/TextureManager";
|
|
3
|
+
import { TextureManager, TTextureObject } from "../../TextureManager/TextureManager";
|
|
4
4
|
import { TTextStyle } from "../AxisCore";
|
|
5
5
|
import { LabelProvider } from "./LabelProvider";
|
|
6
6
|
export declare type TLabelInfo = {
|
|
@@ -28,8 +28,9 @@ export declare abstract class LabelProviderBase2D extends LabelProvider implemen
|
|
|
28
28
|
getLabelWidth(ctx: CanvasRenderingContext2D, labelText: string, labelStyle?: TTextStyle): number;
|
|
29
29
|
getMaxLabelHeightForHorizontalAxis(majorTickLabels: string[], ctx: CanvasRenderingContext2D, labelStyle: TTextStyle): number;
|
|
30
30
|
getMaxLabelWidthForVerticalAxis(majorTickLabels: string[], ctx: CanvasRenderingContext2D, labelStyle: TTextStyle): number;
|
|
31
|
-
getLabelTexture(labelText: string, textureManager: TextureManager, labelStyle: TTextStyle, width?: number, height?: number):
|
|
31
|
+
getLabelTexture(labelText: string, textureManager: TextureManager, labelStyle: TTextStyle, width?: number, height?: number): TTextureObject;
|
|
32
32
|
delete(): void;
|
|
33
33
|
checkTextStyleEqual(style1: TTextStyle, style2: TTextStyle): boolean;
|
|
34
|
+
protected invalidateParent(): void;
|
|
34
35
|
protected pruneCache(maxSize: number): void;
|
|
35
36
|
}
|
|
@@ -157,6 +157,19 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
|
|
|
157
157
|
style1.fontWeight === style2.fontWeight &&
|
|
158
158
|
style1.padding.equals(style2.padding));
|
|
159
159
|
};
|
|
160
|
+
LabelProviderBase2D.prototype.invalidateParent = function () {
|
|
161
|
+
if (this.useCache) {
|
|
162
|
+
// Clear cache if property changed
|
|
163
|
+
var labels = Array.from(this.labelCacheByText.values());
|
|
164
|
+
for (var index = 0; index < this.labelCacheByText.size; index++) {
|
|
165
|
+
var element = labels[index];
|
|
166
|
+
element.bitmapTexture = Deleter_1.deleteSafe(element.bitmapTexture);
|
|
167
|
+
this.labelCacheByText.delete(element.text);
|
|
168
|
+
}
|
|
169
|
+
this.tickToText.clear();
|
|
170
|
+
}
|
|
171
|
+
_super.prototype.invalidateParent.call(this);
|
|
172
|
+
};
|
|
160
173
|
LabelProviderBase2D.prototype.pruneCache = function (maxSize) {
|
|
161
174
|
if (this.labelCacheByText.size > maxSize) {
|
|
162
175
|
// remove more than we need so we do this less.
|
|
@@ -32,6 +32,6 @@ export declare class TextLabelProvider extends LabelProviderBase2D {
|
|
|
32
32
|
wrapText(text: string): string[];
|
|
33
33
|
toJSON(): {
|
|
34
34
|
type: string;
|
|
35
|
-
options: import("./LabelProvider").ILabelOptions
|
|
35
|
+
options: Required<Pick<import("./LabelProvider").ILabelOptions, "labelFormat" | "labelPrecision" | "cursorLabelFormat" | "cursorLabelPrecision" | "labelPrefix" | "labelPostfix">>;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { TEasing } from "../../../Core/Animations/EasingFunctions";
|
|
2
|
+
import { AnimationToken } from "../../../Core/AnimationToken";
|
|
1
3
|
import { Dictionary } from "../../../Core/Dictionary";
|
|
2
4
|
import { NumberRange } from "../../../Core/NumberRange";
|
|
3
5
|
import { EAxisType } from "../../../types/AxisType";
|
|
4
6
|
import { TSciChart } from "../../../types/TSciChart";
|
|
5
7
|
import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
|
|
8
|
+
import { ELogarithmicMajorTickMode, ELogarithmicMinorTickMode } from "../../Numerics/TickProviders/LogarithmicTickProvider";
|
|
6
9
|
import { TickProvider } from "../../Numerics/TickProviders/TickProvider";
|
|
7
10
|
import { AxisBase2D } from "./AxisBase2D";
|
|
8
11
|
import { DeltaCalculator } from "./DeltaCalculator/DeltaCalculator";
|
|
@@ -17,6 +20,20 @@ export interface ILogarithmicAxisOptions extends INumericAxisOptions {
|
|
|
17
20
|
* False if this axis only shows positive values, true if it only shows negative. A log axis cannot show both
|
|
18
21
|
*/
|
|
19
22
|
isNegative?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The mode for Major ticks using {@link ELogarithmicMajorTickMode}
|
|
25
|
+
* Equally spaced (default, best for large ranges) or
|
|
26
|
+
* Round numbers (better for small ranges)
|
|
27
|
+
*/
|
|
28
|
+
majorTickMode?: ELogarithmicMajorTickMode;
|
|
29
|
+
/**
|
|
30
|
+
* The mode for minor ticks using {@link ELogarithmicMinorTickMode},
|
|
31
|
+
* Linear (default, best for smaller ranges),
|
|
32
|
+
* Logarithmic (better for very large ranges) or
|
|
33
|
+
* Auto (switches from linear to Logarithmic when the visible range is such that
|
|
34
|
+
* the first linear minor tick would be more than 70% of the major tick)
|
|
35
|
+
*/
|
|
36
|
+
minorTickMode?: ELogarithmicMinorTickMode;
|
|
20
37
|
}
|
|
21
38
|
/**
|
|
22
39
|
* Creates an instance of a {@link LogarithmicAxis}
|
|
@@ -40,14 +57,50 @@ export declare class LogarithmicAxis extends AxisBase2D {
|
|
|
40
57
|
get isNegative(): boolean;
|
|
41
58
|
set isNegative(isNegative: boolean);
|
|
42
59
|
getDefaultNonZeroRange(): NumberRange;
|
|
60
|
+
hasValidVisibleRange(): boolean;
|
|
43
61
|
get tickProvider(): TickProvider;
|
|
44
62
|
set tickProvider(tickProvider: TickProvider);
|
|
45
63
|
get deltaCalculator(): DeltaCalculator;
|
|
46
64
|
set deltaCalculator(deltaCalculator: DeltaCalculator);
|
|
47
65
|
get labelProvider(): LabelProviderBase2D;
|
|
48
66
|
set labelProvider(labelProvider: LabelProviderBase2D);
|
|
67
|
+
/**
|
|
68
|
+
* Gets or sets the mode for Major ticks using {@link ELogarithmicMajorTickMode}
|
|
69
|
+
* Equally spaced (best for large ranges) or
|
|
70
|
+
* Round numbers (better for small ranges)
|
|
71
|
+
*/
|
|
72
|
+
get majorTickMode(): ELogarithmicMajorTickMode;
|
|
73
|
+
/**
|
|
74
|
+
* Gets or sets the mode for Major ticks using {@link ELogarithmicMajorTickMode}
|
|
75
|
+
* Equally spaced (best for large ranges) or
|
|
76
|
+
* Round numbers (better for small ranges)
|
|
77
|
+
*/
|
|
78
|
+
set majorTickMode(mode: ELogarithmicMajorTickMode);
|
|
79
|
+
/**
|
|
80
|
+
* Gets or sets the mode for minor ticks using {@link ELogarithmicMinorTickMode},
|
|
81
|
+
* Linear (default, best for smaller ranges),
|
|
82
|
+
* Logarithmic (better for very large ranges) or
|
|
83
|
+
* Auto (switches from linear to Logarithmic when the visible range is such that
|
|
84
|
+
* the first linear minor tick would be more than 70% of the major tick)
|
|
85
|
+
*/
|
|
86
|
+
get minorTickMode(): ELogarithmicMinorTickMode;
|
|
87
|
+
/**
|
|
88
|
+
* Gets or sets the mode for minor ticks using {@link ELogarithmicMinorTickMode},
|
|
89
|
+
* Linear (default, best for smaller ranges),
|
|
90
|
+
* Logarithmic (better for very large ranges) or
|
|
91
|
+
* Auto (switches from linear to Logarithmic when the visible range is such that
|
|
92
|
+
* the first linear minor tick would be more than 70% of the major tick)
|
|
93
|
+
*/
|
|
94
|
+
set minorTickMode(mode: ELogarithmicMinorTickMode);
|
|
49
95
|
getWindowedYRange(xRanges: Dictionary<NumberRange>): NumberRange;
|
|
96
|
+
/**
|
|
97
|
+
* @inheritdoc
|
|
98
|
+
*/
|
|
99
|
+
animateVisibleRange(visibleRange: NumberRange, durationMs: number, easingFunction?: TEasing, onCompleted?: () => void): AnimationToken;
|
|
100
|
+
scale(initialRange: NumberRange, delta: number, isMoreThanHalf: boolean): void;
|
|
50
101
|
toJSON(): import("../../../Builder/buildAxis").TAxisDefinition;
|
|
51
102
|
protected getCurrentCoordinateCalculatorInternal(): CoordinateCalculatorBase;
|
|
103
|
+
private get logTickProvider();
|
|
52
104
|
private updateLogarithmicBase;
|
|
105
|
+
private interpolateLog;
|
|
53
106
|
}
|
|
@@ -14,6 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
})();
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.LogarithmicAxis = void 0;
|
|
17
|
+
var Animator_1 = require("../../../Core/Animations/Animator");
|
|
18
|
+
var EasingFunctions_1 = require("../../../Core/Animations/EasingFunctions");
|
|
17
19
|
var NumberRange_1 = require("../../../Core/NumberRange");
|
|
18
20
|
var AxisType_1 = require("../../../types/AxisType");
|
|
19
21
|
var XyDirection_1 = require("../../../types/XyDirection");
|
|
@@ -35,11 +37,14 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
35
37
|
var _a, _b;
|
|
36
38
|
var _this = _super.call(this, wasmContext, options) || this;
|
|
37
39
|
_this.type = AxisType_1.EAxisType.LogarithmicAxis;
|
|
40
|
+
_this.interpolateLog = _this.interpolateLog.bind(_this);
|
|
38
41
|
_this.tickProvider = new LogarithmicTickProvider_1.LogarithmicTickProvider(wasmContext);
|
|
39
42
|
_this.deltaCalculator = new LogarithmicDeltaCalculator_1.LogarithmicDeltaCalculator(wasmContext);
|
|
40
43
|
_this.labelProvider = new LogarithmicLabelProvider_1.LogarithmicLabelProvider(options);
|
|
41
44
|
_this.logBase = (_a = options === null || options === void 0 ? void 0 : options.logBase) !== null && _a !== void 0 ? _a : 10;
|
|
42
45
|
_this.isNegativeProperty = (_b = options === null || options === void 0 ? void 0 : options.isNegative) !== null && _b !== void 0 ? _b : false;
|
|
46
|
+
_this.majorTickMode = (options === null || options === void 0 ? void 0 : options.majorTickMode) || _this.majorTickMode;
|
|
47
|
+
_this.minorTickMode = (options === null || options === void 0 ? void 0 : options.minorTickMode) || _this.minorTickMode;
|
|
43
48
|
// Log axis can be positive or negative, but not both.
|
|
44
49
|
if (_this.isNegativeProperty) {
|
|
45
50
|
_this.visibleRangeLimit = new NumberRange_1.NumberRange(-Infinity, -0.0000000001);
|
|
@@ -88,6 +93,9 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
88
93
|
var adj = this.isNegativeProperty ? -1 : 1;
|
|
89
94
|
return new NumberRange_1.NumberRange(adj * Math.pow(this.logBase, -1), adj * Math.pow(this.logBase, 2));
|
|
90
95
|
};
|
|
96
|
+
LogarithmicAxis.prototype.hasValidVisibleRange = function () {
|
|
97
|
+
return _super.prototype.hasValidVisibleRange.call(this) && this.visibleRange.min * this.visibleRange.max > 0;
|
|
98
|
+
};
|
|
91
99
|
Object.defineProperty(LogarithmicAxis.prototype, "tickProvider", {
|
|
92
100
|
get: function () {
|
|
93
101
|
return this.tickProviderProperty;
|
|
@@ -124,7 +132,50 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
124
132
|
enumerable: false,
|
|
125
133
|
configurable: true
|
|
126
134
|
});
|
|
127
|
-
|
|
135
|
+
Object.defineProperty(LogarithmicAxis.prototype, "majorTickMode", {
|
|
136
|
+
/**
|
|
137
|
+
* Gets or sets the mode for Major ticks using {@link ELogarithmicMajorTickMode}
|
|
138
|
+
* Equally spaced (best for large ranges) or
|
|
139
|
+
* Round numbers (better for small ranges)
|
|
140
|
+
*/
|
|
141
|
+
get: function () {
|
|
142
|
+
return this.logTickProvider.majorTickMode;
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Gets or sets the mode for Major ticks using {@link ELogarithmicMajorTickMode}
|
|
146
|
+
* Equally spaced (best for large ranges) or
|
|
147
|
+
* Round numbers (better for small ranges)
|
|
148
|
+
*/
|
|
149
|
+
set: function (mode) {
|
|
150
|
+
this.logTickProvider.majorTickMode = mode;
|
|
151
|
+
},
|
|
152
|
+
enumerable: false,
|
|
153
|
+
configurable: true
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(LogarithmicAxis.prototype, "minorTickMode", {
|
|
156
|
+
/**
|
|
157
|
+
* Gets or sets the mode for minor ticks using {@link ELogarithmicMinorTickMode},
|
|
158
|
+
* Linear (default, best for smaller ranges),
|
|
159
|
+
* Logarithmic (better for very large ranges) or
|
|
160
|
+
* Auto (switches from linear to Logarithmic when the visible range is such that
|
|
161
|
+
* the first linear minor tick would be more than 70% of the major tick)
|
|
162
|
+
*/
|
|
163
|
+
get: function () {
|
|
164
|
+
return this.logTickProvider.minorTickMode;
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* Gets or sets the mode for minor ticks using {@link ELogarithmicMinorTickMode},
|
|
168
|
+
* Linear (default, best for smaller ranges),
|
|
169
|
+
* Logarithmic (better for very large ranges) or
|
|
170
|
+
* Auto (switches from linear to Logarithmic when the visible range is such that
|
|
171
|
+
* the first linear minor tick would be more than 70% of the major tick)
|
|
172
|
+
*/
|
|
173
|
+
set: function (mode) {
|
|
174
|
+
this.logTickProvider.minorTickMode = mode;
|
|
175
|
+
},
|
|
176
|
+
enumerable: false,
|
|
177
|
+
configurable: true
|
|
178
|
+
});
|
|
128
179
|
LogarithmicAxis.prototype.getWindowedYRange = function (xRanges) {
|
|
129
180
|
var _this = this;
|
|
130
181
|
var maxRange;
|
|
@@ -154,12 +205,52 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
154
205
|
if (this.visibleRangeLimit && maxRange) {
|
|
155
206
|
maxRange = maxRange.clip(this.visibleRangeLimit);
|
|
156
207
|
}
|
|
157
|
-
return maxRange
|
|
208
|
+
return maxRange;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @inheritdoc
|
|
212
|
+
*/
|
|
213
|
+
LogarithmicAxis.prototype.animateVisibleRange = function (visibleRange, durationMs, easingFunction, onCompleted) {
|
|
214
|
+
var _this = this;
|
|
215
|
+
var _a;
|
|
216
|
+
if (easingFunction === void 0) { easingFunction = EasingFunctions_1.easing.outCubic; }
|
|
217
|
+
if (onCompleted === void 0) { onCompleted = function () { }; }
|
|
218
|
+
if (durationMs <= 0) {
|
|
219
|
+
this.visibleRange = visibleRange;
|
|
220
|
+
onCompleted();
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
(_a = this.visibleRangeAnimationToken) === null || _a === void 0 ? void 0 : _a.cancelAnimation();
|
|
224
|
+
this.visibleRangeAnimationToken = Animator_1.animateAny(durationMs, this.visibleRange, visibleRange, function (range) {
|
|
225
|
+
_this.visibleRange = range;
|
|
226
|
+
}, this.interpolateLog, onCompleted, easingFunction);
|
|
227
|
+
return this.visibleRangeAnimationToken;
|
|
228
|
+
};
|
|
229
|
+
LogarithmicAxis.prototype.scale = function (initialRange, delta, isMoreThanHalf) {
|
|
230
|
+
var deltaRange = initialRange.max / initialRange.min;
|
|
231
|
+
var newMin, newMax;
|
|
232
|
+
// Respect flippedCoordinates
|
|
233
|
+
var isMoreThanHalf2 = this.flippedCoordinates ? !isMoreThanHalf : isMoreThanHalf;
|
|
234
|
+
var delta2 = this.flippedCoordinates ? -delta : delta;
|
|
235
|
+
if (isMoreThanHalf2) {
|
|
236
|
+
newMin = initialRange.min;
|
|
237
|
+
var mult = delta2 > 0 ? Math.pow(deltaRange, 1 - delta2) : Math.pow(deltaRange, 1 + Math.abs(delta2));
|
|
238
|
+
newMax = mult * newMin;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
newMax = initialRange.max;
|
|
242
|
+
var mult = delta2 > 0 ? Math.pow(deltaRange, 1 + delta2) : Math.pow(deltaRange, 1 + delta2);
|
|
243
|
+
newMin = newMax / mult;
|
|
244
|
+
}
|
|
245
|
+
this.visibleRange = new NumberRange_1.NumberRange(newMin, newMax);
|
|
158
246
|
};
|
|
159
247
|
LogarithmicAxis.prototype.toJSON = function () {
|
|
160
248
|
var json = _super.prototype.toJSON.call(this);
|
|
161
249
|
var options = {
|
|
162
|
-
logBase: this.logBase
|
|
250
|
+
logBase: this.logBase,
|
|
251
|
+
isNegative: this.isNegative,
|
|
252
|
+
majorTickMode: this.majorTickMode,
|
|
253
|
+
minorTickMode: this.minorTickMode
|
|
163
254
|
};
|
|
164
255
|
Object.assign(json.options, options);
|
|
165
256
|
return json;
|
|
@@ -172,6 +263,13 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
172
263
|
var direction = this.isXAxis ? XyDirection_1.EXyDirection.XDirection : XyDirection_1.EXyDirection.YDirection;
|
|
173
264
|
return new LogarithmicCoordinateCalculator_1.LogarithmicCoordinateCalculator(this.webAssemblyContext2D, size, min, max, direction, this.logBase, shouldFlip, this.offset);
|
|
174
265
|
};
|
|
266
|
+
Object.defineProperty(LogarithmicAxis.prototype, "logTickProvider", {
|
|
267
|
+
get: function () {
|
|
268
|
+
return this.tickProvider;
|
|
269
|
+
},
|
|
270
|
+
enumerable: false,
|
|
271
|
+
configurable: true
|
|
272
|
+
});
|
|
175
273
|
LogarithmicAxis.prototype.updateLogarithmicBase = function (logBase) {
|
|
176
274
|
var logTickProvider = this.tickProvider;
|
|
177
275
|
if (logTickProvider) {
|
|
@@ -186,6 +284,12 @@ var LogarithmicAxis = /** @class */ (function (_super) {
|
|
|
186
284
|
logLabelProvider.logarithmicBase = logBase;
|
|
187
285
|
}
|
|
188
286
|
};
|
|
287
|
+
LogarithmicAxis.prototype.interpolateLog = function (from, to, interpolationFactor) {
|
|
288
|
+
var newMin = Math.pow(to.min / from.min, interpolationFactor) * from.min;
|
|
289
|
+
var newMax = Math.pow(to.max / from.max, interpolationFactor) * from.max;
|
|
290
|
+
var result = new NumberRange_1.NumberRange(newMin, newMax);
|
|
291
|
+
return result;
|
|
292
|
+
};
|
|
189
293
|
return LogarithmicAxis;
|
|
190
294
|
}(AxisBase2D_1.AxisBase2D));
|
|
191
295
|
exports.LogarithmicAxis = LogarithmicAxis;
|
|
@@ -47,4 +47,5 @@ var PROPERTY;
|
|
|
47
47
|
PROPERTY["VISIBLE_RANGE_LIMIT"] = "VISIBLE_RANGE_LIMIT";
|
|
48
48
|
PROPERTY["TICK_PROVIDER"] = "TICK_PROVIDER";
|
|
49
49
|
PROPERTY["VIEW_RECT"] = "VIEW_RECT";
|
|
50
|
+
PROPERTY["ZOOMEXTENTS_RANGE"] = "ZOOMEXTENTS_RANGE";
|
|
50
51
|
})(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
|
|
@@ -91,7 +91,7 @@ var SciChartLegend = /** @class */ (function (_super) {
|
|
|
91
91
|
// TODO: Stocked charts
|
|
92
92
|
var name = rs.getDataSeriesName() || "Series " + (index + 1);
|
|
93
93
|
var id = rs.id;
|
|
94
|
-
var str = "<div style=\"display: flex; margin-right: 4px;\">";
|
|
94
|
+
var str = "<div class=\"scichart__legend-item\" style=\"display: flex; margin-right: 4px;\">";
|
|
95
95
|
if (_this.showCheckboxes) {
|
|
96
96
|
str += "<input " + (rs.isVisible ? "checked" : "") + " type=\"checkbox\" id=\"" + id + "\" name=\"" + name + "\" value=\"" + name + "\">";
|
|
97
97
|
}
|
|
@@ -31,6 +31,7 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
31
31
|
protected marginProperty: number;
|
|
32
32
|
protected isDirty: boolean;
|
|
33
33
|
protected parentSurfaceProperty: ISciChartSurfaceBase;
|
|
34
|
+
protected placementDivIdProperty: string;
|
|
34
35
|
/**
|
|
35
36
|
* @inheritDoc
|
|
36
37
|
*/
|
|
@@ -90,6 +91,14 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
90
91
|
* Gets or sets the margin in pixels
|
|
91
92
|
*/
|
|
92
93
|
set margin(value: number);
|
|
94
|
+
/**
|
|
95
|
+
* Gets or sets the parent div element for the Legend
|
|
96
|
+
*/
|
|
97
|
+
get placementDivId(): string;
|
|
98
|
+
/**
|
|
99
|
+
* Gets or sets the parent div element for the Legend
|
|
100
|
+
*/
|
|
101
|
+
set placementDivId(value: string);
|
|
93
102
|
/**
|
|
94
103
|
* @inheritDoc
|
|
95
104
|
*/
|
|
@@ -110,6 +119,8 @@ export declare abstract class SciChartLegendBase implements IDeletable {
|
|
|
110
119
|
* When overridden in a derived class, will be called when its time to add event listeners to series
|
|
111
120
|
*/
|
|
112
121
|
protected abstract addEventListeners(): void;
|
|
122
|
+
private getParentDiv;
|
|
123
|
+
private isLocatedOutside;
|
|
113
124
|
}
|
|
114
125
|
export declare const calcLegendPosition: (seriesViewRect: Rect, div: Rect, margin: number, placement: ELegendPlacement) => {
|
|
115
126
|
left: number;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.calcLegendPosition = exports.SciChartLegendBase = exports.ELegendPlacement = exports.ELegendOrientation = void 0;
|
|
4
4
|
var app_1 = require("../../../constants/app");
|
|
5
5
|
var Rect_1 = require("../../../Core/Rect");
|
|
6
|
+
var DpiHelper_1 = require("../TextureManager/DpiHelper");
|
|
6
7
|
/**
|
|
7
8
|
* Enumeration constants to define legend orientation
|
|
8
9
|
*/
|
|
@@ -148,12 +149,29 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
148
149
|
enumerable: false,
|
|
149
150
|
configurable: true
|
|
150
151
|
});
|
|
152
|
+
Object.defineProperty(SciChartLegendBase.prototype, "placementDivId", {
|
|
153
|
+
/**
|
|
154
|
+
* Gets or sets the parent div element for the Legend
|
|
155
|
+
*/
|
|
156
|
+
get: function () {
|
|
157
|
+
return this.placementDivIdProperty;
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Gets or sets the parent div element for the Legend
|
|
161
|
+
*/
|
|
162
|
+
set: function (value) {
|
|
163
|
+
this.placementDivIdProperty = value;
|
|
164
|
+
this.notifyPropertyChanged();
|
|
165
|
+
},
|
|
166
|
+
enumerable: false,
|
|
167
|
+
configurable: true
|
|
168
|
+
});
|
|
151
169
|
/**
|
|
152
170
|
* @inheritDoc
|
|
153
171
|
*/
|
|
154
172
|
SciChartLegendBase.prototype.delete = function () {
|
|
155
173
|
// TODO: remove listeners from renderable series to prevent memory leaks in older browsers
|
|
156
|
-
this.
|
|
174
|
+
this.getParentDiv().removeChild(this.div);
|
|
157
175
|
this.div = undefined;
|
|
158
176
|
};
|
|
159
177
|
/**
|
|
@@ -170,7 +188,10 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
170
188
|
*/
|
|
171
189
|
SciChartLegendBase.prototype.create = function () {
|
|
172
190
|
var div = document.createElement("div");
|
|
173
|
-
div.
|
|
191
|
+
div.setAttribute("class", "scichart__legend");
|
|
192
|
+
if (!this.isLocatedOutside()) {
|
|
193
|
+
div.style.position = "absolute";
|
|
194
|
+
}
|
|
174
195
|
div.style.pointerEvents = "auto";
|
|
175
196
|
div.style.padding = "5px";
|
|
176
197
|
div.style.borderRadius = "3px";
|
|
@@ -178,40 +199,48 @@ var SciChartLegendBase = /** @class */ (function () {
|
|
|
178
199
|
div.style.color = this.parentSurfaceProperty.themeProvider.labelForegroundBrush;
|
|
179
200
|
div.style.display = this.orientationProperty === ELegendOrientation.Vertical ? "block" : "flex";
|
|
180
201
|
div.innerHTML = this.getLegendHtml();
|
|
181
|
-
this.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
this.getParentDiv().appendChild(div);
|
|
203
|
+
if (!this.isLocatedOutside()) {
|
|
204
|
+
var divWidth = div.offsetWidth;
|
|
205
|
+
var divHeight = div.offsetHeight;
|
|
206
|
+
var position = exports.calcLegendPosition(this.seriesViewRect, Rect_1.Rect.create(0, 0, divWidth, divHeight), this.margin, this.placement);
|
|
207
|
+
div.style.left = position.left + "px";
|
|
208
|
+
div.style.top = position.top + "px";
|
|
209
|
+
}
|
|
187
210
|
this.div = div;
|
|
188
211
|
if (!app_1.IS_TEST_ENV) {
|
|
189
212
|
this.addEventListeners();
|
|
190
213
|
}
|
|
191
214
|
};
|
|
215
|
+
SciChartLegendBase.prototype.getParentDiv = function () {
|
|
216
|
+
return this.placementDivId ? document.getElementById(this.placementDivId) : this.rootDiv;
|
|
217
|
+
};
|
|
218
|
+
SciChartLegendBase.prototype.isLocatedOutside = function () {
|
|
219
|
+
return !!this.placementDivId;
|
|
220
|
+
};
|
|
192
221
|
return SciChartLegendBase;
|
|
193
222
|
}());
|
|
194
223
|
exports.SciChartLegendBase = SciChartLegendBase;
|
|
195
224
|
exports.calcLegendPosition = function (seriesViewRect, div, margin, placement) {
|
|
196
225
|
switch (placement) {
|
|
197
226
|
case ELegendPlacement.TopLeft: {
|
|
198
|
-
var left = seriesViewRect.left + margin;
|
|
199
|
-
var top_1 = seriesViewRect.top + margin;
|
|
227
|
+
var left = seriesViewRect.left / DpiHelper_1.DpiHelper.PIXEL_RATIO + margin;
|
|
228
|
+
var top_1 = seriesViewRect.top / DpiHelper_1.DpiHelper.PIXEL_RATIO + margin;
|
|
200
229
|
return { left: left, top: top_1 };
|
|
201
230
|
}
|
|
202
231
|
case ELegendPlacement.TopRight: {
|
|
203
|
-
var left = seriesViewRect.right - (margin + div.width);
|
|
204
|
-
var top_2 = seriesViewRect.top + margin;
|
|
232
|
+
var left = seriesViewRect.right / DpiHelper_1.DpiHelper.PIXEL_RATIO - (margin + div.width);
|
|
233
|
+
var top_2 = seriesViewRect.top / DpiHelper_1.DpiHelper.PIXEL_RATIO + margin;
|
|
205
234
|
return { left: left, top: top_2 };
|
|
206
235
|
}
|
|
207
236
|
case ELegendPlacement.BottomLeft: {
|
|
208
|
-
var left = seriesViewRect.left + margin;
|
|
209
|
-
var top_3 = seriesViewRect.bottom - (margin + div.height);
|
|
237
|
+
var left = seriesViewRect.left / DpiHelper_1.DpiHelper.PIXEL_RATIO + margin;
|
|
238
|
+
var top_3 = seriesViewRect.bottom / DpiHelper_1.DpiHelper.PIXEL_RATIO - (margin + div.height);
|
|
210
239
|
return { left: left, top: top_3 };
|
|
211
240
|
}
|
|
212
241
|
case ELegendPlacement.BottomRight: {
|
|
213
|
-
var left = seriesViewRect.right - (margin + div.width);
|
|
214
|
-
var top_4 = seriesViewRect.bottom - (margin + div.height);
|
|
242
|
+
var left = seriesViewRect.right / DpiHelper_1.DpiHelper.PIXEL_RATIO - (margin + div.width);
|
|
243
|
+
var top_4 = seriesViewRect.bottom / DpiHelper_1.DpiHelper.PIXEL_RATIO - (margin + div.height);
|
|
215
244
|
return { left: left, top: top_4 };
|
|
216
245
|
}
|
|
217
246
|
}
|