scichart 2.0.0-alpha.1971 → 2.0.0-alpha.1991

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 (111) hide show
  1. package/Builder/buildAxis.d.ts +3 -3
  2. package/Builder/buildDataSeries.d.ts +44 -4
  3. package/Builder/buildDataSeries.js +66 -0
  4. package/Builder/buildSeries.d.ts +1 -1
  5. package/Builder/buildSeries.js +1 -2
  6. package/Builder/buildSurface.d.ts +14 -6
  7. package/Builder/buildSurface.js +13 -8
  8. package/Builder/chartBuilder.d.ts +12 -6
  9. package/Builder/chartBuilder.js +6 -6
  10. package/Charting/ChartModifiers/LegendModifier.d.ts +4 -0
  11. package/Charting/ChartModifiers/LegendModifier.js +2 -1
  12. package/Charting/ChartModifiers/SeriesSelectionModifier.d.ts +14 -6
  13. package/Charting/ChartModifiers/SeriesSelectionModifier.js +10 -10
  14. package/Charting/ChartModifiers/ZoomExtentsModifier.d.ts +13 -0
  15. package/Charting/ChartModifiers/ZoomExtentsModifier.js +16 -4
  16. package/Charting/Drawing/BrushCache.js +6 -8
  17. package/Charting/LayoutManager/BottomAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +1 -0
  18. package/Charting/LayoutManager/LeftAlignedOuterVerticallyStackedAxisLayoutStrategy.js +1 -0
  19. package/Charting/LayoutManager/RightAlignedOuterVerticallyStackedAxisLayoutStrategy.js +1 -0
  20. package/Charting/LayoutManager/TopAlignedOuterHorizontallyStackedAxisLayoutStrategy.js +1 -0
  21. package/Charting/Model/BaseDataSeries.d.ts +61 -53
  22. package/Charting/Model/BaseDataSeries.js +145 -81
  23. package/Charting/Model/BaseHeatmapDataSeries.d.ts +2 -2
  24. package/Charting/Model/DataPointSelectionPaletteProvider.d.ts +6 -4
  25. package/Charting/Model/DataPointSelectionPaletteProvider.js +10 -1
  26. package/Charting/Model/Filters/OhlcScaleOffsetFilter.d.ts +106 -0
  27. package/Charting/Model/Filters/OhlcScaleOffsetFilter.js +21 -0
  28. package/Charting/Model/Filters/XyLinearTrendFilter.d.ts +112 -1
  29. package/Charting/Model/Filters/XyLinearTrendFilter.js +21 -0
  30. package/Charting/Model/Filters/XyMovingAverageFilter.d.ts +110 -1
  31. package/Charting/Model/Filters/XyMovingAverageFilter.js +21 -0
  32. package/Charting/Model/Filters/XyRatioFilter.d.ts +111 -2
  33. package/Charting/Model/Filters/XyRatioFilter.js +34 -3
  34. package/Charting/Model/Filters/XyScaleOffsetFilter.d.ts +112 -1
  35. package/Charting/Model/Filters/XyScaleOffsetFilter.js +21 -0
  36. package/Charting/Model/Filters/XyyScaleOffsetFilter.d.ts +116 -0
  37. package/Charting/Model/Filters/XyyScaleOffsetFilter.js +21 -0
  38. package/Charting/Model/Filters/XyzScaleOffsetFilter.d.ts +116 -0
  39. package/Charting/Model/Filters/XyzScaleOffsetFilter.js +21 -0
  40. package/Charting/Model/IDataSeries.d.ts +18 -3
  41. package/Charting/Model/IDataSeries.js +12 -1
  42. package/Charting/Model/IPaletteProvider.d.ts +8 -8
  43. package/Charting/Model/OhlcDataSeries.d.ts +39 -10
  44. package/Charting/Model/OhlcDataSeries.js +106 -19
  45. package/Charting/Model/UniformHeatmapDataSeries.d.ts +2 -2
  46. package/Charting/Model/XyyDataSeries.d.ts +21 -12
  47. package/Charting/Model/XyyDataSeries.js +70 -16
  48. package/Charting/Model/XyzDataSeries.d.ts +20 -5
  49. package/Charting/Model/XyzDataSeries.js +62 -6
  50. package/Charting/Services/SciChartRenderer.js +3 -1
  51. package/Charting/Visuals/Annotations/AnnotationBase.js +5 -9
  52. package/Charting/Visuals/Annotations/AxisMarkerAnnotation.js +0 -3
  53. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +0 -3
  54. package/Charting/Visuals/Annotations/LineAnnotation.js +0 -3
  55. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +0 -3
  56. package/Charting/Visuals/Axis/AxisBase2D.d.ts +20 -0
  57. package/Charting/Visuals/Axis/AxisBase2D.js +57 -5
  58. package/Charting/Visuals/Axis/AxisCore.js +16 -13
  59. package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +13 -0
  60. package/Charting/Visuals/Axis/constants.d.ts +2 -1
  61. package/Charting/Visuals/Axis/constants.js +1 -0
  62. package/Charting/Visuals/Legend/SciChartLegend.js +1 -1
  63. package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +11 -0
  64. package/Charting/Visuals/Legend/SciChartLegendBase.js +45 -17
  65. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.d.ts +9 -2
  66. package/Charting/Visuals/RenderableSeries/Animations/animationHelpers.js +65 -4
  67. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +0 -11
  68. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +0 -29
  69. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +1 -1
  70. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +0 -37
  71. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +0 -120
  72. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +4 -24
  73. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +44 -72
  74. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.d.ts +2 -1
  75. package/Charting/Visuals/RenderableSeries/DrawingProviders/MountainSeriesDrawingProvider.js +6 -6
  76. package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.d.ts +0 -6
  77. package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.js +0 -42
  78. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +0 -17
  79. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +0 -71
  80. package/Charting/Visuals/RenderableSeries/FastOhlcRenderableSeries.js +1 -1
  81. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +12 -4
  82. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.d.ts +3 -0
  83. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +10 -32
  84. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +4 -0
  85. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +11 -21
  86. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.d.ts +3 -0
  87. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +10 -21
  88. package/Charting/Visuals/SciChartOverview.d.ts +1 -1
  89. package/Charting/Visuals/SciChartOverview.js +1 -1
  90. package/Charting/Visuals/SciChartSurface.d.ts +2 -2
  91. package/Charting/Visuals/SciChartSurface.js +4 -4
  92. package/Charting/Visuals/SciChartSurfaceBase.d.ts +2 -3
  93. package/Charting/Visuals/SciChartSurfaceBase.js +2 -6
  94. package/Charting/Visuals/TextureManager/DpiHelper.js +2 -1
  95. package/Charting/Visuals/TextureManager/TextureManager.js +3 -2
  96. package/Charting3D/Visuals/SciChart3DSurface.d.ts +1 -1
  97. package/Charting3D/Visuals/SciChart3DSurface.js +1 -1
  98. package/_wasm/scichart.browser.js +1 -1
  99. package/_wasm/scichart2d.js +95 -95
  100. package/_wasm/scichart2d.wasm +0 -0
  101. package/_wasm/scichart3d.js +1 -1
  102. package/_wasm/scichart3d.wasm +0 -0
  103. package/package.json +1 -1
  104. package/types/BaseType.d.ts +3 -1
  105. package/types/BaseType.js +2 -0
  106. package/types/DataFilterType.d.ts +9 -0
  107. package/types/DataFilterType.js +13 -0
  108. package/types/SeriesType.d.ts +17 -17
  109. package/types/SeriesType.js +17 -17
  110. package/utils/font.d.ts +8 -0
  111. package/utils/font.js +15 -0
@@ -9,13 +9,13 @@ import { ELabelProviderType } from "../types/LabelProviderType";
9
9
  import { TSciChart } from "../types/TSciChart";
10
10
  /** Definition of an {@link AxisBase2D}, comprising a {@link EAxisType} and the relevant options */
11
11
  export declare type TAxisDefinition = {
12
- type: EAxisType.NumericAxis | string;
12
+ type: EAxisType.NumericAxis;
13
13
  options?: INumericAxisOptions;
14
14
  } | {
15
- type: EAxisType.LogarithmicAxis | string;
15
+ type: EAxisType.LogarithmicAxis;
16
16
  options?: ILogarithmicAxisOptions;
17
17
  } | {
18
- type: EAxisType.CategoryAxis | string;
18
+ type: EAxisType.CategoryAxis;
19
19
  options?: ICategoryAxisOptions;
20
20
  };
21
21
  /** Definition of a {@link LabelProviderBase2D}, comprising a {@link ELabelProviderType} and the relevant options */
@@ -1,9 +1,17 @@
1
+ import { IOhlcScaleOffsetFilterOptions } from "../Charting/Model/Filters/OhlcScaleOffsetFilter";
2
+ import { IXyFilterOptions } from "../Charting/Model/Filters/XyFilterBase";
3
+ import { IXyMovingAverageFilterOptions } from "../Charting/Model/Filters/XyMovingAverageFilter";
4
+ import { IXyRatioFilterOptions } from "../Charting/Model/Filters/XyRatioFilter";
5
+ import { IXyScaleOffsetFilterOptions } from "../Charting/Model/Filters/XyScaleOffsetFilter";
6
+ import { IXyyScaleOffsetFilterOptions } from "../Charting/Model/Filters/XyyScaleOffsetFilter";
7
+ import { IXyzScaleOffsetFilterOptions } from "../Charting/Model/Filters/XyzScaleOffsetFilter";
1
8
  import { IDataSeries } from "../Charting/Model/IDataSeries";
2
9
  import { IOhlcDataSeriesOptions } from "../Charting/Model/OhlcDataSeries";
3
10
  import { IUniformHeatmapSeriesOptions } from "../Charting/Model/UniformHeatmapDataSeries";
4
11
  import { IXyDataSeriesOptions } from "../Charting/Model/XyDataSeries";
5
12
  import { IXyyDataSeriesOptions } from "../Charting/Model/XyyDataSeries";
6
13
  import { IXyzDataSeriesOptions } from "../Charting/Model/XyzDataSeries";
14
+ import { EDataFilterType } from "../types/DataFilterType";
7
15
  import { TSciChart } from "../types/TSciChart";
8
16
  import { TSeriesDefinition } from "./buildSeries";
9
17
  /**
@@ -11,13 +19,38 @@ import { TSeriesDefinition } from "./buildSeries";
11
19
  * or directly in {@link chartBuilder.buildSeries} or {@link chartBuilder.buildDataSeries}
12
20
  */
13
21
  export declare type TSharedDataDefinition = Record<number | string, number[]>;
22
+ /** Definition of a data filter */
23
+ declare type TFilterDefinition = {
24
+ type: EDataFilterType.XyLinearTrend;
25
+ options?: IXyFilterOptions;
26
+ } | {
27
+ type: EDataFilterType.XyMovingAverage;
28
+ options?: IXyMovingAverageFilterOptions;
29
+ } | {
30
+ type: EDataFilterType.XyRatio;
31
+ options: IXyRatioFilterOptions;
32
+ } | {
33
+ type: EDataFilterType.XyScaleOffset;
34
+ options?: IXyScaleOffsetFilterOptions;
35
+ } | {
36
+ type: EDataFilterType.XyyScaleOffset;
37
+ options?: IXyyScaleOffsetFilterOptions;
38
+ } | {
39
+ type: EDataFilterType.XyzScaleOffset;
40
+ options?: IXyzScaleOffsetFilterOptions;
41
+ } | {
42
+ type: EDataFilterType.OhlcScaleOffset;
43
+ options?: IOhlcScaleOffsetFilterOptions;
44
+ };
14
45
  /** Definition of XY data */
15
46
  export declare type TXySeriesData = {
16
47
  /** The id of sharedData to use for X data. You must either specify both xDataId and yDataId, or both xValues and yValues */
17
48
  xDataId?: number | string;
18
49
  /** The id of sharedData to use for Y data. You must either specify both xDataId and yDataId, or both xValues and yValues */
19
50
  yDataId?: number | string;
20
- } & IXyDataSeriesOptions;
51
+ } & IXyDataSeriesOptions & {
52
+ filter?: TFilterDefinition;
53
+ };
21
54
  /** Definition of XYY data */
22
55
  export declare type TXyySeriesData = {
23
56
  /** The id of sharedData to use for X data.
@@ -32,7 +65,9 @@ export declare type TXyySeriesData = {
32
65
  * You must either specify all of xDataId, yDataId and y1DataId, or all of xValues, yValues and y1Values
33
66
  */
34
67
  y1DataId?: number | string;
35
- } & IXyyDataSeriesOptions;
68
+ } & IXyyDataSeriesOptions & {
69
+ filter?: TFilterDefinition;
70
+ };
36
71
  /** Definition of XYZ data */
37
72
  export declare type TXyzSeriesData = {
38
73
  /** The id of sharedData to use for X data.
@@ -47,7 +82,9 @@ export declare type TXyzSeriesData = {
47
82
  * You must either specify all of xDataId, yDataId and zDataId, or all of xValues, yValues and zValues
48
83
  */
49
84
  zDataId?: number | string;
50
- } & IXyzDataSeriesOptions;
85
+ } & IXyzDataSeriesOptions & {
86
+ filter?: TFilterDefinition;
87
+ };
51
88
  /** Definition of Open, High, Low, Close data */
52
89
  export declare type TOhlcSeriesData = {
53
90
  /** The id of sharedData to use for X data. You must either use all DataId or all Values properties. You cannot mix them. */
@@ -60,7 +97,9 @@ export declare type TOhlcSeriesData = {
60
97
  lowDataId?: number | string;
61
98
  /** The id of sharedData to use for Close data. You must either use all DataId or all Values properties. You cannot mix them. */
62
99
  closeDataId?: number | string;
63
- } & IOhlcDataSeriesOptions;
100
+ } & IOhlcDataSeriesOptions & {
101
+ filter?: TFilterDefinition;
102
+ };
64
103
  /** Definition of series data, which can take various shapes */
65
104
  export declare type TSeriesDataDefinition = TXySeriesData | TXyySeriesData | TXyzSeriesData | TOhlcSeriesData | IUniformHeatmapSeriesOptions;
66
105
  /**
@@ -71,3 +110,4 @@ export declare type TSeriesDataDefinition = TXySeriesData | TXyySeriesData | TXy
71
110
  * @returns An {@link IDataSeries}
72
111
  */
73
112
  export declare const buildDataSeries: (wasmContext: TSciChart, seriesDefinition: TSeriesDefinition, sharedData?: TSharedDataDefinition) => IDataSeries;
113
+ export {};
@@ -12,11 +12,19 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.buildDataSeries = void 0;
15
+ var OhlcScaleOffsetFilter_1 = require("../Charting/Model/Filters/OhlcScaleOffsetFilter");
16
+ var XyLinearTrendFilter_1 = require("../Charting/Model/Filters/XyLinearTrendFilter");
17
+ var XyMovingAverageFilter_1 = require("../Charting/Model/Filters/XyMovingAverageFilter");
18
+ var XyRatioFilter_1 = require("../Charting/Model/Filters/XyRatioFilter");
19
+ var XyScaleOffsetFilter_1 = require("../Charting/Model/Filters/XyScaleOffsetFilter");
20
+ var XyyScaleOffsetFilter_1 = require("../Charting/Model/Filters/XyyScaleOffsetFilter");
21
+ var XyzScaleOffsetFilter_1 = require("../Charting/Model/Filters/XyzScaleOffsetFilter");
15
22
  var OhlcDataSeries_1 = require("../Charting/Model/OhlcDataSeries");
16
23
  var UniformHeatmapDataSeries_1 = require("../Charting/Model/UniformHeatmapDataSeries");
17
24
  var XyDataSeries_1 = require("../Charting/Model/XyDataSeries");
18
25
  var XyyDataSeries_1 = require("../Charting/Model/XyyDataSeries");
19
26
  var XyzDataSeries_1 = require("../Charting/Model/XyzDataSeries");
27
+ var DataFilterType_1 = require("../types/DataFilterType");
20
28
  var chartBuilder_1 = require("./chartBuilder");
21
29
  function hasOwnProperty(obj, prop) {
22
30
  return obj.hasOwnProperty(prop);
@@ -36,6 +44,7 @@ exports.buildDataSeries = function (wasmContext, seriesDefinition, sharedData) {
36
44
  sharedData = JSON.parse(sharedData, chartBuilder_1.chartReviver);
37
45
  }
38
46
  var dataSeries;
47
+ var filterDef;
39
48
  if (hasOwnProperty(seriesDefinition, "xyData")) {
40
49
  var data = seriesDefinition.xyData;
41
50
  if (sharedData && data.xDataId) {
@@ -46,6 +55,9 @@ exports.buildDataSeries = function (wasmContext, seriesDefinition, sharedData) {
46
55
  else {
47
56
  dataSeries = new XyDataSeries_1.XyDataSeries(wasmContext, data);
48
57
  }
58
+ if (hasOwnProperty(data, "filter")) {
59
+ filterDef = data.filter;
60
+ }
49
61
  }
50
62
  else if (hasOwnProperty(seriesDefinition, "xyyData")) {
51
63
  var data = seriesDefinition.xyyData;
@@ -58,6 +70,9 @@ exports.buildDataSeries = function (wasmContext, seriesDefinition, sharedData) {
58
70
  else {
59
71
  dataSeries = new XyyDataSeries_1.XyyDataSeries(wasmContext, data);
60
72
  }
73
+ if (hasOwnProperty(data, "filter")) {
74
+ filterDef = data.filter;
75
+ }
61
76
  }
62
77
  else if (hasOwnProperty(seriesDefinition, "xyzData")) {
63
78
  var data = seriesDefinition.xyzData;
@@ -70,6 +85,9 @@ exports.buildDataSeries = function (wasmContext, seriesDefinition, sharedData) {
70
85
  else {
71
86
  dataSeries = new XyzDataSeries_1.XyzDataSeries(wasmContext, data);
72
87
  }
88
+ if (hasOwnProperty(data, "filter")) {
89
+ filterDef = data.filter;
90
+ }
73
91
  }
74
92
  else if (hasOwnProperty(seriesDefinition, "ohlcData")) {
75
93
  var data = seriesDefinition.ohlcData;
@@ -88,9 +106,57 @@ exports.buildDataSeries = function (wasmContext, seriesDefinition, sharedData) {
88
106
  else {
89
107
  dataSeries = new OhlcDataSeries_1.OhlcDataSeries(wasmContext, data);
90
108
  }
109
+ if (hasOwnProperty(data, "filter")) {
110
+ filterDef = data.filter;
111
+ }
91
112
  }
92
113
  else if (hasOwnProperty(seriesDefinition, "heatmapData")) {
93
114
  dataSeries = new UniformHeatmapDataSeries_1.UniformHeatmapDataSeries(wasmContext, seriesDefinition.heatmapData);
94
115
  }
116
+ if (filterDef) {
117
+ if ("dataSeries" in seriesDefinition.options) {
118
+ dataSeries = seriesDefinition.options.dataSeries;
119
+ }
120
+ if (dataSeries) {
121
+ var filter = buildFilter(dataSeries, filterDef);
122
+ if (filter) {
123
+ dataSeries = filter;
124
+ }
125
+ }
126
+ }
95
127
  return dataSeries;
96
128
  };
129
+ var buildFilter = function (dataSeries, definition) {
130
+ if (definition.type === DataFilterType_1.EDataFilterType.OhlcScaleOffset) {
131
+ return new OhlcScaleOffsetFilter_1.OhlcScaleOffsetFilter(dataSeries, definition.options);
132
+ }
133
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyLinearTrend) {
134
+ return new XyLinearTrendFilter_1.XyLinearTrendFilter(dataSeries, definition.options);
135
+ }
136
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyMovingAverage) {
137
+ return new XyMovingAverageFilter_1.XyMovingAverageFilter(dataSeries, definition.options);
138
+ }
139
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyRatio) {
140
+ var options = definition.options;
141
+ if (Array.isArray(options.divisorSeries)) {
142
+ var xValues = new Array(dataSeries.count()).fill(0);
143
+ definition.options.divisorSeries = new XyDataSeries_1.XyDataSeries(dataSeries.webAssemblyContext, {
144
+ xValues: xValues,
145
+ yValues: options.divisorSeries
146
+ });
147
+ }
148
+ return new XyRatioFilter_1.XyRatioFilter(dataSeries, definition.options);
149
+ }
150
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyScaleOffset) {
151
+ return new XyScaleOffsetFilter_1.XyScaleOffsetFilter(dataSeries, definition.options);
152
+ }
153
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyyScaleOffset) {
154
+ return new XyyScaleOffsetFilter_1.XyyScaleOffsetFilter(dataSeries, definition.options);
155
+ }
156
+ else if (definition.type === DataFilterType_1.EDataFilterType.XyzScaleOffset) {
157
+ return new XyzScaleOffsetFilter_1.XyzScaleOffsetFilter(dataSeries, definition.options);
158
+ }
159
+ else {
160
+ return undefined;
161
+ }
162
+ };
@@ -68,7 +68,7 @@ export declare type TEffectDefinition = {
68
68
  options?: IShadowEffectOptions;
69
69
  };
70
70
  /** Definition of a palette provider, comprising a {@link EPaletteProviderType} and the relevant options */
71
- export declare type TPalletProviderDefinition = {
71
+ export declare type TPaletteProviderDefinition = {
72
72
  type: EPaletteProviderType.Gradient;
73
73
  options: GradientParams;
74
74
  } | {
@@ -68,7 +68,6 @@ classFactory_1.registerType(BaseType_1.EBaseType.PaletteProvider, PaletteProvide
68
68
  * @returns An array of {@link IRenderableSeries}.
69
69
  */
70
70
  exports.buildSeries = function (wasmContext, definition, sharedData) {
71
- var _a;
72
71
  if (typeof definition === "string") {
73
72
  definition = JSON.parse(definition, chartBuilder_1.chartReviver);
74
73
  }
@@ -137,7 +136,7 @@ exports.buildSeries = function (wasmContext, definition, sharedData) {
137
136
  col.add.apply(col, exports.buildSeries(wasmContext, seriesDef.series, sharedData));
138
137
  series = col;
139
138
  }
140
- if (series && !((_a = seriesDef.options) === null || _a === void 0 ? void 0 : _a.dataSeries)) {
139
+ if (series) {
141
140
  var dataSeries = buildDataSeries_1.buildDataSeries(wasmContext, seriesDef, sharedData);
142
141
  if (dataSeries) {
143
142
  series.dataSeries = dataSeries;
@@ -12,7 +12,7 @@ import { TSeriesDefinition } from "./buildSeries";
12
12
  * A definition that can be used to build a 2D Chart using {@link chartBuilder.buildChart}
13
13
  */
14
14
  export interface ISciChart2DDefinition {
15
- /** Optional {@link IChartCreationOptions} to pass to the surface */
15
+ /** Optional {@link I2DSurfaceOptions} to pass to the surface */
16
16
  surface?: I2DSurfaceOptions;
17
17
  /** One or an array of {@link TAxisDefinition} to describe the X Axes. Defaults to a single numeric axis */
18
18
  xAxes?: TAxisDefinition[] | TAxisDefinition;
@@ -32,6 +32,9 @@ export interface ISciChart2DDefinition {
32
32
  */
33
33
  onCreated?: ((surface: SciChartSurface) => void) | string;
34
34
  }
35
+ /**
36
+ * A definition that can be used to build a Pie Chart using {@link chartBuilder.buildChart} or {@link chartBuilder.buildPieChart}
37
+ */
35
38
  export interface ISciChartPieDefinition {
36
39
  /** Optional {@link IPieSurfaceOptions} to pass to the surface */
37
40
  surface?: IPieSurfaceOptions;
@@ -46,14 +49,19 @@ export interface ISciChartPieDefinition {
46
49
  onCreated?: ((surface: SciChartPieSurface) => void) | string;
47
50
  }
48
51
  /**
49
- * Construct a {@link SciChartSurface} using a {@link TSurfaceDefinition} which can be pure data.
50
- * This method only builds the surface. To build an entire chart use {@link chartbuilder.buildChart}
52
+ * Construct a chart with {@link SciChartSurface} using a {@link ISciChart2DDefinition} which can be pure data.
51
53
  * @remarks This method is async and must be awaited
52
54
  * @param divElementId The Div Element ID where the {@link SciChartSurface} will reside
53
- * @param definition The type of surface to create (only the default 2d surface currently supported), and the {@link IChartCreationOptions}
55
+ * @param definition the {@link ISciChart2DDefinition}
54
56
  */
55
- export declare const build2DSurface: (divElementId: string, definition: ISciChart2DDefinition | string) => Promise<{
57
+ export declare const build2DChart: (divElementId: string, definition: ISciChart2DDefinition | string) => Promise<{
56
58
  wasmContext: import("../types/TSciChart").TSciChart;
57
59
  sciChartSurface: SciChartSurface;
58
60
  }>;
59
- export declare const buildPieSurface: (divElementId: string, definition: ISciChartPieDefinition | string) => Promise<SciChartPieSurface>;
61
+ /**
62
+ * Construct a chart with {@link SciChartPieSurface} using a {@link ISciChartPieDefinition} which can be pure data.
63
+ * @remarks This method is async and must be awaited
64
+ * @param divElementId The Div Element ID where the {@link SciChartPieSurface} will reside
65
+ * @param definition the {@link ISciChartPieDefinition}
66
+ */
67
+ export declare const buildPieChart: (divElementId: string, definition: ISciChartPieDefinition | string) => Promise<SciChartPieSurface>;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.buildPieSurface = exports.build2DSurface = void 0;
39
+ exports.buildPieChart = exports.build2DChart = void 0;
40
40
  var CentralAxesLayoutManager_1 = require("../Charting/LayoutManager/CentralAxesLayoutManager");
41
41
  var LayoutManager_1 = require("../Charting/LayoutManager/LayoutManager");
42
42
  var SciChartJSDarkv2Theme_1 = require("../Charting/Themes/SciChartJSDarkv2Theme");
@@ -63,13 +63,12 @@ classFactory_1.registerType(BaseType_1.EBaseType.LayoutManager, LayoutMangerType
63
63
  // register loaders
64
64
  classFactory_1.registerType(BaseType_1.EBaseType.Loader, "Default", function () { return new loader_1.DefaultSciChartLoader(); }, true);
65
65
  /**
66
- * Construct a {@link SciChartSurface} using a {@link TSurfaceDefinition} which can be pure data.
67
- * This method only builds the surface. To build an entire chart use {@link chartbuilder.buildChart}
66
+ * Construct a chart with {@link SciChartSurface} using a {@link ISciChart2DDefinition} which can be pure data.
68
67
  * @remarks This method is async and must be awaited
69
68
  * @param divElementId The Div Element ID where the {@link SciChartSurface} will reside
70
- * @param definition The type of surface to create (only the default 2d surface currently supported), and the {@link IChartCreationOptions}
69
+ * @param definition the {@link ISciChart2DDefinition}
71
70
  */
72
- exports.build2DSurface = function (divElementId, definition) { return __awaiter(void 0, void 0, void 0, function () {
71
+ exports.build2DChart = function (divElementId, definition) { return __awaiter(void 0, void 0, void 0, function () {
73
72
  var _a, wasmContext, sciChartSurface;
74
73
  var _b, _c, _d, _e, _f;
75
74
  return __generator(this, function (_g) {
@@ -106,7 +105,7 @@ exports.build2DSurface = function (divElementId, definition) { return __awaiter(
106
105
  if (typeof definition.onCreated === "string") {
107
106
  sciChartSurface.onCreatedName = definition.onCreated;
108
107
  // @ts-ignore
109
- definition.onCreated = getFunction(BaseType_1.EBaseType.OnCreateFunction, definition.onCreated);
108
+ definition.onCreated = classFactory_1.getFunction(BaseType_1.EBaseType.OnCreateFunction, definition.onCreated);
110
109
  }
111
110
  // @ts-ignore
112
111
  definition.onCreated(sciChartSurface);
@@ -115,7 +114,13 @@ exports.build2DSurface = function (divElementId, definition) { return __awaiter(
115
114
  }
116
115
  });
117
116
  }); };
118
- exports.buildPieSurface = function (divElementId, definition) { return __awaiter(void 0, void 0, void 0, function () {
117
+ /**
118
+ * Construct a chart with {@link SciChartPieSurface} using a {@link ISciChartPieDefinition} which can be pure data.
119
+ * @remarks This method is async and must be awaited
120
+ * @param divElementId The Div Element ID where the {@link SciChartPieSurface} will reside
121
+ * @param definition the {@link ISciChartPieDefinition}
122
+ */
123
+ exports.buildPieChart = function (divElementId, definition) { return __awaiter(void 0, void 0, void 0, function () {
119
124
  var scps, _i, _a, segmentOption, segment;
120
125
  return __generator(this, function (_b) {
121
126
  switch (_b.label) {
@@ -137,7 +142,7 @@ exports.buildPieSurface = function (divElementId, definition) { return __awaiter
137
142
  if (typeof definition.onCreated === "string") {
138
143
  scps.onCreatedName = definition.onCreated;
139
144
  // @ts-ignore
140
- definition.onCreated = getFunction(BaseType_1.EBaseType.OnCreateFunction, definition.onCreated);
145
+ definition.onCreated = classFactory_1.getFunction(BaseType_1.EBaseType.OnCreateFunction, definition.onCreated);
141
146
  }
142
147
  // @ts-ignore
143
148
  definition.onCreated(scps);
@@ -21,7 +21,7 @@ export declare function chartReviver(key: string, value: any): any;
21
21
  /**
22
22
  * Builds an entire chart from a definition that can be pure data.
23
23
  * @param divElementId The Div Element ID where the {@link SciChartSurface} will reside
24
- * @param definition a {@link ISciChart2DDefinition } or a string which will be parsed to it.
24
+ * @param definition a {@link TSurfaceDefinition } or a string which will be parsed to it.
25
25
  * @returns
26
26
  */
27
27
  export declare const buildChart: (divElementId: string, definition: string | TSurfaceDefinition) => Promise<TWebAssemblyChart | SciChartPieSurface>;
@@ -35,12 +35,12 @@ export declare const chartBuilder: {
35
35
  /** @inheritdoc */
36
36
  chartReviver: typeof chartReviver;
37
37
  /** @inheritdoc */
38
- build2DSurface: (divElementId: string, definition: string | ISciChart2DDefinition) => Promise<{
38
+ build2DChart: (divElementId: string, definition: string | ISciChart2DDefinition) => Promise<{
39
39
  wasmContext: import("../types/TSciChart").TSciChart;
40
40
  sciChartSurface: SciChartSurface;
41
41
  }>;
42
42
  /** @inheritdoc */
43
- buildPieSurface: (divElementId: string, definition: string | ISciChartPieDefinition) => Promise<SciChartPieSurface>;
43
+ buildPieChart: (divElementId: string, definition: string | ISciChartPieDefinition) => Promise<SciChartPieSurface>;
44
44
  /** @inheritdoc */
45
45
  buildSeries: (wasmContext: import("../types/TSciChart").TSciChart, definition: {
46
46
  type: import("../types/SeriesType").ESeriesType.BandSeries;
@@ -152,6 +152,9 @@ export declare const chartBuilder: {
152
152
  options?: import("../Charting/ChartModifiers/ChartModifierBase2D").IChartModifierBaseOptions;
153
153
  } | {
154
154
  type: import("../types/ChartModifierType").EChart2DModifierType.OverviewRangeSelection;
155
+ /**
156
+ * This is just something to call to ensure that all the registrations are run before a surface is created
157
+ */
155
158
  options?: import("../Charting/ChartModifiers/OverviewRangeSelectionModifier").IRangeSelectionModifierOptions;
156
159
  } | {
157
160
  type: import("../types/ChartModifierType").EChart2DModifierType.Custom;
@@ -160,13 +163,13 @@ export declare const chartBuilder: {
160
163
  } | TModifierDefinition[]) => import("../Charting/ChartModifiers/ChartModifierBase2D").ChartModifierBase2D[];
161
164
  /** @inheritdoc */
162
165
  buildAxes: (wasmContext: import("../types/TSciChart").TSciChart, definition: {
163
- type: string;
166
+ type: import("../types/AxisType").EAxisType.NumericAxis;
164
167
  options?: import("../Charting/Visuals/Axis/NumericAxis").INumericAxisOptions;
165
168
  } | {
166
- type: string;
169
+ type: import("../types/AxisType").EAxisType.LogarithmicAxis;
167
170
  options?: import("../Charting/Visuals/Axis/LogarithmicAxis").ILogarithmicAxisOptions;
168
171
  } | {
169
- type: string;
172
+ type: import("../types/AxisType").EAxisType.CategoryAxis;
170
173
  options?: import("../Charting/Visuals/Axis/CategoryAxis").ICategoryAxisOptions;
171
174
  } | TAxisDefinition[]) => import("../Charting/Visuals/Axis/AxisBase2D").AxisBase2D[];
172
175
  /** @inheritdoc */
@@ -177,6 +180,9 @@ export declare const chartBuilder: {
177
180
  type: import("../Charting/Visuals/Annotations/IAnnotation").EAnnotationType.RenderContextBoxAnnotation;
178
181
  options?: import("../Charting/Visuals/Annotations/BoxAnnotation").IBoxAnnotationOptions;
179
182
  } | {
183
+ /**
184
+ * The reviver function needed when parsing definitions to JSON
185
+ */
180
186
  type: import("../Charting/Visuals/Annotations/IAnnotation").EAnnotationType.RenderContextHorizontalLineAnnotation;
181
187
  options?: import("../Charting/Visuals/Annotations/LineAnnotation").ILineAnnotationOptions;
182
188
  } | {
@@ -68,7 +68,7 @@ exports.chartReviver = chartReviver;
68
68
  /**
69
69
  * Builds an entire chart from a definition that can be pure data.
70
70
  * @param divElementId The Div Element ID where the {@link SciChartSurface} will reside
71
- * @param definition a {@link ISciChart2DDefinition } or a string which will be parsed to it.
71
+ * @param definition a {@link TSurfaceDefinition } or a string which will be parsed to it.
72
72
  * @returns
73
73
  */
74
74
  exports.buildChart = function (divElementId, definition) { return __awaiter(void 0, void 0, void 0, function () {
@@ -83,17 +83,17 @@ exports.buildChart = function (divElementId, definition) { return __awaiter(void
83
83
  }
84
84
  if (!("type" in definition)) return [3 /*break*/, 6];
85
85
  if (!(definition.type === SciChartSurfaceType_1.ESciChartSurfaceType.Default2D)) return [3 /*break*/, 2];
86
- return [4 /*yield*/, buildSurface_1.build2DSurface(divElementId, definition.options)];
86
+ return [4 /*yield*/, buildSurface_1.build2DChart(divElementId, definition.options)];
87
87
  case 1: return [2 /*return*/, _a.sent()];
88
88
  case 2:
89
89
  if (!(definition.type === SciChartSurfaceType_1.ESciChartSurfaceType.Pie2D)) return [3 /*break*/, 4];
90
- return [4 /*yield*/, buildSurface_1.buildPieSurface(divElementId, definition.options)];
90
+ return [4 /*yield*/, buildSurface_1.buildPieChart(divElementId, definition.options)];
91
91
  case 3: return [2 /*return*/, _a.sent()];
92
92
  case 4:
93
93
  // @ts-ignore
94
94
  throw new Error("Surface type: " + definition.type + " is not yet supported by the builder api");
95
95
  case 5: return [3 /*break*/, 8];
96
- case 6: return [4 /*yield*/, buildSurface_1.build2DSurface(divElementId, definition)];
96
+ case 6: return [4 /*yield*/, buildSurface_1.build2DChart(divElementId, definition)];
97
97
  case 7: return [2 /*return*/, _a.sent()];
98
98
  case 8: return [2 /*return*/];
99
99
  }
@@ -109,9 +109,9 @@ exports.chartBuilder = {
109
109
  /** @inheritdoc */
110
110
  chartReviver: chartReviver,
111
111
  /** @inheritdoc */
112
- build2DSurface: buildSurface_1.build2DSurface,
112
+ build2DChart: buildSurface_1.build2DChart,
113
113
  /** @inheritdoc */
114
- buildPieSurface: buildSurface_1.buildPieSurface,
114
+ buildPieChart: buildSurface_1.buildPieChart,
115
115
  /** @inheritdoc */
116
116
  buildSeries: buildSeries_1.buildSeries,
117
117
  /** @inheritdoc */