scichart 2.2.2410 → 2.2.2415
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/ChartModifierBase.d.ts +2 -0
- package/Charting/ChartModifiers/ChartModifierBase.js +4 -0
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +7 -2
- package/Charting/ChartModifiers/ModifierMouseArgs.js +9 -5
- package/Charting/Visuals/Annotations/BoxAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/BoxAnnotation.js +46 -42
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +3 -0
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Mouse/MouseManager.js +2 -2
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.js +1 -1
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.js +1 -1
- package/_wasm/scichart3d.wasm +0 -0
- package/package.json +1 -1
|
@@ -78,6 +78,8 @@ export interface IChartModifierBase extends IThemeable, IDeletable {
|
|
|
78
78
|
onParentSurfaceRendered(): void;
|
|
79
79
|
/**
|
|
80
80
|
* Method called when mouse-down or touch-down occurs on the parent {@link SciChartSurfaceBase}
|
|
81
|
+
* Call args.nativeEvent.preventDefault() to prevent default browser actions
|
|
82
|
+
* like fast scroll for mouse wheel click and dragging of selected elements
|
|
81
83
|
* @param args the {@link ModifierMouseArgs} containing data about the mouse event
|
|
82
84
|
* @param scs the {@link SciChartSurfaceBase} on which method was called
|
|
83
85
|
*/
|
|
@@ -112,6 +112,10 @@ var ChartModifierBase = /** @class */ (function () {
|
|
|
112
112
|
/** @inheritDoc */
|
|
113
113
|
ChartModifierBase.prototype.modifierMouseDown = function (args) {
|
|
114
114
|
// Override in derived class to be notified of mouse down
|
|
115
|
+
if (this.executeOn === ExecuteOn_1.EExecuteOn.MouseMiddleButton) {
|
|
116
|
+
// Don't scroll browser if middle button is being used for the modifier
|
|
117
|
+
args.nativeEvent.preventDefault();
|
|
118
|
+
}
|
|
115
119
|
};
|
|
116
120
|
/** @inheritDoc */
|
|
117
121
|
ChartModifierBase.prototype.modifierMouseMove = function (args) {
|
|
@@ -13,6 +13,7 @@ declare type TModifierMouseArgsParams = {
|
|
|
13
13
|
shiftKey?: boolean;
|
|
14
14
|
ctrlKey?: boolean;
|
|
15
15
|
altKey?: boolean;
|
|
16
|
+
nativeEvent?: MouseEvent;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* Mouse arguments passed to {@link ChartModifierBase} methods
|
|
@@ -25,12 +26,12 @@ export declare class ModifierMouseArgs extends ModifierArgsBase {
|
|
|
25
26
|
static fromMouseEvent(mouseEvent: MouseEvent): ModifierMouseArgs;
|
|
26
27
|
/**
|
|
27
28
|
* Creates a {@link ModifierMouseArgs} instance from Javascript {@link WheelEvent}
|
|
28
|
-
* @param
|
|
29
|
+
* @param wheelEvent the Javascript {@link WheelEvent}
|
|
29
30
|
*/
|
|
30
31
|
static fromWheelEvent(wheelEvent: WheelEvent): ModifierMouseArgs;
|
|
31
32
|
/**
|
|
32
33
|
* Creates a {@link ModifierMouseArgs} instance from Javascript {@link PointerEvent}
|
|
33
|
-
* @param
|
|
34
|
+
* @param pointerEvent the Javascript {@link PointerEvent}
|
|
34
35
|
*/
|
|
35
36
|
static fromPointerEvent(pointerEvent: PointerEvent): ModifierMouseArgs;
|
|
36
37
|
/**
|
|
@@ -88,6 +89,10 @@ export declare class ModifierMouseArgs extends ModifierArgsBase {
|
|
|
88
89
|
* When true, the Ctrl Key is currently pressed
|
|
89
90
|
*/
|
|
90
91
|
readonly ctrlKey: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The native pointer event
|
|
94
|
+
*/
|
|
95
|
+
nativeEvent: MouseEvent;
|
|
91
96
|
/**
|
|
92
97
|
* Creates an instance of {@link ModifierMouseArgs}
|
|
93
98
|
* @param mousePoint the mouse point as an X,Y location
|
|
@@ -55,6 +55,7 @@ var ModifierMouseArgs = /** @class */ (function (_super) {
|
|
|
55
55
|
_this.shiftKey = options === null || options === void 0 ? void 0 : options.shiftKey;
|
|
56
56
|
_this.altKey = options === null || options === void 0 ? void 0 : options.altKey;
|
|
57
57
|
_this.ctrlKey = options === null || options === void 0 ? void 0 : options.ctrlKey;
|
|
58
|
+
_this.nativeEvent = options === null || options === void 0 ? void 0 : options.nativeEvent;
|
|
58
59
|
return _this;
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
@@ -69,13 +70,14 @@ var ModifierMouseArgs = /** @class */ (function (_super) {
|
|
|
69
70
|
isMaster: true,
|
|
70
71
|
shiftKey: mouseEvent.shiftKey,
|
|
71
72
|
ctrlKey: mouseEvent.ctrlKey,
|
|
72
|
-
altKey: mouseEvent.altKey
|
|
73
|
+
altKey: mouseEvent.altKey,
|
|
74
|
+
nativeEvent: mouseEvent
|
|
73
75
|
};
|
|
74
76
|
return new ModifierMouseArgs(mousePoint, options);
|
|
75
77
|
};
|
|
76
78
|
/**
|
|
77
79
|
* Creates a {@link ModifierMouseArgs} instance from Javascript {@link WheelEvent}
|
|
78
|
-
* @param
|
|
80
|
+
* @param wheelEvent the Javascript {@link WheelEvent}
|
|
79
81
|
*/
|
|
80
82
|
ModifierMouseArgs.fromWheelEvent = function (wheelEvent) {
|
|
81
83
|
Guard_1.Guard.notNull(wheelEvent, "wheelEvent");
|
|
@@ -86,13 +88,14 @@ var ModifierMouseArgs = /** @class */ (function (_super) {
|
|
|
86
88
|
isMaster: true,
|
|
87
89
|
shiftKey: wheelEvent.shiftKey,
|
|
88
90
|
ctrlKey: wheelEvent.ctrlKey,
|
|
89
|
-
altKey: wheelEvent.altKey
|
|
91
|
+
altKey: wheelEvent.altKey,
|
|
92
|
+
nativeEvent: wheelEvent
|
|
90
93
|
};
|
|
91
94
|
return new ModifierMouseArgs(mousePoint, options);
|
|
92
95
|
};
|
|
93
96
|
/**
|
|
94
97
|
* Creates a {@link ModifierMouseArgs} instance from Javascript {@link PointerEvent}
|
|
95
|
-
* @param
|
|
98
|
+
* @param pointerEvent the Javascript {@link PointerEvent}
|
|
96
99
|
*/
|
|
97
100
|
ModifierMouseArgs.fromPointerEvent = function (pointerEvent) {
|
|
98
101
|
Guard_1.Guard.notNull(pointerEvent, "pointerEvent");
|
|
@@ -105,7 +108,8 @@ var ModifierMouseArgs = /** @class */ (function (_super) {
|
|
|
105
108
|
isMaster: true,
|
|
106
109
|
shiftKey: pointerEvent.shiftKey,
|
|
107
110
|
ctrlKey: pointerEvent.ctrlKey,
|
|
108
|
-
altKey: pointerEvent.altKey
|
|
111
|
+
altKey: pointerEvent.altKey,
|
|
112
|
+
nativeEvent: pointerEvent
|
|
109
113
|
};
|
|
110
114
|
return new ModifierMouseArgs(mousePoint, options);
|
|
111
115
|
};
|
|
@@ -84,7 +84,6 @@ export declare class BoxAnnotation extends RenderContextAnnotationBase {
|
|
|
84
84
|
delete(): void;
|
|
85
85
|
/** @inheritDoc */
|
|
86
86
|
drawWithContext(renderContext: IRenderContext2D, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, viewRect: Rect): void;
|
|
87
|
-
private drawWithProvider;
|
|
88
87
|
/** @inheritDoc */
|
|
89
88
|
onAttach(scs: SciChartSurface): void;
|
|
90
89
|
onDragStarted(args: ModifierMouseArgs): boolean;
|
|
@@ -97,4 +96,5 @@ export declare class BoxAnnotation extends RenderContextAnnotationBase {
|
|
|
97
96
|
protected checkIsClickedOnAnnotationInternal(x: number, y: number): boolean;
|
|
98
97
|
protected notifyPropertyChanged(propertyName: string): void;
|
|
99
98
|
protected updateAdornerInner(): void;
|
|
99
|
+
private drawWithProvider;
|
|
100
100
|
}
|
|
@@ -140,51 +140,15 @@ var BoxAnnotation = /** @class */ (function (_super) {
|
|
|
140
140
|
// Temporary HAX! drawRect is rubbish with large strokeThickness, whereas the columnDrawingProvider does a nice
|
|
141
141
|
// outlined rectangle, but the code is ugly. In 2.3 we will improve the native drawRect to do the outline properly.
|
|
142
142
|
if (!app_1.IS_TEST_ENV) {
|
|
143
|
-
this.
|
|
143
|
+
if (this.strokeThickness > 3) {
|
|
144
|
+
this.drawWithProvider(renderContext, strokePen.scrtPen, fillBrush.scrtBrush, xCalc, yCalc, rect, viewRect);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
renderContext.drawRect(rect, viewRect, strokePen, fillBrush);
|
|
148
|
+
}
|
|
144
149
|
}
|
|
145
|
-
//renderContext.drawRect(rect, viewRect, strokePen, fillBrush);
|
|
146
150
|
this.updateAdornerInner();
|
|
147
151
|
};
|
|
148
|
-
BoxAnnotation.prototype.drawWithProvider = function (renderContext, linesPen, fillBrush, xCalc, yCalc, rect, viewRect) {
|
|
149
|
-
var webAssemblyContext = this.parentSurface.webAssemblyContext2D;
|
|
150
|
-
var args = new webAssemblyContext.SCRTColumnDrawingParams();
|
|
151
|
-
args.forceShaderMethod = true;
|
|
152
|
-
args.verticalChart = this.isVerticalChart;
|
|
153
|
-
args.zeroLineY = this.isVerticalChart ? yCalc.getDataValue(rect.left) : yCalc.getDataValue(rect.bottom);
|
|
154
|
-
args.columnWidth = this.isVerticalChart ? rect.height : rect.width;
|
|
155
|
-
// ISSUE: If the strokeThickness property is not provided,
|
|
156
|
-
// the fill will be disappeared with large zoom (when the column width will be small or zero)
|
|
157
|
-
// if (args.columnWidth === 0 && this.strokeThickness === 0) {
|
|
158
|
-
// strokePenCache = this.strokePenFillColoredCache;
|
|
159
|
-
// }
|
|
160
|
-
if (linesPen) {
|
|
161
|
-
args.SetLinesPen(linesPen);
|
|
162
|
-
}
|
|
163
|
-
if (fillBrush) {
|
|
164
|
-
args.SetFillBrush(fillBrush);
|
|
165
|
-
}
|
|
166
|
-
args.viewportWidth = viewRect.width;
|
|
167
|
-
args.viewportHeight = viewRect.height;
|
|
168
|
-
var xMid = this.isVerticalChart ? (rect.top + rect.bottom) / 2 : (rect.left + rect.right) / 2;
|
|
169
|
-
var xVal = xCalc.getDataValue(xMid);
|
|
170
|
-
var xValues = new webAssemblyContext.SCRTDoubleVector();
|
|
171
|
-
xValues.push_back(xVal);
|
|
172
|
-
var yVal = this.isVerticalChart ? yCalc.getDataValue(rect.right) : yCalc.getDataValue(rect.top);
|
|
173
|
-
var yValues = new webAssemblyContext.SCRTDoubleVector();
|
|
174
|
-
yValues.push_back(yVal);
|
|
175
|
-
args.count = yValues.size();
|
|
176
|
-
var nativeContext = renderContext.getNativeContext();
|
|
177
|
-
nativeContext.PushMatrix();
|
|
178
|
-
nativeContext.PushState();
|
|
179
|
-
nativeContext.Translate(viewRect.x, viewRect.y);
|
|
180
|
-
nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
|
|
181
|
-
this.nativeDrawingProvider.DrawPointsVec(nativeContext, xValues, yValues, xCalc.nativeCalculator, yCalc.nativeCalculator, args);
|
|
182
|
-
nativeContext.PopMatrix();
|
|
183
|
-
nativeContext.PopState();
|
|
184
|
-
xValues.delete();
|
|
185
|
-
yValues.delete();
|
|
186
|
-
args.delete();
|
|
187
|
-
};
|
|
188
152
|
/** @inheritDoc */
|
|
189
153
|
BoxAnnotation.prototype.onAttach = function (scs) {
|
|
190
154
|
_super.prototype.onAttach.call(this, scs);
|
|
@@ -354,6 +318,46 @@ var BoxAnnotation = /** @class */ (function (_super) {
|
|
|
354
318
|
this.svgAdorner = annotationHelpers_1.annotationHelpers.createSvg(svgString, adornerSvgRoot);
|
|
355
319
|
}
|
|
356
320
|
};
|
|
321
|
+
BoxAnnotation.prototype.drawWithProvider = function (renderContext, linesPen, fillBrush, xCalc, yCalc, rect, viewRect) {
|
|
322
|
+
var webAssemblyContext = this.parentSurface.webAssemblyContext2D;
|
|
323
|
+
var args = new webAssemblyContext.SCRTColumnDrawingParams();
|
|
324
|
+
args.forceShaderMethod = true;
|
|
325
|
+
args.verticalChart = this.isVerticalChart;
|
|
326
|
+
args.zeroLineY = this.isVerticalChart ? yCalc.getDataValue(rect.left) : yCalc.getDataValue(rect.bottom);
|
|
327
|
+
args.columnWidth = this.isVerticalChart ? rect.height : rect.width;
|
|
328
|
+
// ISSUE: If the strokeThickness property is not provided,
|
|
329
|
+
// the fill will be disappeared with large zoom (when the column width will be small or zero)
|
|
330
|
+
// if (args.columnWidth === 0 && this.strokeThickness === 0) {
|
|
331
|
+
// strokePenCache = this.strokePenFillColoredCache;
|
|
332
|
+
// }
|
|
333
|
+
if (linesPen) {
|
|
334
|
+
args.SetLinesPen(linesPen);
|
|
335
|
+
}
|
|
336
|
+
if (fillBrush) {
|
|
337
|
+
args.SetFillBrush(fillBrush);
|
|
338
|
+
}
|
|
339
|
+
args.viewportWidth = viewRect.width;
|
|
340
|
+
args.viewportHeight = viewRect.height;
|
|
341
|
+
var xMid = this.isVerticalChart ? (rect.top + rect.bottom) / 2 : (rect.left + rect.right) / 2;
|
|
342
|
+
var xVal = xCalc.getDataValue(xMid);
|
|
343
|
+
var xValues = new webAssemblyContext.SCRTDoubleVector();
|
|
344
|
+
xValues.push_back(xVal);
|
|
345
|
+
var yVal = this.isVerticalChart ? yCalc.getDataValue(rect.right) : yCalc.getDataValue(rect.top);
|
|
346
|
+
var yValues = new webAssemblyContext.SCRTDoubleVector();
|
|
347
|
+
yValues.push_back(yVal);
|
|
348
|
+
args.count = yValues.size();
|
|
349
|
+
var nativeContext = renderContext.getNativeContext();
|
|
350
|
+
nativeContext.PushMatrix();
|
|
351
|
+
nativeContext.PushState();
|
|
352
|
+
nativeContext.Translate(viewRect.x, viewRect.y);
|
|
353
|
+
nativeContext.SetClipRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
|
|
354
|
+
this.nativeDrawingProvider.DrawPointsVec(nativeContext, xValues, yValues, xCalc.nativeCalculator, yCalc.nativeCalculator, args);
|
|
355
|
+
nativeContext.PopMatrix();
|
|
356
|
+
nativeContext.PopState();
|
|
357
|
+
xValues.delete();
|
|
358
|
+
yValues.delete();
|
|
359
|
+
args.delete();
|
|
360
|
+
};
|
|
357
361
|
return BoxAnnotation;
|
|
358
362
|
}(RenderContextAnnotationBase_1.RenderContextAnnotationBase));
|
|
359
363
|
exports.BoxAnnotation = BoxAnnotation;
|
|
@@ -824,6 +824,9 @@ var getSectorPath = function (x, y, outerRadius, a1, a2, delta) {
|
|
|
824
824
|
var cy1 = Math.sin(DEG_TO_RAD * a2) * outerRadius + y + deltaY;
|
|
825
825
|
var cx2 = Math.cos(DEG_TO_RAD * a1) * outerRadius + x + deltaX;
|
|
826
826
|
var cy2 = Math.sin(DEG_TO_RAD * a1) * outerRadius + y + deltaY;
|
|
827
|
+
if (Math.abs(cx1 - cx2) < 0.0001) {
|
|
828
|
+
cx2 += 0.001;
|
|
829
|
+
}
|
|
827
830
|
return "M".concat(x + deltaX, " ").concat(y + deltaY, " ").concat(cx1, " ").concat(cy1, " A").concat(outerRadius, " ").concat(outerRadius, " 0 ").concat(bigArc, " 0 ").concat(cx2, " ").concat(cy2, "Z");
|
|
828
831
|
};
|
|
829
832
|
/**
|
package/Core/BuildStamp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TSciChart } from "../types/TSciChart";
|
|
2
2
|
import { TSciChart3D } from "../types/TSciChart3D";
|
|
3
|
-
export declare const libraryVersion = "2.2.
|
|
3
|
+
export declare const libraryVersion = "2.2.2415";
|
|
4
4
|
export declare const checkBuildStamp: (wasmContext: TSciChart | TSciChart3D) => boolean;
|
package/Core/BuildStamp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkBuildStamp = exports.libraryVersion = void 0;
|
|
4
|
-
var buildStamp = "2022-
|
|
4
|
+
var buildStamp = "2022-09-15T00:00:00";
|
|
5
5
|
var result;
|
|
6
6
|
// tslint:disable-next-line:no-var-requires
|
|
7
|
-
exports.libraryVersion = "2.2.
|
|
7
|
+
exports.libraryVersion = "2.2.2415";
|
|
8
8
|
var checkBuildStamp = function (wasmContext) {
|
|
9
9
|
if (result !== undefined)
|
|
10
10
|
return result;
|
|
@@ -81,8 +81,8 @@ var MouseManager = /** @class */ (function () {
|
|
|
81
81
|
* @param event The {@link PointerEvent}
|
|
82
82
|
*/
|
|
83
83
|
MouseManager.prototype.onPointerDown = function (event) {
|
|
84
|
-
// prevent default browser actions (like fast scroll for mouse wheel click and dragging of selected elements)
|
|
85
|
-
event.preventDefault()
|
|
84
|
+
// To prevent default browser actions (like fast scroll for mouse wheel click and dragging of selected elements)
|
|
85
|
+
// call args.nativeEvent.preventDefault() in the chart modifier instead of calling event.preventDefault() here
|
|
86
86
|
var modifierEvent = ModifierMouseArgs_1.ModifierMouseArgs.fromPointerEvent(event);
|
|
87
87
|
this.modifierMouseDown(modifierEvent);
|
|
88
88
|
};
|