scichart 2.1.2294 → 2.2.2378

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.
Files changed (184) hide show
  1. package/Builder/buildAxis.d.ts +7 -0
  2. package/Builder/buildAxis.js +6 -0
  3. package/Builder/buildDataSeries.d.ts +19 -1
  4. package/Builder/buildDataSeries.js +22 -1
  5. package/Builder/buildModifiers.d.ts +2 -1
  6. package/Builder/buildSeries.d.ts +7 -2
  7. package/Builder/buildSeries.js +5 -1
  8. package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
  9. package/Charting/ChartModifiers/CursorModifier.js +15 -10
  10. package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
  11. package/Charting/ChartModifiers/LegendModifier.js +22 -0
  12. package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
  13. package/Charting/ChartModifiers/RolloverModifier.js +76 -19
  14. package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
  15. package/Charting/LayoutManager/LayoutManager.js +6 -1
  16. package/Charting/Model/BaseHeatmapDataSeries.d.ts +3 -2
  17. package/Charting/Model/BaseHeatmapDataSeries.js +17 -5
  18. package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
  19. package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
  20. package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
  21. package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
  22. package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
  23. package/Charting/Model/Filters/HlcFilterBase.js +141 -0
  24. package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
  25. package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
  26. package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
  27. package/Charting/Model/Filters/XyFilterBase.js +6 -0
  28. package/Charting/Model/Filters/XyyFilterBase.js +9 -0
  29. package/Charting/Model/Filters/XyzFilterBase.js +12 -3
  30. package/Charting/Model/HlcDataSeries.d.ts +189 -0
  31. package/Charting/Model/HlcDataSeries.js +557 -0
  32. package/Charting/Model/IDataSeries.d.ts +5 -1
  33. package/Charting/Model/IDataSeries.js +4 -0
  34. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
  35. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
  36. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
  37. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
  38. package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
  39. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
  40. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
  41. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
  42. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
  43. package/Charting/Services/SciChartRenderer.d.ts +1 -0
  44. package/Charting/Services/SciChartRenderer.js +6 -0
  45. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
  46. package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
  47. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
  48. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
  49. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
  50. package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
  51. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
  52. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
  53. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
  54. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
  55. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
  56. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
  57. package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
  58. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
  59. package/Charting/Visuals/Annotations/constants.d.ts +2 -1
  60. package/Charting/Visuals/Annotations/constants.js +1 -0
  61. package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
  62. package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
  63. package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
  64. package/Charting/Visuals/Axis/AxisCore.js +6 -0
  65. package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
  66. package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
  67. package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
  68. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
  69. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
  70. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
  71. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
  72. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
  73. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
  74. package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
  75. package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
  76. package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
  77. package/Charting/Visuals/Helpers/NativeObject.js +101 -0
  78. package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
  79. package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
  80. package/Charting/Visuals/Helpers/drawBorder.js +2 -2
  81. package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
  82. package/Charting/Visuals/Helpers/drawLabel.js +38 -18
  83. package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
  84. package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
  85. package/Charting/Visuals/Legend/SciChartLegend.js +7 -1
  86. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
  87. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
  88. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
  89. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
  90. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
  91. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
  92. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
  93. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
  94. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
  95. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
  96. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
  97. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +1 -1
  98. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
  99. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
  100. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
  101. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
  102. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
  103. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
  104. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
  105. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
  106. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
  107. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
  108. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
  109. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
  110. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
  111. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
  112. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
  113. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
  114. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
  115. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
  116. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +13 -0
  117. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +23 -3
  118. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  119. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
  120. package/Charting/Visuals/RenderableSeries/constants.d.ts +8 -0
  121. package/Charting/Visuals/RenderableSeries/constants.js +8 -0
  122. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
  123. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
  124. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
  125. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
  126. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
  127. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
  128. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
  129. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
  130. package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
  131. package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
  132. package/Charting/Visuals/SciChartSurface.d.ts +13 -2
  133. package/Charting/Visuals/SciChartSurface.js +39 -3
  134. package/Charting/Visuals/createMaster.js +17 -13
  135. package/Charting/Visuals/createSingle.js +5 -3
  136. package/Charting/Visuals/licenseManager2D.d.ts +6 -0
  137. package/Charting/Visuals/licenseManager2D.js +83 -8
  138. package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
  139. package/Charting/Visuals/licenseManager2dState.js +37 -1
  140. package/Charting/Visuals/loader.js +4 -1
  141. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  142. package/Charting/Visuals/sciChartInitCommon.js +13 -9
  143. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
  144. package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
  145. package/Charting3D/Visuals/createMaster3d.js +20 -14
  146. package/Charting3D/Visuals/createSingle3d.js +3 -4
  147. package/Charting3D/Visuals/licenseManager3D.js +3 -1
  148. package/Core/BuildStamp.d.ts +1 -1
  149. package/Core/BuildStamp.js +2 -2
  150. package/Core/Telemetry.d.ts +7 -0
  151. package/Core/Telemetry.js +106 -0
  152. package/Core/storage/localStorageApi.d.ts +4 -0
  153. package/Core/storage/localStorageApi.js +12 -0
  154. package/_wasm/scichart.browser.js +1 -1
  155. package/_wasm/scichart2d.js +95 -95
  156. package/_wasm/scichart2d.wasm +0 -0
  157. package/_wasm/scichart3d.js +14 -14
  158. package/_wasm/scichart3d.wasm +0 -0
  159. package/package.json +1 -1
  160. package/types/AxisType.d.ts +5 -1
  161. package/types/AxisType.js +4 -0
  162. package/types/Color.d.ts +1 -0
  163. package/types/Color.js +1 -0
  164. package/types/DataFilterType.d.ts +1 -0
  165. package/types/DataFilterType.js +1 -0
  166. package/types/DataPointWidthMode.d.ts +13 -0
  167. package/types/DataPointWidthMode.js +17 -0
  168. package/types/ErrorDirection.d.ts +13 -0
  169. package/types/ErrorDirection.js +17 -0
  170. package/types/ErrorMode.d.ts +17 -0
  171. package/types/ErrorMode.js +21 -0
  172. package/types/LabelPlacement.d.ts +8 -0
  173. package/types/LabelPlacement.js +11 -1
  174. package/types/LabelProviderType.d.ts +5 -1
  175. package/types/LabelProviderType.js +4 -0
  176. package/types/SeriesType.d.ts +3 -1
  177. package/types/SeriesType.js +2 -0
  178. package/types/TSciChart.d.ts +8 -2
  179. package/types/TSciChart3D.d.ts +5 -2
  180. package/types/TSciChartSurfaceCanvases.d.ts +1 -0
  181. package/utils/date.d.ts +1 -0
  182. package/utils/date.js +15 -1
  183. package/utils/guid.d.ts +6 -0
  184. package/utils/guid.js +17 -1
@@ -1,24 +1,55 @@
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");
19
+ var PieLabelProvider_1 = require("../../Axis/LabelProvider/PieLabelProvider");
5
20
  var constants_1 = require("./constants");
6
21
  var PieSegment = /** @class */ (function () {
7
22
  function PieSegment(options) {
8
- var _a, _b, _c, _d, _e, _f, _g;
23
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
9
24
  this.colorProperty = "grey";
10
25
  this.isSelectedProperty = false;
11
26
  this.textProperty = "";
12
- this.deltaProperty = 0;
27
+ this.deltaProperty = 15;
28
+ this.shiftProperty = 0;
29
+ this.labelOffsetProperty = new Point_1.Point(0, 0);
30
+ this.radiusAdjustmentProperty = 1;
13
31
  this.id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : (0, guid_1.generateGuid)();
14
32
  this.colorProperty = (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : this.colorProperty;
15
33
  this.colorLinearGradientProperty = (_c = options === null || options === void 0 ? void 0 : options.colorLinearGradient) !== null && _c !== void 0 ? _c : this.colorLinearGradientProperty;
16
34
  this.isSelectedProperty = (_d = options === null || options === void 0 ? void 0 : options.isSelected) !== null && _d !== void 0 ? _d : this.isSelectedProperty;
17
35
  this.textProperty = (_e = options === null || options === void 0 ? void 0 : options.text) !== null && _e !== void 0 ? _e : this.textProperty;
18
36
  this.valueProperty = (_f = options === null || options === void 0 ? void 0 : options.value) !== null && _f !== void 0 ? _f : this.valueProperty;
19
- this.delta = (_g = options === null || options === void 0 ? void 0 : options.delta) !== null && _g !== void 0 ? _g : this.deltaProperty;
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
+ }
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;
20
47
  }
21
48
  PieSegment.prototype.onAttach = function (scps) {
49
+ this.parentSurface = scps;
50
+ if (this.labelProviderProperty) {
51
+ this.labelProviderProperty.attachedToSurface(scps);
52
+ }
22
53
  this.invalidateParentCallback = scps.invalidateElement;
23
54
  };
24
55
  PieSegment.prototype.onDetach = function () {
@@ -26,9 +57,15 @@ var PieSegment = /** @class */ (function () {
26
57
  };
27
58
  Object.defineProperty(PieSegment.prototype, "colorLinearGradient", {
28
59
  // GETTERS AND SETTERS FOR PROPERTIES
60
+ /**
61
+ * An optional color gradient
62
+ */
29
63
  get: function () {
30
64
  return this.colorLinearGradientProperty;
31
65
  },
66
+ /**
67
+ * An optional color gradient
68
+ */
32
69
  set: function (value) {
33
70
  this.colorLinearGradientProperty = value;
34
71
  this.notifyPropertyChanged(constants_1.PROPERTY.COLOR_LINEAR_GRADIENT);
@@ -37,9 +74,15 @@ var PieSegment = /** @class */ (function () {
37
74
  configurable: true
38
75
  });
39
76
  Object.defineProperty(PieSegment.prototype, "color", {
77
+ /**
78
+ * The color of the segment as an HTML color code
79
+ */
40
80
  get: function () {
41
81
  return this.colorProperty;
42
82
  },
83
+ /**
84
+ * The color of the segment as an HTML color code
85
+ */
43
86
  set: function (value) {
44
87
  this.colorProperty = value;
45
88
  this.notifyPropertyChanged(constants_1.PROPERTY.COLOR);
@@ -48,26 +91,34 @@ var PieSegment = /** @class */ (function () {
48
91
  configurable: true
49
92
  });
50
93
  Object.defineProperty(PieSegment.prototype, "isSelected", {
94
+ /**
95
+ * Whether the segment is selected. Selected segments are shifted outwards by the delta
96
+ */
51
97
  get: function () {
52
98
  return this.isSelectedProperty;
53
99
  },
100
+ /**
101
+ * Whether the segment is selected. Selected segments are shifted outwards by the delta
102
+ */
54
103
  set: function (value) {
55
- this.isSelectedProperty = value;
56
- if (value) {
57
- this.deltaProperty = PieSegment.DEFAULT_DELTA;
58
- }
59
- else {
60
- this.deltaProperty = 0;
104
+ if (this.isSelectedProperty !== value) {
105
+ this.isSelectedProperty = value;
106
+ this.notifyPropertyChanged(constants_1.PROPERTY.IS_SELECTED);
61
107
  }
62
- this.notifyPropertyChanged(constants_1.PROPERTY.IS_SELECTED);
63
108
  },
64
109
  enumerable: false,
65
110
  configurable: true
66
111
  });
67
112
  Object.defineProperty(PieSegment.prototype, "text", {
113
+ /**
114
+ * A text value for the segment which will be displayed in the legend
115
+ */
68
116
  get: function () {
69
117
  return this.textProperty;
70
118
  },
119
+ /**
120
+ * A text value for the segment which will be displayed in the legend
121
+ */
71
122
  set: function (value) {
72
123
  this.textProperty = value;
73
124
  this.notifyPropertyChanged(constants_1.PROPERTY.TEXT);
@@ -75,39 +126,154 @@ var PieSegment = /** @class */ (function () {
75
126
  enumerable: false,
76
127
  configurable: true
77
128
  });
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
+ */
133
+ get: function () {
134
+ // Create a labelProvider if it is accessed. This will override behaviour from the parent surface
135
+ if (this.labelProviderProperty === undefined) {
136
+ this.labelProvider = new PieLabelProvider_1.PieLabelProvider();
137
+ }
138
+ return this.labelProviderProperty;
139
+ },
140
+ /**
141
+ * Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
142
+ */
143
+ set: function (value) {
144
+ this.labelProviderProperty = value;
145
+ this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_PROVIDER);
146
+ },
147
+ enumerable: false,
148
+ configurable: true
149
+ });
78
150
  PieSegment.prototype.getPercentage = function (total) {
79
- var pers = (100 * this.value) / total;
80
- return pers.toFixed(2) + " %";
151
+ return (100 * this.value) / total;
81
152
  };
82
153
  Object.defineProperty(PieSegment.prototype, "value", {
154
+ /**
155
+ * The numerical value of the segment
156
+ */
83
157
  get: function () {
84
158
  return this.valueProperty;
85
159
  },
160
+ /**
161
+ * The numerical value of the segment
162
+ */
86
163
  set: function (value) {
164
+ this.oldValueProperty = this.valueProperty;
87
165
  this.valueProperty = value;
88
166
  this.notifyPropertyChanged(constants_1.PROPERTY.VALUE);
89
167
  },
90
168
  enumerable: false,
91
169
  configurable: true
92
170
  });
171
+ Object.defineProperty(PieSegment.prototype, "oldValue", {
172
+ /**
173
+ * The previous value of the segment, if it has been updated. Used for animations
174
+ */
175
+ get: function () {
176
+ return this.oldValueProperty;
177
+ },
178
+ enumerable: false,
179
+ configurable: true
180
+ });
93
181
  Object.defineProperty(PieSegment.prototype, "delta", {
182
+ /**
183
+ * The amount to shift the segment when it is selected. Default 15 px
184
+ */
94
185
  get: function () {
95
186
  return this.deltaProperty;
96
187
  },
188
+ /**
189
+ * The amount to shift the segment when it is selected. Default 15 px
190
+ */
97
191
  set: function (value) {
98
- if (this.deltaProperty === PieSegment.DEFAULT_DELTA && value < PieSegment.DEFAULT_DELTA) {
99
- this.isSelectedProperty = false;
192
+ if (this.deltaProperty !== value) {
193
+ this.deltaProperty = value;
194
+ this.notifyPropertyChanged(constants_1.PROPERTY.DELTA);
100
195
  }
101
- else if (this.deltaProperty === 0 && value > 0) {
102
- this.isSelectedProperty = true;
196
+ },
197
+ enumerable: false,
198
+ configurable: true
199
+ });
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
+ */
205
+ get: function () {
206
+ return this.shiftProperty;
207
+ },
208
+ /**
209
+ * The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
210
+ */
211
+ set: function (value) {
212
+ if (this.shiftProperty !== value) {
213
+ this.shiftProperty = value;
214
+ this.notifyPropertyChanged(constants_1.PROPERTY.SHIFT);
103
215
  }
104
- this.deltaProperty = value;
105
- this.notifyPropertyChanged(constants_1.PROPERTY.DELTA);
216
+ },
217
+ enumerable: false,
218
+ configurable: true
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);
106
271
  },
107
272
  enumerable: false,
108
273
  configurable: true
109
274
  });
110
275
  PieSegment.prototype.toJSON = function () {
276
+ var _a;
111
277
  return {
112
278
  id: this.id,
113
279
  color: this.color,
@@ -115,15 +281,30 @@ var PieSegment = /** @class */ (function () {
115
281
  isSelected: this.isSelected,
116
282
  delta: this.delta,
117
283
  text: this.text,
118
- value: this.value
284
+ value: this.value,
285
+ // @ts-ignore
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
119
290
  };
120
291
  };
292
+ PieSegment.prototype.getLabelText = function (total) {
293
+ if (this.labelProviderProperty) {
294
+ return this.labelProvider.getSegmentText(this, total);
295
+ }
296
+ else {
297
+ return this.parentSurface.labelProvider.getSegmentText(this, total);
298
+ }
299
+ };
121
300
  PieSegment.prototype.notifyPropertyChanged = function (propertyName) {
301
+ if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER && this.labelProviderProperty) {
302
+ this.labelProviderProperty.attachedToSurface(this.parentSurface);
303
+ }
122
304
  if (this.invalidateParentCallback) {
123
- this.invalidateParentCallback();
305
+ this.invalidateParentCallback(propertyName);
124
306
  }
125
307
  };
126
- PieSegment.DEFAULT_DELTA = 15;
127
308
  return PieSegment;
128
309
  }());
129
310
  exports.PieSegment = PieSegment;
@@ -5,5 +5,10 @@ export declare enum PROPERTY {
5
5
  IS_SELECTED = "IS_SELECTED",
6
6
  PERCENTAGE = "PERCENTAGE",
7
7
  TEXT = "TEXT",
8
- VALUE = "VALUE"
8
+ VALUE = "VALUE",
9
+ SHIFT = "SHIFT",
10
+ LABEL_PROVIDER = "LABEL_PROVIDER",
11
+ LABEL_STYLE = "LABEL_STYLE",
12
+ LABEL_OFFSET = "LABEL_OFFSET",
13
+ RADIUS_ADJUSTMENT = "RADIUS_ADJUSTMENT"
9
14
  }
@@ -10,4 +10,9 @@ var PROPERTY;
10
10
  PROPERTY["PERCENTAGE"] = "PERCENTAGE";
11
11
  PROPERTY["TEXT"] = "TEXT";
12
12
  PROPERTY["VALUE"] = "VALUE";
13
+ PROPERTY["SHIFT"] = "SHIFT";
14
+ PROPERTY["LABEL_PROVIDER"] = "LABEL_PROVIDER";
15
+ PROPERTY["LABEL_STYLE"] = "LABEL_STYLE";
16
+ PROPERTY["LABEL_OFFSET"] = "LABEL_OFFSET";
17
+ PROPERTY["RADIUS_ADJUSTMENT"] = "RADIUS_ADJUSTMENT";
13
18
  })(PROPERTY = exports.PROPERTY || (exports.PROPERTY = {}));
@@ -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 { TTextStyle } from "../Axis/AxisCore";
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: PieLabelProvider;
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,27 @@ 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;
97
+ private labelStyleProperty;
83
98
  constructor(canvases?: TSciChartSurfaceCanvases, options?: IPieSurfaceOptions);
99
+ /**
100
+ * Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
101
+ */
102
+ get labelProvider(): PieLabelProvider;
103
+ /**
104
+ * Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
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);
84
115
  /**
85
116
  * @inheritDoc
86
117
  */
@@ -97,7 +128,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
97
128
  * Call invalidateElement() to trigger a redraw of the {@link SciChartPieSurface}. SciChart's rendering
98
129
  * engine will schedule a redraw a the next time the renderer is free.
99
130
  */
100
- invalidateElement(): void;
131
+ invalidateElement(propertyName?: string): void;
101
132
  /**
102
133
  * Called internally - Updates and draws the Pie Chart
103
134
  */
@@ -105,7 +136,7 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
105
136
  /**
106
137
  * @inheritDoc
107
138
  */
108
- delete(): void;
139
+ delete(isAnimationProgress?: boolean): void;
109
140
  /**
110
141
  * @inheritDoc
111
142
  */
@@ -150,6 +181,39 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
150
181
  * which sets the size of a Donut Chart hole
151
182
  */
152
183
  set holeRadiusSizingMode(holeRadiusSizingMode: ESizingMode);
184
+ /**
185
+ * Gets or sets padding
186
+ */
187
+ get padding(): Thickness;
188
+ /**
189
+ * Gets or sets padding
190
+ */
191
+ set padding(value: Thickness);
192
+ /**
193
+ * Gets or sets canvas border
194
+ */
195
+ get canvasBorder(): TBorder;
196
+ /**
197
+ * Gets or sets canvas border
198
+ */
199
+ set canvasBorder(value: TBorder);
200
+ get seriesSpacing(): number;
201
+ set seriesSpacing(value: number);
202
+ /** Whether to show labels as percentages, or raw values. Default to percentages */
203
+ get valueMode(): EPieValueMode;
204
+ /** Whether to show labels as percentages, or raw values. Default to percentages */
205
+ set valueMode(value: EPieValueMode);
206
+ /**
207
+ * Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
208
+ * For Pie charts, 1.7 will place the labels outside the pie
209
+ * If you want more detailed control you can override calcTitlePosition.
210
+ */
211
+ get labelRadiusAdjustment(): number;
212
+ /**
213
+ * Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
214
+ * If you want more detailed control you can override calcTitlePosition.
215
+ */
216
+ set labelRadiusAdjustment(value: number);
153
217
  /**
154
218
  * Convert the surface to a {@link TSurfaceDefinition}
155
219
  * @param excludedata If false, segments will be included in the json
@@ -158,6 +222,11 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
158
222
  type: ESciChartSurfaceType;
159
223
  options: ISciChartPieDefinition;
160
224
  };
225
+ /** The method used to calculate the label position for each segment */
226
+ calcTitlePosition(x: number, y: number, outerRadius: number, innerRadius: number, a1: number, a2: number, delta: number, divWidth: number, divHeight: number): {
227
+ left: number;
228
+ top: number;
229
+ };
161
230
  /**
162
231
  * Changes the size of the DOM element where the {@link SciChartSurfaceBase} resides.
163
232
  * @param width
@@ -168,14 +237,19 @@ export declare class SciChartPieSurface implements ISciChartSurfaceBase {
168
237
  private isValidToDraw;
169
238
  private detachPieSegment;
170
239
  private attachPieSegment;
240
+ private updateLegendMargin;
241
+ private calculateViewRectWidth;
242
+ private calculateViewRectHeight;
171
243
  private draw;
172
244
  /**
173
245
  * @description Draws pie chart itself
174
246
  * @param animationProgress - Current progress from 0 to 1, is being used for sweep animation on start.
175
247
  */
176
248
  private drawChart;
177
- private drawSegmentTitles;
249
+ private adjustDomContainer;
250
+ private drawSegmentLabel;
178
251
  private pieSegmentsTotalValue;
252
+ private pieSegmentsTotalOldValue;
179
253
  private applySciChartBackground;
180
254
  }
181
255
  /** @ignore */