scichart 2.1.2301 → 2.2.2351

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/Builder/buildModifiers.d.ts +2 -1
  2. package/Charting/ChartModifiers/CursorModifier.d.ts +5 -0
  3. package/Charting/ChartModifiers/CursorModifier.js +15 -10
  4. package/Charting/ChartModifiers/LegendModifier.d.ts +31 -0
  5. package/Charting/ChartModifiers/LegendModifier.js +22 -0
  6. package/Charting/ChartModifiers/RolloverModifier.d.ts +10 -0
  7. package/Charting/ChartModifiers/RolloverModifier.js +76 -19
  8. package/Charting/LayoutManager/LayoutManager.js +6 -1
  9. package/Charting/Model/BaseHeatmapDataSeries.d.ts +1 -0
  10. package/Charting/Model/BaseHeatmapDataSeries.js +4 -1
  11. package/Charting/Model/PointSeries/BasePointSeriesWrapped.d.ts +1 -1
  12. package/Charting/Model/PointSeries/BasePointSeriesWrapped.js +2 -2
  13. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.d.ts +1 -1
  14. package/Charting/Model/PointSeries/XyyPointSeriesWrapped.js +3 -3
  15. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +6 -1
  16. package/Charting/Visuals/Annotations/AnnotationBase.js +23 -2
  17. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +6 -0
  18. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +46 -5
  19. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +3 -1
  20. package/Charting/Visuals/Annotations/CustomAnnotation.js +14 -3
  21. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.d.ts +4 -0
  22. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +3 -2
  23. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +1 -1
  24. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +13 -3
  25. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +13 -0
  26. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +63 -14
  27. package/Charting/Visuals/Annotations/VerticalLineAnnotation.d.ts +2 -0
  28. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +3 -2
  29. package/Charting/Visuals/Annotations/constants.d.ts +2 -1
  30. package/Charting/Visuals/Annotations/constants.js +1 -0
  31. package/Charting/Visuals/Axis/AxisBase2D.d.ts +10 -0
  32. package/Charting/Visuals/Axis/AxisBase2D.js +72 -1
  33. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +29 -0
  34. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +77 -0
  35. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +2 -2
  36. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +21 -4
  37. package/Charting/Visuals/Helpers/drawLabel.d.ts +3 -3
  38. package/Charting/Visuals/Helpers/drawLabel.js +38 -18
  39. package/Charting/Visuals/I2DSurfaceOptions.d.ts +6 -0
  40. package/Charting/Visuals/Legend/SciChartLegend.d.ts +4 -0
  41. package/Charting/Visuals/Legend/SciChartLegend.js +7 -1
  42. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +16 -7
  43. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +56 -9
  44. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +3 -0
  45. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +8 -0
  46. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +17 -166
  47. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +35 -328
  48. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +5 -2
  49. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +5 -3
  50. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +8 -0
  51. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +6 -0
  52. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.d.ts +6 -0
  53. package/Charting/Visuals/RenderableSeries/SeriesVisibleChangedArgs.js +11 -0
  54. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +22 -0
  55. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +38 -1
  56. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.d.ts +2 -2
  57. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +26 -45
  58. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +77 -18
  59. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +139 -42
  60. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  61. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +21 -1
  62. package/Charting/Visuals/RenderableSeries/constants.d.ts +2 -0
  63. package/Charting/Visuals/RenderableSeries/constants.js +2 -0
  64. package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +24 -2
  65. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +4 -1
  66. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +13 -2
  67. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +66 -20
  68. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +3 -1
  69. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +2 -0
  70. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +66 -2
  71. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +304 -52
  72. package/Charting/Visuals/SciChartPieSurface/constants.d.ts +6 -1
  73. package/Charting/Visuals/SciChartPieSurface/constants.js +5 -0
  74. package/Charting/Visuals/SciChartSurface.d.ts +13 -2
  75. package/Charting/Visuals/SciChartSurface.js +39 -3
  76. package/Charting/Visuals/createMaster.js +2 -2
  77. package/Charting/Visuals/createSingle.js +2 -2
  78. package/Charting/Visuals/sciChartInitCommon.d.ts +2 -2
  79. package/Charting/Visuals/sciChartInitCommon.js +13 -9
  80. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +6 -2
  81. package/Core/BuildStamp.d.ts +1 -1
  82. package/Core/BuildStamp.js +2 -2
  83. package/_wasm/scichart.browser.js +1 -1
  84. package/_wasm/scichart2d.js +1 -1
  85. package/_wasm/scichart2d.wasm +0 -0
  86. package/_wasm/scichart3d.js +95 -95
  87. package/_wasm/scichart3d.wasm +0 -0
  88. package/package.json +1 -1
  89. package/types/Color.d.ts +1 -0
  90. package/types/Color.js +1 -0
  91. package/types/LabelPlacement.d.ts +8 -0
  92. package/types/LabelPlacement.js +11 -1
  93. package/types/LabelProviderType.d.ts +5 -1
  94. package/types/LabelProviderType.js +4 -0
  95. package/types/TSciChartSurfaceCanvases.d.ts +1 -0
@@ -16,10 +16,10 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.StackedMountainCollection = void 0;
19
- var Deleter_1 = require("../../../Core/Deleter");
20
19
  var NumberRange_1 = require("../../../Core/NumberRange");
21
20
  var SeriesType_1 = require("../../../types/SeriesType");
22
- var Pen2DCache_1 = require("../../Drawing/Pen2DCache");
21
+ var XyyPointSeriesWrapped_1 = require("../../Model/PointSeries/XyyPointSeriesWrapped");
22
+ var RenderPassData_1 = require("../../Services/RenderPassData");
23
23
  var BaseStackedCollection_1 = require("./BaseStackedCollection");
24
24
  var constants_1 = require("./constants");
25
25
  /**
@@ -64,13 +64,10 @@ var StackedMountainCollection = /** @class */ (function (_super) {
64
64
  (_a = arg.getOldItems()) === null || _a === void 0 ? void 0 : _a.forEach(_this.detachChildSeries);
65
65
  (_b = arg.getNewItems()) === null || _b === void 0 ? void 0 : _b.forEach(_this.attachChildSeries);
66
66
  });
67
- _this.transparentPenCache = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
68
67
  return _this;
69
68
  }
70
69
  /** @inheritDoc */
71
70
  StackedMountainCollection.prototype.delete = function () {
72
- this.nativeDrawingProvider = (0, Deleter_1.deleteSafe)(this.nativeDrawingProvider);
73
- this.transparentPenCache = (0, Deleter_1.deleteSafe)(this.transparentPenCache);
74
71
  _super.prototype.delete.call(this);
75
72
  };
76
73
  /** @inheritDoc */
@@ -114,23 +111,20 @@ var StackedMountainCollection = /** @class */ (function (_super) {
114
111
  return;
115
112
  }
116
113
  this.updateAccumulatedVectors();
117
- var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
118
- var firstDataSeries = this.get(0).dataSeries;
119
- var viewRect_1 = this.parentSurface.seriesViewRect;
120
- var xValues_1 = isCategoryAxis ? firstDataSeries.getNativeIndexes() : firstDataSeries.getNativeXValues();
121
- this.getVisibleSeries().forEach(function (el, index) {
122
- var currAccumVec = el.accumulatedValues;
123
- if (index === 0) {
124
- var accumulatedVector0 = _this.accumulatedValues0;
125
- var transparentPen = (0, Pen2DCache_1.getScrtPenFromCache)(_this.transparentPenCache);
126
- drawBand(_this.webAssemblyContext, renderContext, renderPassData, _this.nativeDrawingProvider, xValues_1, accumulatedVector0, currAccumVec, el.getFillBrush(), transparentPen, el.getStrokePen(), viewRect_1, el.isDigitalLine);
127
- }
128
- else {
129
- var previousEl = _this.getVisibleSeries()[index - 1];
130
- var prevAccumVec = previousEl.accumulatedValues;
131
- drawBand(_this.webAssemblyContext, renderContext, renderPassData, _this.nativeDrawingProvider, xValues_1, prevAccumVec, currAccumVec, el.getFillBrush(), previousEl.getStrokePen(), el.getStrokePen(), viewRect_1, el.isDigitalLine);
132
- }
133
- });
114
+ var xAxis_1 = this.parentSurface.getXAxisById(this.xAxisId);
115
+ var visibleSeries = this.getVisibleSeries();
116
+ // draw Stacked Series in reverse order to prevent overlapping with Point Markers
117
+ visibleSeries.reduceRight(function (nextSeries, series, index, collection) {
118
+ var currAccumVec = series.accumulatedValues;
119
+ var accumulatedValues = index === 0 ? _this.accumulatedValues0 : collection[index - 1].accumulatedValues;
120
+ // wrap XyDataSeries as XyyDataSeries
121
+ var xyyPointSeries = new XyyPointSeriesWrapped_1.XyyPointSeriesWrapped(series.dataSeries, accumulatedValues, currAccumVec);
122
+ var renderData = new RenderPassData_1.RenderPassData(undefined, renderPassData.xCoordinateCalculator, renderPassData.yCoordinateCalculator, xAxis_1.isVerticalChart, xyyPointSeries);
123
+ series.strokeY1 = index === 0 ? "transparent" : collection[index - 1].stroke;
124
+ series.strokeY1DashArray = index === 0 ? [] : collection[index - 1].strokeDashArray;
125
+ series.draw(renderContext, renderData);
126
+ return series;
127
+ }, undefined);
134
128
  }
135
129
  };
136
130
  /** @inheritDoc */
@@ -143,8 +137,16 @@ var StackedMountainCollection = /** @class */ (function (_super) {
143
137
  /** @inheritDoc */
144
138
  StackedMountainCollection.prototype.onAttach = function (scs) {
145
139
  _super.prototype.onAttach.call(this, scs);
146
- this.nativeDrawingProvider = new this.webAssemblyContext.SCRTBandSeriesDrawingProvider();
147
- (0, Pen2DCache_1.createPenInCache)(this.transparentPenCache, "transparent", 2, 0);
140
+ this.getVisibleSeries().forEach(function (series) {
141
+ series.onAttach(scs);
142
+ });
143
+ };
144
+ /** @inheritDoc */
145
+ StackedMountainCollection.prototype.onDetach = function () {
146
+ this.getVisibleSeries().forEach(function (series) {
147
+ series.onDetach();
148
+ });
149
+ _super.prototype.onDetach.call(this);
148
150
  };
149
151
  /** @inheritDoc */
150
152
  StackedMountainCollection.prototype.notifyPropertyChanged = function (propertyName) {
@@ -195,24 +197,3 @@ var StackedMountainCollection = /** @class */ (function (_super) {
195
197
  return StackedMountainCollection;
196
198
  }(BaseStackedCollection_1.BaseStackedCollection));
197
199
  exports.StackedMountainCollection = StackedMountainCollection;
198
- /** @ignore */
199
- var drawBand = function (wasmContext, renderContext, renderPassData, nativeDrawingProvider, xValues, yValues, y1Values, fillBrush, strokePen, strokePenY1, viewRect, isDigitalLine) {
200
- var args = new wasmContext.SCRTBandDrawingParams();
201
- args.forceShaderMethod = true;
202
- args.verticalChart = renderPassData.isVerticalChart;
203
- args.count = xValues.size();
204
- args.isDigitalLine = isDigitalLine;
205
- if (fillBrush) {
206
- args.SetFillBrush(fillBrush);
207
- args.SetFillBrush1(fillBrush);
208
- }
209
- if (strokePen) {
210
- args.SetLinesPen(strokePen);
211
- }
212
- if (strokePenY1) {
213
- args.SetLinesPen1(strokePenY1);
214
- }
215
- var nativeContext = renderContext.getNativeContext();
216
- nativeDrawingProvider.DrawPointsVec(nativeContext, xValues, yValues, y1Values, renderPassData.xCoordinateCalculator.nativeCalculator, renderPassData.yCoordinateCalculator.nativeCalculator, args);
217
- args.delete();
218
- };
@@ -1,5 +1,11 @@
1
+ import { TPaletteProviderDefinition } from "../../../Builder/buildSeries";
1
2
  import { ESeriesType } from "../../../types/SeriesType";
2
3
  import { TSciChart } from "../../../types/TSciChart";
4
+ import { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
5
+ import { IPaletteProvider } from "../../Model/IPaletteProvider";
6
+ import { IPointSeries } from "../../Model/PointSeries/IPointSeries";
7
+ import { ResamplingParams } from "../../Numerics/Resamplers/ResamplingParams";
8
+ import { RenderPassData } from "../../Services/RenderPassData";
3
9
  import { SciChartSurface } from "../SciChartSurface";
4
10
  import { TDpiChangedEventArgs } from "../TextureManager/DpiHelper";
5
11
  import { BaseStackedCollection } from "./BaseStackedCollection";
@@ -21,6 +27,18 @@ export interface IStackedMountainRenderableSeriesOptions extends IBasedStackedRe
21
27
  * The column strokeThickness
22
28
  */
23
29
  strokeThickness?: number;
30
+ /**
31
+ * The StrokeDashArray defines the stroke or dash pattern for the Y0 line.
32
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
33
+ */
34
+ strokeDashArray?: number[];
35
+ /**
36
+ * An optional {@link IPaletteProvider} which is used to provide per data-point coloring or paletting.
37
+ * @remarks See {@link IStrokePaletteProvider} for per data-point coloring of lines or strokes, {@link IFillPaletteProvider} for
38
+ * per data-point coloring of fills or series bodies, and {@link IPointMarkerPaletteProvider} for per data-point coloring of
39
+ * point-markers
40
+ */
41
+ paletteProvider?: IPaletteProvider | TPaletteProviderDefinition;
24
42
  }
25
43
  /**
26
44
  * @summary The {@link StackedMountainRenderableSeries} allows creating JavaScript Stacked Mountain charts
@@ -49,8 +67,9 @@ export interface IStackedMountainRenderableSeriesOptions extends IBasedStackedRe
49
67
  export declare class StackedMountainRenderableSeries extends BaseStackedRenderableSeries {
50
68
  readonly type = ESeriesType.StackedMountainSeries;
51
69
  private fillProperty;
52
- private strokePenCache;
53
- private fillBrushCache;
70
+ private strokeY1Property;
71
+ private strokeDashArrayProperty;
72
+ private strokeY1DashArrayProperty;
54
73
  /**
55
74
  * Creates an instance of the {@link StackedMountainRenderableSeries}
56
75
  * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
@@ -58,10 +77,6 @@ export declare class StackedMountainRenderableSeries extends BaseStackedRenderab
58
77
  * @param options Optional parameters of type {@link IStackedMountainRenderableSeriesOptions} to configure the series
59
78
  */
60
79
  constructor(webAssemblyContext: TSciChart, options?: IStackedMountainRenderableSeriesOptions);
61
- /**
62
- * @inheritDoc
63
- */
64
- delete(): void;
65
80
  /**
66
81
  * Called internally when the {@link StackedMountainRenderableSeries} is attached to a parent {@link StackedMountainCollection}
67
82
  * @param parentCollection the parent {@link BaseStackedCollection}
@@ -69,22 +84,16 @@ export declare class StackedMountainRenderableSeries extends BaseStackedRenderab
69
84
  * @param notifyPropertyChangedFn function to notify property has changed
70
85
  */
71
86
  onAttachToParentCollection(parentCollection: BaseStackedCollection<BaseStackedRenderableSeries>, getParentSurfaceFn: () => SciChartSurface, notifyPropertyChangedFn: (propertyName: string) => void): void;
72
- /**
73
- * Gets the fill brush of the mountain as an HTML color code
74
- */
75
- getFillBrush(): import("../../../types/TSciChart").SCRTBrush;
76
- /**
77
- * Gets the stroke of the mountain as an HTML color code
78
- */
79
- getStrokePen(): import("../../../types/TSciChart").SCRTPen;
87
+ /** @inheritDoc */
88
+ onAttach(scs: SciChartSurface): void;
89
+ /** @inheritDoc */
90
+ onDetach(): void;
91
+ /** @inheritDoc */
92
+ draw(renderContext: WebGlRenderContext2D, renderPassData: RenderPassData): void;
80
93
  /**
81
94
  * @inheritDoc
82
95
  */
83
96
  onDpiChanged(args: TDpiChangedEventArgs): void;
84
- /**
85
- * @inheritDoc
86
- */
87
- notifyPropertyChanged(propertyName: string): void;
88
97
  /**
89
98
  * Gets or sets the fill brush of the mountain as an HTML color code
90
99
  */
@@ -93,7 +102,57 @@ export declare class StackedMountainRenderableSeries extends BaseStackedRenderab
93
102
  * Gets or sets the fill brush of the mountain as an HTML color code
94
103
  */
95
104
  set fill(fill: string);
105
+ /**
106
+ * Gets or sets the stroke color the Y1 values in the data-series.
107
+ * See associated {@link XyyDataSeries} for further information
108
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
109
+ */
110
+ get strokeY1(): string;
111
+ /**
112
+ * Gets or sets the stroke color the Y1 values in the data-series.
113
+ * See associated {@link XyyDataSeries} for further information
114
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
115
+ */
116
+ set strokeY1(strokeY1: string);
117
+ /**
118
+ * Gets or sets the fill color for when Y1 is less than Y as an HTML Color code
119
+ */
120
+ get fillY1(): string;
121
+ /**
122
+ * Gets or sets the fill color for when Y1 is less than Y as an HTML Color code
123
+ */
124
+ set fillY1(fillY1: string);
125
+ /**
126
+ * The StrokeDashArray defines the stroke or dash pattern for the Y0 line.
127
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
128
+ */
129
+ get strokeDashArray(): number[];
130
+ /**
131
+ * The StrokeDashArray defines the stroke or dash pattern for the Y0 line.
132
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
133
+ */
134
+ set strokeDashArray(strokeDashArray: number[]);
135
+ /**
136
+ * The strokeY1DashArray defines the stroke or dash pattern for the Y1 line.
137
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
138
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
139
+ */
140
+ get strokeY1DashArray(): number[];
141
+ /**
142
+ * The strokeY1DashArray defines the stroke or dash pattern for the Y1 line.
143
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
144
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
145
+ */
146
+ set strokeY1DashArray(strokeY1DashArray: number[]);
96
147
  toJSON(excludeData?: boolean): import("../../../Builder/buildSeries").TSeriesDefinition;
97
148
  /** @inheritDoc */
149
+ toPointSeries(resamplingParams?: ResamplingParams): IPointSeries;
150
+ /** @inheritDoc */
151
+ hasStrokePaletteProvider(): boolean;
152
+ /** @inheritDoc */
153
+ hasFillPaletteProvider(): boolean;
154
+ /** @inheritDoc */
155
+ hasPointMarkerPaletteProvider(): boolean;
156
+ /** @inheritDoc */
98
157
  protected newHitTestProvider(): IHitTestProvider;
99
158
  }
@@ -16,13 +16,13 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.StackedMountainRenderableSeries = void 0;
19
- var Deleter_1 = require("../../../Core/Deleter");
20
19
  var SeriesType_1 = require("../../../types/SeriesType");
21
- var BrushCache_1 = require("../../Drawing/BrushCache");
22
- var Pen2DCache_1 = require("../../Drawing/Pen2DCache");
20
+ var XyPointSeriesWrapped_1 = require("../../Model/PointSeries/XyPointSeriesWrapped");
23
21
  var SciChartSurfaceBase_1 = require("../SciChartSurfaceBase");
24
22
  var BaseStackedRenderableSeries_1 = require("./BaseStackedRenderableSeries");
25
23
  var constants_1 = require("./constants");
24
+ var BandSeriesDrawingProvider_1 = require("./DrawingProviders/BandSeriesDrawingProvider");
25
+ var PointMarkerDrawingProvider_1 = require("./DrawingProviders/PointMarkerDrawingProvider");
26
26
  var StackedMountainSeriesHitTestProvider_1 = require("./HitTest/StackedMountainSeriesHitTestProvider");
27
27
  /**
28
28
  * @summary The {@link StackedMountainRenderableSeries} allows creating JavaScript Stacked Mountain charts
@@ -61,22 +61,20 @@ var StackedMountainRenderableSeries = /** @class */ (function (_super) {
61
61
  var _this = _super.call(this, webAssemblyContext, options) || this;
62
62
  _this.type = SeriesType_1.ESeriesType.StackedMountainSeries;
63
63
  _this.fillProperty = "#7e8486";
64
- _this.strokePenCache = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
65
- _this.fillBrushCache = new BrushCache_1.BrushCache(webAssemblyContext);
64
+ _this.strokeY1Property = "transparent";
65
+ _this.strokeDashArrayProperty = [];
66
+ _this.strokeY1DashArrayProperty = [];
66
67
  _this.fill = (_a = options === null || options === void 0 ? void 0 : options.fill) !== null && _a !== void 0 ? _a : _this.fillProperty;
67
68
  _this.stroke = (_b = options === null || options === void 0 ? void 0 : options.stroke) !== null && _b !== void 0 ? _b : SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.mountainLineColor;
68
- _this.strokeThickness = (_c = options === null || options === void 0 ? void 0 : options.strokeThickness) !== null && _c !== void 0 ? _c : 2;
69
+ _this.strokeDashArrayProperty = (_c = options === null || options === void 0 ? void 0 : options.strokeDashArray) !== null && _c !== void 0 ? _c : _this.strokeDashArrayProperty;
70
+ _this.drawingProviders.push(new BandSeriesDrawingProvider_1.BandSeriesDrawingProvider(webAssemblyContext,
71
+ // TODO find more elegant way to pass this. In scope of https://abtsoftware.myjetbrains.com/youtrack/issue/SCJS-1109
72
+ _this,
73
+ // StackedMountainRenderableSeries have reverse order of yValues and y1Values compared to FastBandRenderableSeries
74
+ function (ps) { return ps.y1Values; }, function (ps) { return ps.yValues; }), new PointMarkerDrawingProvider_1.PointMarkerDrawingProvider(webAssemblyContext, _this, function (ps) { return ps.y1Values; }));
69
75
  return _this;
70
76
  }
71
77
  // PUBLIC
72
- /**
73
- * @inheritDoc
74
- */
75
- StackedMountainRenderableSeries.prototype.delete = function () {
76
- this.strokePenCache = (0, Deleter_1.deleteSafe)(this.strokePenCache);
77
- this.fillBrushCache = (0, Deleter_1.deleteSafe)(this.fillBrushCache);
78
- _super.prototype.delete.call(this);
79
- };
80
78
  /**
81
79
  * Called internally when the {@link StackedMountainRenderableSeries} is attached to a parent {@link StackedMountainCollection}
82
80
  * @param parentCollection the parent {@link BaseStackedCollection}
@@ -90,21 +88,34 @@ var StackedMountainRenderableSeries = /** @class */ (function (_super) {
90
88
  this.parentCollection = parentCollection;
91
89
  this.getParentSurfaceFn = getParentSurfaceFn;
92
90
  this.notifyParentPropertyChangedFn = notifyPropertyChangedFn;
93
- var _a = this, stroke = _a.stroke, strokeThickness = _a.strokeThickness, fill = _a.fill, opacity = _a.opacity;
94
- (0, Pen2DCache_1.createPenInCache)(this.strokePenCache, stroke, strokeThickness, opacity);
95
- (0, BrushCache_1.createBrushInCache)(this.fillBrushCache, fill, opacity);
96
91
  };
97
- /**
98
- * Gets the fill brush of the mountain as an HTML color code
99
- */
100
- StackedMountainRenderableSeries.prototype.getFillBrush = function () {
101
- return (0, BrushCache_1.getScrtBrushFromCache)(this.fillBrushCache);
92
+ /** @inheritDoc */
93
+ StackedMountainRenderableSeries.prototype.onAttach = function (scs) {
94
+ if (this.invalidateParentCallback) {
95
+ throw new Error("Invalid operation in sciChartSurface.attachSeries, this series has already been attached to a SciChartSurface. Please detach it from a SciChartSurface before attaching to another");
96
+ }
97
+ this.invalidateParentCallback = scs.invalidateElement;
98
+ this.drawingProviders.forEach(function (dp) { return dp.onAttachSeries(); });
99
+ this.rolloverModifierProps.setInvalidateParentCallback(scs.invalidateElement);
102
100
  };
103
- /**
104
- * Gets the stroke of the mountain as an HTML color code
105
- */
106
- StackedMountainRenderableSeries.prototype.getStrokePen = function () {
107
- return (0, Pen2DCache_1.getScrtPenFromCache)(this.strokePenCache);
101
+ /** @inheritDoc */
102
+ StackedMountainRenderableSeries.prototype.onDetach = function () {
103
+ this.invalidateParentCallback = undefined;
104
+ this.drawingProviders.forEach(function (dp) { return dp.onDetachSeries(); });
105
+ this.rolloverModifierProps.setInvalidateParentCallback(undefined);
106
+ };
107
+ /** @inheritDoc */
108
+ StackedMountainRenderableSeries.prototype.draw = function (renderContext, renderPassData) {
109
+ var _a;
110
+ this.currentRenderPassData = renderPassData;
111
+ (_a = this.hitTestProvider) === null || _a === void 0 ? void 0 : _a.update(renderPassData);
112
+ try {
113
+ renderContext.pushShaderEffect(this.effect);
114
+ this.drawingProviders.forEach(function (dp) { return dp.draw(renderContext, renderPassData); });
115
+ }
116
+ finally {
117
+ renderContext.popShaderEffect();
118
+ }
108
119
  };
109
120
  /**
110
121
  * @inheritDoc
@@ -113,20 +124,6 @@ var StackedMountainRenderableSeries = /** @class */ (function (_super) {
113
124
  _super.prototype.onDpiChanged.call(this, args);
114
125
  this.notifyPropertyChanged(constants_1.PROPERTY.STROKE);
115
126
  };
116
- /**
117
- * @inheritDoc
118
- */
119
- StackedMountainRenderableSeries.prototype.notifyPropertyChanged = function (propertyName) {
120
- _super.prototype.notifyPropertyChanged.call(this, propertyName);
121
- if (propertyName === constants_1.PROPERTY.STROKE ||
122
- propertyName === constants_1.PROPERTY.STROKE_THICKNESS ||
123
- propertyName === constants_1.PROPERTY.OPACITY) {
124
- (0, Pen2DCache_1.createPenInCache)(this.strokePenCache, this.stroke, this.strokeThickness, this.opacity);
125
- }
126
- if (propertyName === constants_1.PROPERTY.FILL || propertyName === constants_1.PROPERTY.OPACITY) {
127
- (0, BrushCache_1.createBrushInCache)(this.fillBrushCache, this.fill, this.opacity);
128
- }
129
- };
130
127
  Object.defineProperty(StackedMountainRenderableSeries.prototype, "fill", {
131
128
  // PROPERTIES
132
129
  /**
@@ -145,6 +142,85 @@ var StackedMountainRenderableSeries = /** @class */ (function (_super) {
145
142
  enumerable: false,
146
143
  configurable: true
147
144
  });
145
+ Object.defineProperty(StackedMountainRenderableSeries.prototype, "strokeY1", {
146
+ /**
147
+ * Gets or sets the stroke color the Y1 values in the data-series.
148
+ * See associated {@link XyyDataSeries} for further information
149
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
150
+ */
151
+ get: function () {
152
+ return this.strokeY1Property;
153
+ },
154
+ /**
155
+ * Gets or sets the stroke color the Y1 values in the data-series.
156
+ * See associated {@link XyyDataSeries} for further information
157
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
158
+ */
159
+ set: function (strokeY1) {
160
+ this.strokeY1Property = strokeY1;
161
+ // no need to call notifyPropertyChange here since this will cause an unwanted redraw loop, so just updating a pen
162
+ this.drawingProviders.forEach(function (dp) { return dp.onSeriesPropertyChange(constants_1.PROPERTY.STROKE_Y1); });
163
+ },
164
+ enumerable: false,
165
+ configurable: true
166
+ });
167
+ Object.defineProperty(StackedMountainRenderableSeries.prototype, "fillY1", {
168
+ /**
169
+ * Gets or sets the fill color for when Y1 is less than Y as an HTML Color code
170
+ */
171
+ get: function () {
172
+ return this.fillProperty;
173
+ },
174
+ /**
175
+ * Gets or sets the fill color for when Y1 is less than Y as an HTML Color code
176
+ */
177
+ set: function (fillY1) {
178
+ throw new Error("Setting fillY1 property is not supported on StackedMountainRenderableSeries");
179
+ },
180
+ enumerable: false,
181
+ configurable: true
182
+ });
183
+ Object.defineProperty(StackedMountainRenderableSeries.prototype, "strokeDashArray", {
184
+ /**
185
+ * The StrokeDashArray defines the stroke or dash pattern for the Y0 line.
186
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
187
+ */
188
+ get: function () {
189
+ return this.strokeDashArrayProperty;
190
+ },
191
+ /**
192
+ * The StrokeDashArray defines the stroke or dash pattern for the Y0 line.
193
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
194
+ */
195
+ set: function (strokeDashArray) {
196
+ this.strokeDashArrayProperty = strokeDashArray;
197
+ this.notifyPropertyChanged(constants_1.PROPERTY.STROKE_DASH_ARRAY);
198
+ },
199
+ enumerable: false,
200
+ configurable: true
201
+ });
202
+ Object.defineProperty(StackedMountainRenderableSeries.prototype, "strokeY1DashArray", {
203
+ /**
204
+ * The strokeY1DashArray defines the stroke or dash pattern for the Y1 line.
205
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
206
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
207
+ */
208
+ get: function () {
209
+ return this.strokeY1DashArrayProperty;
210
+ },
211
+ /**
212
+ * The strokeY1DashArray defines the stroke or dash pattern for the Y1 line.
213
+ * Accepts an array of values, e.g. [2,2] will have a line of length 2 and a gap of length 2.
214
+ * @remarks This property is set internally to the value of a previous StackedMountainSeries.
215
+ */
216
+ set: function (strokeY1DashArray) {
217
+ this.strokeY1DashArrayProperty = strokeY1DashArray;
218
+ // no need to call notifyPropertyChange here since this will cause an unwanted redraw loop, so just updating a pen
219
+ this.drawingProviders.forEach(function (dp) { return dp.onSeriesPropertyChange(constants_1.PROPERTY.STROKE_Y1_DASH_ARRAY); });
220
+ },
221
+ enumerable: false,
222
+ configurable: true
223
+ });
148
224
  // PROPERTIES END
149
225
  StackedMountainRenderableSeries.prototype.toJSON = function (excludeData) {
150
226
  if (excludeData === void 0) { excludeData = false; }
@@ -152,11 +228,32 @@ var StackedMountainRenderableSeries = /** @class */ (function (_super) {
152
228
  var options = {
153
229
  fill: this.fill,
154
230
  stroke: this.stroke,
155
- strokeThickness: this.strokeThickness
231
+ strokeThickness: this.strokeThickness,
232
+ strokeDashArray: this.strokeDashArray,
233
+ paletteProvider: this.paletteProvider
156
234
  };
157
235
  Object.assign(json.options, options);
158
236
  return json;
159
237
  };
238
+ /** @inheritDoc */
239
+ StackedMountainRenderableSeries.prototype.toPointSeries = function (resamplingParams) {
240
+ return new XyPointSeriesWrapped_1.XyPointSeriesWrapped(this.dataSeries);
241
+ };
242
+ /** @inheritDoc */
243
+ StackedMountainRenderableSeries.prototype.hasStrokePaletteProvider = function () {
244
+ var strokePalette = this.paletteProvider;
245
+ return (strokePalette === null || strokePalette === void 0 ? void 0 : strokePalette.overrideStrokeArgb) !== undefined;
246
+ };
247
+ /** @inheritDoc */
248
+ StackedMountainRenderableSeries.prototype.hasFillPaletteProvider = function () {
249
+ var fillPalette = this.paletteProvider;
250
+ return (fillPalette === null || fillPalette === void 0 ? void 0 : fillPalette.overrideFillArgb) !== undefined;
251
+ };
252
+ /** @inheritDoc */
253
+ StackedMountainRenderableSeries.prototype.hasPointMarkerPaletteProvider = function () {
254
+ var pointMarkerPalette = this.paletteProvider;
255
+ return (pointMarkerPalette === null || pointMarkerPalette === void 0 ? void 0 : pointMarkerPalette.overridePointMarkerArgb) !== undefined;
256
+ };
160
257
  // PROTECTED
161
258
  /** @inheritDoc */
162
259
  StackedMountainRenderableSeries.prototype.newHitTestProvider = function () {
@@ -40,6 +40,7 @@ export interface IXyScatterRenderableSeriesOptions extends IBaseRenderableSeries
40
40
  */
41
41
  export declare class XyScatterRenderableSeries extends BaseRenderableSeries {
42
42
  readonly type = ESeriesType.ScatterSeries;
43
+ private scatterOpacityProperty;
43
44
  /**
44
45
  * Creates an instance of the {@link XyScatterRenderableSeries}
45
46
  * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing
@@ -51,4 +52,8 @@ export declare class XyScatterRenderableSeries extends BaseRenderableSeries {
51
52
  toPointSeries(rp?: ResamplingParams): IPointSeries;
52
53
  /** @inheritDoc */
53
54
  protected newHitTestProvider(): IHitTestProvider;
55
+ /** @inheritDoc */
56
+ get opacity(): number;
57
+ /** @inheritDoc */
58
+ set opacity(value: number);
54
59
  }
@@ -20,6 +20,7 @@ var SeriesType_1 = require("../../../types/SeriesType");
20
20
  var XyPointSeriesWrapped_1 = require("../../Model/PointSeries/XyPointSeriesWrapped");
21
21
  var EllipsePointMarker_1 = require("../PointMarkers/EllipsePointMarker");
22
22
  var BaseRenderableSeries_1 = require("./BaseRenderableSeries");
23
+ var constants_1 = require("./constants");
23
24
  var PointMarkerDrawingProvider_1 = require("./DrawingProviders/PointMarkerDrawingProvider");
24
25
  var ScatterSeriesHitTestProvider_1 = require("./HitTest/ScatterSeriesHitTestProvider");
25
26
  /**
@@ -59,9 +60,10 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
59
60
  * @param options Optional parameters of type {@link IBaseRenderableSeriesOptions} to configure the series
60
61
  */
61
62
  function XyScatterRenderableSeries(webAssemblyContext, options) {
62
- var _a, _b;
63
+ var _a, _b, _c;
63
64
  var _this = _super.call(this, webAssemblyContext, options) || this;
64
65
  _this.type = SeriesType_1.ESeriesType.ScatterSeries;
66
+ _this.scatterOpacityProperty = 1;
65
67
  if (!_this.pointMarker) {
66
68
  _this.pointMarker = new EllipsePointMarker_1.EllipsePointMarker(webAssemblyContext, { width: 10, height: 10 });
67
69
  }
@@ -74,6 +76,7 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
74
76
  if ((_a = _this.paletteProvider) === null || _a === void 0 ? void 0 : _a.onAttached) {
75
77
  (_b = _this.paletteProvider) === null || _b === void 0 ? void 0 : _b.onAttached(_this);
76
78
  }
79
+ _this.scatterOpacityProperty = (_c = options === null || options === void 0 ? void 0 : options.opacity) !== null && _c !== void 0 ? _c : _this.scatterOpacityProperty;
77
80
  return _this;
78
81
  }
79
82
  /** @inheritDoc */
@@ -84,6 +87,23 @@ var XyScatterRenderableSeries = /** @class */ (function (_super) {
84
87
  XyScatterRenderableSeries.prototype.newHitTestProvider = function () {
85
88
  return new ScatterSeriesHitTestProvider_1.ScatterSeriesHitTestProvider(this, this.webAssemblyContext);
86
89
  };
90
+ Object.defineProperty(XyScatterRenderableSeries.prototype, "opacity", {
91
+ /** @inheritDoc */
92
+ get: function () {
93
+ return this.scatterOpacityProperty;
94
+ },
95
+ /** @inheritDoc */
96
+ set: function (value) {
97
+ this.scatterOpacityProperty = value;
98
+ this.notifyPropertyChanged(constants_1.PROPERTY.OPACITY);
99
+ if (this.pointMarker) {
100
+ this.pointMarker.opacity = value;
101
+ this.notifyPropertyChanged(constants_1.PROPERTY.POINT_MARKER);
102
+ }
103
+ },
104
+ enumerable: false,
105
+ configurable: true
106
+ });
87
107
  return XyScatterRenderableSeries;
88
108
  }(BaseRenderableSeries_1.BaseRenderableSeries));
89
109
  exports.XyScatterRenderableSeries = XyScatterRenderableSeries;
@@ -10,6 +10,7 @@ export declare enum PROPERTY {
10
10
  CONTOUR_COLOR_MAP_MODE = "CONTOUR_COLOR_MAP_MODE",
11
11
  DATA_POINT_WIDTH = "dataPointWidth",
12
12
  DATA_SERIES = "dataSeries",
13
+ DRAWING_PROVIDERS = "DRAWING_PROVIDERS",
13
14
  DRAW_NAN_AS = "drawNaNAs",
14
15
  EFFECT = "EFFECT",
15
16
  ENABLE_DRAWING_OPTIMISATIONS = "ENABLE_DRAWING_OPTIMISATIONS",
@@ -30,6 +31,7 @@ export declare enum PROPERTY {
30
31
  OFFSET = "OFFSET",
31
32
  OPACITY = "OPACITY",
32
33
  PALETTE_PROVIDER = "PALETTE_PROVIDER",
34
+ PARENT_SURFACE = "PARENT_SURFACE",
33
35
  POINT_MARKER = "pointMarker",
34
36
  RANGE = "RANGE",
35
37
  RESAMPLING_MODE = "RESAMPLING_MODE",
@@ -14,6 +14,7 @@ var PROPERTY;
14
14
  PROPERTY["CONTOUR_COLOR_MAP_MODE"] = "CONTOUR_COLOR_MAP_MODE";
15
15
  PROPERTY["DATA_POINT_WIDTH"] = "dataPointWidth";
16
16
  PROPERTY["DATA_SERIES"] = "dataSeries";
17
+ PROPERTY["DRAWING_PROVIDERS"] = "DRAWING_PROVIDERS";
17
18
  PROPERTY["DRAW_NAN_AS"] = "drawNaNAs";
18
19
  PROPERTY["EFFECT"] = "EFFECT";
19
20
  PROPERTY["ENABLE_DRAWING_OPTIMISATIONS"] = "ENABLE_DRAWING_OPTIMISATIONS";
@@ -34,6 +35,7 @@ var PROPERTY;
34
35
  PROPERTY["OFFSET"] = "OFFSET";
35
36
  PROPERTY["OPACITY"] = "OPACITY";
36
37
  PROPERTY["PALETTE_PROVIDER"] = "PALETTE_PROVIDER";
38
+ PROPERTY["PARENT_SURFACE"] = "PARENT_SURFACE";
37
39
  PROPERTY["POINT_MARKER"] = "pointMarker";
38
40
  PROPERTY["RANGE"] = "RANGE";
39
41
  PROPERTY["RESAMPLING_MODE"] = "RESAMPLING_MODE";
@@ -1,5 +1,8 @@
1
+ import { Thickness } from "../../../Core/Thickness";
2
+ import { TBorder } from "../../../types/TBorder";
3
+ import { PieLabelProvider } from "../Axis/LabelProvider/PieLabelProvider";
1
4
  import { ISurfaceOptionsBase } from "../SciChartSurfaceBase";
2
- import { EPieType, ESizingMode } from "./SciChartPieSurface";
5
+ import { EPieType, EPieValueMode, ESizingMode } from "./SciChartPieSurface";
3
6
  /**
4
7
  * Options passed to a {@link SciChartPieSurface} in the {@link SciChartPieSurface.create} function
5
8
  */
@@ -18,8 +21,10 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
18
21
  pieType?: EPieType;
19
22
  /** Optional - the radius of the hole for a donut chart. */
20
23
  holeRadius?: number;
21
- /** Optional - Whether to animate the chart as it is initially drawn. Default true */
24
+ /** Optional - Whether to animate the chart as it is drawn. Default true */
22
25
  animate?: boolean;
26
+ /** Optional - The number of frames for the animation. Default 30. A frame will be trigged every 20ms. */
27
+ animationFrames?: number;
23
28
  /** Optional - how the hole radius is interpreted, either absolute, or relative to the total radius */
24
29
  holeRadiusSizingMode?: ESizingMode;
25
30
  /** Optional - whether to show the legend. Default true */
@@ -30,4 +35,21 @@ export interface IPieSurfaceOptions extends ISurfaceOptionsBase {
30
35
  showLegendCheckBoxes?: boolean;
31
36
  /** Optional - whether to show series markers on the legend. Default true */
32
37
  showLegendSeriesMarkers?: boolean;
38
+ /** Optional - adds the spacings / padding around the view area */
39
+ padding?: Thickness;
40
+ /** Optional - adds the border to the view area */
41
+ canvasBorder?: TBorder;
42
+ /** Optional - addes spacing between the segments */
43
+ seriesSpacing?: number;
44
+ /**
45
+ * Sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
46
+ */
47
+ labelProvider?: PieLabelProvider;
48
+ /** Whether to show labels as percentages, or raw values. Default to percentages */
49
+ valueMode?: EPieValueMode;
50
+ /**
51
+ * Use this to adjust the position of the labels. 1 is the default. Larger values will shift the labels outwards.
52
+ * If you want more detailed control you can override calcTitlePosition.
53
+ */
54
+ labelRadiusAdjustment?: number;
33
55
  }
@@ -5,12 +5,15 @@ export interface IPieSegment {
5
5
  readonly id: string;
6
6
  text: string;
7
7
  value: number;
8
+ oldValue: number;
8
9
  color: string;
9
10
  colorLinearGradient: GradientParams;
10
11
  isSelected: boolean;
11
12
  delta: number;
13
+ shift: number;
12
14
  onAttach(scs: SciChartPieSurface): void;
13
15
  onDetach(): void;
14
- getPercentage(total: number): string;
15
16
  toJSON(): IPieSegmentOptions;
17
+ getPercentage(total: number): number;
18
+ getLabelText(total: number): string;
16
19
  }