scichart 2.1.2290 → 2.2.2351
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/buildModifiers.d.ts +2 -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/RolloverModifier.d.ts +10 -0
- package/Charting/ChartModifiers/RolloverModifier.js +76 -19
- package/Charting/LayoutManager/LayoutManager.js +6 -1
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +3 -2
- package/Charting/Model/BaseHeatmapDataSeries.js +17 -5
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
- package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
- 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 +63 -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 +10 -0
- package/Charting/Visuals/Axis/AxisBase2D.js +72 -1
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +29 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +77 -0
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +21 -4
- 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 +7 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +16 -7
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +56 -9
- 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/UniformHeatmapDrawingProvider.js +1 -1
- 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/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/UniformHeatmapRenderableSeries.d.ts +13 -0
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +23 -3
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/constants.js +3 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +24 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +4 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +13 -2
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +66 -20
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +3 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +2 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +66 -2
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +304 -52
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +6 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +5 -0
- package/Charting/Visuals/SciChartSurface.d.ts +19 -3
- package/Charting/Visuals/SciChartSurface.js +49 -4
- package/Charting/Visuals/createMaster.js +2 -2
- package/Charting/Visuals/createSingle.js +2 -2
- package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
- package/Charting/Visuals/sciChartInitCommon.js +13 -9
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- 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/Color.d.ts +1 -0
- package/types/Color.js +1 -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/TSciChartSurfaceCanvases.d.ts +1 -0
|
@@ -20,6 +20,7 @@ var SeriesType_1 = require("../../../types/SeriesType");
|
|
|
20
20
|
var XyPointSeriesWrapped_1 = require("../../Model/PointSeries/XyPointSeriesWrapped");
|
|
21
21
|
var EllipsePointMarker_1 = require("../PointMarkers/EllipsePointMarker");
|
|
22
22
|
var BaseRenderableSeries_1 = require("./BaseRenderableSeries");
|
|
23
|
+
var constants_1 = require("./constants");
|
|
23
24
|
var PointMarkerDrawingProvider_1 = require("./DrawingProviders/PointMarkerDrawingProvider");
|
|
24
25
|
var ScatterSeriesHitTestProvider_1 = require("./HitTest/ScatterSeriesHitTestProvider");
|
|
25
26
|
/**
|
|
@@ -59,9 +60,10 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
|
|
|
59
60
|
* @param options Optional parameters of type {@link IBaseRenderableSeriesOptions} to configure the series
|
|
60
61
|
*/
|
|
61
62
|
function XyScatterRenderableSeries(webAssemblyContext, options) {
|
|
62
|
-
var _a, _b;
|
|
63
|
+
var _a, _b, _c;
|
|
63
64
|
var _this = _super.call(this, webAssemblyContext, options) || this;
|
|
64
65
|
_this.type = SeriesType_1.ESeriesType.ScatterSeries;
|
|
66
|
+
_this.scatterOpacityProperty = 1;
|
|
65
67
|
if (!_this.pointMarker) {
|
|
66
68
|
_this.pointMarker = new EllipsePointMarker_1.EllipsePointMarker(webAssemblyContext, { width: 10, height: 10 });
|
|
67
69
|
}
|
|
@@ -74,6 +76,7 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
|
|
|
74
76
|
if ((_a = _this.paletteProvider) === null || _a === void 0 ? void 0 : _a.onAttached) {
|
|
75
77
|
(_b = _this.paletteProvider) === null || _b === void 0 ? void 0 : _b.onAttached(_this);
|
|
76
78
|
}
|
|
79
|
+
_this.scatterOpacityProperty = (_c = options === null || options === void 0 ? void 0 : options.opacity) !== null && _c !== void 0 ? _c : _this.scatterOpacityProperty;
|
|
77
80
|
return _this;
|
|
78
81
|
}
|
|
79
82
|
/** @inheritDoc */
|
|
@@ -84,6 +87,23 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
|
|
|
84
87
|
XyScatterRenderableSeries.prototype.newHitTestProvider = function () {
|
|
85
88
|
return new ScatterSeriesHitTestProvider_1.ScatterSeriesHitTestProvider(this, this.webAssemblyContext);
|
|
86
89
|
};
|
|
90
|
+
Object.defineProperty(XyScatterRenderableSeries.prototype, "opacity", {
|
|
91
|
+
/** @inheritDoc */
|
|
92
|
+
get: function () {
|
|
93
|
+
return this.scatterOpacityProperty;
|
|
94
|
+
},
|
|
95
|
+
/** @inheritDoc */
|
|
96
|
+
set: function (value) {
|
|
97
|
+
this.scatterOpacityProperty = value;
|
|
98
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.OPACITY);
|
|
99
|
+
if (this.pointMarker) {
|
|
100
|
+
this.pointMarker.opacity = value;
|
|
101
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.POINT_MARKER);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
enumerable: false,
|
|
105
|
+
configurable: true
|
|
106
|
+
});
|
|
87
107
|
return XyScatterRenderableSeries;
|
|
88
108
|
}(BaseRenderableSeries_1.BaseRenderableSeries));
|
|
89
109
|
exports.XyScatterRenderableSeries = XyScatterRenderableSeries;
|
|
@@ -10,12 +10,14 @@ export declare enum PROPERTY {
|
|
|
10
10
|
CONTOUR_COLOR_MAP_MODE = "CONTOUR_COLOR_MAP_MODE",
|
|
11
11
|
DATA_POINT_WIDTH = "dataPointWidth",
|
|
12
12
|
DATA_SERIES = "dataSeries",
|
|
13
|
+
DRAWING_PROVIDERS = "DRAWING_PROVIDERS",
|
|
13
14
|
DRAW_NAN_AS = "drawNaNAs",
|
|
14
15
|
EFFECT = "EFFECT",
|
|
15
16
|
ENABLE_DRAWING_OPTIMISATIONS = "ENABLE_DRAWING_OPTIMISATIONS",
|
|
16
17
|
FILL = "fill",
|
|
17
18
|
FILL_Y1 = "FILL_Y1",
|
|
18
19
|
FILL_LINEAR_GRADIENT = "FILL_LINEAR_GRADIENT",
|
|
20
|
+
FILL_VALUES_OUT_OF_RANGE = "FILL_VALUES_OUT_OF_RANGE",
|
|
19
21
|
GRADIENT_STOPS = "GRADIENT_STOPS",
|
|
20
22
|
HOVERED = "HOVERED",
|
|
21
23
|
INTERPOLATION_POINTS = "INTERPOLATION_POINTS",
|
|
@@ -29,6 +31,7 @@ export declare enum PROPERTY {
|
|
|
29
31
|
OFFSET = "OFFSET",
|
|
30
32
|
OPACITY = "OPACITY",
|
|
31
33
|
PALETTE_PROVIDER = "PALETTE_PROVIDER",
|
|
34
|
+
PARENT_SURFACE = "PARENT_SURFACE",
|
|
32
35
|
POINT_MARKER = "pointMarker",
|
|
33
36
|
RANGE = "RANGE",
|
|
34
37
|
RESAMPLING_MODE = "RESAMPLING_MODE",
|
|
@@ -14,12 +14,14 @@ var PROPERTY;
|
|
|
14
14
|
PROPERTY["CONTOUR_COLOR_MAP_MODE"] = "CONTOUR_COLOR_MAP_MODE";
|
|
15
15
|
PROPERTY["DATA_POINT_WIDTH"] = "dataPointWidth";
|
|
16
16
|
PROPERTY["DATA_SERIES"] = "dataSeries";
|
|
17
|
+
PROPERTY["DRAWING_PROVIDERS"] = "DRAWING_PROVIDERS";
|
|
17
18
|
PROPERTY["DRAW_NAN_AS"] = "drawNaNAs";
|
|
18
19
|
PROPERTY["EFFECT"] = "EFFECT";
|
|
19
20
|
PROPERTY["ENABLE_DRAWING_OPTIMISATIONS"] = "ENABLE_DRAWING_OPTIMISATIONS";
|
|
20
21
|
PROPERTY["FILL"] = "fill";
|
|
21
22
|
PROPERTY["FILL_Y1"] = "FILL_Y1";
|
|
22
23
|
PROPERTY["FILL_LINEAR_GRADIENT"] = "FILL_LINEAR_GRADIENT";
|
|
24
|
+
PROPERTY["FILL_VALUES_OUT_OF_RANGE"] = "FILL_VALUES_OUT_OF_RANGE";
|
|
23
25
|
PROPERTY["GRADIENT_STOPS"] = "GRADIENT_STOPS";
|
|
24
26
|
PROPERTY["HOVERED"] = "HOVERED";
|
|
25
27
|
PROPERTY["INTERPOLATION_POINTS"] = "INTERPOLATION_POINTS";
|
|
@@ -33,6 +35,7 @@ var PROPERTY;
|
|
|
33
35
|
PROPERTY["OFFSET"] = "OFFSET";
|
|
34
36
|
PROPERTY["OPACITY"] = "OPACITY";
|
|
35
37
|
PROPERTY["PALETTE_PROVIDER"] = "PALETTE_PROVIDER";
|
|
38
|
+
PROPERTY["PARENT_SURFACE"] = "PARENT_SURFACE";
|
|
36
39
|
PROPERTY["POINT_MARKER"] = "pointMarker";
|
|
37
40
|
PROPERTY["RANGE"] = "RANGE";
|
|
38
41
|
PROPERTY["RESAMPLING_MODE"] = "RESAMPLING_MODE";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { Thickness } from "../../../Core/Thickness";
|
|
2
|
+
import { TBorder } from "../../../types/TBorder";
|
|
3
|
+
import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
|
|
1
4
|
import { ISurfaceOptionsBase } from "../SciChartSurfaceBase";
|
|
2
|
-
import { EPieType, ESizingMode } from "./SciChartPieSurface";
|
|
5
|
+
import { EPieType, EPieValueMode, ESizingMode } from "./SciChartPieSurface";
|
|
3
6
|
/**
|
|
4
7
|
* Options passed to a {@link SciChartPieSurface} in the {@link SciChartPieSurface.create} function
|
|
5
8
|
*/
|
|
@@ -18,8 +21,10 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
|
|
|
18
21
|
pieType?: EPieType;
|
|
19
22
|
/** Optional - the radius of the hole for a donut chart. */
|
|
20
23
|
holeRadius?: number;
|
|
21
|
-
/** Optional - Whether to animate the chart as it is
|
|
24
|
+
/** Optional - Whether to animate the chart as it is drawn. Default true */
|
|
22
25
|
animate?: boolean;
|
|
26
|
+
/** Optional - The number of frames for the animation. Default 30. A frame will be trigged every 20ms. */
|
|
27
|
+
animationFrames?: number;
|
|
23
28
|
/** Optional - how the hole radius is interpreted, either absolute, or relative to the total radius */
|
|
24
29
|
holeRadiusSizingMode?: ESizingMode;
|
|
25
30
|
/** Optional - whether to show the legend. Default true */
|
|
@@ -30,4 +35,21 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
|
|
|
30
35
|
showLegendCheckBoxes?: boolean;
|
|
31
36
|
/** Optional - whether to show series markers on the legend. Default true */
|
|
32
37
|
showLegendSeriesMarkers?: boolean;
|
|
38
|
+
/** Optional - adds the spacings / padding around the view area */
|
|
39
|
+
padding?: Thickness;
|
|
40
|
+
/** Optional - adds the border to the view area */
|
|
41
|
+
canvasBorder?: TBorder;
|
|
42
|
+
/** Optional - addes spacing between the segments */
|
|
43
|
+
seriesSpacing?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
46
|
+
*/
|
|
47
|
+
labelProvider?: PieLabelProvider;
|
|
48
|
+
/** Whether to show labels as percentages, or raw values. Default to percentages */
|
|
49
|
+
valueMode?: EPieValueMode;
|
|
50
|
+
/**
|
|
51
|
+
* Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
|
|
52
|
+
* If you want more detailed control you can override calcTitlePosition.
|
|
53
|
+
*/
|
|
54
|
+
labelRadiusAdjustment?: number;
|
|
33
55
|
}
|
|
@@ -5,12 +5,15 @@ export interface IPieSegment {
|
|
|
5
5
|
readonly id: string;
|
|
6
6
|
text: string;
|
|
7
7
|
value: number;
|
|
8
|
+
oldValue: number;
|
|
8
9
|
color: string;
|
|
9
10
|
colorLinearGradient: GradientParams;
|
|
10
11
|
isSelected: boolean;
|
|
11
12
|
delta: number;
|
|
13
|
+
shift: number;
|
|
12
14
|
onAttach(scs: SciChartPieSurface): void;
|
|
13
15
|
onDetach(): void;
|
|
14
|
-
getPercentage(total: number): string;
|
|
15
16
|
toJSON(): IPieSegmentOptions;
|
|
17
|
+
getPercentage(total: number): number;
|
|
18
|
+
getLabelText(total: number): string;
|
|
16
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GradientParams } from "../../../../Core/GradientParams";
|
|
2
2
|
import { RequiredOwnProps } from "../../../../types/HelperTypes";
|
|
3
|
+
import { PieLabelProvider } from "../../Axis/LabelProvider/PieLabelProvider";
|
|
3
4
|
import { SciChartPieSurface } from "../SciChartPieSurface";
|
|
4
5
|
import { IPieSegment } from "./IPieSegment";
|
|
5
6
|
export interface IPieSegmentOptions {
|
|
@@ -10,16 +11,20 @@ export interface IPieSegmentOptions {
|
|
|
10
11
|
colorLinearGradient?: GradientParams;
|
|
11
12
|
isSelected?: boolean;
|
|
12
13
|
delta?: number;
|
|
14
|
+
labelProvider?: PieLabelProvider;
|
|
13
15
|
}
|
|
14
16
|
export declare class PieSegment implements IPieSegment {
|
|
15
|
-
static readonly DEFAULT_DELTA = 15;
|
|
16
17
|
readonly id: string;
|
|
17
18
|
private colorProperty;
|
|
18
19
|
private colorLinearGradientProperty;
|
|
19
20
|
private isSelectedProperty;
|
|
20
21
|
private textProperty;
|
|
21
22
|
private valueProperty;
|
|
23
|
+
private oldValueProperty;
|
|
22
24
|
private deltaProperty;
|
|
25
|
+
private shiftProperty;
|
|
26
|
+
private parentSurface;
|
|
27
|
+
private labelProviderProperty;
|
|
23
28
|
private invalidateParentCallback;
|
|
24
29
|
constructor(options?: IPieSegmentOptions);
|
|
25
30
|
onAttach(scps: SciChartPieSurface): void;
|
|
@@ -32,11 +37,17 @@ export declare class PieSegment implements IPieSegment {
|
|
|
32
37
|
set isSelected(value: boolean);
|
|
33
38
|
get text(): string;
|
|
34
39
|
set text(value: string);
|
|
35
|
-
|
|
40
|
+
get labelProvider(): PieLabelProvider;
|
|
41
|
+
set labelProvider(value: PieLabelProvider);
|
|
42
|
+
getPercentage(total: number): number;
|
|
36
43
|
get value(): number;
|
|
37
44
|
set value(value: number);
|
|
45
|
+
get oldValue(): number;
|
|
38
46
|
get delta(): number;
|
|
39
47
|
set delta(value: number);
|
|
48
|
+
get shift(): number;
|
|
49
|
+
set shift(value: number);
|
|
40
50
|
toJSON(): RequiredOwnProps<IPieSegmentOptions>;
|
|
51
|
+
getLabelText(total: number): string;
|
|
41
52
|
private notifyPropertyChanged;
|
|
42
53
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PieSegment = void 0;
|
|
4
4
|
var guid_1 = require("../../../../utils/guid");
|
|
5
|
+
var PieLabelProvider_1 = require("../../Axis/LabelProvider/PieLabelProvider");
|
|
5
6
|
var constants_1 = require("./constants");
|
|
6
7
|
var PieSegment = /** @class */ (function () {
|
|
7
8
|
function PieSegment(options) {
|
|
@@ -9,16 +10,22 @@ var PieSegment = /** @class */ (function () {
|
|
|
9
10
|
this.colorProperty = "grey";
|
|
10
11
|
this.isSelectedProperty = false;
|
|
11
12
|
this.textProperty = "";
|
|
12
|
-
this.deltaProperty =
|
|
13
|
+
this.deltaProperty = 15;
|
|
14
|
+
this.shiftProperty = 0;
|
|
13
15
|
this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
|
|
14
16
|
this.colorProperty = (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : this.colorProperty;
|
|
15
17
|
this.colorLinearGradientProperty = (_c = options === null || options === void 0 ? void 0 : options.colorLinearGradient) !== null && _c !== void 0 ? _c : this.colorLinearGradientProperty;
|
|
16
18
|
this.isSelectedProperty = (_d = options === null || options === void 0 ? void 0 : options.isSelected) !== null && _d !== void 0 ? _d : this.isSelectedProperty;
|
|
17
19
|
this.textProperty = (_e = options === null || options === void 0 ? void 0 : options.text) !== null && _e !== void 0 ? _e : this.textProperty;
|
|
18
20
|
this.valueProperty = (_f = options === null || options === void 0 ? void 0 : options.value) !== null && _f !== void 0 ? _f : this.valueProperty;
|
|
19
|
-
this.
|
|
21
|
+
this.deltaProperty = (_g = options === null || options === void 0 ? void 0 : options.delta) !== null && _g !== void 0 ? _g : this.deltaProperty;
|
|
22
|
+
this.labelProviderProperty = options === null || options === void 0 ? void 0 : options.labelProvider; // No default here as we default to labelprovider on parent surface
|
|
20
23
|
}
|
|
21
24
|
PieSegment.prototype.onAttach = function (scps) {
|
|
25
|
+
this.parentSurface = scps;
|
|
26
|
+
if (this.labelProviderProperty) {
|
|
27
|
+
this.labelProviderProperty.attachedToSurface(scps);
|
|
28
|
+
}
|
|
22
29
|
this.invalidateParentCallback = scps.invalidateElement;
|
|
23
30
|
};
|
|
24
31
|
PieSegment.prototype.onDetach = function () {
|
|
@@ -52,14 +59,10 @@ var PieSegment = /** @class */ (function () {
|
|
|
52
59
|
return this.isSelectedProperty;
|
|
53
60
|
},
|
|
54
61
|
set: function (value) {
|
|
55
|
-
this.isSelectedProperty
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
this.deltaProperty = 0;
|
|
62
|
+
if (this.isSelectedProperty !== value) {
|
|
63
|
+
this.isSelectedProperty = value;
|
|
64
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.IS_SELECTED);
|
|
61
65
|
}
|
|
62
|
-
this.notifyPropertyChanged(constants_1.PROPERTY.IS_SELECTED);
|
|
63
66
|
},
|
|
64
67
|
enumerable: false,
|
|
65
68
|
configurable: true
|
|
@@ -75,34 +78,65 @@ var PieSegment = /** @class */ (function () {
|
|
|
75
78
|
enumerable: false,
|
|
76
79
|
configurable: true
|
|
77
80
|
});
|
|
81
|
+
Object.defineProperty(PieSegment.prototype, "labelProvider", {
|
|
82
|
+
get: function () {
|
|
83
|
+
// Create a labelProvider if it is accessed. This will override behaviour from the parent surface
|
|
84
|
+
if (this.labelProviderProperty === undefined) {
|
|
85
|
+
this.labelProvider = new PieLabelProvider_1.PieLabelProvider();
|
|
86
|
+
}
|
|
87
|
+
return this.labelProviderProperty;
|
|
88
|
+
},
|
|
89
|
+
set: function (value) {
|
|
90
|
+
this.labelProviderProperty = value;
|
|
91
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_PROVIDER);
|
|
92
|
+
},
|
|
93
|
+
enumerable: false,
|
|
94
|
+
configurable: true
|
|
95
|
+
});
|
|
78
96
|
PieSegment.prototype.getPercentage = function (total) {
|
|
79
|
-
|
|
80
|
-
return pers.toFixed(2) + " %";
|
|
97
|
+
return (100 * this.value) / total;
|
|
81
98
|
};
|
|
82
99
|
Object.defineProperty(PieSegment.prototype, "value", {
|
|
83
100
|
get: function () {
|
|
84
101
|
return this.valueProperty;
|
|
85
102
|
},
|
|
86
103
|
set: function (value) {
|
|
104
|
+
this.oldValueProperty = this.valueProperty;
|
|
87
105
|
this.valueProperty = value;
|
|
88
106
|
this.notifyPropertyChanged(constants_1.PROPERTY.VALUE);
|
|
89
107
|
},
|
|
90
108
|
enumerable: false,
|
|
91
109
|
configurable: true
|
|
92
110
|
});
|
|
111
|
+
Object.defineProperty(PieSegment.prototype, "oldValue", {
|
|
112
|
+
get: function () {
|
|
113
|
+
return this.oldValueProperty;
|
|
114
|
+
},
|
|
115
|
+
enumerable: false,
|
|
116
|
+
configurable: true
|
|
117
|
+
});
|
|
93
118
|
Object.defineProperty(PieSegment.prototype, "delta", {
|
|
94
119
|
get: function () {
|
|
95
120
|
return this.deltaProperty;
|
|
96
121
|
},
|
|
97
122
|
set: function (value) {
|
|
98
|
-
if (this.deltaProperty
|
|
99
|
-
this.
|
|
123
|
+
if (this.deltaProperty !== value) {
|
|
124
|
+
this.deltaProperty = value;
|
|
125
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.DELTA);
|
|
100
126
|
}
|
|
101
|
-
|
|
102
|
-
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(PieSegment.prototype, "shift", {
|
|
132
|
+
get: function () {
|
|
133
|
+
return this.shiftProperty;
|
|
134
|
+
},
|
|
135
|
+
set: function (value) {
|
|
136
|
+
if (this.shiftProperty !== value) {
|
|
137
|
+
this.shiftProperty = value;
|
|
138
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.SHIFT);
|
|
103
139
|
}
|
|
104
|
-
this.deltaProperty = value;
|
|
105
|
-
this.notifyPropertyChanged(constants_1.PROPERTY.DELTA);
|
|
106
140
|
},
|
|
107
141
|
enumerable: false,
|
|
108
142
|
configurable: true
|
|
@@ -115,15 +149,27 @@ var PieSegment = /** @class */ (function () {
|
|
|
115
149
|
isSelected: this.isSelected,
|
|
116
150
|
delta: this.delta,
|
|
117
151
|
text: this.text,
|
|
118
|
-
value: this.value
|
|
152
|
+
value: this.value,
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
labelProvider: this.labelProvider.toJSON()
|
|
119
155
|
};
|
|
120
156
|
};
|
|
157
|
+
PieSegment.prototype.getLabelText = function (total) {
|
|
158
|
+
if (this.labelProviderProperty) {
|
|
159
|
+
return this.labelProvider.getSegmentText(this, total);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
return this.parentSurface.labelProvider.getSegmentText(this, total);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
121
165
|
PieSegment.prototype.notifyPropertyChanged = function (propertyName) {
|
|
166
|
+
if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER) {
|
|
167
|
+
this.labelProvider.attachedToSurface(this.parentSurface);
|
|
168
|
+
}
|
|
122
169
|
if (this.invalidateParentCallback) {
|
|
123
|
-
this.invalidateParentCallback();
|
|
170
|
+
this.invalidateParentCallback(propertyName);
|
|
124
171
|
}
|
|
125
172
|
};
|
|
126
|
-
PieSegment.DEFAULT_DELTA = 15;
|
|
127
173
|
return PieSegment;
|
|
128
174
|
}());
|
|
129
175
|
exports.PieSegment = PieSegment;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ISciChartPieDefinition } from "../../../Builder/buildSurface";
|
|
2
2
|
import { IDeletable } from "../../../Core/IDeletable";
|
|
3
3
|
import { ObservableArray } from "../../../Core/ObservableArray";
|
|
4
|
+
import { Thickness } from "../../../Core/Thickness";
|
|
4
5
|
import { ESciChartSurfaceType } from "../../../types/SciChartSurfaceType";
|
|
6
|
+
import { TBorder } from "../../../types/TBorder";
|
|
5
7
|
import { TSciChartSurfaceCanvases } from "../../../types/TSciChartSurfaceCanvases";
|
|
6
8
|
import { IThemeProvider } from "../../Themes/IThemeProvider";
|
|
9
|
+
import { LabelProvider } from "../Axis/LabelProvider/LabelProvider";
|
|
10
|
+
import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
|
|
7
11
|
import { IEventSubscriptionItem } from "../Legend/SciChartLegendBase";
|
|
8
12
|
import { SciChartPieLegend } from "../Legend/SciChartPieLegend";
|
|
9
13
|
import { ISciChartSurfaceBase } from "../SciChartSurfaceBase";
|
|
@@ -23,6 +27,10 @@ export declare enum EPieType {
|
|
|
23
27
|
Pie = "Pie",
|
|
24
28
|
Donut = "Donut"
|
|
25
29
|
}
|
|
30
|
+
export declare enum EPieValueMode {
|
|
31
|
+
Percentage = 0,
|
|
32
|
+
Raw = 1
|
|
33
|
+
}
|
|
26
34
|
/**
|
|
27
35
|
* @summary The {@link SciChartPieSurface} is the root Pie and Donut Chart control in SciChart's High Performance Real-time
|
|
28
36
|
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Chart Library}
|
|
@@ -61,6 +69,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
61
69
|
readonly domSvgAdornerLayer: SVGSVGElement;
|
|
62
70
|
readonly domDivContainer: HTMLDivElement;
|
|
63
71
|
animate: boolean;
|
|
72
|
+
animationFrames: number;
|
|
64
73
|
/**
|
|
65
74
|
* An optional legend of type {@link SciChartPieLegend} which may be added to the Pie chart
|
|
66
75
|
*/
|
|
@@ -68,10 +77,12 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
68
77
|
onCreatedName: string;
|
|
69
78
|
protected widthAspect: number;
|
|
70
79
|
protected heightAspect: number;
|
|
80
|
+
protected labelProviderProperty: LabelProvider;
|
|
71
81
|
private pieTypeProperty;
|
|
72
82
|
private holeRadiusProperty;
|
|
73
83
|
private holeRadiusSizingModeProperty;
|
|
74
84
|
private seriesSpacingProperty;
|
|
85
|
+
private labelRadiusProperty;
|
|
75
86
|
private svg;
|
|
76
87
|
private titleDivs;
|
|
77
88
|
private viewRect;
|
|
@@ -80,7 +91,18 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
80
91
|
private themeProviderProperty;
|
|
81
92
|
private previousThemeProviderProperty;
|
|
82
93
|
private deletables;
|
|
94
|
+
private paddingProperty?;
|
|
95
|
+
private canvasBorderProperty?;
|
|
96
|
+
private valueModeProperty;
|
|
83
97
|
constructor(canvases?: TSciChartSurfaceCanvases, options?: IPieSurfaceOptions);
|
|
98
|
+
/**
|
|
99
|
+
* Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
100
|
+
*/
|
|
101
|
+
get labelProvider(): PieLabelProvider;
|
|
102
|
+
/**
|
|
103
|
+
* Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
104
|
+
*/
|
|
105
|
+
set labelProvider(labelProvider: PieLabelProvider);
|
|
84
106
|
/**
|
|
85
107
|
* @inheritDoc
|
|
86
108
|
*/
|
|
@@ -97,7 +119,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
97
119
|
* Call invalidateElement() to trigger a redraw of the {@link SciChartPieSurface}. SciChart's rendering
|
|
98
120
|
* engine will schedule a redraw a the next time the renderer is free.
|
|
99
121
|
*/
|
|
100
|
-
invalidateElement(): void;
|
|
122
|
+
invalidateElement(propertyName?: string): void;
|
|
101
123
|
/**
|
|
102
124
|
* Called internally - Updates and draws the Pie Chart
|
|
103
125
|
*/
|
|
@@ -105,7 +127,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
105
127
|
/**
|
|
106
128
|
* @inheritDoc
|
|
107
129
|
*/
|
|
108
|
-
delete(): void;
|
|
130
|
+
delete(isAnimationProgress?: boolean): void;
|
|
109
131
|
/**
|
|
110
132
|
* @inheritDoc
|
|
111
133
|
*/
|
|
@@ -150,6 +172,39 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
150
172
|
* which sets the size of a Donut Chart hole
|
|
151
173
|
*/
|
|
152
174
|
set holeRadiusSizingMode(holeRadiusSizingMode: ESizingMode);
|
|
175
|
+
/**
|
|
176
|
+
* Gets or sets padding
|
|
177
|
+
*/
|
|
178
|
+
get padding(): Thickness;
|
|
179
|
+
/**
|
|
180
|
+
* Gets or sets padding
|
|
181
|
+
*/
|
|
182
|
+
set padding(value: Thickness);
|
|
183
|
+
/**
|
|
184
|
+
* Gets or sets canvas border
|
|
185
|
+
*/
|
|
186
|
+
get canvasBorder(): TBorder;
|
|
187
|
+
/**
|
|
188
|
+
* Gets or sets canvas border
|
|
189
|
+
*/
|
|
190
|
+
set canvasBorder(value: TBorder);
|
|
191
|
+
get seriesSpacing(): number;
|
|
192
|
+
set seriesSpacing(value: number);
|
|
193
|
+
/** Whether to show labels as percentages, or raw values. Default to percentages */
|
|
194
|
+
get valueMode(): EPieValueMode;
|
|
195
|
+
/** Whether to show labels as percentages, or raw values. Default to percentages */
|
|
196
|
+
set valueMode(value: EPieValueMode);
|
|
197
|
+
/**
|
|
198
|
+
* Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
|
|
199
|
+
* For Pie charts, 1.7 will place the labels outside the pie
|
|
200
|
+
* If you want more detailed control you can override calcTitlePosition.
|
|
201
|
+
*/
|
|
202
|
+
get labelRadiusAdjustment(): number;
|
|
203
|
+
/**
|
|
204
|
+
* Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
|
|
205
|
+
* If you want more detailed control you can override calcTitlePosition.
|
|
206
|
+
*/
|
|
207
|
+
set labelRadiusAdjustment(value: number);
|
|
153
208
|
/**
|
|
154
209
|
* Convert the surface to a {@link TSurfaceDefinition}
|
|
155
210
|
* @param excludedata If false, segments will be included in the json
|
|
@@ -158,6 +213,11 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
158
213
|
type: ESciChartSurfaceType;
|
|
159
214
|
options: ISciChartPieDefinition;
|
|
160
215
|
};
|
|
216
|
+
/** The method used to calculate the label position for each segment */
|
|
217
|
+
calcTitlePosition(x: number, y: number, outerRadius: number, innerRadius: number, a1: number, a2: number, delta: number, divWidth: number, divHeight: number): {
|
|
218
|
+
left: number;
|
|
219
|
+
top: number;
|
|
220
|
+
};
|
|
161
221
|
/**
|
|
162
222
|
* Changes the size of the DOM element where the {@link SciChartSurfaceBase} resides.
|
|
163
223
|
* @param width
|
|
@@ -168,12 +228,16 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
|
|
|
168
228
|
private isValidToDraw;
|
|
169
229
|
private detachPieSegment;
|
|
170
230
|
private attachPieSegment;
|
|
231
|
+
private updateLegendMargin;
|
|
232
|
+
private calculateViewRectWidth;
|
|
233
|
+
private calculateViewRectHeight;
|
|
171
234
|
private draw;
|
|
172
235
|
/**
|
|
173
236
|
* @description Draws pie chart itself
|
|
174
237
|
* @param animationProgress - Current progress from 0 to 1, is being used for sweep animation on start.
|
|
175
238
|
*/
|
|
176
239
|
private drawChart;
|
|
240
|
+
private adjustDomContainer;
|
|
177
241
|
private drawSegmentTitles;
|
|
178
242
|
private pieSegmentsTotalValue;
|
|
179
243
|
private applySciChartBackground;
|