scichart 3.1.333 → 3.1.348
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/Charting/ChartModifiers/RolloverModifier.d.ts +11 -0
- package/Charting/ChartModifiers/RolloverModifier.js +59 -46
- package/Charting/ChartModifiers/ZoomExtentsModifier.js +2 -2
- package/Charting/ChartModifiers/ZoomPanModifier.js +2 -0
- package/Charting/Model/BaseDataSeries.js +3 -6
- package/Charting/Model/HlcDataSeries.js +4 -5
- package/Charting/Model/OhlcDataSeries.js +2 -3
- package/Charting/Model/XyyDataSeries.js +2 -2
- package/Charting/Services/ChartTitleRenderer.js +1 -8
- package/Charting/Services/TitleRenderer.d.ts +5 -4
- package/Charting/Services/TitleRenderer.js +24 -19
- package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.js +2 -0
- package/Charting/Visuals/Axis/AxisCore.d.ts +17 -11
- package/Charting/Visuals/Axis/AxisCore.js +14 -9
- package/Charting/Visuals/Axis/AxisTitleRenderer.d.ts +3 -3
- package/Charting/Visuals/Axis/AxisTitleRenderer.js +2 -8
- package/Charting/Visuals/Axis/IAxisCoreOptions.d.ts +2 -2
- package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +11 -4
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +11 -4
- package/Charting/Visuals/RenderableSeries/HitTest/LineSeriesHitTestProvider.js +11 -4
- package/Charting/Visuals/SciChartSurface.js +1 -1
- package/Charting3D/Model/DataSeries/UniformGridDataSeries3D.d.ts +1 -1
- package/Charting3D/Model/DataSeries/UniformGridDataSeries3D.js +1 -1
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/ObservableArray.d.ts +11 -5
- package/Core/ObservableArray.js +25 -6
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +7 -7
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +16 -16
- package/_wasm/scichart3d.wasm +0 -0
- package/index.d.ts +2 -0
- package/index.js +13 -11
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/types/TextStyle.d.ts +2 -0
- package/types/TextStyle.js +1 -1
- package/utils/date.js +2 -0
- package/utils/text.d.ts +3 -2
- package/utils/text.js +45 -2
package/package.json
CHANGED
package/types/TextStyle.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export declare type TCommonTextStyle = TNativeTextStyle | TTextureTextStyle;
|
|
|
52
52
|
export declare type TAdvancedTextProperties = {
|
|
53
53
|
/** Horizontal text alignment for multiline text. */
|
|
54
54
|
multilineAlignment?: EMultiLineAlignment;
|
|
55
|
+
/** Text rotation in degrees. */
|
|
56
|
+
rotation?: number;
|
|
55
57
|
};
|
|
56
58
|
/**
|
|
57
59
|
* Defines text style with advanced options
|
package/types/TextStyle.js
CHANGED
|
@@ -74,7 +74,7 @@ exports.areEqualSimpleTextStyles = areEqualSimpleTextStyles;
|
|
|
74
74
|
var areEqualTextStyles = function (style1, style2) {
|
|
75
75
|
var areBasePropertiesEqual = (0, exports.areEqualSimpleTextStyles)(style1, style2);
|
|
76
76
|
return (areBasePropertiesEqual &&
|
|
77
|
-
|
|
77
|
+
style1.rotation === style2.rotation &&
|
|
78
78
|
style1.multilineAlignment === style2.multilineAlignment);
|
|
79
79
|
};
|
|
80
80
|
exports.areEqualTextStyles = areEqualTextStyles;
|
package/utils/date.js
CHANGED
|
@@ -20,6 +20,7 @@ var formatUnixDateToHumanString = function (unixTimestamp, locale) {
|
|
|
20
20
|
exports.formatUnixDateToHumanString = formatUnixDateToHumanString;
|
|
21
21
|
var formatUnixDateToHumanStringDDMMYY = function (unixTimestamp) {
|
|
22
22
|
var res = new Date(unixTimestamp * 1000).toLocaleDateString("en-GB", {
|
|
23
|
+
timeZone: "utc",
|
|
23
24
|
year: "2-digit",
|
|
24
25
|
month: "2-digit",
|
|
25
26
|
day: "2-digit"
|
|
@@ -38,6 +39,7 @@ var formatUnixDateToHumanStringDDMMHHMM = function (unixTimestamp) {
|
|
|
38
39
|
exports.formatUnixDateToHumanStringDDMMHHMM = formatUnixDateToHumanStringDDMMHHMM;
|
|
39
40
|
var formatUnixDateToHumanStringDDMM = function (unixTimestamp) {
|
|
40
41
|
var res = new Date(unixTimestamp * 1000).toLocaleDateString("en-GB", {
|
|
42
|
+
timeZone: "utc",
|
|
41
43
|
day: "numeric",
|
|
42
44
|
month: "numeric"
|
|
43
45
|
});
|
package/utils/text.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { SCRTFont, TSciChart, TSRTextBounds } from "../types/TSciChart";
|
|
|
4
4
|
* Wrap a string by adding newline characters, splitting on spaces and wrapping to a maximum size
|
|
5
5
|
*/
|
|
6
6
|
export declare const wrapNativeText: (text: string, maxWidth: number, font: SCRTFont, textBounds: TSRTextBounds) => string;
|
|
7
|
-
export declare const getNativeTextSize: (text: string, nativeFont: SCRTFont, textStyle: TNativeTextStyle, webAssemblyContext: TSciChart) => {
|
|
7
|
+
export declare const getNativeTextSize: (text: string, nativeFont: SCRTFont, textStyle: TNativeTextStyle, webAssemblyContext: TSciChart, rotation?: number) => {
|
|
8
8
|
textHeight: number;
|
|
9
9
|
textWidth: number;
|
|
10
10
|
nativeLineSpacing: number;
|
|
11
|
-
|
|
11
|
+
deltaX: number;
|
|
12
|
+
deltaY: number;
|
|
12
13
|
};
|
package/utils/text.js
CHANGED
|
@@ -47,7 +47,8 @@ var wrapNativeText = function (text, maxWidth, font, textBounds) {
|
|
|
47
47
|
return lines.join("\n");
|
|
48
48
|
};
|
|
49
49
|
exports.wrapNativeText = wrapNativeText;
|
|
50
|
-
var getNativeTextSize = function (text, nativeFont, textStyle, webAssemblyContext) {
|
|
50
|
+
var getNativeTextSize = function (text, nativeFont, textStyle, webAssemblyContext, rotation) {
|
|
51
|
+
if (rotation === void 0) { rotation = 0; }
|
|
51
52
|
var textBounds = (0, NativeObject_1.getTextBounds)(webAssemblyContext);
|
|
52
53
|
nativeFont.CalculateStringBounds(text, textBounds, 0);
|
|
53
54
|
var maxLineHeight = 0;
|
|
@@ -65,6 +66,48 @@ var getNativeTextSize = function (text, nativeFont, textStyle, webAssemblyContex
|
|
|
65
66
|
textStyle.padding.bottom);
|
|
66
67
|
var textWidth = Math.round(textBounds.m_fWidth + textStyle.padding.left + textStyle.padding.right);
|
|
67
68
|
var firstLineAscent = textBounds.GetLineBounds(0).m_fHeight;
|
|
68
|
-
|
|
69
|
+
var rotationRad = ((rotation % 360) * Math.PI) / 180;
|
|
70
|
+
var sin = Math.sin(rotationRad);
|
|
71
|
+
var cos = Math.cos(rotationRad);
|
|
72
|
+
// if (rotation % 180 === 0) {
|
|
73
|
+
// sin = 0;
|
|
74
|
+
// cos = 1;
|
|
75
|
+
// } else if (rotation % 90 === 0) {
|
|
76
|
+
// sin = 1;
|
|
77
|
+
// cos = 0;
|
|
78
|
+
// }
|
|
79
|
+
var newTextureWidth = Math.round(textWidth * Math.abs(cos) + textHeight * Math.abs(sin));
|
|
80
|
+
var newTextureHeight = Math.round(textWidth * Math.abs(sin) + textHeight * Math.abs(cos));
|
|
81
|
+
var deltaX = 0;
|
|
82
|
+
var deltaY = 0;
|
|
83
|
+
if (rotation >= 0 && rotation < 90) {
|
|
84
|
+
deltaX = (textHeight - textStyle.padding.top - firstLineAscent) * sin + textStyle.padding.left * cos;
|
|
85
|
+
deltaY = textStyle.padding.left * sin + (textStyle.padding.top + firstLineAscent) * cos;
|
|
86
|
+
}
|
|
87
|
+
else if (rotation >= 90 && rotation <= 180) {
|
|
88
|
+
deltaX = newTextureWidth - (textStyle.padding.top + firstLineAscent) * sin + textStyle.padding.left * cos;
|
|
89
|
+
deltaY = -(textHeight - textStyle.padding.top - firstLineAscent) * cos + textStyle.padding.left * sin;
|
|
90
|
+
}
|
|
91
|
+
else if (rotation > 180 && rotation <= 270) {
|
|
92
|
+
deltaX =
|
|
93
|
+
newTextureWidth -
|
|
94
|
+
(textStyle.padding.top + firstLineAscent - textHeight) * sin +
|
|
95
|
+
textStyle.padding.left * cos;
|
|
96
|
+
deltaY = newTextureHeight + (textStyle.padding.top + firstLineAscent) * cos + textStyle.padding.left * sin;
|
|
97
|
+
}
|
|
98
|
+
else if (rotation > 270 && rotation < 360) {
|
|
99
|
+
deltaX = -(textStyle.padding.top + firstLineAscent) * sin + textStyle.padding.left * cos;
|
|
100
|
+
deltaY =
|
|
101
|
+
newTextureHeight -
|
|
102
|
+
(textHeight - firstLineAscent - textStyle.padding.top) * cos +
|
|
103
|
+
textStyle.padding.left * sin;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
textHeight: newTextureHeight,
|
|
107
|
+
textWidth: newTextureWidth,
|
|
108
|
+
nativeLineSpacing: nativeLineSpacing,
|
|
109
|
+
deltaX: deltaX,
|
|
110
|
+
deltaY: deltaY
|
|
111
|
+
};
|
|
69
112
|
};
|
|
70
113
|
exports.getNativeTextSize = getNativeTextSize;
|