scichart 2.1.2301 → 2.2.2389
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 +7 -0
- package/Builder/buildAxis.js +6 -0
- package/Builder/buildDataSeries.d.ts +19 -1
- package/Builder/buildDataSeries.js +22 -1
- package/Builder/buildModifiers.d.ts +2 -1
- package/Builder/buildSeries.d.ts +7 -2
- package/Builder/buildSeries.js +5 -1
- package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
- package/Charting/ChartModifiers/CursorModifier.js +15 -10
- package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
- package/Charting/ChartModifiers/LegendModifier.js +22 -0
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
- package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
- package/Charting/ChartModifiers/RolloverModifier.js +76 -19
- package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
- package/Charting/LayoutManager/LayoutManager.js +6 -1
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
- package/Charting/Model/BaseHeatmapDataSeries.js +5 -2
- package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
- package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
- package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
- package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
- package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
- package/Charting/Model/Filters/HlcFilterBase.js +141 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
- package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
- package/Charting/Model/Filters/XyFilterBase.js +6 -0
- package/Charting/Model/Filters/XyyFilterBase.js +9 -0
- package/Charting/Model/Filters/XyzFilterBase.js +12 -3
- package/Charting/Model/HlcDataSeries.d.ts +189 -0
- package/Charting/Model/HlcDataSeries.js +557 -0
- package/Charting/Model/IDataSeries.d.ts +5 -1
- package/Charting/Model/IDataSeries.js +4 -0
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
- package/Charting/Services/SciChartRenderer.d.ts +1 -0
- package/Charting/Services/SciChartRenderer.js +6 -0
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
- package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
- package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/constants.d.ts +2 -1
- package/Charting/Visuals/Annotations/constants.js +1 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
- package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
- package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
- package/Charting/Visuals/Axis/AxisCore.js +6 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
- package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
- package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
- package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
- package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
- package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
- package/Charting/Visuals/Helpers/NativeObject.js +101 -0
- package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
- package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
- package/Charting/Visuals/Helpers/drawBorder.js +2 -2
- package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
- package/Charting/Visuals/Helpers/drawLabel.js +38 -18
- package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
- package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
- package/Charting/Visuals/Legend/SciChartLegend.js +8 -2
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
- package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
- package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/constants.js +7 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
- package/Charting/Visuals/SciChartSurface.d.ts +13 -2
- package/Charting/Visuals/SciChartSurface.js +39 -3
- package/Charting/Visuals/createMaster.js +17 -13
- package/Charting/Visuals/createSingle.js +5 -3
- package/Charting/Visuals/licenseManager2D.d.ts +6 -0
- package/Charting/Visuals/licenseManager2D.js +98 -9
- package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
- package/Charting/Visuals/licenseManager2dState.js +37 -1
- package/Charting/Visuals/loader.js +4 -1
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +13 -9
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
- package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
- package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
- package/Charting3D/Visuals/createMaster3d.js +20 -14
- package/Charting3D/Visuals/createSingle3d.js +3 -4
- package/Charting3D/Visuals/licenseManager3D.js +3 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Telemetry.d.ts +7 -0
- package/Core/Telemetry.js +109 -0
- package/Core/storage/localStorageApi.d.ts +4 -0
- package/Core/storage/localStorageApi.js +12 -0
- package/README.md +49 -13
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +95 -95
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +97 -97
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/AxisType.d.ts +5 -1
- package/types/AxisType.js +4 -0
- package/types/Color.d.ts +1 -0
- package/types/Color.js +1 -0
- package/types/DataFilterType.d.ts +1 -0
- package/types/DataFilterType.js +1 -0
- package/types/DataPointWidthMode.d.ts +13 -0
- package/types/DataPointWidthMode.js +17 -0
- package/types/ErrorDirection.d.ts +13 -0
- package/types/ErrorDirection.js +17 -0
- package/types/ErrorMode.d.ts +17 -0
- package/types/ErrorMode.js +21 -0
- package/types/LabelPlacement.d.ts +8 -0
- package/types/LabelPlacement.js +11 -1
- package/types/LabelProviderType.d.ts +5 -1
- package/types/LabelProviderType.js +4 -0
- package/types/SeriesType.d.ts +3 -1
- package/types/SeriesType.js +2 -0
- package/types/TSciChart.d.ts +8 -2
- package/types/TSciChart3D.d.ts +5 -2
- package/types/TSciChartSurfaceCanvases.d.ts +1 -0
- package/utils/date.d.ts +1 -0
- package/utils/date.js +15 -1
- package/utils/guid.d.ts +6 -0
- package/utils/guid.js +17 -1
|
@@ -58,7 +58,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
58
58
|
* @param options Optional parameters of type {@link ILineAnnotationOptions} which configure the annotation upon construction
|
|
59
59
|
*/
|
|
60
60
|
function VerticalLineAnnotation(options) {
|
|
61
|
-
var _a, _b;
|
|
61
|
+
var _a, _b, _c;
|
|
62
62
|
var _this = _super.call(this, options) || this;
|
|
63
63
|
/** @inheritDoc */
|
|
64
64
|
_this.type = IAnnotation_1.EAnnotationType.RenderContextVerticalLineAnnotation;
|
|
@@ -72,6 +72,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
72
72
|
}
|
|
73
73
|
_this.dragOnLine = (_a = options === null || options === void 0 ? void 0 : options.dragOnLine) !== null && _a !== void 0 ? _a : _this.dragOnLine;
|
|
74
74
|
_this.dragOnLabel = (_b = options === null || options === void 0 ? void 0 : options.dragOnLabel) !== null && _b !== void 0 ? _b : _this.dragOnLabel;
|
|
75
|
+
_this.verticalAlignment = (_c = options === null || options === void 0 ? void 0 : options.verticalAlignment) !== null && _c !== void 0 ? _c : _this.verticalAlignment;
|
|
75
76
|
return _this;
|
|
76
77
|
}
|
|
77
78
|
Object.defineProperty(VerticalLineAnnotation.prototype, "y2", {
|
|
@@ -138,7 +139,7 @@ var VerticalLineAnnotation = /** @class */ (function (_super) {
|
|
|
138
139
|
var isLineAnnotationEdgeVisible = !isPartialLine || isLineAnnotationInVerticalVisibleRange;
|
|
139
140
|
if (isAxisLabelInHorizontalVisibleRange && isLineAnnotationEdgeVisible) {
|
|
140
141
|
var textStyle = __assign(__assign({}, verticalAxis.labelStyle), { color: this.axisLabelStroke, fontSize: this.axisFontSize * DpiHelper_1.DpiHelper.PIXEL_RATIO, fontFamily: this.axisFontFamily });
|
|
141
|
-
var labelRect = (0, drawLabel_1.drawLineAnnotation)(horizontalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity);
|
|
142
|
+
var labelRect = (0, drawLabel_1.drawLineAnnotation)(horizontalAxis, renderContext, this.labelPlacement, this.labelValue, borderX1, borderX2, borderY1, borderY2, textStyle, this.axisLabelFill, strokePen, viewRect, this.showLabel, this.opacity, null, this.verticalAlignment);
|
|
142
143
|
if (labelRect) {
|
|
143
144
|
var point1 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.left, labelRect.top), viewRect, true);
|
|
144
145
|
var point2 = (0, translate_1.translateFromCanvasToSeriesViewRect)(new Point_1.Point(labelRect.right, labelRect.bottom), viewRect, true);
|
|
@@ -51,7 +51,8 @@ export declare enum PROPERTY {
|
|
|
51
51
|
Y2 = "Y2",
|
|
52
52
|
YAXIS_ID = "YAXIS_ID",
|
|
53
53
|
Y_COORDINATE_MODE = "Y_COORDINATE_MODE",
|
|
54
|
-
Y_COORD_SHIFT = "Y_COORD_SHIFT"
|
|
54
|
+
Y_COORD_SHIFT = "Y_COORD_SHIFT",
|
|
55
|
+
PLACEMENT_DIV_ID = "PLACEMENT_DIV_ID"
|
|
55
56
|
}
|
|
56
57
|
export declare const ADORNER_GRIP_RADIUS = 10;
|
|
57
58
|
export declare const DISTANCE_TO_LINE = 10;
|
|
@@ -56,6 +56,7 @@ var PROPERTY;
|
|
|
56
56
|
PROPERTY["YAXIS_ID"] = "YAXIS_ID";
|
|
57
57
|
PROPERTY["Y_COORDINATE_MODE"] = "Y_COORDINATE_MODE";
|
|
58
58
|
PROPERTY["Y_COORD_SHIFT"] = "Y_COORD_SHIFT";
|
|
59
|
+
PROPERTY["PLACEMENT_DIV_ID"] = "PLACEMENT_DIV_ID";
|
|
59
60
|
})(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
|
|
60
61
|
exports.ADORNER_GRIP_RADIUS = 10;
|
|
61
62
|
exports.DISTANCE_TO_LINE = 10;
|
|
@@ -144,6 +144,7 @@ export interface IAxisBase2dOptions extends IAxisCoreOptions {
|
|
|
144
144
|
* Useful to align seriesViewRects for different charts
|
|
145
145
|
*/
|
|
146
146
|
axisThickness?: number;
|
|
147
|
+
backgroundColor?: string;
|
|
147
148
|
}
|
|
148
149
|
/**
|
|
149
150
|
* The base class for 2D Chart Axis within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}.
|
|
@@ -238,6 +239,14 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
|
|
|
238
239
|
* This is only used to allow multiple primary axes, so that all stacked axes can draw gridlines
|
|
239
240
|
*/
|
|
240
241
|
set isStackedAxis(value: boolean);
|
|
242
|
+
/**
|
|
243
|
+
* Gets the background color of separate Axis
|
|
244
|
+
*/
|
|
245
|
+
get backgroundColor(): string;
|
|
246
|
+
/**
|
|
247
|
+
* Sets the background color of separate Axis
|
|
248
|
+
*/
|
|
249
|
+
set backgroundColor(value: string);
|
|
241
250
|
/** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
|
|
242
251
|
* A plain number will be interpreted as a number of pixels.
|
|
243
252
|
* A number with % will take that percentage of the total length.
|
|
@@ -299,7 +308,7 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
|
|
|
299
308
|
* Gets or sets a {@link IAutoRangeAnimationOptions} object that controls if and how the visible range is animated during autoRanging
|
|
300
309
|
*/
|
|
301
310
|
set autoRangeAnimation(autoRangeAnimation: IAutoRangeAnimationOptions);
|
|
302
|
-
abstract type: EAxisType.CategoryAxis | EAxisType.LogarithmicAxis | EAxisType.NumericAxis;
|
|
311
|
+
abstract type: EAxisType.CategoryAxis | EAxisType.LogarithmicAxis | EAxisType.NumericAxis | EAxisType.DateTimeNumericAxis;
|
|
303
312
|
/**
|
|
304
313
|
* Gets the parent {@link SciChartSurface} that this axis is attached to
|
|
305
314
|
*/
|
|
@@ -341,6 +350,7 @@ export declare abstract class AxisBase2D extends AxisCore implements IThemeable
|
|
|
341
350
|
private axisLengthProperty;
|
|
342
351
|
private offsetProperty;
|
|
343
352
|
private tickCache;
|
|
353
|
+
private backgroundColorProperty;
|
|
344
354
|
/**
|
|
345
355
|
* Creates an instance of the {@link AxisBase2D}
|
|
346
356
|
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
|
|
@@ -45,6 +45,7 @@ var WebGlRenderContext2D_1 = require("../../Drawing/WebGlRenderContext2D");
|
|
|
45
45
|
var DefaultTickCoordinatesProvider_1 = require("../../Numerics/TickCoordinateProviders/DefaultTickCoordinatesProvider");
|
|
46
46
|
var createNativeRect_1 = require("../Helpers/createNativeRect");
|
|
47
47
|
var drawBorder_1 = require("../Helpers/drawBorder");
|
|
48
|
+
var NativeObject_1 = require("../Helpers/NativeObject");
|
|
48
49
|
var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
|
|
49
50
|
var DpiHelper_1 = require("../TextureManager/DpiHelper");
|
|
50
51
|
var AxisCore_1 = require("./AxisCore");
|
|
@@ -100,7 +101,7 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
100
101
|
* @param options Optional parameters of type {@link IAxisBase2dOptions} used to configure the axis at instantiation time
|
|
101
102
|
*/
|
|
102
103
|
function AxisBase2D(webAssemblyContext, options) {
|
|
103
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
104
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
104
105
|
var _this = _super.call(this, options) || this;
|
|
105
106
|
/**
|
|
106
107
|
* Gets the {@link AxisLayoutState} class which manages layout
|
|
@@ -157,6 +158,7 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
_this.autoRangeAnimationProperty = options === null || options === void 0 ? void 0 : options.autoRangeAnimation;
|
|
161
|
+
_this.backgroundColor = (_j = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _j !== void 0 ? _j : _this.backgroundColor;
|
|
160
162
|
return _this;
|
|
161
163
|
}
|
|
162
164
|
Object.defineProperty(AxisBase2D.prototype, "labelProvider", {
|
|
@@ -348,6 +350,25 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
348
350
|
enumerable: false,
|
|
349
351
|
configurable: true
|
|
350
352
|
});
|
|
353
|
+
Object.defineProperty(AxisBase2D.prototype, "backgroundColor", {
|
|
354
|
+
/**
|
|
355
|
+
* Gets the background color of separate Axis
|
|
356
|
+
*/
|
|
357
|
+
get: function () {
|
|
358
|
+
return this.backgroundColorProperty;
|
|
359
|
+
},
|
|
360
|
+
/**
|
|
361
|
+
* Sets the background color of separate Axis
|
|
362
|
+
*/
|
|
363
|
+
set: function (value) {
|
|
364
|
+
this.backgroundColorProperty = value;
|
|
365
|
+
if (this.invalidateParentCallback) {
|
|
366
|
+
this.invalidateParentCallback();
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
enumerable: false,
|
|
370
|
+
configurable: true
|
|
371
|
+
});
|
|
351
372
|
Object.defineProperty(AxisBase2D.prototype, "stackedAxisLength", {
|
|
352
373
|
/** Gets or sets the length of a stacked axis as an absolute number or percentage, e.g. 100, or "30%".
|
|
353
374
|
* A plain number will be interpreted as a number of pixels.
|
|
@@ -590,6 +611,53 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
590
611
|
}
|
|
591
612
|
// make sure axes is drawn at the last stage
|
|
592
613
|
renderContext.enqueueLayeredDraw(function () {
|
|
614
|
+
// Draw background
|
|
615
|
+
if (_this.backgroundColorProperty) {
|
|
616
|
+
var viewAxisRect = _this.axisRenderer.viewRect;
|
|
617
|
+
var viewTitleRect = _this.axisTitleRenderer.viewRect;
|
|
618
|
+
var brush = new _this.webAssemblyContext2D.SCRTSolidBrush((0, parseColor_1.parseColorToUIntArgb)(_this.backgroundColorProperty), false);
|
|
619
|
+
var nativeAxisRect = void 0;
|
|
620
|
+
var nativeTitleRect = void 0;
|
|
621
|
+
// Empty space covering for axis coloring
|
|
622
|
+
// let shift: number = 0;
|
|
623
|
+
// let additionalSize: number = 0;
|
|
624
|
+
// if (this.isHorizontalAxis) {
|
|
625
|
+
// this.parentSurface.yAxes.asArray().forEach((yAxis: AxisBase2D, index: number) => {
|
|
626
|
+
// const size: number = yAxis.axisRenderer.viewAxisRect.width + yAxis.axisTitleRenderer.viewAxisRect.width;
|
|
627
|
+
// if (index === 0) {
|
|
628
|
+
// shift += size;
|
|
629
|
+
// } else {
|
|
630
|
+
// additionalSize += size;
|
|
631
|
+
// }
|
|
632
|
+
// });
|
|
633
|
+
// nativeAxisRect = createNativeRect(this.webAssemblyContext2D, 0 - shift, 0, viewAxisRect.width + additionalSize, viewAxisRect.height);
|
|
634
|
+
// nativeTitleRect = createNativeRect(this.webAssemblyContext2D, 0 - shift, 0, viewTitleRect.width + additionalSize, viewTitleRect.height);
|
|
635
|
+
// } else {
|
|
636
|
+
// this.parentSurface.xAxes.asArray().forEach((xAxis: AxisBase2D, index: number) => {
|
|
637
|
+
// const size: number = xAxis.axisRenderer.viewAxisRect.height + xAxis.axisTitleRenderer.viewAxisRect.height;
|
|
638
|
+
// if (index === 0) {
|
|
639
|
+
// shift += size;
|
|
640
|
+
// } else {
|
|
641
|
+
// additionalSize += size;
|
|
642
|
+
// }
|
|
643
|
+
// });
|
|
644
|
+
// nativeAxisRect = createNativeRect(this.webAssemblyContext2D, 0, 0 - shift, viewAxisRect.width, viewAxisRect.height + additionalSize);
|
|
645
|
+
// nativeTitleRect = createNativeRect(this.webAssemblyContext2D, 0, 0 - shift, viewTitleRect.width, viewTitleRect.height + additionalSize);
|
|
646
|
+
// }
|
|
647
|
+
nativeAxisRect = (0, createNativeRect_1.createNativeRect)(_this.webAssemblyContext2D, 0, 0, viewAxisRect.width, viewAxisRect.height);
|
|
648
|
+
nativeTitleRect = (0, createNativeRect_1.createNativeRect)(_this.webAssemblyContext2D, 0, 0, viewTitleRect.width, viewTitleRect.height);
|
|
649
|
+
if (nativeAxisRect) {
|
|
650
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(_this.webAssemblyContext2D);
|
|
651
|
+
vecRects.push_back(nativeAxisRect);
|
|
652
|
+
renderContext.drawRects(vecRects, brush, viewAxisRect.left, viewAxisRect.top);
|
|
653
|
+
}
|
|
654
|
+
if (nativeTitleRect) {
|
|
655
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(_this.webAssemblyContext2D);
|
|
656
|
+
vecRects.push_back(nativeTitleRect);
|
|
657
|
+
renderContext.drawRects(vecRects, brush, viewTitleRect.left, viewTitleRect.top);
|
|
658
|
+
}
|
|
659
|
+
brush.delete();
|
|
660
|
+
}
|
|
593
661
|
// Draw axis labels
|
|
594
662
|
if (_this.drawLabels) {
|
|
595
663
|
if (SciChartSurfaceBase_1.DebugForDpi) {
|
|
@@ -617,26 +685,22 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
617
685
|
this.axisRenderer.drawDebug = true;
|
|
618
686
|
var drawTickViewRects = function () {
|
|
619
687
|
var viewRect = _this.axisRenderer.viewRect;
|
|
620
|
-
var vecRects =
|
|
688
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(_this.webAssemblyContext2D);
|
|
621
689
|
var brush = new _this.webAssemblyContext2D.SCRTSolidBrush((0, parseColor_1.parseColorToUIntArgb)("rgba(255,0,0,0.7)"), false);
|
|
622
690
|
var nativeRect = (0, createNativeRect_1.createNativeRect)(_this.webAssemblyContext2D, 0, 0, viewRect.width, viewRect.height);
|
|
623
691
|
vecRects.push_back(nativeRect);
|
|
624
692
|
renderContext.drawRects(vecRects, brush, viewRect.left, viewRect.top);
|
|
625
|
-
nativeRect.delete();
|
|
626
693
|
brush.delete();
|
|
627
|
-
vecRects.delete();
|
|
628
694
|
};
|
|
629
695
|
drawTickViewRects();
|
|
630
696
|
var drawTitleViewRects = function () {
|
|
631
697
|
var viewRect = _this.axisTitleRenderer.viewRect;
|
|
632
|
-
var vecRects =
|
|
698
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(_this.webAssemblyContext2D);
|
|
633
699
|
var brush = new _this.webAssemblyContext2D.SCRTSolidBrush((0, parseColor_1.parseColorToUIntArgb)("rgba(0,255,0,0.7)"), false);
|
|
634
700
|
var nativeRect = (0, createNativeRect_1.createNativeRect)(_this.webAssemblyContext2D, 0, 0, viewRect.width, viewRect.height);
|
|
635
701
|
vecRects.push_back(nativeRect);
|
|
636
702
|
renderContext.drawRects(vecRects, brush, viewRect.left, viewRect.top);
|
|
637
|
-
nativeRect.delete();
|
|
638
703
|
brush.delete();
|
|
639
|
-
vecRects.delete();
|
|
640
704
|
};
|
|
641
705
|
drawTitleViewRects();
|
|
642
706
|
};
|
|
@@ -929,14 +993,13 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
929
993
|
// Even/Odd calculation helps preserve order of bands as you scroll
|
|
930
994
|
var firstTickIndex = this.getMajorTickIndex(ticks[0]);
|
|
931
995
|
var isEven = firstTickIndex % 2 === 0;
|
|
932
|
-
var vecRects =
|
|
996
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(this.webAssemblyContext2D);
|
|
933
997
|
var drawBand = function (coord0, coord1, isThisBandEven) {
|
|
934
998
|
if (!isThisBandEven) {
|
|
935
999
|
return;
|
|
936
1000
|
}
|
|
937
1001
|
var nativeRect = (0, createNativeRect_1.createNativeRect)(_this.webAssemblyContext2D, direction === XyDirection_1.EXyDirection.YDirection ? 0 : coord0, direction === XyDirection_1.EXyDirection.YDirection ? coord0 : 0, direction === XyDirection_1.EXyDirection.YDirection ? seriesViewRect.width : coord1, direction === XyDirection_1.EXyDirection.YDirection ? coord1 : seriesViewRect.height);
|
|
938
1002
|
vecRects.push_back(nativeRect);
|
|
939
|
-
nativeRect.delete();
|
|
940
1003
|
};
|
|
941
1004
|
ticks.forEach(function (mt, index) {
|
|
942
1005
|
var coord0 = index === 0 ? min : tickCoords[index - 1];
|
|
@@ -947,7 +1010,6 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
947
1010
|
// Draw the last band to the edge of the screen
|
|
948
1011
|
drawBand(max, tickCoords[ticks.length - 1], isEven);
|
|
949
1012
|
renderContext.drawRects(vecRects, brush, seriesViewRect.left, seriesViewRect.top);
|
|
950
|
-
vecRects.delete();
|
|
951
1013
|
};
|
|
952
1014
|
/**
|
|
953
1015
|
* Called internally - draws the Axis Grid Lines
|
|
@@ -960,22 +1022,18 @@ var AxisBase2D = /** @class */ (function (_super) {
|
|
|
960
1022
|
if (!tickCoords || tickCoords.length === 0)
|
|
961
1023
|
return;
|
|
962
1024
|
var seriesViewRect = this.parentSurface.seriesViewRect;
|
|
963
|
-
var vertices =
|
|
1025
|
+
var vertices = (0, NativeObject_1.getVectorColorVertex)(this.webAssemblyContext2D);
|
|
964
1026
|
tickCoords.forEach(function (tc) {
|
|
965
1027
|
var x1 = _this.isHorizontalAxis ? tc : 0;
|
|
966
1028
|
var x2 = _this.isHorizontalAxis ? tc : seriesViewRect.width;
|
|
967
1029
|
var y1 = _this.isHorizontalAxis ? 0 : tc;
|
|
968
1030
|
var y2 = _this.isHorizontalAxis ? seriesViewRect.height : tc;
|
|
969
|
-
var vertex =
|
|
1031
|
+
var vertex = (0, NativeObject_1.getVertex)(_this.webAssemblyContext2D, x1, y1);
|
|
970
1032
|
vertices.push_back(vertex);
|
|
971
|
-
|
|
972
|
-
var vertex2 = new _this.webAssemblyContext2D.SCRTColorVertex(x2, y2);
|
|
1033
|
+
var vertex2 = (0, NativeObject_1.getVertex)(_this.webAssemblyContext2D, x2, y2);
|
|
973
1034
|
vertices.push_back(vertex2);
|
|
974
|
-
vertex2.delete();
|
|
975
1035
|
});
|
|
976
1036
|
renderContext.drawLinesNative(vertices, linesPen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, seriesViewRect.left, seriesViewRect.top);
|
|
977
|
-
vertices.clear();
|
|
978
|
-
vertices.delete();
|
|
979
1037
|
};
|
|
980
1038
|
AxisBase2D.prototype.getXVisibleRange = function (xAxisId) {
|
|
981
1039
|
return this.parentSurface.getXAxisById(xAxisId).visibleRange;
|
|
@@ -741,6 +741,10 @@ export declare abstract class AxisCore implements IAxisParams, IDeletable {
|
|
|
741
741
|
* allows you to transform between pixel and data coordinates (and vice versa)
|
|
742
742
|
*/
|
|
743
743
|
getCurrentCoordinateCalculator(forceRecreate?: boolean): CoordinateCalculatorBase;
|
|
744
|
+
/** Force the recreation of the coordinate calculator the next time it is requested
|
|
745
|
+
* Required if the dataSeries has changed on a category axis
|
|
746
|
+
*/
|
|
747
|
+
clearCoordCalcCache(): void;
|
|
744
748
|
/**
|
|
745
749
|
* Gets a default value to apply to {@link AxisCore.visibleRange} if none provided, and no auto-range operation
|
|
746
750
|
*/
|
|
@@ -970,6 +970,12 @@ var AxisCore = /** @class */ (function () {
|
|
|
970
970
|
}
|
|
971
971
|
return this.coordCalcCache;
|
|
972
972
|
};
|
|
973
|
+
/** Force the recreation of the coordinate calculator the next time it is requested
|
|
974
|
+
* Required if the dataSeries has changed on a category axis
|
|
975
|
+
*/
|
|
976
|
+
AxisCore.prototype.clearCoordCalcCache = function () {
|
|
977
|
+
this.coordCalcCache = (0, Deleter_1.deleteSafe)(this.coordCalcCache);
|
|
978
|
+
};
|
|
973
979
|
/**
|
|
974
980
|
* @inheritDoc
|
|
975
981
|
*/
|
|
@@ -21,6 +21,7 @@ var LabelAlignment_1 = require("../../../types/LabelAlignment");
|
|
|
21
21
|
var parseColor_1 = require("../../../utils/parseColor");
|
|
22
22
|
var WebGlRenderContext2D_1 = require("../../Drawing/WebGlRenderContext2D");
|
|
23
23
|
var createNativeRect_1 = require("../Helpers/createNativeRect");
|
|
24
|
+
var NativeObject_1 = require("../Helpers/NativeObject");
|
|
24
25
|
var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
|
|
25
26
|
var DpiHelper_1 = require("../TextureManager/DpiHelper");
|
|
26
27
|
var TextureManager_1 = require("../TextureManager/TextureManager");
|
|
@@ -45,7 +46,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
45
46
|
this.hideOverlappingLabelsProperty = true;
|
|
46
47
|
this.webAssemblyContext = webAssemblyContext;
|
|
47
48
|
this.textureManager = new TextureManager_1.TextureManager(webAssemblyContext);
|
|
48
|
-
this.vertices =
|
|
49
|
+
this.vertices = (0, NativeObject_1.getVectorColorVertex)(webAssemblyContext);
|
|
49
50
|
if (!app_1.IS_TEST_ENV) {
|
|
50
51
|
this.measureTextCanvas = document.createElement("canvas");
|
|
51
52
|
this.measureTextCanvas.width = 1;
|
|
@@ -56,7 +57,6 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
56
57
|
AxisRenderer.prototype.delete = function () {
|
|
57
58
|
this.measureTextCanvas = undefined;
|
|
58
59
|
this.textureManager = (0, Deleter_1.deleteSafe)(this.textureManager);
|
|
59
|
-
this.vertices = (0, Deleter_1.deleteSafe)(this.vertices);
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* Called when the {@link AxisRenderer} is attached to an {@link AxisBase2D | Axis}
|
|
@@ -313,6 +313,7 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
313
313
|
return;
|
|
314
314
|
var viewRect = this.viewRect;
|
|
315
315
|
var tickSize = tickStyle.tickSize;
|
|
316
|
+
this.vertices.clear();
|
|
316
317
|
var isHorizontal = (0, AxisAlignment_1.getIsHorizontal)(axisAlignment);
|
|
317
318
|
if (isHorizontal === undefined) {
|
|
318
319
|
return;
|
|
@@ -347,17 +348,14 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
347
348
|
y2 = tc;
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
|
-
var vertex =
|
|
351
|
+
var vertex = (0, NativeObject_1.getVertex)(_this.webAssemblyContext, x1, y1);
|
|
351
352
|
_this.vertices.push_back(vertex);
|
|
352
|
-
|
|
353
|
-
var vertex2 = new _this.webAssemblyContext.SCRTColorVertex(x2, y2);
|
|
353
|
+
var vertex2 = (0, NativeObject_1.getVertex)(_this.webAssemblyContext, x2, y2);
|
|
354
354
|
_this.vertices.push_back(vertex2);
|
|
355
|
-
vertex2.delete();
|
|
356
355
|
});
|
|
357
356
|
var leftOffset = viewRect.left - (isHorizontal ? axisOffset : 0);
|
|
358
357
|
var topOffset = viewRect.top - (isHorizontal ? 0 : axisOffset);
|
|
359
358
|
renderContext.drawLinesNative(this.vertices, pen, WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine, leftOffset, topOffset);
|
|
360
|
-
this.vertices.clear();
|
|
361
359
|
};
|
|
362
360
|
/**
|
|
363
361
|
* Called internally - draws axis labels when needed, for example for line annotations
|
|
@@ -440,17 +438,15 @@ var AxisRenderer = /** @class */ (function () {
|
|
|
440
438
|
}
|
|
441
439
|
};
|
|
442
440
|
AxisRenderer.prototype.drawLabelViewRects = function (renderContext, axisRect, rects) {
|
|
443
|
-
var vecRects =
|
|
441
|
+
var vecRects = (0, NativeObject_1.getVectorRectVertex)(this.webAssemblyContext);
|
|
444
442
|
var brush = new this.webAssemblyContext.SCRTSolidBrush((0, parseColor_1.parseColorToUIntArgb)("rgba(30,30,255,0.3)"), false);
|
|
445
443
|
for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {
|
|
446
444
|
var rect = rects_1[_i];
|
|
447
445
|
var nativeRect = (0, createNativeRect_1.createNativeRect)(this.webAssemblyContext, rect.left, rect.top, rect.right, rect.bottom);
|
|
448
446
|
vecRects.push_back(nativeRect);
|
|
449
|
-
nativeRect.delete();
|
|
450
447
|
}
|
|
451
448
|
renderContext.drawRects(vecRects, brush, this.viewRect.left, this.viewRect.top);
|
|
452
449
|
brush.delete();
|
|
453
|
-
vecRects.delete();
|
|
454
450
|
};
|
|
455
451
|
return AxisRenderer;
|
|
456
452
|
}());
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TSciChart } from "../../../types/TSciChart";
|
|
2
|
+
import { IAxisBase2dOptions } from "./AxisBase2D";
|
|
3
|
+
import { ILabel2DOptions } from "./LabelProvider/LabelProviderBase2D";
|
|
4
|
+
import { NumericAxis } from "./NumericAxis";
|
|
5
|
+
export interface IDateTimeNumericAxisOptions extends IAxisBase2dOptions, ILabel2DOptions {
|
|
6
|
+
possibleDeltas?: number[];
|
|
7
|
+
minTicks?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class DateTimeNumericAxis extends NumericAxis {
|
|
10
|
+
constructor(webAssemblyContext: TSciChart, options?: IDateTimeNumericAxisOptions);
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DateTimeNumericAxis = void 0;
|
|
19
|
+
var DateTimeDeltaCalculator_1 = require("./DeltaCalculator/DateTimeDeltaCalculator");
|
|
20
|
+
var SmartDateLabelProvider_1 = require("./LabelProvider/SmartDateLabelProvider");
|
|
21
|
+
var NumericAxis_1 = require("./NumericAxis");
|
|
22
|
+
var DateTimeNumericAxis = /** @class */ (function (_super) {
|
|
23
|
+
__extends(DateTimeNumericAxis, _super);
|
|
24
|
+
function DateTimeNumericAxis(webAssemblyContext, options) {
|
|
25
|
+
var _a;
|
|
26
|
+
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
27
|
+
_this.labelProvider = (_a = options === null || options === void 0 ? void 0 : options.labelProvider) !== null && _a !== void 0 ? _a : new SmartDateLabelProvider_1.SmartDateLabelProvider();
|
|
28
|
+
_this.deltaCalculator = new DateTimeDeltaCalculator_1.DateTimeDeltaCalculator({
|
|
29
|
+
possibleDeltas: options === null || options === void 0 ? void 0 : options.possibleDeltas,
|
|
30
|
+
minTicks: options === null || options === void 0 ? void 0 : options.minTicks
|
|
31
|
+
});
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
return DateTimeNumericAxis;
|
|
35
|
+
}(NumericAxis_1.NumericAxis));
|
|
36
|
+
exports.DateTimeNumericAxis = DateTimeNumericAxis;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NumberRange } from "../../../../Core/NumberRange";
|
|
2
|
+
import { DeltaCalculator } from "./DeltaCalculator";
|
|
3
|
+
export interface IDeltaCalculatorOptions {
|
|
4
|
+
possibleDeltas?: number[];
|
|
5
|
+
minTicks?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The DateTimeDeltaCalculator is respinsible for calculating {@link AxisCore.minorDelta} and {@link AxisCore.majorDelta} on
|
|
9
|
+
* {@link NumericAxis} types.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DateTimeDeltaCalculator extends DeltaCalculator {
|
|
12
|
+
private possibleDeltasProperty;
|
|
13
|
+
private minTicksProperty;
|
|
14
|
+
private prevIndex;
|
|
15
|
+
private currIndex;
|
|
16
|
+
constructor(options?: IDeltaCalculatorOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Gets or sets deltas array
|
|
19
|
+
*/
|
|
20
|
+
get possibleDeltas(): number[];
|
|
21
|
+
set possibleDeltas(value: number[]);
|
|
22
|
+
get minTicks(): number;
|
|
23
|
+
set minTicks(value: number);
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
getDeltaFromRange(min: number, max: number, minorsPerMajor: number, maxTicks: number): NumberRange;
|
|
28
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DateTimeDeltaCalculator = void 0;
|
|
19
|
+
var NumberRange_1 = require("../../../../Core/NumberRange");
|
|
20
|
+
var DeltaCalculator_1 = require("./DeltaCalculator");
|
|
21
|
+
/**
|
|
22
|
+
* The DateTimeDeltaCalculator is respinsible for calculating {@link AxisCore.minorDelta} and {@link AxisCore.majorDelta} on
|
|
23
|
+
* {@link NumericAxis} types.
|
|
24
|
+
*/
|
|
25
|
+
var DateTimeDeltaCalculator = /** @class */ (function (_super) {
|
|
26
|
+
__extends(DateTimeDeltaCalculator, _super);
|
|
27
|
+
function DateTimeDeltaCalculator(options) {
|
|
28
|
+
var _a;
|
|
29
|
+
var _this = _super.call(this) || this;
|
|
30
|
+
_this.possibleDeltasProperty = [
|
|
31
|
+
1,
|
|
32
|
+
2,
|
|
33
|
+
5,
|
|
34
|
+
10,
|
|
35
|
+
15,
|
|
36
|
+
30,
|
|
37
|
+
60,
|
|
38
|
+
2 * 60,
|
|
39
|
+
5 * 60,
|
|
40
|
+
10 * 60,
|
|
41
|
+
15 * 60,
|
|
42
|
+
30 * 60,
|
|
43
|
+
60 * 60,
|
|
44
|
+
3 * 60 * 60,
|
|
45
|
+
6 * 60 * 60,
|
|
46
|
+
12 * 60 * 60,
|
|
47
|
+
24 * 60 * 60,
|
|
48
|
+
3 * 24 * 60 * 60,
|
|
49
|
+
5 * 24 * 60 * 60,
|
|
50
|
+
10 * 24 * 60 * 60,
|
|
51
|
+
15 * 24 * 60 * 60,
|
|
52
|
+
20 * 24 * 60 * 60,
|
|
53
|
+
30 * 24 * 60 * 60,
|
|
54
|
+
// TODO these month deltas really need special handling
|
|
55
|
+
2 * 30 * 24 * 60 * 60,
|
|
56
|
+
4 * 30 * 24 * 60 * 60,
|
|
57
|
+
6 * 30 * 24 * 60 * 60,
|
|
58
|
+
12 * 30 * 24 * 60 * 60
|
|
59
|
+
];
|
|
60
|
+
_this.currIndex = 12;
|
|
61
|
+
_this.possibleDeltasProperty = (_a = options === null || options === void 0 ? void 0 : options.possibleDeltas) !== null && _a !== void 0 ? _a : _this.possibleDeltasProperty;
|
|
62
|
+
_this.minTicks = options === null || options === void 0 ? void 0 : options.minTicks;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
Object.defineProperty(DateTimeDeltaCalculator.prototype, "possibleDeltas", {
|
|
66
|
+
/**
|
|
67
|
+
* Gets or sets deltas array
|
|
68
|
+
*/
|
|
69
|
+
get: function () {
|
|
70
|
+
return this.possibleDeltasProperty;
|
|
71
|
+
},
|
|
72
|
+
set: function (value) {
|
|
73
|
+
if (this.possibleDeltasProperty !== value) {
|
|
74
|
+
this.possibleDeltasProperty = value;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
enumerable: false,
|
|
78
|
+
configurable: true
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(DateTimeDeltaCalculator.prototype, "minTicks", {
|
|
81
|
+
get: function () {
|
|
82
|
+
return this.minTicksProperty;
|
|
83
|
+
},
|
|
84
|
+
set: function (value) {
|
|
85
|
+
if (this.minTicksProperty !== value) {
|
|
86
|
+
this.minTicksProperty = value;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
enumerable: false,
|
|
90
|
+
configurable: true
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
DateTimeDeltaCalculator.prototype.getDeltaFromRange = function (min, max, minorsPerMajor, maxTicks) {
|
|
96
|
+
var _this = this;
|
|
97
|
+
var diff = max - min;
|
|
98
|
+
this.prevIndex = undefined;
|
|
99
|
+
var calculateDelta = function (deltas, index) {
|
|
100
|
+
var _a;
|
|
101
|
+
var delta = deltas[index];
|
|
102
|
+
var ticksCount = Math.floor(diff / delta);
|
|
103
|
+
if (ticksCount < ((_a = _this.minTicks) !== null && _a !== void 0 ? _a : maxTicks / 3) && index > 0 && index !== _this.prevIndex) {
|
|
104
|
+
if (!_this.prevIndex)
|
|
105
|
+
_this.prevIndex = index;
|
|
106
|
+
return calculateDelta(deltas, index - 1);
|
|
107
|
+
}
|
|
108
|
+
if (ticksCount > maxTicks && index < deltas.length && index !== _this.prevIndex) {
|
|
109
|
+
if (!_this.prevIndex)
|
|
110
|
+
_this.prevIndex = index;
|
|
111
|
+
return calculateDelta(deltas, index + 1);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if (_this.currIndex !== index) {
|
|
115
|
+
_this.currIndex = index;
|
|
116
|
+
}
|
|
117
|
+
return delta;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var delta = calculateDelta(this.possibleDeltasProperty, this.currIndex);
|
|
121
|
+
return new NumberRange_1.NumberRange(delta / minorsPerMajor, delta);
|
|
122
|
+
};
|
|
123
|
+
return DateTimeDeltaCalculator;
|
|
124
|
+
}(DeltaCalculator_1.DeltaCalculator));
|
|
125
|
+
exports.DateTimeDeltaCalculator = DateTimeDeltaCalculator;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ELabelProviderType } from "../../../../types/LabelProviderType";
|
|
2
|
+
import { IPieSegment } from "../../SciChartPieSurface/PieSegment/IPieSegment";
|
|
3
|
+
import { SciChartPieSurface } from "../../SciChartPieSurface/SciChartPieSurface";
|
|
4
|
+
import { ILabelOptions, LabelProvider } from "./LabelProvider";
|
|
5
|
+
/**
|
|
6
|
+
* @summary A Label Provider for use with Pie Charts to allow customizing of segment labels
|
|
7
|
+
* To completely customise the label output, override {@link getSegmentText}
|
|
8
|
+
* To just adjust the numeric formatting of the label, use numericformat, precision, prefix, postfix, or override {@link formatLabel}
|
|
9
|
+
*/
|
|
10
|
+
export declare class PieLabelProvider extends LabelProvider {
|
|
11
|
+
readonly type = ELabelProviderType.Pie;
|
|
12
|
+
/**
|
|
13
|
+
* The parent {@link SciChartPieSurface}. This will be set once {@link attachedToSurface} is called
|
|
14
|
+
*/
|
|
15
|
+
protected parentSurface: SciChartPieSurface;
|
|
16
|
+
constructor(options?: ILabelOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Get the text to be used as the segmet label. This picks the raw value, or percentage depending on the chart's valueMode
|
|
19
|
+
* then formats it using the {@link formatLabel} function.
|
|
20
|
+
* @param segment The PieSegment to get a label for
|
|
21
|
+
* @param total Total of all pieSegment values
|
|
22
|
+
*/
|
|
23
|
+
getSegmentText(segment: IPieSegment, total: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* Called when the {@link LabelProvider} is attached to an {@link SciChartPieSurface }
|
|
26
|
+
* @param pieSurface The SciPieSurface we are attached to.
|
|
27
|
+
*/
|
|
28
|
+
attachedToSurface(pieSurface: SciChartPieSurface): void;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
onBeginAxisDraw(): void;
|
|
33
|
+
protected invalidateParent(): void;
|
|
34
|
+
}
|