scichart 2.2.2351 → 2.2.2393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Builder/buildAxis.d.ts +7 -0
- package/Builder/buildAxis.js +6 -0
- package/Builder/buildDataSeries.d.ts +19 -1
- package/Builder/buildDataSeries.js +22 -1
- package/Builder/buildSeries.d.ts +7 -2
- package/Builder/buildSeries.js +5 -1
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +2 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +4 -2
- package/Charting/Drawing/WebGlRenderContext2D.js +26 -42
- package/Charting/Model/BaseHeatmapDataSeries.js +1 -1
- package/Charting/Model/ChartData/HlcSeriesInfo.d.ts +12 -0
- package/Charting/Model/ChartData/HlcSeriesInfo.js +52 -0
- package/Charting/Model/Filters/HlcCustomFilter.d.ts +41 -0
- package/Charting/Model/Filters/HlcCustomFilter.js +119 -0
- package/Charting/Model/Filters/HlcFilterBase.d.ts +30 -0
- package/Charting/Model/Filters/HlcFilterBase.js +141 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.d.ts +18 -0
- package/Charting/Model/Filters/HlcScaleOffsetFilter.js +86 -0
- package/Charting/Model/Filters/XyFilterBase.d.ts +2 -0
- package/Charting/Model/Filters/XyFilterBase.js +6 -0
- package/Charting/Model/Filters/XyyFilterBase.js +9 -0
- package/Charting/Model/Filters/XyzFilterBase.js +12 -3
- package/Charting/Model/HlcDataSeries.d.ts +189 -0
- package/Charting/Model/HlcDataSeries.js +557 -0
- package/Charting/Model/IDataSeries.d.ts +5 -1
- package/Charting/Model/IDataSeries.js +4 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.d.ts +10 -0
- package/Charting/Model/PointSeries/HlcPointSeriesWrapped.js +31 -0
- package/Charting/Model/PointSeries/IPointSeries.d.ts +5 -0
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.d.ts +2 -2
- package/Charting/Numerics/CoordinateCalculators/LogarithmicCoordinateCalculator.js +15 -6
- package/Charting/Services/SciChartRenderer.d.ts +1 -0
- package/Charting/Services/SciChartRenderer.js +6 -0
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +8 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +1 -1
- package/Charting/Visuals/Axis/AxisBase2D.js +9 -22
- package/Charting/Visuals/Axis/AxisCore.d.ts +4 -0
- package/Charting/Visuals/Axis/AxisCore.js +6 -0
- package/Charting/Visuals/Axis/AxisRenderer.js +6 -10
- package/Charting/Visuals/Axis/DateTimeNumericAxis.d.ts +11 -0
- package/Charting/Visuals/Axis/DateTimeNumericAxis.js +36 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.d.ts +28 -0
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +125 -0
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.d.ts +7 -2
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +9 -4
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +18 -2
- package/Charting/Visuals/Axis/LogarithmicAxis.d.ts +1 -0
- package/Charting/Visuals/Axis/LogarithmicAxis.js +5 -3
- package/Charting/Visuals/Helpers/NativeObject.d.ts +13 -0
- package/Charting/Visuals/Helpers/NativeObject.js +101 -0
- package/Charting/Visuals/Helpers/createNativeRect.d.ts +2 -2
- package/Charting/Visuals/Helpers/createNativeRect.js +3 -1
- package/Charting/Visuals/Helpers/drawBorder.js +2 -2
- package/Charting/Visuals/Legend/SciChartLegend.js +1 -1
- package/Charting/Visuals/Legend/SciChartLegendBase.d.ts +1 -0
- package/Charting/Visuals/Legend/SciChartLegendBase.js +4 -2
- package/Charting/Visuals/Legend/SciChartPieLegend.js +1 -1
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +9 -2
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +74 -22
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +14 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +46 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +252 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.d.ts +188 -0
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +357 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +3 -10
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/ErrorSeriesHitTestProvider.js +120 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +36 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +1 -2
- package/Charting/Visuals/RenderableSeries/constants.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/constants.js +5 -0
- package/Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +5 -0
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +116 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +139 -4
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +4 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +3 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +13 -3
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +114 -74
- package/Charting/Visuals/SciChartPieSurface/constants.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/constants.js +1 -0
- package/Charting/Visuals/createMaster.js +15 -11
- package/Charting/Visuals/createSingle.js +3 -1
- package/Charting/Visuals/licenseManager2D.d.ts +6 -0
- package/Charting/Visuals/licenseManager2D.js +98 -9
- package/Charting/Visuals/licenseManager2dState.d.ts +11 -0
- package/Charting/Visuals/licenseManager2dState.js +37 -1
- package/Charting/Visuals/loader.js +4 -1
- package/Charting3D/Visuals/SciChart3DRenderer.js +1 -1
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +8 -3
- package/Charting3D/Visuals/SciChart3DSurface.js +12 -3
- package/Charting3D/Visuals/createMaster3d.js +22 -16
- package/Charting3D/Visuals/createSingle3d.js +5 -6
- package/Charting3D/Visuals/licenseManager3D.js +3 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Telemetry.d.ts +7 -0
- package/Core/Telemetry.js +109 -0
- package/Core/storage/localStorageApi.d.ts +4 -0
- package/Core/storage/localStorageApi.js +12 -0
- package/README.md +49 -13
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +10 -10
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +97 -97
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
- package/types/AxisType.d.ts +5 -1
- package/types/AxisType.js +4 -0
- package/types/DataFilterType.d.ts +1 -0
- package/types/DataFilterType.js +1 -0
- package/types/DataPointWidthMode.d.ts +13 -0
- package/types/DataPointWidthMode.js +17 -0
- package/types/ErrorDirection.d.ts +13 -0
- package/types/ErrorDirection.js +17 -0
- package/types/ErrorMode.d.ts +17 -0
- package/types/ErrorMode.js +21 -0
- package/types/NumericFormat.d.ts +4 -0
- package/types/NumericFormat.js +4 -0
- package/types/SeriesType.d.ts +3 -1
- package/types/SeriesType.js +2 -0
- package/types/TSciChart.d.ts +8 -2
- package/types/TSciChart3D.d.ts +5 -2
- package/utils/date.d.ts +1 -0
- package/utils/date.js +15 -1
- package/utils/guid.d.ts +6 -0
- package/utils/guid.js +17 -1
- package/utils/number.js +15 -2
|
@@ -1,4 +1,15 @@
|
|
|
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
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
14
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
15
|
if (ar || !(i in from)) {
|
|
@@ -11,12 +22,14 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
23
|
exports.addEventListenerToPieSegment = exports.SciChartPieSurface = exports.EPieValueMode = exports.EPieType = exports.ESizingMode = void 0;
|
|
13
24
|
var chartBuilder_1 = require("../../../Builder/chartBuilder");
|
|
25
|
+
var classFactory_1 = require("../../../Builder/classFactory");
|
|
14
26
|
var createMaster3d_1 = require("../../../Charting3D/Visuals/createMaster3d");
|
|
15
27
|
var app_1 = require("../../../constants/app");
|
|
16
28
|
var EasingFunctions_1 = require("../../../Core/Animations/EasingFunctions");
|
|
17
29
|
var Deleter_1 = require("../../../Core/Deleter");
|
|
18
30
|
var ObservableArray_1 = require("../../../Core/ObservableArray");
|
|
19
31
|
var Rect_1 = require("../../../Core/Rect");
|
|
32
|
+
var BaseType_1 = require("../../../types/BaseType");
|
|
20
33
|
var SciChartSurfaceType_1 = require("../../../types/SciChartSurfaceType");
|
|
21
34
|
var SciChartJSDarkTheme_1 = require("../../Themes/SciChartJSDarkTheme");
|
|
22
35
|
var PieLabelProvider_1 = require("../Axis/LabelProvider/PieLabelProvider");
|
|
@@ -87,6 +100,12 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
87
100
|
this.previousThemeProviderProperty = new SciChartJSDarkTheme_1.SciChartJSDarkTheme();
|
|
88
101
|
this.deletables = [];
|
|
89
102
|
this.valueModeProperty = EPieValueMode.Percentage;
|
|
103
|
+
this.labelStyleProperty = {
|
|
104
|
+
fontSize: 14,
|
|
105
|
+
fontFamily: "Arial",
|
|
106
|
+
color: "#1e323d",
|
|
107
|
+
fontWeight: "bold"
|
|
108
|
+
};
|
|
90
109
|
this.domChartRoot = canvases.domChartRoot;
|
|
91
110
|
this.domCanvas2D = canvases.domCanvas2D;
|
|
92
111
|
this.domSvgContainer = canvases.domSvgContainer;
|
|
@@ -105,6 +124,8 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
105
124
|
var _a, _b;
|
|
106
125
|
(_a = args.getOldItems()) === null || _a === void 0 ? void 0 : _a.forEach(_this.detachPieSegment);
|
|
107
126
|
(_b = args.getNewItems()) === null || _b === void 0 ? void 0 : _b.forEach(_this.attachPieSegment);
|
|
127
|
+
// Do this only after all changes have been processed
|
|
128
|
+
_this.invalidateElement();
|
|
108
129
|
});
|
|
109
130
|
this.applySciChartBackground(SciChartSurfaceBase_1.SciChartSurfaceBase.DEFAULT_THEME.sciChartBackground);
|
|
110
131
|
this.legend = new SciChartPieLegend_1.SciChartPieLegend();
|
|
@@ -124,6 +145,11 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
124
145
|
this.legend.showCheckboxes = (_k = options === null || options === void 0 ? void 0 : options.showLegendCheckBoxes) !== null && _k !== void 0 ? _k : this.legend.showCheckboxes;
|
|
125
146
|
this.legend.showSeriesMarkers = (_l = options === null || options === void 0 ? void 0 : options.showLegendSeriesMarkers) !== null && _l !== void 0 ? _l : this.legend.showSeriesMarkers;
|
|
126
147
|
this.paddingProperty = (_m = options === null || options === void 0 ? void 0 : options.padding) !== null && _m !== void 0 ? _m : this.paddingProperty;
|
|
148
|
+
if (options === null || options === void 0 ? void 0 : options.labelProvider) {
|
|
149
|
+
if (!("getSegmentText" in (options === null || options === void 0 ? void 0 : options.labelProvider))) {
|
|
150
|
+
options.labelProvider = (0, classFactory_1.createType)(BaseType_1.EBaseType.LabelProvider, options.labelProvider.type, undefined, options.labelProvider.options);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
127
153
|
this.labelProvider = (_o = options === null || options === void 0 ? void 0 : options.labelProvider) !== null && _o !== void 0 ? _o : new PieLabelProvider_1.PieLabelProvider();
|
|
128
154
|
this.valueModeProperty = (_p = options === null || options === void 0 ? void 0 : options.valueMode) !== null && _p !== void 0 ? _p : this.valueModeProperty;
|
|
129
155
|
}
|
|
@@ -161,7 +187,7 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
161
187
|
* Gets or sets a {@link LabelProvider} - a class which is responsible for formatting axis labels and cursor labels from numeric values
|
|
162
188
|
*/
|
|
163
189
|
set: function (labelProvider) {
|
|
164
|
-
if (this.labelProviderProperty !== labelProvider) {
|
|
190
|
+
if (labelProvider && this.labelProviderProperty !== labelProvider) {
|
|
165
191
|
this.labelProviderProperty = labelProvider;
|
|
166
192
|
this.notifyPropertyChanged(constants_1.PROPERTY.LABEL_PROVIDER);
|
|
167
193
|
}
|
|
@@ -169,6 +195,23 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
169
195
|
enumerable: false,
|
|
170
196
|
configurable: true
|
|
171
197
|
});
|
|
198
|
+
Object.defineProperty(SciChartPieSurface.prototype, "labelStyle", {
|
|
199
|
+
/**
|
|
200
|
+
* Gets or sets a {@link TTextStyle} object for styling labels
|
|
201
|
+
*/
|
|
202
|
+
get: function () {
|
|
203
|
+
return this.labelStyleProperty;
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* Gets or sets a {@link TTextStyle} object for styling labels
|
|
207
|
+
*/
|
|
208
|
+
set: function (textStyle) {
|
|
209
|
+
this.labelStyleProperty = __assign(__assign({}, this.labelStyle), textStyle);
|
|
210
|
+
this.notifyPropertyChanged(constants_1.PROPERTY.TEXT_STYLE);
|
|
211
|
+
},
|
|
212
|
+
enumerable: false,
|
|
213
|
+
configurable: true
|
|
214
|
+
});
|
|
172
215
|
/**
|
|
173
216
|
* @inheritDoc
|
|
174
217
|
*/
|
|
@@ -176,6 +219,9 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
176
219
|
this.previousThemeProviderProperty = this.themeProviderProperty;
|
|
177
220
|
this.themeProviderProperty = themeProvider;
|
|
178
221
|
this.applySciChartBackground(themeProvider.sciChartBackground);
|
|
222
|
+
if (this.labelStyle.color === this.previousThemeProvider.tickTextBrush) {
|
|
223
|
+
this.labelStyle = { color: themeProvider.tickTextBrush };
|
|
224
|
+
}
|
|
179
225
|
this.invalidateElement();
|
|
180
226
|
};
|
|
181
227
|
Object.defineProperty(SciChartPieSurface.prototype, "themeProvider", {
|
|
@@ -216,8 +262,6 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
216
262
|
SciChartPieSurface.prototype.update = function () {
|
|
217
263
|
if (!this.suspendUpdate) {
|
|
218
264
|
this.draw();
|
|
219
|
-
var width = this.calculateViewRectWidth(this.viewRect.width);
|
|
220
|
-
var height = this.calculateViewRectHeight(this.viewRect.height);
|
|
221
265
|
this.legend.setSeriesViewRect(this.viewRect);
|
|
222
266
|
this.legend.update();
|
|
223
267
|
}
|
|
@@ -437,7 +481,8 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
437
481
|
padding: this.padding,
|
|
438
482
|
canvasBorder: this.canvasBorder,
|
|
439
483
|
seriesSpacing: this.seriesSpacing,
|
|
440
|
-
|
|
484
|
+
// @ts-ignore
|
|
485
|
+
labelProvider: this.labelProvider.toJSON(),
|
|
441
486
|
valueMode: this.valueMode,
|
|
442
487
|
labelRadiusAdjustment: this.labelRadiusAdjustment,
|
|
443
488
|
animationFrames: this.animationFrames,
|
|
@@ -485,8 +530,8 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
485
530
|
// PRIVATE
|
|
486
531
|
SciChartPieSurface.prototype.notifyPropertyChanged = function (propertyName) {
|
|
487
532
|
this.invalidateElement();
|
|
488
|
-
if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER) {
|
|
489
|
-
this.
|
|
533
|
+
if (propertyName === constants_1.PROPERTY.LABEL_PROVIDER && this.labelProviderProperty) {
|
|
534
|
+
this.labelProviderProperty.attachedToSurface(this);
|
|
490
535
|
}
|
|
491
536
|
};
|
|
492
537
|
SciChartPieSurface.prototype.isValidToDraw = function () {
|
|
@@ -495,11 +540,9 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
495
540
|
};
|
|
496
541
|
SciChartPieSurface.prototype.detachPieSegment = function (pieSegment) {
|
|
497
542
|
pieSegment.onDetach();
|
|
498
|
-
this.invalidateElement();
|
|
499
543
|
};
|
|
500
544
|
SciChartPieSurface.prototype.attachPieSegment = function (pieSegment) {
|
|
501
545
|
pieSegment.onAttach(this);
|
|
502
|
-
this.invalidateElement();
|
|
503
546
|
};
|
|
504
547
|
SciChartPieSurface.prototype.updateLegendMargin = function () {
|
|
505
548
|
var _a, _b, _c;
|
|
@@ -553,6 +596,8 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
553
596
|
};
|
|
554
597
|
SciChartPieSurface.prototype.draw = function () {
|
|
555
598
|
var _this = this;
|
|
599
|
+
if (this.pieSegments.size() === 0)
|
|
600
|
+
return;
|
|
556
601
|
if (this.sweepAnimationDone || !this.animate) {
|
|
557
602
|
this.delete();
|
|
558
603
|
this.drawChart();
|
|
@@ -590,9 +635,6 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
590
635
|
}
|
|
591
636
|
});
|
|
592
637
|
}
|
|
593
|
-
if (this.sweepAnimationDone) {
|
|
594
|
-
this.drawSegmentTitles();
|
|
595
|
-
}
|
|
596
638
|
};
|
|
597
639
|
/**
|
|
598
640
|
* @description Draws pie chart itself
|
|
@@ -605,6 +647,7 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
605
647
|
var strokeColor = this.themeProviderProperty.sciChartBackground;
|
|
606
648
|
var segments = this.pieSegments.asArray();
|
|
607
649
|
var totalValue = this.pieSegmentsTotalValue();
|
|
650
|
+
var totalOldValue = this.pieSegmentsTotalOldValue();
|
|
608
651
|
var outerRadius = (Math.min(this.calculateViewRectWidth(this.viewRect.width), this.calculateViewRectHeight(this.viewRect.height)) *
|
|
609
652
|
0.8) /
|
|
610
653
|
2;
|
|
@@ -619,14 +662,18 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
619
662
|
var gradientsBlock = "<defs>";
|
|
620
663
|
var pathsBlock = "";
|
|
621
664
|
var currentValue = 0;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
665
|
+
var currentOldValue = 0;
|
|
666
|
+
segments.forEach(function (el, index) {
|
|
667
|
+
var _a;
|
|
668
|
+
var oldValue = (_a = el.oldValue) !== null && _a !== void 0 ? _a : 0;
|
|
669
|
+
var newFrom = (360 * currentValue) / totalValue - START_ANGLE;
|
|
670
|
+
var newTo = (360 * (currentValue + el.value)) / totalValue - START_ANGLE;
|
|
671
|
+
var oldFrom = (360 * currentOldValue) / totalOldValue - START_ANGLE;
|
|
672
|
+
var oldTo = (360 * (currentOldValue + oldValue)) / totalOldValue - START_ANGLE;
|
|
673
|
+
currentValue += el.value;
|
|
674
|
+
currentOldValue += oldValue;
|
|
675
|
+
var angleFrom = oldFrom + (newFrom - oldFrom) * EasingFunctions_1.easing.inOutCubic(animationProgress);
|
|
676
|
+
var angleTo = oldTo + (newTo - oldTo) * EasingFunctions_1.easing.inOutCubic(animationProgress);
|
|
630
677
|
var hasGradient = !!el.colorLinearGradient;
|
|
631
678
|
var gradientId = "grad".concat(el.id);
|
|
632
679
|
if (hasGradient) {
|
|
@@ -642,16 +689,16 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
642
689
|
gradientBlock_1 += "</linearGradient>";
|
|
643
690
|
gradientsBlock += gradientBlock_1;
|
|
644
691
|
}
|
|
645
|
-
var angleFrom = (360 * currentValue) / totalValue - START_ANGLE;
|
|
646
|
-
var angleTo = (360 * (currentValue + newValue)) / totalValue - START_ANGLE;
|
|
647
692
|
var dAttribute = _this.pieType === EPieType.Donut
|
|
648
|
-
? getDonutSectorPath(xCoord, yCoord, outerRadius, innerRadius, angleFrom, angleTo, el.shift + _this.seriesSpacing)
|
|
649
|
-
: getSectorPath(xCoord, yCoord, outerRadius, angleFrom, angleTo, el.shift + _this.seriesSpacing);
|
|
693
|
+
? getDonutSectorPath(xCoord, yCoord, outerRadius * el.radiusAdjustment, innerRadius, angleFrom, angleTo, el.shift + _this.seriesSpacing)
|
|
694
|
+
: getSectorPath(xCoord, yCoord, outerRadius * el.radiusAdjustment, angleFrom, angleTo, el.shift + _this.seriesSpacing);
|
|
650
695
|
var pathBlock = hasGradient
|
|
651
696
|
? "<g fill=\"url(#".concat(gradientId, ")\"><path id=\"").concat(el.id, "\" stroke=\"").concat(strokeColor, "\" stroke-width=\"").concat(strokeWidth, "\" d=\"").concat(dAttribute, "\" /></g>")
|
|
652
697
|
: "<path id=\"".concat(el.id, "\" stroke=\"").concat(strokeColor, "\" stroke-width=\"").concat(strokeWidth, "\" d=\"").concat(dAttribute, "\" fill=\"").concat(el.color, "\" />");
|
|
653
698
|
pathsBlock += pathBlock;
|
|
654
|
-
|
|
699
|
+
if (animationProgress === 1 || el.oldValue) {
|
|
700
|
+
_this.drawSegmentLabel(el, index, totalValue, angleFrom, angleTo, xCoord, yCoord, outerRadius * el.radiusAdjustment, innerRadius);
|
|
701
|
+
}
|
|
655
702
|
});
|
|
656
703
|
gradientsBlock += "</defs>";
|
|
657
704
|
this.adjustDomContainer();
|
|
@@ -697,68 +744,61 @@ var SciChartPieSurface = /** @class */ (function () {
|
|
|
697
744
|
this.domSvgContainer.style.borderRightWidth = this.canvasBorder.borderRight + "px";
|
|
698
745
|
}
|
|
699
746
|
};
|
|
700
|
-
SciChartPieSurface.prototype.
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
0.8) /
|
|
708
|
-
2;
|
|
709
|
-
var innerRadius = 0;
|
|
710
|
-
if (this.pieType === EPieType.Donut) {
|
|
711
|
-
innerRadius =
|
|
712
|
-
this.holeRadiusSizingMode === ESizingMode.Absolute ? this.holeRadius : outerRadius * this.holeRadius;
|
|
713
|
-
}
|
|
714
|
-
this.pieSegments.asArray().forEach(function (el, index) {
|
|
715
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
716
|
-
var div = document.createElement("div");
|
|
747
|
+
SciChartPieSurface.prototype.drawSegmentLabel = function (el, index, totalValue, angleFrom, angleTo, xCoord, yCoord, outerRadius, innerRadius) {
|
|
748
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
749
|
+
var labelDivId = "segment" + index;
|
|
750
|
+
var div = this.titleDivs.find(function (d) { return d.id === labelDivId; });
|
|
751
|
+
if (!div) {
|
|
752
|
+
div = document.createElement("div");
|
|
753
|
+
var labelStyle = el.labelStyle;
|
|
717
754
|
div.className = "scichart-pie-text-container";
|
|
755
|
+
div.id = labelDivId;
|
|
718
756
|
div.style.position = "absolute";
|
|
719
757
|
div.style.pointerEvents = "none";
|
|
720
758
|
div.style.padding = "5px";
|
|
721
759
|
div.style.borderRadius = "3px";
|
|
722
|
-
|
|
723
|
-
|
|
760
|
+
this.titleDivs.push(div);
|
|
761
|
+
this.domDivContainer.appendChild(div);
|
|
724
762
|
div.style.display = "block";
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
763
|
+
}
|
|
764
|
+
div.style.color = el.labelStyle.color;
|
|
765
|
+
div.style.fontWeight = el.labelStyle.fontWeight;
|
|
766
|
+
div.style.fontFamily = el.labelStyle.fontFamily;
|
|
767
|
+
div.style.fontSize = el.labelStyle.fontSize.toString() + "px";
|
|
768
|
+
div.innerHTML = el.getLabelText(totalValue);
|
|
769
|
+
var divWidth = div.offsetWidth;
|
|
770
|
+
var divHeight = div.offsetHeight;
|
|
771
|
+
var leftShift = 0;
|
|
772
|
+
var topShift = 0;
|
|
773
|
+
if ((_a = this.padding) === null || _a === void 0 ? void 0 : _a.left) {
|
|
774
|
+
leftShift += (_b = this.padding) === null || _b === void 0 ? void 0 : _b.left;
|
|
775
|
+
}
|
|
776
|
+
if ((_c = this.padding) === null || _c === void 0 ? void 0 : _c.top) {
|
|
777
|
+
topShift += (_d = this.padding) === null || _d === void 0 ? void 0 : _d.top;
|
|
778
|
+
}
|
|
779
|
+
if ((_e = this.canvasBorder) === null || _e === void 0 ? void 0 : _e.border) {
|
|
780
|
+
leftShift += (_f = this.canvasBorder) === null || _f === void 0 ? void 0 : _f.border;
|
|
781
|
+
topShift += (_g = this.canvasBorder) === null || _g === void 0 ? void 0 : _g.border;
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
if ((_h = this.canvasBorder) === null || _h === void 0 ? void 0 : _h.borderLeft) {
|
|
785
|
+
leftShift += (_j = this.canvasBorder) === null || _j === void 0 ? void 0 : _j.borderLeft;
|
|
739
786
|
}
|
|
740
|
-
if ((
|
|
741
|
-
leftShift += (
|
|
742
|
-
topShift += (_g = _this.canvasBorder) === null || _g === void 0 ? void 0 : _g.border;
|
|
787
|
+
if ((_k = this.canvasBorder) === null || _k === void 0 ? void 0 : _k.borderTop) {
|
|
788
|
+
leftShift += (_l = this.canvasBorder) === null || _l === void 0 ? void 0 : _l.borderTop;
|
|
743
789
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if ((_k = _this.canvasBorder) === null || _k === void 0 ? void 0 : _k.borderTop) {
|
|
749
|
-
leftShift += (_l = _this.canvasBorder) === null || _l === void 0 ? void 0 : _l.borderTop;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
var position = _this.calcTitlePosition(xCoord + leftShift, yCoord + topShift, outerRadius, innerRadius, angleFrom, angleTo, el.shift + _this.seriesSpacing, divWidth, divHeight);
|
|
753
|
-
div.style.left = "".concat(position.left, "px");
|
|
754
|
-
div.style.top = "".concat(position.top, "px");
|
|
755
|
-
_this.titleDivs.push(div);
|
|
756
|
-
currentValue += el.value;
|
|
757
|
-
});
|
|
790
|
+
}
|
|
791
|
+
var position = this.calcTitlePosition(xCoord + leftShift, yCoord + topShift, outerRadius, innerRadius, angleFrom, angleTo, el.shift + this.seriesSpacing, divWidth, divHeight);
|
|
792
|
+
div.style.left = "".concat(position.left + el.labelOffset.x, "px");
|
|
793
|
+
div.style.top = "".concat(position.top + el.labelOffset.y, "px");
|
|
758
794
|
};
|
|
759
795
|
SciChartPieSurface.prototype.pieSegmentsTotalValue = function () {
|
|
760
796
|
return this.pieSegments.asArray().reduce(function (prev, cur) { return prev + cur.value; }, 0);
|
|
761
797
|
};
|
|
798
|
+
SciChartPieSurface.prototype.pieSegmentsTotalOldValue = function () {
|
|
799
|
+
var total = this.pieSegments.asArray().reduce(function (prev, cur) { var _a; return prev + ((_a = cur.oldValue) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
800
|
+
return total > 0 ? total : 1;
|
|
801
|
+
};
|
|
762
802
|
SciChartPieSurface.prototype.applySciChartBackground = function (htmlColor) {
|
|
763
803
|
this.domCanvas2D.style.background = htmlColor;
|
|
764
804
|
};
|
|
@@ -190,17 +190,21 @@ var createMaster = function () {
|
|
|
190
190
|
InitializeChart: function () {
|
|
191
191
|
resolve({ getChildSurfaces: getChildSurfaces, createChildSurface: createChildSurface, wasmContext: wasmContext });
|
|
192
192
|
},
|
|
193
|
-
Draw: function () {
|
|
194
|
-
exports.sciChartDestinations.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
193
|
+
Draw: function (canvasId) {
|
|
194
|
+
var dest = exports.sciChartDestinations.find(function (d) { return d.canvasElementId === canvasId; });
|
|
195
|
+
if (dest) {
|
|
196
|
+
dest.sciChartSurface.renderSurface.onRenderTimeElapsed();
|
|
197
|
+
}
|
|
198
|
+
// sciChartDestinations.forEach((dest, index) => {
|
|
199
|
+
// const { canvasElementId, sciChartSurface } = dest;
|
|
200
|
+
// const chart = wasmContext.SCRTGetGlobalSampleChartInterface();
|
|
201
|
+
// if (chart.GetCurrentDestination()) {
|
|
202
|
+
// const currDestID = chart.GetCurrentDestination().GetID();
|
|
203
|
+
// if (currDestID === canvasElementId) {
|
|
204
|
+
// (sciChartSurface as SciChartSurface).renderSurface.onRenderTimeElapsed();
|
|
205
|
+
// }
|
|
206
|
+
// }
|
|
207
|
+
// });
|
|
204
208
|
},
|
|
205
209
|
Update: function (deltaTime) {
|
|
206
210
|
// Logger.log("sciChartInitCommon.ts Update");
|
|
@@ -12,6 +12,7 @@ var loader_1 = require("./loader");
|
|
|
12
12
|
var sciChartInitCommon_1 = require("./sciChartInitCommon");
|
|
13
13
|
var SciChartSurface_1 = require("./SciChartSurface");
|
|
14
14
|
var SciChartSurfaceBase_1 = require("./SciChartSurfaceBase");
|
|
15
|
+
var NativeObject_1 = require("./Helpers/NativeObject");
|
|
15
16
|
// Global variables
|
|
16
17
|
exports.sciChartSingleDestinations = [];
|
|
17
18
|
/** @ignore */
|
|
@@ -70,10 +71,11 @@ var initDrawEngineSingleChart = function (wasmContext, canvases, resolve, theme)
|
|
|
70
71
|
licenseManager2D_1.licenseManager.applyLicense2D(wasmContext, scs, true);
|
|
71
72
|
var unsub = sciChartInitCommon_1.default.subscribeToResize(canvases.domChartRoot, canvases.aspect, scs, canvases.disableAspect);
|
|
72
73
|
scs.addDeletable(unsub);
|
|
74
|
+
scs.addDeletable((0, NativeObject_1.freeCache)(wasmContext));
|
|
73
75
|
resolve({ wasmContext: wasmContext, sciChartSurface: scs });
|
|
74
76
|
}, 0);
|
|
75
77
|
},
|
|
76
|
-
Draw: function () {
|
|
78
|
+
Draw: function (canvasId) {
|
|
77
79
|
scs.renderSurface.onRenderTimeElapsed();
|
|
78
80
|
},
|
|
79
81
|
Update: function (deltaTime) {
|
|
@@ -10,6 +10,7 @@ export declare type TLicenseDependencies = {
|
|
|
10
10
|
debug: (message: string) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const setDependencies: (dependencies: TLicenseDependencies) => TLicenseDependencies;
|
|
13
|
+
export declare const setIsDebugLicensing: (value: boolean, persist?: boolean) => void;
|
|
13
14
|
export declare const setLicenseCallback: (callback: (queryString: string) => Promise<Response>) => void;
|
|
14
15
|
export declare const setRuntimeLicenseKey: (value: string) => void;
|
|
15
16
|
export declare const setUseLicenseWizard: (value: boolean) => void;
|
|
@@ -39,6 +40,7 @@ export declare type TLicenseContext = {
|
|
|
39
40
|
GetLicenseType: () => SCRTLicenseType;
|
|
40
41
|
GetLicenseDaysRemaining: () => number;
|
|
41
42
|
Dump: () => string;
|
|
43
|
+
HasFeature: (feature: string) => SCRTLicenseType;
|
|
42
44
|
GetLicenseErrors: () => string;
|
|
43
45
|
GetAllowDebugging: () => boolean;
|
|
44
46
|
SetRuntimeLicenseKeyW: (licenseKey: string) => void;
|
|
@@ -47,6 +49,9 @@ export declare type TLicenseContext = {
|
|
|
47
49
|
ResetRuntimeLicense: () => void;
|
|
48
50
|
GetLicenseChallenge: () => string;
|
|
49
51
|
GetOrderId: () => string;
|
|
52
|
+
GetEncryptedOrderId: () => string;
|
|
53
|
+
GetProductCode: () => string;
|
|
54
|
+
GetDeveloperCount: () => number;
|
|
50
55
|
};
|
|
51
56
|
SCRTLicenseType: {
|
|
52
57
|
LICENSE_TYPE_NO_LICENSE: SCRTLicenseType;
|
|
@@ -64,6 +69,7 @@ export declare const getLicenseInfo: (licenseContext: TLicenseContext) => ILicen
|
|
|
64
69
|
export declare const updateLicenseDisplay: (licenseInfo: ILicenseInfo, sciChartSurface: SciChartSurfaceBase, is2D: boolean, applyToOther: boolean) => void;
|
|
65
70
|
export declare const licenseManager: {
|
|
66
71
|
setRuntimeLicenseKey: (value: string) => void;
|
|
72
|
+
setIsDebugLicensing: (value: boolean) => void;
|
|
67
73
|
setLicenseCallback: (callback: (queryString: string) => Promise<Response>) => void;
|
|
68
74
|
setServerLicenseEndpoint: (value: string) => void;
|
|
69
75
|
applyLicense2D: (licenseContext: TLicenseContext, sciChartSurface: SciChartSurfaceBase, isSingle: boolean) => void;
|