scichart 2.1.2301 → 2.2.2389

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) 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/ModifierMouseArgs.d.ts +2 -2
  13. package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
  14. package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
  15. package/Charting/ChartModifiers/RolloverModifier.js +76 -19
  16. package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
  17. package/Charting/LayoutManager/LayoutManager.js +6 -1
  18. package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
  19. package/Charting/Model/BaseHeatmapDataSeries.js +5 -2
  20. package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
  21. package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
  22. package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
  23. package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
  24. package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
  25. package/Charting/Model/Filters/HlcFilterBase.js +141 -0
  26. package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
  27. package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
  28. package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
  29. package/Charting/Model/Filters/XyFilterBase.js +6 -0
  30. package/Charting/Model/Filters/XyyFilterBase.js +9 -0
  31. package/Charting/Model/Filters/XyzFilterBase.js +12 -3
  32. package/Charting/Model/HlcDataSeries.d.ts +189 -0
  33. package/Charting/Model/HlcDataSeries.js +557 -0
  34. package/Charting/Model/IDataSeries.d.ts +5 -1
  35. package/Charting/Model/IDataSeries.js +4 -0
  36. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
  37. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
  38. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
  39. package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
  40. package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
  41. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
  42. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
  43. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
  44. package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
  45. package/Charting/Services/SciChartRenderer.d.ts +1 -0
  46. package/Charting/Services/SciChartRenderer.js +6 -0
  47. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
  48. package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
  49. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
  50. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
  51. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
  52. package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
  53. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
  54. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
  55. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
  56. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
  57. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
  58. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +71 -14
  59. package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
  60. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
  61. package/Charting/Visuals/Annotations/constants.d.ts +2 -1
  62. package/Charting/Visuals/Annotations/constants.js +1 -0
  63. package/Charting/Visuals/Axis/AxisBase2D.d.ts +11 -1
  64. package/Charting/Visuals/Axis/AxisBase2D.js +75 -17
  65. package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
  66. package/Charting/Visuals/Axis/AxisCore.js +6 -0
  67. package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
  68. package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
  69. package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
  70. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
  71. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
  72. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +34 -0
  73. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +82 -0
  74. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
  75. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +39 -6
  76. package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
  77. package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
  78. package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
  79. package/Charting/Visuals/Helpers/NativeObject.js +101 -0
  80. package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
  81. package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
  82. package/Charting/Visuals/Helpers/drawBorder.js +2 -2
  83. package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
  84. package/Charting/Visuals/Helpers/drawLabel.js +38 -18
  85. package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
  86. package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
  87. package/Charting/Visuals/Legend/SciChartLegend.js +8 -2
  88. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
  89. package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
  90. package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
  91. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +24 -8
  92. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +109 -31
  93. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
  94. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
  95. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
  96. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
  97. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
  98. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
  99. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
  100. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
  101. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
  102. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
  103. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
  104. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
  105. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
  106. package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
  107. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
  108. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
  109. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
  110. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
  111. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
  112. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
  113. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
  114. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
  115. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
  116. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
  117. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
  118. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
  119. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
  120. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  121. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
  122. package/Charting/Visuals/RenderableSeries/constants.d.ts +7 -0
  123. package/Charting/Visuals/RenderableSeries/constants.js +7 -0
  124. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +25 -2
  125. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +9 -1
  126. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +128 -2
  127. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +202 -21
  128. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +6 -1
  129. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +5 -0
  130. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +77 -3
  131. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +373 -81
  132. package/Charting/Visuals/SciChartPieSurface/constants.d.ts +7 -1
  133. package/Charting/Visuals/SciChartPieSurface/constants.js +6 -0
  134. package/Charting/Visuals/SciChartSurface.d.ts +13 -2
  135. package/Charting/Visuals/SciChartSurface.js +39 -3
  136. package/Charting/Visuals/createMaster.js +17 -13
  137. package/Charting/Visuals/createSingle.js +5 -3
  138. package/Charting/Visuals/licenseManager2D.d.ts +6 -0
  139. package/Charting/Visuals/licenseManager2D.js +98 -9
  140. package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
  141. package/Charting/Visuals/licenseManager2dState.js +37 -1
  142. package/Charting/Visuals/loader.js +4 -1
  143. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  144. package/Charting/Visuals/sciChartInitCommon.js +13 -9
  145. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
  146. package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
  147. package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
  148. package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
  149. package/Charting3D/Visuals/createMaster3d.js +20 -14
  150. package/Charting3D/Visuals/createSingle3d.js +3 -4
  151. package/Charting3D/Visuals/licenseManager3D.js +3 -1
  152. package/Core/BuildStamp.d.ts +1 -1
  153. package/Core/BuildStamp.js +2 -2
  154. package/Core/Telemetry.d.ts +7 -0
  155. package/Core/Telemetry.js +109 -0
  156. package/Core/storage/localStorageApi.d.ts +4 -0
  157. package/Core/storage/localStorageApi.js +12 -0
  158. package/README.md +49 -13
  159. package/_wasm/scichart.browser.js +1 -1
  160. package/_wasm/scichart2d.js +95 -95
  161. package/_wasm/scichart2d.wasm +0 -0
  162. package/_wasm/scichart3d.js +97 -97
  163. package/_wasm/scichart3d.wasm +0 -0
  164. package/package.json +1 -1
  165. package/types/AxisType.d.ts +5 -1
  166. package/types/AxisType.js +4 -0
  167. package/types/Color.d.ts +1 -0
  168. package/types/Color.js +1 -0
  169. package/types/DataFilterType.d.ts +1 -0
  170. package/types/DataFilterType.js +1 -0
  171. package/types/DataPointWidthMode.d.ts +13 -0
  172. package/types/DataPointWidthMode.js +17 -0
  173. package/types/ErrorDirection.d.ts +13 -0
  174. package/types/ErrorDirection.js +17 -0
  175. package/types/ErrorMode.d.ts +17 -0
  176. package/types/ErrorMode.js +21 -0
  177. package/types/LabelPlacement.d.ts +8 -0
  178. package/types/LabelPlacement.js +11 -1
  179. package/types/LabelProviderType.d.ts +5 -1
  180. package/types/LabelProviderType.js +4 -0
  181. package/types/SeriesType.d.ts +3 -1
  182. package/types/SeriesType.js +2 -0
  183. package/types/TSciChart.d.ts +8 -2
  184. package/types/TSciChart3D.d.ts +5 -2
  185. package/types/TSciChartSurfaceCanvases.d.ts +1 -0
  186. package/utils/date.d.ts +1 -0
  187. package/utils/date.js +15 -1
  188. package/utils/guid.d.ts +6 -0
  189. package/utils/guid.js +17 -1
@@ -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;
@@ -9,10 +9,16 @@ export declare enum PROPERTY {
9
9
  CONTOUR_MAJOR_LINE_STYLE = "CONTOUR_MAJOR_LINE_STYLE",
10
10
  CONTOUR_COLOR_MAP_MODE = "CONTOUR_COLOR_MAP_MODE",
11
11
  DATA_POINT_WIDTH = "dataPointWidth",
12
+ DATA_POINT_WIDTH_MODE = "DATA_POINT_WIDTH_MODE",
12
13
  DATA_SERIES = "dataSeries",
14
+ DRAWING_PROVIDERS = "DRAWING_PROVIDERS",
13
15
  DRAW_NAN_AS = "drawNaNAs",
16
+ DRAW_CONNECTOR = "DRAW_CONNECTOR",
17
+ DRAW_WHISKERS = "DRAW_WHISKERS",
14
18
  EFFECT = "EFFECT",
15
19
  ENABLE_DRAWING_OPTIMISATIONS = "ENABLE_DRAWING_OPTIMISATIONS",
20
+ ERROR_DIRECTION = "ERROR_DIRECTION",
21
+ ERROR_MODE = "ERROR_MODE",
16
22
  FILL = "fill",
17
23
  FILL_Y1 = "FILL_Y1",
18
24
  FILL_LINEAR_GRADIENT = "FILL_LINEAR_GRADIENT",
@@ -30,6 +36,7 @@ export declare enum PROPERTY {
30
36
  OFFSET = "OFFSET",
31
37
  OPACITY = "OPACITY",
32
38
  PALETTE_PROVIDER = "PALETTE_PROVIDER",
39
+ PARENT_SURFACE = "PARENT_SURFACE",
33
40
  POINT_MARKER = "pointMarker",
34
41
  RANGE = "RANGE",
35
42
  RESAMPLING_MODE = "RESAMPLING_MODE",
@@ -13,10 +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";
18
+ PROPERTY["DRAWING_PROVIDERS"] = "DRAWING_PROVIDERS";
17
19
  PROPERTY["DRAW_NAN_AS"] = "drawNaNAs";
20
+ PROPERTY["DRAW_CONNECTOR"] = "DRAW_CONNECTOR";
21
+ PROPERTY["DRAW_WHISKERS"] = "DRAW_WHISKERS";
18
22
  PROPERTY["EFFECT"] = "EFFECT";
19
23
  PROPERTY["ENABLE_DRAWING_OPTIMISATIONS"] = "ENABLE_DRAWING_OPTIMISATIONS";
24
+ PROPERTY["ERROR_DIRECTION"] = "ERROR_DIRECTION";
25
+ PROPERTY["ERROR_MODE"] = "ERROR_MODE";
20
26
  PROPERTY["FILL"] = "fill";
21
27
  PROPERTY["FILL_Y1"] = "FILL_Y1";
22
28
  PROPERTY["FILL_LINEAR_GRADIENT"] = "FILL_LINEAR_GRADIENT";
@@ -34,6 +40,7 @@ var PROPERTY;
34
40
  PROPERTY["OFFSET"] = "OFFSET";
35
41
  PROPERTY["OPACITY"] = "OPACITY";
36
42
  PROPERTY["PALETTE_PROVIDER"] = "PALETTE_PROVIDER";
43
+ PROPERTY["PARENT_SURFACE"] = "PARENT_SURFACE";
37
44
  PROPERTY["POINT_MARKER"] = "pointMarker";
38
45
  PROPERTY["RANGE"] = "RANGE";
39
46
  PROPERTY["RESAMPLING_MODE"] = "RESAMPLING_MODE";
@@ -1,5 +1,9 @@
1
+ import { TLabelProviderDefinition } from "../../../Builder/buildAxis";
2
+ import { Thickness } from "../../../Core/Thickness";
3
+ import { TBorder } from "../../../types/TBorder";
4
+ import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
1
5
  import { ISurfaceOptionsBase } from "../SciChartSurfaceBase";
2
- import { EPieType, ESizingMode } from "./SciChartPieSurface";
6
+ import { EPieType, EPieValueMode, ESizingMode } from "./SciChartPieSurface";
3
7
  /**
4
8
  * Options passed to a {@link SciChartPieSurface} in the {@link SciChartPieSurface.create} function
5
9
  */
@@ -18,8 +22,10 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
18
22
  pieType?: EPieType;
19
23
  /** Optional - the radius of the hole for a donut chart. */
20
24
  holeRadius?: number;
21
- /** Optional - Whether to animate the chart as it is initially drawn. Default true */
25
+ /** Optional - Whether to animate the chart as it is drawn. Default true */
22
26
  animate?: boolean;
27
+ /** Optional - The number of frames for the animation. Default 30. A frame will be trigged every 20ms. */
28
+ animationFrames?: number;
23
29
  /** Optional - how the hole radius is interpreted, either absolute, or relative to the total radius */
24
30
  holeRadiusSizingMode?: ESizingMode;
25
31
  /** Optional - whether to show the legend. Default true */
@@ -30,4 +36,21 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
30
36
  showLegendCheckBoxes?: boolean;
31
37
  /** Optional - whether to show series markers on the legend. Default true */
32
38
  showLegendSeriesMarkers?: boolean;
39
+ /** Optional - adds the spacings / padding around the view area */
40
+ padding?: Thickness;
41
+ /** Optional - adds the border to the view area */
42
+ canvasBorder?: TBorder;
43
+ /** Optional - addes spacing between the segments */
44
+ seriesSpacing?: number;
45
+ /**
46
+ * Sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
47
+ */
48
+ labelProvider?: PieLabelProvider | TLabelProviderDefinition;
49
+ /** Whether to show labels as percentages, or raw values. Default to percentages */
50
+ valueMode?: EPieValueMode;
51
+ /**
52
+ * Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
53
+ * If you want more detailed control you can override calcTitlePosition.
54
+ */
55
+ labelRadiusAdjustment?: number;
33
56
  }
@@ -1,16 +1,24 @@
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 {
5
7
  readonly id: string;
6
8
  text: string;
7
9
  value: number;
10
+ oldValue: number;
8
11
  color: string;
9
12
  colorLinearGradient: GradientParams;
10
13
  isSelected: boolean;
11
14
  delta: number;
15
+ shift: number;
16
+ labelStyle: TTextStyle;
17
+ labelOffset: Point;
18
+ radiusAdjustment: number;
12
19
  onAttach(scs: SciChartPieSurface): void;
13
20
  onDetach(): void;
14
- getPercentage(total: number): string;
15
21
  toJSON(): IPieSegmentOptions;
22
+ getPercentage(total: number): number;
23
+ getLabelText(total: number): string;
16
24
  }
@@ -1,42 +1,168 @@
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";
6
+ import { PieLabelProvider } from "../../Axis/LabelProvider/PieLabelProvider";
3
7
  import { SciChartPieSurface } from "../SciChartPieSurface";
4
8
  import { IPieSegment } from "./IPieSegment";
5
9
  export interface IPieSegmentOptions {
6
10
  id?: string;
11
+ /**
12
+ * A text value for the segment which will be displayed in the legend
13
+ */
7
14
  text?: string;
15
+ /**
16
+ * The numerical value of the segment
17
+ */
8
18
  value?: number;
19
+ /**
20
+ * The color of the segment as an HTML color code
21
+ */
9
22
  color?: string;
23
+ /**
24
+ * An optional color gradient
25
+ */
10
26
  colorLinearGradient?: GradientParams;
27
+ /**
28
+ * Whether the segment is selected. Selected segments are shifted outwards by the delta
29
+ */
11
30
  isSelected?: boolean;
31
+ /**
32
+ * The amount to shift the segment when it is selected. Default 15 px
33
+ */
12
34
  delta?: number;
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;
13
51
  }
14
52
  export declare class PieSegment implements IPieSegment {
15
- static readonly DEFAULT_DELTA = 15;
16
53
  readonly id: string;
17
54
  private colorProperty;
18
55
  private colorLinearGradientProperty;
19
56
  private isSelectedProperty;
20
57
  private textProperty;
21
58
  private valueProperty;
59
+ private oldValueProperty;
22
60
  private deltaProperty;
61
+ private shiftProperty;
62
+ private parentSurface;
63
+ private labelProviderProperty;
64
+ private labelStyleProperty;
65
+ private labelOffsetProperty;
66
+ private radiusAdjustmentProperty;
23
67
  private invalidateParentCallback;
24
68
  constructor(options?: IPieSegmentOptions);
25
69
  onAttach(scps: SciChartPieSurface): void;
26
70
  onDetach(): void;
71
+ /**
72
+ * An optional color gradient
73
+ */
27
74
  get colorLinearGradient(): GradientParams;
75
+ /**
76
+ * An optional color gradient
77
+ */
28
78
  set colorLinearGradient(value: GradientParams);
79
+ /**
80
+ * The color of the segment as an HTML color code
81
+ */
29
82
  get color(): string;
83
+ /**
84
+ * The color of the segment as an HTML color code
85
+ */
30
86
  set color(value: string);
87
+ /**
88
+ * Whether the segment is selected. Selected segments are shifted outwards by the delta
89
+ */
31
90
  get isSelected(): boolean;
91
+ /**
92
+ * Whether the segment is selected. Selected segments are shifted outwards by the delta
93
+ */
32
94
  set isSelected(value: boolean);
95
+ /**
96
+ * A text value for the segment which will be displayed in the legend
97
+ */
33
98
  get text(): string;
99
+ /**
100
+ * A text value for the segment which will be displayed in the legend
101
+ */
34
102
  set text(value: string);
35
- getPercentage(total: number): string;
103
+ /**
104
+ * Optional class that can override the default label formatting for this segment only. Must be or inherit from {@link PieLabelProvider}
105
+ */
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
+ */
110
+ set labelProvider(value: PieLabelProvider);
111
+ getPercentage(total: number): number;
112
+ /**
113
+ * The numerical value of the segment
114
+ */
36
115
  get value(): number;
116
+ /**
117
+ * The numerical value of the segment
118
+ */
37
119
  set value(value: number);
120
+ /**
121
+ * The previous value of the segment, if it has been updated. Used for animations
122
+ */
123
+ get oldValue(): number;
124
+ /**
125
+ * The amount to shift the segment when it is selected. Default 15 px
126
+ */
38
127
  get delta(): number;
128
+ /**
129
+ * The amount to shift the segment when it is selected. Default 15 px
130
+ */
39
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
+ */
136
+ get shift(): number;
137
+ /**
138
+ * The amount the segment is shifted radially outwards. Automatically set during selected/deselection animations
139
+ */
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);
40
165
  toJSON(): RequiredOwnProps<IPieSegmentOptions>;
166
+ getLabelText(total: number): string;
41
167
  private notifyPropertyChanged;
42
168
  }
@@ -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;