scichart 2.2.2351 → 2.2.2393
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/buildSeries.d.ts +7 -2
- package/Builder/buildSeries.js +5 -1
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
- package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
- package/Charting/Model/BaseHeatmapDataSeries.js +1 -1
- 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/HlcPointSeriesWrapped.d.ts +10 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
- 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/RolloverTooltipSvgAnnotation.js +8 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +1 -1
- package/Charting/Visuals/Axis/AxisBase2D.js +9 -22
- 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 +7 -2
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +9 -4
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +18 -2
- 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/Legend/SciChartLegend.js +1 -1
- 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 +9 -2
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +74 -22
- 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/StackedColumnCollection.js +1 -2
- package/Charting/Visuals/RenderableSeries/constants.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/constants.js +5 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +5 -0
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +116 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +139 -4
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +4 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +3 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +13 -3
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +114 -74
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +1 -0
- package/Charting/Visuals/createMaster.js +15 -11
- package/Charting/Visuals/createSingle.js +3 -1
- 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/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 +22 -16
- package/Charting3D/Visuals/createSingle3d.js +5 -6
- 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 +10 -10
- 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/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/NumericFormat.d.ts +4 -0
- package/types/NumericFormat.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/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
- package/utils/number.js +15 -2
|
@@ -13,11 +13,16 @@ var PROPERTY;
|
|
|
13
13
|
PROPERTY["CONTOUR_MAJOR_LINE_STYLE"] = "CONTOUR_MAJOR_LINE_STYLE";
|
|
14
14
|
PROPERTY["CONTOUR_COLOR_MAP_MODE"] = "CONTOUR_COLOR_MAP_MODE";
|
|
15
15
|
PROPERTY["DATA_POINT_WIDTH"] = "dataPointWidth";
|
|
16
|
+
PROPERTY["DATA_POINT_WIDTH_MODE"] = "DATA_POINT_WIDTH_MODE";
|
|
16
17
|
PROPERTY["DATA_SERIES"] = "dataSeries";
|
|
17
18
|
PROPERTY["DRAWING_PROVIDERS"] = "DRAWING_PROVIDERS";
|
|
18
19
|
PROPERTY["DRAW_NAN_AS"] = "drawNaNAs";
|
|
20
|
+
PROPERTY["DRAW_CONNECTOR"] = "DRAW_CONNECTOR";
|
|
21
|
+
PROPERTY["DRAW_WHISKERS"] = "DRAW_WHISKERS";
|
|
19
22
|
PROPERTY["EFFECT"] = "EFFECT";
|
|
20
23
|
PROPERTY["ENABLE_DRAWING_OPTIMISATIONS"] = "ENABLE_DRAWING_OPTIMISATIONS";
|
|
24
|
+
PROPERTY["ERROR_DIRECTION"] = "ERROR_DIRECTION";
|
|
25
|
+
PROPERTY["ERROR_MODE"] = "ERROR_MODE";
|
|
21
26
|
PROPERTY["FILL"] = "fill";
|
|
22
27
|
PROPERTY["FILL_Y1"] = "FILL_Y1";
|
|
23
28
|
PROPERTY["FILL_LINEAR_GRADIENT"] = "FILL_LINEAR_GRADIENT";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TLabelProviderDefinition } from "../../../Builder/buildAxis";
|
|
1
2
|
import { Thickness } from "../../../Core/Thickness";
|
|
2
3
|
import { TBorder } from "../../../types/TBorder";
|
|
3
4
|
import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
|
|
@@ -44,7 +45,7 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
|
|
|
44
45
|
/**
|
|
45
46
|
* Sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
46
47
|
*/
|
|
47
|
-
labelProvider?: PieLabelProvider;
|
|
48
|
+
labelProvider?: PieLabelProvider | TLabelProviderDefinition;
|
|
48
49
|
/** Whether to show labels as percentages, or raw values. Default to percentages */
|
|
49
50
|
valueMode?: EPieValueMode;
|
|
50
51
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { GradientParams } from "../../../../Core/GradientParams";
|
|
2
|
+
import { Point } from "../../../../Core/Point";
|
|
3
|
+
import { TTextStyle } from "../../Axis/AxisCore";
|
|
2
4
|
import { SciChartPieSurface } from "../SciChartPieSurface";
|
|
3
5
|
import { IPieSegmentOptions } from "./PieSegment";
|
|
4
6
|
export interface IPieSegment {
|
|
@@ -11,6 +13,9 @@ export interface IPieSegment {
|
|
|
11
13
|
isSelected: boolean;
|
|
12
14
|
delta: number;
|
|
13
15
|
shift: number;
|
|
16
|
+
labelStyle: TTextStyle;
|
|
17
|
+
labelOffset: Point;
|
|
18
|
+
radiusAdjustment: number;
|
|
14
19
|
onAttach(scs: SciChartPieSurface): void;
|
|
15
20
|
onDetach(): void;
|
|
16
21
|
toJSON(): IPieSegmentOptions;
|
|
@@ -1,17 +1,53 @@
|
|
|
1
|
+
import { TLabelProviderDefinition } from "../../../../Builder/buildAxis";
|
|
1
2
|
import { GradientParams } from "../../../../Core/GradientParams";
|
|
3
|
+
import { Point } from "../../../../Core/Point";
|
|
2
4
|
import { RequiredOwnProps } from "../../../../types/HelperTypes";
|
|
5
|
+
import { TTextStyle } from "../../Axis/AxisCore";
|
|
3
6
|
import { PieLabelProvider } from "../../Axis/LabelProvider/PieLabelProvider";
|
|
4
7
|
import { SciChartPieSurface } from "../SciChartPieSurface";
|
|
5
8
|
import { IPieSegment } from "./IPieSegment";
|
|
6
9
|
export interface IPieSegmentOptions {
|
|
7
10
|
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* A text value for the segment which will be displayed in the legend
|
|
13
|
+
*/
|
|
8
14
|
text?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The numerical value of the segment
|
|
17
|
+
*/
|
|
9
18
|
value?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The color of the segment as an HTML color code
|
|
21
|
+
*/
|
|
10
22
|
color?: string;
|
|
23
|
+
/**
|
|
24
|
+
* An optional color gradient
|
|
25
|
+
*/
|
|
11
26
|
colorLinearGradient?: GradientParams;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the segment is selected. Selected segments are shifted outwards by the delta
|
|
29
|
+
*/
|
|
12
30
|
isSelected?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The amount to shift the segment when it is selected. Default 15 px
|
|
33
|
+
*/
|
|
13
34
|
delta?: number;
|
|
14
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
|
|
37
|
+
*/
|
|
38
|
+
labelProvider?: PieLabelProvider | TLabelProviderDefinition;
|
|
39
|
+
/**
|
|
40
|
+
* Optional text style that will override the default style from the surface for this segment only
|
|
41
|
+
*/
|
|
42
|
+
labelStyle?: TTextStyle;
|
|
43
|
+
/**
|
|
44
|
+
* An x, y offset for the label position
|
|
45
|
+
*/
|
|
46
|
+
labelOffset?: Point;
|
|
47
|
+
/**
|
|
48
|
+
* A relative adjustment of the radius for this segment. eg 1.5 will be 50% larger than normal
|
|
49
|
+
*/
|
|
50
|
+
radiusAdjustment?: number;
|
|
15
51
|
}
|
|
16
52
|
export declare class PieSegment implements IPieSegment {
|
|
17
53
|
readonly id: string;
|
|
@@ -25,28 +61,107 @@ export declare class PieSegment implements IPieSegment {
|
|
|
25
61
|
private shiftProperty;
|
|
26
62
|
private parentSurface;
|
|
27
63
|
private labelProviderProperty;
|
|
64
|
+
private labelStyleProperty;
|
|
65
|
+
private labelOffsetProperty;
|
|
66
|
+
private radiusAdjustmentProperty;
|
|
28
67
|
private invalidateParentCallback;
|
|
29
68
|
constructor(options?: IPieSegmentOptions);
|
|
30
69
|
onAttach(scps: SciChartPieSurface): void;
|
|
31
70
|
onDetach(): void;
|
|
71
|
+
/**
|
|
72
|
+
* An optional color gradient
|
|
73
|
+
*/
|
|
32
74
|
get colorLinearGradient(): GradientParams;
|
|
75
|
+
/**
|
|
76
|
+
* An optional color gradient
|
|
77
|
+
*/
|
|
33
78
|
set colorLinearGradient(value: GradientParams);
|
|
79
|
+
/**
|
|
80
|
+
* The color of the segment as an HTML color code
|
|
81
|
+
*/
|
|
34
82
|
get color(): string;
|
|
83
|
+
/**
|
|
84
|
+
* The color of the segment as an HTML color code
|
|
85
|
+
*/
|
|
35
86
|
set color(value: string);
|
|
87
|
+
/**
|
|
88
|
+
* Whether the segment is selected. Selected segments are shifted outwards by the delta
|
|
89
|
+
*/
|
|
36
90
|
get isSelected(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the segment is selected. Selected segments are shifted outwards by the delta
|
|
93
|
+
*/
|
|
37
94
|
set isSelected(value: boolean);
|
|
95
|
+
/**
|
|
96
|
+
* A text value for the segment which will be displayed in the legend
|
|
97
|
+
*/
|
|
38
98
|
get text(): string;
|
|
99
|
+
/**
|
|
100
|
+
* A text value for the segment which will be displayed in the legend
|
|
101
|
+
*/
|
|
39
102
|
set text(value: string);
|
|
103
|
+
/**
|
|
104
|
+
* Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
|
|
105
|
+
*/
|
|
40
106
|
get labelProvider(): PieLabelProvider;
|
|
107
|
+
/**
|
|
108
|
+
* Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
|
|
109
|
+
*/
|
|
41
110
|
set labelProvider(value: PieLabelProvider);
|
|
42
111
|
getPercentage(total: number): number;
|
|
112
|
+
/**
|
|
113
|
+
* The numerical value of the segment
|
|
114
|
+
*/
|
|
43
115
|
get value(): number;
|
|
116
|
+
/**
|
|
117
|
+
* The numerical value of the segment
|
|
118
|
+
*/
|
|
44
119
|
set value(value: number);
|
|
120
|
+
/**
|
|
121
|
+
* The previous value of the segment, if it has been updated. Used for animations
|
|
122
|
+
*/
|
|
45
123
|
get oldValue(): number;
|
|
124
|
+
/**
|
|
125
|
+
* The amount to shift the segment when it is selected. Default 15 px
|
|
126
|
+
*/
|
|
46
127
|
get delta(): number;
|
|
128
|
+
/**
|
|
129
|
+
* The amount to shift the segment when it is selected. Default 15 px
|
|
130
|
+
*/
|
|
47
131
|
set delta(value: number);
|
|
132
|
+
/**
|
|
133
|
+
* The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
|
|
134
|
+
* Do not set this directly. Use delta and isSelected instead
|
|
135
|
+
*/
|
|
48
136
|
get shift(): number;
|
|
137
|
+
/**
|
|
138
|
+
* The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
|
|
139
|
+
*/
|
|
49
140
|
set shift(value: number);
|
|
141
|
+
/**
|
|
142
|
+
* Gets or sets a {@link TTextStyle} object for styling labels for this segment only
|
|
143
|
+
*/
|
|
144
|
+
get labelStyle(): TTextStyle;
|
|
145
|
+
/**
|
|
146
|
+
* Gets or sets a {@link TTextStyle} object for styling labels for this segment only
|
|
147
|
+
*/
|
|
148
|
+
set labelStyle(textStyle: TTextStyle);
|
|
149
|
+
/**
|
|
150
|
+
* An x, y offset for the label position
|
|
151
|
+
*/
|
|
152
|
+
get labelOffset(): Point;
|
|
153
|
+
/**
|
|
154
|
+
* An x, y offset for the label position
|
|
155
|
+
*/
|
|
156
|
+
set labelOffset(value: Point);
|
|
157
|
+
/**
|
|
158
|
+
* A relative adjustment of the radius for this segment. eg 1.5 will be 50% larger than normal
|
|
159
|
+
*/
|
|
160
|
+
get radiusAdjustment(): number;
|
|
161
|
+
/**
|
|
162
|
+
* A relative adjustment of the radius for this segment. eg 1.5 will be 50% larger than normal
|
|
163
|
+
*/
|
|
164
|
+
set radiusAdjustment(value: number);
|
|
50
165
|
toJSON(): RequiredOwnProps<IPieSegmentOptions>;
|
|
51
166
|
getLabelText(total: number): string;
|
|
52
167
|
private notifyPropertyChanged;
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.PieSegment = void 0;
|
|
15
|
+
var classFactory_1 = require("../../../../Builder/classFactory");
|
|
16
|
+
var Point_1 = require("../../../../Core/Point");
|
|
17
|
+
var BaseType_1 = require("../../../../types/BaseType");
|
|
4
18
|
var guid_1 = require("../../../../utils/guid");
|
|
5
19
|
var PieLabelProvider_1 = require("../../Axis/LabelProvider/PieLabelProvider");
|
|
6
20
|
var constants_1 = require("./constants");
|
|
7
21
|
var PieSegment = /** @class */ (function () {
|
|
8
22
|
function PieSegment(options) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
10
24
|
this.colorProperty = "grey";
|
|
11
25
|
this.isSelectedProperty = false;
|
|
12
26
|
this.textProperty = "";
|
|
13
27
|
this.deltaProperty = 15;
|
|
14
28
|
this.shiftProperty = 0;
|
|
29
|
+
this.labelOffsetProperty = new Point_1.Point(0, 0);
|
|
30
|
+
this.radiusAdjustmentProperty = 1;
|
|
15
31
|
this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
|
|
16
32
|
this.colorProperty = (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : this.colorProperty;
|
|
17
33
|
this.colorLinearGradientProperty = (_c = options === null || options === void 0 ? void 0 : options.colorLinearGradient) !== null && _c !== void 0 ? _c : this.colorLinearGradientProperty;
|
|
@@ -19,7 +35,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
19
35
|
this.textProperty = (_e = options === null || options === void 0 ? void 0 : options.text) !== null && _e !== void 0 ? _e : this.textProperty;
|
|
20
36
|
this.valueProperty = (_f = options === null || options === void 0 ? void 0 : options.value) !== null && _f !== void 0 ? _f : this.valueProperty;
|
|
21
37
|
this.deltaProperty = (_g = options === null || options === void 0 ? void 0 : options.delta) !== null && _g !== void 0 ? _g : this.deltaProperty;
|
|
38
|
+
if (options === null || options === void 0 ? void 0 : options.labelProvider) {
|
|
39
|
+
if (!("getSegmentText" in (options === null || options === void 0 ? void 0 : options.labelProvider))) {
|
|
40
|
+
options.labelProvider = (0, classFactory_1.createType)(BaseType_1.EBaseType.LabelProvider, options.labelProvider.type, undefined, options.labelProvider.options);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
22
43
|
this.labelProviderProperty = options === null || options === void 0 ? void 0 : options.labelProvider; // No default here as we default to labelprovider on parent surface
|
|
44
|
+
this.labelOffsetProperty = (_h = options === null || options === void 0 ? void 0 : options.labelOffset) !== null && _h !== void 0 ? _h : this.labelOffsetProperty;
|
|
45
|
+
this.labelStyleProperty = options === null || options === void 0 ? void 0 : options.labelStyle;
|
|
46
|
+
this.radiusAdjustmentProperty = (_j = options === null || options === void 0 ? void 0 : options.radiusAdjustment) !== null && _j !== void 0 ? _j : this.radiusAdjustmentProperty;
|
|
23
47
|
}
|
|
24
48
|
PieSegment.prototype.onAttach = function (scps) {
|
|
25
49
|
this.parentSurface = scps;
|
|
@@ -33,9 +57,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
33
57
|
};
|
|
34
58
|
Object.defineProperty(PieSegment.prototype, "colorLinearGradient", {
|
|
35
59
|
// GETTERS AND SETTERS FOR PROPERTIES
|
|
60
|
+
/**
|
|
61
|
+
* An optional color gradient
|
|
62
|
+
*/
|
|
36
63
|
get: function () {
|
|
37
64
|
return this.colorLinearGradientProperty;
|
|
38
65
|
},
|
|
66
|
+
/**
|
|
67
|
+
* An optional color gradient
|
|
68
|
+
*/
|
|
39
69
|
set: function (value) {
|
|
40
70
|
this.colorLinearGradientProperty = value;
|
|
41
71
|
this.notifyPropertyChanged(constants_1.PROPERTY.COLOR_LINEAR_GRADIENT);
|
|
@@ -44,9 +74,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
44
74
|
configurable: true
|
|
45
75
|
});
|
|
46
76
|
Object.defineProperty(PieSegment.prototype, "color", {
|
|
77
|
+
/**
|
|
78
|
+
* The color of the segment as an HTML color code
|
|
79
|
+
*/
|
|
47
80
|
get: function () {
|
|
48
81
|
return this.colorProperty;
|
|
49
82
|
},
|
|
83
|
+
/**
|
|
84
|
+
* The color of the segment as an HTML color code
|
|
85
|
+
*/
|
|
50
86
|
set: function (value) {
|
|
51
87
|
this.colorProperty = value;
|
|
52
88
|
this.notifyPropertyChanged(constants_1.PROPERTY.COLOR);
|
|
@@ -55,9 +91,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
55
91
|
configurable: true
|
|
56
92
|
});
|
|
57
93
|
Object.defineProperty(PieSegment.prototype, "isSelected", {
|
|
94
|
+
/**
|
|
95
|
+
* Whether the segment is selected. Selected segments are shifted outwards by the delta
|
|
96
|
+
*/
|
|
58
97
|
get: function () {
|
|
59
98
|
return this.isSelectedProperty;
|
|
60
99
|
},
|
|
100
|
+
/**
|
|
101
|
+
* Whether the segment is selected. Selected segments are shifted outwards by the delta
|
|
102
|
+
*/
|
|
61
103
|
set: function (value) {
|
|
62
104
|
if (this.isSelectedProperty !== value) {
|
|
63
105
|
this.isSelectedProperty = value;
|
|
@@ -68,9 +110,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
68
110
|
configurable: true
|
|
69
111
|
});
|
|
70
112
|
Object.defineProperty(PieSegment.prototype, "text", {
|
|
113
|
+
/**
|
|
114
|
+
* A text value for the segment which will be displayed in the legend
|
|
115
|
+
*/
|
|
71
116
|
get: function () {
|
|
72
117
|
return this.textProperty;
|
|
73
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* A text value for the segment which will be displayed in the legend
|
|
121
|
+
*/
|
|
74
122
|
set: function (value) {
|
|
75
123
|
this.textProperty = value;
|
|
76
124
|
this.notifyPropertyChanged(constants_1.PROPERTY.TEXT);
|
|
@@ -79,6 +127,9 @@ var PieSegment = /** @class */ (function () {
|
|
|
79
127
|
configurable: true
|
|
80
128
|
});
|
|
81
129
|
Object.defineProperty(PieSegment.prototype, "labelProvider", {
|
|
130
|
+
/**
|
|
131
|
+
* Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
|
|
132
|
+
*/
|
|
82
133
|
get: function () {
|
|
83
134
|
// Create a labelProvider if it is accessed. This will override behaviour from the parent surface
|
|
84
135
|
if (this.labelProviderProperty === undefined) {
|
|
@@ -86,6 +137,9 @@ var PieSegment = /** @class */ (function () {
|
|
|
86
137
|
}
|
|
87
138
|
return this.labelProviderProperty;
|
|
88
139
|
},
|
|
140
|
+
/**
|
|
141
|
+
* Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
|
|
142
|
+
*/
|
|
89
143
|
set: function (value) {
|
|
90
144
|
this.labelProviderProperty = value;
|
|
91
145
|
this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_PROVIDER);
|
|
@@ -97,9 +151,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
97
151
|
return (100 * this.value) / total;
|
|
98
152
|
};
|
|
99
153
|
Object.defineProperty(PieSegment.prototype, "value", {
|
|
154
|
+
/**
|
|
155
|
+
* The numerical value of the segment
|
|
156
|
+
*/
|
|
100
157
|
get: function () {
|
|
101
158
|
return this.valueProperty;
|
|
102
159
|
},
|
|
160
|
+
/**
|
|
161
|
+
* The numerical value of the segment
|
|
162
|
+
*/
|
|
103
163
|
set: function (value) {
|
|
104
164
|
this.oldValueProperty = this.valueProperty;
|
|
105
165
|
this.valueProperty = value;
|
|
@@ -109,6 +169,9 @@ var PieSegment = /** @class */ (function () {
|
|
|
109
169
|
configurable: true
|
|
110
170
|
});
|
|
111
171
|
Object.defineProperty(PieSegment.prototype, "oldValue", {
|
|
172
|
+
/**
|
|
173
|
+
* The previous value of the segment, if it has been updated. Used for animations
|
|
174
|
+
*/
|
|
112
175
|
get: function () {
|
|
113
176
|
return this.oldValueProperty;
|
|
114
177
|
},
|
|
@@ -116,9 +179,15 @@ var PieSegment = /** @class */ (function () {
|
|
|
116
179
|
configurable: true
|
|
117
180
|
});
|
|
118
181
|
Object.defineProperty(PieSegment.prototype, "delta", {
|
|
182
|
+
/**
|
|
183
|
+
* The amount to shift the segment when it is selected. Default 15 px
|
|
184
|
+
*/
|
|
119
185
|
get: function () {
|
|
120
186
|
return this.deltaProperty;
|
|
121
187
|
},
|
|
188
|
+
/**
|
|
189
|
+
* The amount to shift the segment when it is selected. Default 15 px
|
|
190
|
+
*/
|
|
122
191
|
set: function (value) {
|
|
123
192
|
if (this.deltaProperty !== value) {
|
|
124
193
|
this.deltaProperty = value;
|
|
@@ -129,9 +198,16 @@ var PieSegment = /** @class */ (function () {
|
|
|
129
198
|
configurable: true
|
|
130
199
|
});
|
|
131
200
|
Object.defineProperty(PieSegment.prototype, "shift", {
|
|
201
|
+
/**
|
|
202
|
+
* The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
|
|
203
|
+
* Do not set this directly. Use delta and isSelected instead
|
|
204
|
+
*/
|
|
132
205
|
get: function () {
|
|
133
206
|
return this.shiftProperty;
|
|
134
207
|
},
|
|
208
|
+
/**
|
|
209
|
+
* The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
|
|
210
|
+
*/
|
|
135
211
|
set: function (value) {
|
|
136
212
|
if (this.shiftProperty !== value) {
|
|
137
213
|
this.shiftProperty = value;
|
|
@@ -141,7 +217,63 @@ var PieSegment = /** @class */ (function () {
|
|
|
141
217
|
enumerable: false,
|
|
142
218
|
configurable: true
|
|
143
219
|
});
|
|
220
|
+
Object.defineProperty(PieSegment.prototype, "labelStyle", {
|
|
221
|
+
/**
|
|
222
|
+
* Gets or sets a {@link TTextStyle} object for styling labels for this segment only
|
|
223
|
+
*/
|
|
224
|
+
get: function () {
|
|
225
|
+
var _a;
|
|
226
|
+
return __assign(__assign({}, (_a = this.parentSurface) === null || _a === void 0 ? void 0 : _a.labelStyle), this.labelStyleProperty);
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* Gets or sets a {@link TTextStyle} object for styling labels for this segment only
|
|
230
|
+
*/
|
|
231
|
+
set: function (textStyle) {
|
|
232
|
+
this.labelStyleProperty = __assign(__assign({}, this.labelStyleProperty), textStyle);
|
|
233
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_STYLE);
|
|
234
|
+
},
|
|
235
|
+
enumerable: false,
|
|
236
|
+
configurable: true
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(PieSegment.prototype, "labelOffset", {
|
|
239
|
+
/**
|
|
240
|
+
* An x, y offset for the label position
|
|
241
|
+
*/
|
|
242
|
+
get: function () {
|
|
243
|
+
return this.labelOffsetProperty;
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* An x, y offset for the label position
|
|
247
|
+
*/
|
|
248
|
+
set: function (value) {
|
|
249
|
+
var _a, _b;
|
|
250
|
+
if (((_a = this.labelOffsetProperty) === null || _a === void 0 ? void 0 : _a.x) !== value.x && ((_b = this.labelOffsetProperty) === null || _b === void 0 ? void 0 : _b.y) !== value.y) {
|
|
251
|
+
this.labelOffsetProperty = value;
|
|
252
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_OFFSET);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
enumerable: false,
|
|
256
|
+
configurable: true
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(PieSegment.prototype, "radiusAdjustment", {
|
|
259
|
+
/**
|
|
260
|
+
* A relative adjustment of the radius for this segment. eg 1.5 will be 50% larger than normal
|
|
261
|
+
*/
|
|
262
|
+
get: function () {
|
|
263
|
+
return this.radiusAdjustmentProperty;
|
|
264
|
+
},
|
|
265
|
+
/**
|
|
266
|
+
* A relative adjustment of the radius for this segment. eg 1.5 will be 50% larger than normal
|
|
267
|
+
*/
|
|
268
|
+
set: function (value) {
|
|
269
|
+
this.radiusAdjustmentProperty = value;
|
|
270
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.RADIUS_ADJUSTMENT);
|
|
271
|
+
},
|
|
272
|
+
enumerable: false,
|
|
273
|
+
configurable: true
|
|
274
|
+
});
|
|
144
275
|
PieSegment.prototype.toJSON = function () {
|
|
276
|
+
var _a;
|
|
145
277
|
return {
|
|
146
278
|
id: this.id,
|
|
147
279
|
color: this.color,
|
|
@@ -151,7 +283,10 @@ var PieSegment = /** @class */ (function () {
|
|
|
151
283
|
text: this.text,
|
|
152
284
|
value: this.value,
|
|
153
285
|
// @ts-ignore
|
|
154
|
-
labelProvider: this.
|
|
286
|
+
labelProvider: (_a = this.labelProviderProperty) === null || _a === void 0 ? void 0 : _a.toJSON(),
|
|
287
|
+
labelOffset: this.labelOffset,
|
|
288
|
+
labelStyle: this.labelStyle,
|
|
289
|
+
radiusAdjustment: this.radiusAdjustment
|
|
155
290
|
};
|
|
156
291
|
};
|
|
157
292
|
PieSegment.prototype.getLabelText = function (total) {
|
|
@@ -163,8 +298,8 @@ var PieSegment = /** @class */ (function () {
|
|
|
163
298
|
}
|
|
164
299
|
};
|
|
165
300
|
PieSegment.prototype.notifyPropertyChanged = function (propertyName) {
|
|
166
|
-
if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER) {
|
|
167
|
-
this.
|
|
301
|
+
if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER && this.labelProviderProperty) {
|
|
302
|
+
this.labelProviderProperty.attachedToSurface(this.parentSurface);
|
|
168
303
|
}
|
|
169
304
|
if (this.invalidateParentCallback) {
|
|
170
305
|
this.invalidateParentCallback(propertyName);
|
|
@@ -7,5 +7,8 @@ export declare enum PROPERTY {
|
|
|
7
7
|
TEXT = "TEXT",
|
|
8
8
|
VALUE = "VALUE",
|
|
9
9
|
SHIFT = "SHIFT",
|
|
10
|
-
LABEL_PROVIDER = "LABEL_PROVIDER"
|
|
10
|
+
LABEL_PROVIDER = "LABEL_PROVIDER",
|
|
11
|
+
LABEL_STYLE = "LABEL_STYLE",
|
|
12
|
+
LABEL_OFFSET = "LABEL_OFFSET",
|
|
13
|
+
RADIUS_ADJUSTMENT = "RADIUS_ADJUSTMENT"
|
|
11
14
|
}
|
|
@@ -12,4 +12,7 @@ var PROPERTY;
|
|
|
12
12
|
PROPERTY["VALUE"] = "VALUE";
|
|
13
13
|
PROPERTY["SHIFT"] = "SHIFT";
|
|
14
14
|
PROPERTY["LABEL_PROVIDER"] = "LABEL_PROVIDER";
|
|
15
|
+
PROPERTY["LABEL_STYLE"] = "LABEL_STYLE";
|
|
16
|
+
PROPERTY["LABEL_OFFSET"] = "LABEL_OFFSET";
|
|
17
|
+
PROPERTY["RADIUS_ADJUSTMENT"] = "RADIUS_ADJUSTMENT";
|
|
15
18
|
})(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
|
|
@@ -6,7 +6,7 @@ import { ESciChartSurfaceType } from "../../../types/SciChartSurfaceType";
|
|
|
6
6
|
import { TBorder } from "../../../types/TBorder";
|
|
7
7
|
import { TSciChartSurfaceCanvases } from "../../../types/TSciChartSurfaceCanvases";
|
|
8
8
|
import { IThemeProvider } from "../../Themes/IThemeProvider";
|
|
9
|
-
import {
|
|
9
|
+
import { TTextStyle } from "../Axis/AxisCore";
|
|
10
10
|
import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
|
|
11
11
|
import { IEventSubscriptionItem } from "../Legend/SciChartLegendBase";
|
|
12
12
|
import { SciChartPieLegend } from "../Legend/SciChartPieLegend";
|
|
@@ -77,7 +77,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
77
77
|
onCreatedName: string;
|
|
78
78
|
protected widthAspect: number;
|
|
79
79
|
protected heightAspect: number;
|
|
80
|
-
protected labelProviderProperty:
|
|
80
|
+
protected labelProviderProperty: PieLabelProvider;
|
|
81
81
|
private pieTypeProperty;
|
|
82
82
|
private holeRadiusProperty;
|
|
83
83
|
private holeRadiusSizingModeProperty;
|
|
@@ -94,6 +94,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
94
94
|
private paddingProperty?;
|
|
95
95
|
private canvasBorderProperty?;
|
|
96
96
|
private valueModeProperty;
|
|
97
|
+
private labelStyleProperty;
|
|
97
98
|
constructor(canvases?: TSciChartSurfaceCanvases, options?: IPieSurfaceOptions);
|
|
98
99
|
/**
|
|
99
100
|
* Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
@@ -103,6 +104,14 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
103
104
|
* Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
104
105
|
*/
|
|
105
106
|
set labelProvider(labelProvider: PieLabelProvider);
|
|
107
|
+
/**
|
|
108
|
+
* Gets or sets a {@link TTextStyle} object for styling labels
|
|
109
|
+
*/
|
|
110
|
+
get labelStyle(): TTextStyle;
|
|
111
|
+
/**
|
|
112
|
+
* Gets or sets a {@link TTextStyle} object for styling labels
|
|
113
|
+
*/
|
|
114
|
+
set labelStyle(textStyle: TTextStyle);
|
|
106
115
|
/**
|
|
107
116
|
* @inheritDoc
|
|
108
117
|
*/
|
|
@@ -238,8 +247,9 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
238
247
|
*/
|
|
239
248
|
private drawChart;
|
|
240
249
|
private adjustDomContainer;
|
|
241
|
-
private
|
|
250
|
+
private drawSegmentLabel;
|
|
242
251
|
private pieSegmentsTotalValue;
|
|
252
|
+
private pieSegmentsTotalOldValue;
|
|
243
253
|
private applySciChartBackground;
|
|
244
254
|
}
|
|
245
255
|
/** @ignore */
|