@visactor/vchart 1.9.3-alpha.0 → 1.9.3-alpha.1
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/build/es5/index.js +1 -1
- package/build/index.js +298 -277
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/package.json +15 -15
package/build/index.js
CHANGED
|
@@ -8336,9 +8336,6 @@
|
|
|
8336
8336
|
clear() {
|
|
8337
8337
|
this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
|
|
8338
8338
|
}
|
|
8339
|
-
beginPath() {
|
|
8340
|
-
this.clear();
|
|
8341
|
-
}
|
|
8342
8339
|
toString() {
|
|
8343
8340
|
if (!this.toStringCbList) {
|
|
8344
8341
|
const list = [];
|
|
@@ -8348,7 +8345,7 @@
|
|
|
8348
8345
|
let path = "";
|
|
8349
8346
|
for (let i = 0; i < bezierPathList.length; i += 6) path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${bezierPathList[i + 4]} ${bezierPathList[i + 5]}`;
|
|
8350
8347
|
return path;
|
|
8351
|
-
}, list[enumCommandMap.
|
|
8348
|
+
}, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
|
|
8352
8349
|
}
|
|
8353
8350
|
const list = this.toStringCbList;
|
|
8354
8351
|
let path = "";
|
|
@@ -8687,7 +8684,6 @@
|
|
|
8687
8684
|
zIndex: 0,
|
|
8688
8685
|
layout: null,
|
|
8689
8686
|
boundsPadding: 0,
|
|
8690
|
-
renderStyle: "default",
|
|
8691
8687
|
pickMode: "accurate",
|
|
8692
8688
|
customPickShape: null,
|
|
8693
8689
|
boundsMode: "accurate",
|
|
@@ -8785,7 +8781,7 @@
|
|
|
8785
8781
|
strokeBoundsBuffer: 0,
|
|
8786
8782
|
keepDirIn3d: !0
|
|
8787
8783
|
});
|
|
8788
|
-
const DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
8784
|
+
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
|
|
8789
8785
|
width: 300,
|
|
8790
8786
|
height: 300,
|
|
8791
8787
|
ellipsis: !0,
|
|
@@ -9693,9 +9689,20 @@
|
|
|
9693
9689
|
this._handler.setStyle(style);
|
|
9694
9690
|
}
|
|
9695
9691
|
create(params) {
|
|
9692
|
+
var _a, _b;
|
|
9696
9693
|
this._handler.createWindow(params);
|
|
9697
9694
|
const windowWH = this._handler.getWH();
|
|
9698
|
-
this._width = windowWH.width, this._height = windowWH.height,
|
|
9695
|
+
this._width = windowWH.width, this._height = windowWH.height, params.viewBox ? this.setViewBox(params.viewBox) : !1 !== params.canvasControled ? this.setViewBox({
|
|
9696
|
+
x1: 0,
|
|
9697
|
+
y1: 0,
|
|
9698
|
+
x2: this._width,
|
|
9699
|
+
y2: this._height
|
|
9700
|
+
}) : this.setViewBox({
|
|
9701
|
+
x1: 0,
|
|
9702
|
+
y1: 0,
|
|
9703
|
+
x2: null !== (_a = params.width) && void 0 !== _a ? _a : this._width,
|
|
9704
|
+
y2: null !== (_b = params.height) && void 0 !== _b ? _b : this._height
|
|
9705
|
+
}), this.title = this._handler.getTitle(), this.resizable = !0;
|
|
9699
9706
|
}
|
|
9700
9707
|
setWindowHandler(handler) {
|
|
9701
9708
|
this._handler = handler;
|
|
@@ -9736,8 +9743,35 @@
|
|
|
9736
9743
|
getContainer() {
|
|
9737
9744
|
return this._handler.container;
|
|
9738
9745
|
}
|
|
9739
|
-
clearViewBox(
|
|
9740
|
-
this._handler.clearViewBox(
|
|
9746
|
+
clearViewBox(color) {
|
|
9747
|
+
this._handler.clearViewBox(color);
|
|
9748
|
+
}
|
|
9749
|
+
setViewBox(viewBox) {
|
|
9750
|
+
this._handler.setViewBox(viewBox);
|
|
9751
|
+
}
|
|
9752
|
+
setViewBoxTransform(a, b, c, d, e, f) {
|
|
9753
|
+
this._handler.setViewBoxTransform(a, b, c, d, e, f);
|
|
9754
|
+
}
|
|
9755
|
+
getViewBox() {
|
|
9756
|
+
return this._handler.getViewBox();
|
|
9757
|
+
}
|
|
9758
|
+
getViewBoxTransform() {
|
|
9759
|
+
return this._handler.getViewBoxTransform();
|
|
9760
|
+
}
|
|
9761
|
+
pointTransform(x, y) {
|
|
9762
|
+
const vb = this._handler.getViewBox(),
|
|
9763
|
+
nextP = {
|
|
9764
|
+
x: x,
|
|
9765
|
+
y: y
|
|
9766
|
+
};
|
|
9767
|
+
return this._handler.getViewBoxTransform().transformPoint({
|
|
9768
|
+
x: x,
|
|
9769
|
+
y: y
|
|
9770
|
+
}, nextP), nextP.x -= vb.x1, nextP.y -= vb.y1, nextP;
|
|
9771
|
+
}
|
|
9772
|
+
hasSubView() {
|
|
9773
|
+
const viewBox = this._handler.getViewBox();
|
|
9774
|
+
return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
|
|
9741
9775
|
}
|
|
9742
9776
|
isVisible(bbox) {
|
|
9743
9777
|
return this._handler.isVisible(bbox);
|
|
@@ -9823,8 +9857,16 @@
|
|
|
9823
9857
|
const window = container.get(VWindow),
|
|
9824
9858
|
bounds = graphic.AABBBounds,
|
|
9825
9859
|
width = bounds.width(),
|
|
9826
|
-
height = bounds.height()
|
|
9860
|
+
height = bounds.height(),
|
|
9861
|
+
x1 = -bounds.x1,
|
|
9862
|
+
y1 = -bounds.y1;
|
|
9827
9863
|
window.create({
|
|
9864
|
+
viewBox: {
|
|
9865
|
+
x1: x1,
|
|
9866
|
+
y1: y1,
|
|
9867
|
+
x2: bounds.x2,
|
|
9868
|
+
y2: bounds.y2
|
|
9869
|
+
},
|
|
9828
9870
|
width: width,
|
|
9829
9871
|
height: height,
|
|
9830
9872
|
canvas: canvas,
|
|
@@ -9833,14 +9875,10 @@
|
|
|
9833
9875
|
offscreen: !0,
|
|
9834
9876
|
title: ""
|
|
9835
9877
|
});
|
|
9836
|
-
const
|
|
9837
|
-
y = -bounds.y1,
|
|
9838
|
-
disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
9878
|
+
const disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
9839
9879
|
stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
width: width,
|
|
9843
|
-
height: height,
|
|
9880
|
+
transMatrix: window.getViewBoxTransform(),
|
|
9881
|
+
viewBox: window.getViewBox(),
|
|
9844
9882
|
stage: stage,
|
|
9845
9883
|
layer: stage.defaultLayer,
|
|
9846
9884
|
renderService: stage.renderService,
|
|
@@ -10664,7 +10702,7 @@
|
|
|
10664
10702
|
const mappers = this.mappingTable[e.type];
|
|
10665
10703
|
let target;
|
|
10666
10704
|
const cacheKey = `${e.canvasX}-${e.canvasY}`;
|
|
10667
|
-
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.
|
|
10705
|
+
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.viewX, e.viewY, e), e.pickParams || (this._prePointTargetCache = {
|
|
10668
10706
|
[cacheKey]: target,
|
|
10669
10707
|
stageRenderCount: null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1
|
|
10670
10708
|
})), mappers) for (let i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn(`[EventManager]: Event mapping not defined for ${e.type}`);
|
|
@@ -10808,7 +10846,7 @@
|
|
|
10808
10846
|
this.setCursor(this.manager.cursor, this.manager.cursorTarget);
|
|
10809
10847
|
}, this.onPointerUp = nativeEvent => {
|
|
10810
10848
|
if (this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
|
|
10811
|
-
const outside = this.
|
|
10849
|
+
const outside = this.isEventOutsideOfTargetViewPort(nativeEvent) ? "outside" : "",
|
|
10812
10850
|
normalizedEvents = this.normalizeToPointerData(nativeEvent);
|
|
10813
10851
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
10814
10852
|
const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);
|
|
@@ -10832,7 +10870,6 @@
|
|
|
10832
10870
|
resolution: resolution,
|
|
10833
10871
|
rootNode: rootNode,
|
|
10834
10872
|
global: global,
|
|
10835
|
-
viewport: viewport,
|
|
10836
10873
|
autoPreventDefault = !1,
|
|
10837
10874
|
clickInterval: clickInterval,
|
|
10838
10875
|
supportsTouchEvents = global.supportsTouchEvents,
|
|
@@ -10840,7 +10877,7 @@
|
|
|
10840
10877
|
} = params;
|
|
10841
10878
|
this.manager = new EventManager(rootNode, {
|
|
10842
10879
|
clickInterval: clickInterval
|
|
10843
|
-
}), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.
|
|
10880
|
+
}), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
|
|
10844
10881
|
default: "inherit",
|
|
10845
10882
|
pointer: "pointer"
|
|
10846
10883
|
}, this.resolution = resolution, this.setTargetElement(targetElement);
|
|
@@ -10882,15 +10919,7 @@
|
|
|
10882
10919
|
this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("pointermove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("mousemove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
|
|
10883
10920
|
}
|
|
10884
10921
|
mapToViewportPoint(event) {
|
|
10885
|
-
|
|
10886
|
-
{
|
|
10887
|
-
x: x,
|
|
10888
|
-
y: y
|
|
10889
|
-
} = event;
|
|
10890
|
-
return {
|
|
10891
|
-
x: x - viewport.x,
|
|
10892
|
-
y: y - viewport.y
|
|
10893
|
-
};
|
|
10922
|
+
return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
|
|
10894
10923
|
}
|
|
10895
10924
|
mapToCanvasPoint(nativeEvent) {
|
|
10896
10925
|
var _a;
|
|
@@ -10947,6 +10976,17 @@
|
|
|
10947
10976
|
transferMouseData(event, nativeEvent) {
|
|
10948
10977
|
event.isTrusted = nativeEvent.isTrusted, event.srcElement = nativeEvent.srcElement, event.timeStamp = clock.now(), event.type = nativeEvent.type, event.altKey = nativeEvent.altKey, event.button = nativeEvent.button, event.buttons = nativeEvent.buttons, event.client.x = nativeEvent.clientX, event.client.y = nativeEvent.clientY, event.ctrlKey = nativeEvent.ctrlKey, event.shiftKey = nativeEvent.shiftKey, event.metaKey = nativeEvent.metaKey, event.movement.x = nativeEvent.movementX, event.movement.y = nativeEvent.movementY, event.page.x = nativeEvent.pageX, event.page.y = nativeEvent.pageY, event.relatedTarget = null;
|
|
10949
10978
|
}
|
|
10979
|
+
isEventOutsideOfTargetViewPort(nativeEvent) {
|
|
10980
|
+
if (this.isEventOutsideOfTargetElement(nativeEvent)) return !0;
|
|
10981
|
+
if (this.domElement.getViewBox) {
|
|
10982
|
+
const p = this.mapToViewportPoint(this.mapToCanvasPoint(nativeEvent)),
|
|
10983
|
+
b = this.domElement.getViewBox(),
|
|
10984
|
+
w = b.width(),
|
|
10985
|
+
h = b.height();
|
|
10986
|
+
return !(p.x < w && p.y < h && p.x > 0 && p.y > 0);
|
|
10987
|
+
}
|
|
10988
|
+
return !1;
|
|
10989
|
+
}
|
|
10950
10990
|
isEventOutsideOfTargetElement(nativeEvent) {
|
|
10951
10991
|
let target = nativeEvent.target;
|
|
10952
10992
|
nativeEvent.composedPath && nativeEvent.composedPath().length > 0 && (target = nativeEvent.composedPath()[0]);
|
|
@@ -14375,15 +14415,12 @@
|
|
|
14375
14415
|
}
|
|
14376
14416
|
render(params, userParams) {
|
|
14377
14417
|
var _a;
|
|
14378
|
-
const stage = this.stage;
|
|
14379
14418
|
this.layerHandler.render([this], {
|
|
14380
14419
|
renderService: params.renderService,
|
|
14381
|
-
x: stage.x,
|
|
14382
|
-
y: stage.y,
|
|
14383
|
-
width: this.viewWidth,
|
|
14384
|
-
height: this.viewHeight,
|
|
14385
14420
|
stage: this.stage,
|
|
14386
14421
|
layer: this,
|
|
14422
|
+
viewBox: params.viewBox,
|
|
14423
|
+
transMatrix: params.transMatrix,
|
|
14387
14424
|
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
14388
14425
|
updateBounds: params.updateBounds
|
|
14389
14426
|
}, userParams), this.afterDrawCbs.forEach(c => c(this)), this.tryRenderSecondaryLayer(params, userParams);
|
|
@@ -14407,33 +14444,18 @@
|
|
|
14407
14444
|
throw new Error("暂不支持");
|
|
14408
14445
|
}
|
|
14409
14446
|
prepare(dirtyBounds, params) {}
|
|
14410
|
-
combineTo(target, params) {
|
|
14411
|
-
var _a, _b, _c;
|
|
14412
|
-
this.offscreen && (this.layerHandler.drawTo(target, [this], Object.assign({
|
|
14413
|
-
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
14414
|
-
renderService: params.renderService,
|
|
14415
|
-
x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
|
|
14416
|
-
y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
|
|
14417
|
-
width: this.viewWidth,
|
|
14418
|
-
height: this.viewHeight,
|
|
14419
|
-
stage: this.stage,
|
|
14420
|
-
layer: this
|
|
14421
|
-
}, params)), this.afterDrawCbs.forEach(c => c(this)));
|
|
14422
|
-
}
|
|
14423
14447
|
release() {
|
|
14424
14448
|
super.release(), this.layerHandler.release(), this.subLayers && this.subLayers.forEach(l => {
|
|
14425
14449
|
application.layerService.releaseLayer(this.stage, l.layer);
|
|
14426
14450
|
});
|
|
14427
14451
|
}
|
|
14428
14452
|
drawTo(target, params) {
|
|
14429
|
-
var _a
|
|
14453
|
+
var _a;
|
|
14430
14454
|
this.layerHandler.drawTo(target, [this], Object.assign({
|
|
14431
14455
|
background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
|
|
14432
14456
|
renderService: params.renderService,
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
width: this.viewWidth,
|
|
14436
|
-
height: this.viewHeight,
|
|
14457
|
+
viewBox: params.viewBox,
|
|
14458
|
+
transMatrix: params.transMatrix,
|
|
14437
14459
|
stage: this.stage,
|
|
14438
14460
|
layer: this
|
|
14439
14461
|
}, params)), this.afterDrawCbs.forEach(c => c(this));
|
|
@@ -17037,6 +17059,24 @@
|
|
|
17037
17059
|
getFrameCache() {
|
|
17038
17060
|
return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
|
|
17039
17061
|
}
|
|
17062
|
+
combinedStyleToCharacter(config) {
|
|
17063
|
+
const {
|
|
17064
|
+
fill: fill,
|
|
17065
|
+
stroke: stroke,
|
|
17066
|
+
fontSize: fontSize,
|
|
17067
|
+
fontFamily: fontFamily,
|
|
17068
|
+
fontStyle: fontStyle,
|
|
17069
|
+
fontWeight: fontWeight
|
|
17070
|
+
} = this.attribute;
|
|
17071
|
+
return Object.assign({
|
|
17072
|
+
fill: fill,
|
|
17073
|
+
stroke: stroke,
|
|
17074
|
+
fontSize: fontSize,
|
|
17075
|
+
fontFamily: fontFamily,
|
|
17076
|
+
fontStyle: fontStyle,
|
|
17077
|
+
fontWeight: fontWeight
|
|
17078
|
+
}, config);
|
|
17079
|
+
}
|
|
17040
17080
|
doUpdateFrameCache() {
|
|
17041
17081
|
var _a;
|
|
17042
17082
|
const {
|
|
@@ -17055,7 +17095,7 @@
|
|
|
17055
17095
|
} = this.attribute,
|
|
17056
17096
|
paragraphs = [];
|
|
17057
17097
|
for (let i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
|
|
17058
|
-
const config = textConfig[i],
|
|
17098
|
+
const config = this.combinedStyleToCharacter(textConfig[i]),
|
|
17059
17099
|
iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
|
|
17060
17100
|
if (iconCache) paragraphs.push(iconCache);else {
|
|
17061
17101
|
const icon = new RichTextIcon(config);
|
|
@@ -17065,7 +17105,7 @@
|
|
|
17065
17105
|
}, icon.richtextId = config.id, paragraphs.push(icon);
|
|
17066
17106
|
}
|
|
17067
17107
|
} else {
|
|
17068
|
-
const richTextConfig = textConfig[i];
|
|
17108
|
+
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
17069
17109
|
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
17070
17110
|
const textParts = richTextConfig.text.split("\n");
|
|
17071
17111
|
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
@@ -20123,12 +20163,11 @@
|
|
|
20123
20163
|
}
|
|
20124
20164
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
20125
20165
|
var _a, _b, _c, _d, _e;
|
|
20126
|
-
const {
|
|
20127
|
-
points: points
|
|
20128
|
-
} = area.attribute;
|
|
20129
|
-
if (points.length < 2) return;
|
|
20130
20166
|
context.beginPath();
|
|
20131
20167
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
20168
|
+
{
|
|
20169
|
+
points: points
|
|
20170
|
+
} = area.attribute,
|
|
20132
20171
|
startP = points[0];
|
|
20133
20172
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
20134
20173
|
for (let i = 1; i < points.length; i++) {
|
|
@@ -20285,7 +20324,6 @@
|
|
|
20285
20324
|
}
|
|
20286
20325
|
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20287
20326
|
var _a, _b, _c, _d;
|
|
20288
|
-
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20289
20327
|
let {
|
|
20290
20328
|
connectedType: connectedType,
|
|
20291
20329
|
connectedX: connectedX,
|
|
@@ -20294,6 +20332,7 @@
|
|
|
20294
20332
|
} = attribute;
|
|
20295
20333
|
const da = [];
|
|
20296
20334
|
if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20335
|
+
if (!cache) return;
|
|
20297
20336
|
context.beginPath();
|
|
20298
20337
|
const {
|
|
20299
20338
|
points: points,
|
|
@@ -21596,10 +21635,10 @@
|
|
|
21596
21635
|
render(group, params) {
|
|
21597
21636
|
var _a;
|
|
21598
21637
|
params.renderService.render(group, Object.assign(Object.assign({
|
|
21599
|
-
context: this.context
|
|
21638
|
+
context: this.context,
|
|
21639
|
+
viewBox: params.stage.window.getViewBox(),
|
|
21640
|
+
transMatrix: params.stage.window.getViewBoxTransform()
|
|
21600
21641
|
}, params), {
|
|
21601
|
-
x: 0,
|
|
21602
|
-
y: 0,
|
|
21603
21642
|
clear: null !== (_a = params.background) && void 0 !== _a ? _a : "#ffffff"
|
|
21604
21643
|
}));
|
|
21605
21644
|
}
|
|
@@ -21614,11 +21653,12 @@
|
|
|
21614
21653
|
const context = target.getContext(),
|
|
21615
21654
|
targetDpr = target.dpr,
|
|
21616
21655
|
{
|
|
21617
|
-
|
|
21618
|
-
|
|
21619
|
-
|
|
21620
|
-
|
|
21621
|
-
|
|
21656
|
+
viewBox: viewBox
|
|
21657
|
+
} = params,
|
|
21658
|
+
x = viewBox.x1,
|
|
21659
|
+
y = viewBox.y1,
|
|
21660
|
+
width = viewBox.width(),
|
|
21661
|
+
height = viewBox.height();
|
|
21622
21662
|
context.nativeContext.save(), context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0), params.clear && context.clearRect(x, y, width, height), context.drawImage(this.canvas.nativeCanvas, 0, 0, this.canvas.width, this.canvas.height, x, y, width, height), context.nativeContext.restore();
|
|
21623
21663
|
}
|
|
21624
21664
|
merge(layerHandlers) {}
|
|
@@ -21774,32 +21814,22 @@
|
|
|
21774
21814
|
const {
|
|
21775
21815
|
context: context,
|
|
21776
21816
|
stage: stage,
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
width: width,
|
|
21780
|
-
height: height
|
|
21817
|
+
viewBox: viewBox,
|
|
21818
|
+
transMatrix: transMatrix
|
|
21781
21819
|
} = drawContext;
|
|
21782
21820
|
if (!context) return;
|
|
21783
|
-
|
|
21784
|
-
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
21785
|
-
const t = context.nativeContext.getTransform();
|
|
21786
|
-
context.setTransformFromMatrix(t, !0, 1);
|
|
21787
|
-
}
|
|
21788
|
-
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
21789
|
-
const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
21821
|
+
const dirtyBounds = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());
|
|
21790
21822
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
21791
21823
|
const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
21792
21824
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
21793
21825
|
}
|
|
21794
21826
|
const d = context.dpr % 1;
|
|
21795
|
-
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds)
|
|
21796
|
-
const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
21797
|
-
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
21827
|
+
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(), context.setTransformForCurrent(!0), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
21798
21828
|
var _a, _b;
|
|
21799
21829
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
21800
21830
|
}).forEach(group => {
|
|
21801
21831
|
group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
|
|
21802
|
-
}), context.restore(), context.
|
|
21832
|
+
}), context.restore(), context.draw(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1;
|
|
21803
21833
|
}
|
|
21804
21834
|
doRegister() {
|
|
21805
21835
|
throw new Error("暂不支持");
|
|
@@ -21880,7 +21910,7 @@
|
|
|
21880
21910
|
}
|
|
21881
21911
|
getRenderContribution(graphic) {
|
|
21882
21912
|
let renderer;
|
|
21883
|
-
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType
|
|
21913
|
+
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
21884
21914
|
}
|
|
21885
21915
|
renderItem(graphic, drawContext, params) {
|
|
21886
21916
|
if (this.InterceptorContributions.length) for (let i = 0; i < this.InterceptorContributions.length; i++) {
|
|
@@ -21912,40 +21942,31 @@
|
|
|
21912
21942
|
selectRenderByType(type) {
|
|
21913
21943
|
return Logger.getInstance().warn("未知错误,不应该走到这里"), null;
|
|
21914
21944
|
}
|
|
21915
|
-
selectRenderByNumberType(type
|
|
21916
|
-
|
|
21917
|
-
if (graphic.attribute.renderStyle) {
|
|
21918
|
-
const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
|
|
21919
|
-
data = currentRenderMap && currentRenderMap.get(type);
|
|
21920
|
-
}
|
|
21921
|
-
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
21945
|
+
selectRenderByNumberType(type) {
|
|
21946
|
+
return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
21922
21947
|
}
|
|
21923
21948
|
clearScreen(renderService, context, drawContext) {
|
|
21924
21949
|
var _a, _b;
|
|
21925
21950
|
const {
|
|
21926
|
-
|
|
21927
|
-
|
|
21951
|
+
clear: clear,
|
|
21952
|
+
viewBox: viewBox
|
|
21953
|
+
} = drawContext,
|
|
21954
|
+
width = viewBox.width(),
|
|
21955
|
+
height = viewBox.height();
|
|
21928
21956
|
if (clear) {
|
|
21929
|
-
|
|
21930
|
-
{
|
|
21931
|
-
width = canvas.width,
|
|
21932
|
-
height = canvas.height
|
|
21933
|
-
} = drawContext,
|
|
21934
|
-
x = 0,
|
|
21935
|
-
y = 0;
|
|
21936
|
-
context.clearRect(x, y, width, height);
|
|
21957
|
+
context.clearRect(0, 0, width, height);
|
|
21937
21958
|
const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
|
|
21938
21959
|
if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
|
|
21939
21960
|
const res = stage.resources.get(clear);
|
|
21940
|
-
res && "success" === res.state && res.data && context.drawImage(res.data,
|
|
21961
|
+
res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
|
|
21941
21962
|
} else context.fillStyle = createColor(context, clear, {
|
|
21942
21963
|
AABBBounds: {
|
|
21943
|
-
x1:
|
|
21944
|
-
y1:
|
|
21945
|
-
x2:
|
|
21946
|
-
y2:
|
|
21964
|
+
x1: 0,
|
|
21965
|
+
y1: 0,
|
|
21966
|
+
x2: 0 + width,
|
|
21967
|
+
y2: 0 + height
|
|
21947
21968
|
}
|
|
21948
|
-
}, 0, 0), context.fillRect(
|
|
21969
|
+
}, 0, 0), context.fillRect(0, 0, width, height);
|
|
21949
21970
|
}
|
|
21950
21971
|
}
|
|
21951
21972
|
afterDraw(renderService, drawParams) {}
|
|
@@ -22202,25 +22223,16 @@
|
|
|
22202
22223
|
this.currentRenderService = renderService;
|
|
22203
22224
|
const {
|
|
22204
22225
|
context: context,
|
|
22205
|
-
|
|
22206
|
-
y = 0
|
|
22226
|
+
viewBox: viewBox
|
|
22207
22227
|
} = drawContext;
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
var _a, _b;
|
|
22217
|
-
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22218
|
-
}).forEach(group => {
|
|
22219
|
-
this.renderGroup(group, drawContext);
|
|
22220
|
-
}), this.hooks.completeDraw.tap("top-draw", () => {
|
|
22221
|
-
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
|
|
22222
|
-
});
|
|
22223
|
-
}
|
|
22228
|
+
context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(viewBox.x1, viewBox.y1, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
22229
|
+
var _a, _b;
|
|
22230
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22231
|
+
}).forEach(group => {
|
|
22232
|
+
this.renderGroup(group, drawContext);
|
|
22233
|
+
}), this.hooks.completeDraw.tap("top-draw", () => {
|
|
22234
|
+
context.restore(), context.restore(), context.draw(), context.inuse = !1, this.rendering = !1;
|
|
22235
|
+
}));
|
|
22224
22236
|
});
|
|
22225
22237
|
}
|
|
22226
22238
|
_increaseRender(group, drawContext) {
|
|
@@ -22390,12 +22402,10 @@
|
|
|
22390
22402
|
if (!layer || !group.layer.subLayers) return;
|
|
22391
22403
|
const subLayer = group.layer.subLayers.get(group._uid);
|
|
22392
22404
|
subLayer && subLayer.drawContribution && subLayer.drawContribution.draw(stage.renderService, Object.assign({
|
|
22393
|
-
x: stage.x,
|
|
22394
|
-
y: stage.y,
|
|
22395
|
-
width: layer.viewWidth,
|
|
22396
|
-
height: layer.viewHeight,
|
|
22397
22405
|
stage: stage,
|
|
22398
22406
|
layer: layer,
|
|
22407
|
+
viewBox: stage.window.getViewBox(),
|
|
22408
|
+
transMatrix: stage.window.getViewBoxTransform(),
|
|
22399
22409
|
clear: "transparent",
|
|
22400
22410
|
renderService: stage.renderService,
|
|
22401
22411
|
updateBounds: !1,
|
|
@@ -22944,22 +22954,24 @@
|
|
|
22944
22954
|
};
|
|
22945
22955
|
class Stage extends Group$1 {
|
|
22946
22956
|
set viewBox(b) {
|
|
22947
|
-
this.
|
|
22957
|
+
this.window.setViewBox(b);
|
|
22948
22958
|
}
|
|
22949
22959
|
get viewBox() {
|
|
22950
|
-
return this.
|
|
22960
|
+
return this.window.getViewBox();
|
|
22951
22961
|
}
|
|
22952
22962
|
get x() {
|
|
22953
|
-
return this.
|
|
22963
|
+
return this.window.getViewBox().x1;
|
|
22954
22964
|
}
|
|
22955
22965
|
set x(x) {
|
|
22956
|
-
|
|
22966
|
+
const b = this.window.getViewBox();
|
|
22967
|
+
b.translate(x - b.x1, 0), this.window.setViewBox(b);
|
|
22957
22968
|
}
|
|
22958
22969
|
get y() {
|
|
22959
|
-
return this.
|
|
22970
|
+
return this.window.getViewBox().y1;
|
|
22960
22971
|
}
|
|
22961
22972
|
set y(y) {
|
|
22962
|
-
|
|
22973
|
+
const b = this.window.getViewBox();
|
|
22974
|
+
b.translate(0, y - b.y1), this.window.setViewBox(b);
|
|
22963
22975
|
}
|
|
22964
22976
|
get width() {
|
|
22965
22977
|
return this.window.width;
|
|
@@ -22968,13 +22980,13 @@
|
|
|
22968
22980
|
this.resize(w, this.height);
|
|
22969
22981
|
}
|
|
22970
22982
|
get viewWidth() {
|
|
22971
|
-
return this.
|
|
22983
|
+
return this.window.getViewBox().width();
|
|
22972
22984
|
}
|
|
22973
22985
|
set viewWidth(w) {
|
|
22974
22986
|
this.resizeView(w, this.viewHeight);
|
|
22975
22987
|
}
|
|
22976
22988
|
get viewHeight() {
|
|
22977
|
-
return this.
|
|
22989
|
+
return this.window.getViewBox().height();
|
|
22978
22990
|
}
|
|
22979
22991
|
set viewHeight(h) {
|
|
22980
22992
|
this.resizeView(this.viewWidth, h);
|
|
@@ -23008,7 +23020,13 @@
|
|
|
23008
23020
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23009
23021
|
var _a;
|
|
23010
23022
|
super({}), this._onVisibleChange = visible => {
|
|
23011
|
-
|
|
23023
|
+
if (!(this._skipRender < 0)) if (visible) {
|
|
23024
|
+
if (this.dirtyBounds) {
|
|
23025
|
+
const b = this.window.getViewBox();
|
|
23026
|
+
this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.height());
|
|
23027
|
+
}
|
|
23028
|
+
this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
|
|
23029
|
+
} else this._skipRender = 1;
|
|
23012
23030
|
}, this.beforeRender = stage => {
|
|
23013
23031
|
this._beforeRender && this._beforeRender(stage);
|
|
23014
23032
|
}, this.afterRender = stage => {
|
|
@@ -23019,17 +23037,24 @@
|
|
|
23019
23037
|
}, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.pluginService.active(this, params), this.window.create({
|
|
23020
23038
|
width: params.width,
|
|
23021
23039
|
height: params.height,
|
|
23040
|
+
viewBox: params.viewBox,
|
|
23022
23041
|
container: params.container,
|
|
23023
23042
|
dpr: params.dpr || this.global.devicePixelRatio,
|
|
23024
23043
|
canvasControled: !1 !== params.canvasControled,
|
|
23025
23044
|
title: params.title || "",
|
|
23026
23045
|
canvas: params.canvas
|
|
23027
|
-
}), this.
|
|
23046
|
+
}), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
|
|
23028
23047
|
main: !0
|
|
23029
23048
|
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
23030
23049
|
background: this._background
|
|
23031
23050
|
});
|
|
23032
23051
|
}
|
|
23052
|
+
pauseRender() {
|
|
23053
|
+
this._skipRender = -1;
|
|
23054
|
+
}
|
|
23055
|
+
resumeRender() {
|
|
23056
|
+
this._skipRender = 0;
|
|
23057
|
+
}
|
|
23033
23058
|
tryInitEventSystem() {
|
|
23034
23059
|
this.global.supportEvent && !this._eventSystem && (this._eventSystem = new EventSystem(Object.assign({
|
|
23035
23060
|
targetElement: this.window,
|
|
@@ -23037,22 +23062,7 @@
|
|
|
23037
23062
|
rootNode: this,
|
|
23038
23063
|
global: this.global,
|
|
23039
23064
|
supportsPointerEvents: this.params.supportsPointerEvents,
|
|
23040
|
-
supportsTouchEvents: this.params.supportsTouchEvents
|
|
23041
|
-
viewport: {
|
|
23042
|
-
viewBox: this._viewBox,
|
|
23043
|
-
get x() {
|
|
23044
|
-
return this.viewBox.x1;
|
|
23045
|
-
},
|
|
23046
|
-
get y() {
|
|
23047
|
-
return this.viewBox.y1;
|
|
23048
|
-
},
|
|
23049
|
-
get width() {
|
|
23050
|
-
return this.viewBox.width();
|
|
23051
|
-
},
|
|
23052
|
-
get height() {
|
|
23053
|
-
return this.viewBox.height();
|
|
23054
|
-
}
|
|
23055
|
-
}
|
|
23065
|
+
supportsTouchEvents: this.params.supportsTouchEvents
|
|
23056
23066
|
}, this.params.event)));
|
|
23057
23067
|
}
|
|
23058
23068
|
preventRender(prevent) {
|
|
@@ -23199,7 +23209,7 @@
|
|
|
23199
23209
|
return this.pluginService.findPluginsByName(name);
|
|
23200
23210
|
}
|
|
23201
23211
|
tryUpdateAABBBounds() {
|
|
23202
|
-
const viewBox = this.
|
|
23212
|
+
const viewBox = this.window.getViewBox();
|
|
23203
23213
|
return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
|
|
23204
23214
|
}
|
|
23205
23215
|
combineLayer(ILayer1, ILayer2) {
|
|
@@ -23226,12 +23236,12 @@
|
|
|
23226
23236
|
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
23227
23237
|
}
|
|
23228
23238
|
clearViewBox(color) {
|
|
23229
|
-
this.window.clearViewBox(
|
|
23239
|
+
this.window.clearViewBox(color);
|
|
23230
23240
|
}
|
|
23231
23241
|
render(layers, params) {
|
|
23232
23242
|
this.ticker.start(), this.timeline.resume();
|
|
23233
23243
|
const state = this.state;
|
|
23234
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children
|
|
23244
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
23235
23245
|
}
|
|
23236
23246
|
combineLayersToWindow() {}
|
|
23237
23247
|
renderNextFrame(layers, force) {
|
|
@@ -23244,7 +23254,7 @@
|
|
|
23244
23254
|
_doRenderInThisFrame() {
|
|
23245
23255
|
this.timeline.resume(), this.ticker.start();
|
|
23246
23256
|
const state = this.state;
|
|
23247
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.
|
|
23257
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
23248
23258
|
}
|
|
23249
23259
|
renderLayerList(layerList, params) {
|
|
23250
23260
|
const list = [];
|
|
@@ -23256,14 +23266,17 @@
|
|
|
23256
23266
|
layer.renderCount > this.renderCount || (layer.renderCount = this.renderCount + 1, layer.render({
|
|
23257
23267
|
renderService: this.renderService,
|
|
23258
23268
|
background: layer === this.defaultLayer ? this.background : void 0,
|
|
23259
|
-
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
23269
|
+
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
|
|
23270
|
+
viewBox: this.window.getViewBox(),
|
|
23271
|
+
transMatrix: this.window.getViewBoxTransform()
|
|
23260
23272
|
}, Object.assign({
|
|
23261
|
-
renderStyle: this.renderStyle
|
|
23262
|
-
keepMatrix: this.params.renderKeepMatrix
|
|
23273
|
+
renderStyle: this.renderStyle
|
|
23263
23274
|
}, params)));
|
|
23264
23275
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
23265
23276
|
renderService: this.renderService,
|
|
23266
|
-
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
23277
|
+
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
|
|
23278
|
+
viewBox: this.window.getViewBox(),
|
|
23279
|
+
transMatrix: this.window.getViewBoxTransform()
|
|
23267
23280
|
}, Object.assign({
|
|
23268
23281
|
renderStyle: this.renderStyle
|
|
23269
23282
|
}, params));
|
|
@@ -23274,9 +23287,9 @@
|
|
|
23274
23287
|
}
|
|
23275
23288
|
resize(w, h) {
|
|
23276
23289
|
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
23277
|
-
this.window.resize(w, h), this.forEachChildren(c => {
|
|
23290
|
+
this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
|
|
23278
23291
|
c.resize(w, h);
|
|
23279
|
-
}), this.
|
|
23292
|
+
}), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
|
|
23280
23293
|
}
|
|
23281
23294
|
resizeView(w, h) {
|
|
23282
23295
|
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
@@ -23330,47 +23343,41 @@
|
|
|
23330
23343
|
getLayer(name) {
|
|
23331
23344
|
return this.children.filter(layer => layer.name === name)[0];
|
|
23332
23345
|
}
|
|
23333
|
-
renderTo(window
|
|
23346
|
+
renderTo(window) {
|
|
23334
23347
|
this.forEachChildren((layer, i) => {
|
|
23335
|
-
layer.drawTo(window,
|
|
23348
|
+
layer.drawTo(window, {
|
|
23336
23349
|
renderService: this.renderService,
|
|
23350
|
+
viewBox: window.getViewBox(),
|
|
23351
|
+
transMatrix: window.getViewBoxTransform(),
|
|
23337
23352
|
background: layer === this.defaultLayer ? this.background : void 0,
|
|
23338
23353
|
clear: 0 === i,
|
|
23339
23354
|
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
23340
|
-
})
|
|
23355
|
+
});
|
|
23341
23356
|
});
|
|
23342
23357
|
}
|
|
23343
23358
|
renderToNewWindow() {
|
|
23344
|
-
let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
23345
23359
|
let viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
23346
|
-
const window = container.get(VWindow)
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23360
|
+
const window = container.get(VWindow),
|
|
23361
|
+
x1 = viewBox ? -viewBox.x1 : 0,
|
|
23362
|
+
y1 = viewBox ? -viewBox.y1 : 0,
|
|
23363
|
+
x2 = viewBox ? viewBox.x2 : this.viewWidth,
|
|
23364
|
+
y2 = viewBox ? viewBox.y2 : this.viewHeight,
|
|
23365
|
+
width = viewBox ? viewBox.width() : this.viewWidth,
|
|
23366
|
+
height = viewBox ? viewBox.height() : this.viewHeight;
|
|
23367
|
+
return window.create({
|
|
23368
|
+
viewBox: {
|
|
23369
|
+
x1: x1,
|
|
23370
|
+
y1: y1,
|
|
23371
|
+
x2: x2,
|
|
23372
|
+
y2: y2
|
|
23373
|
+
},
|
|
23374
|
+
width: width,
|
|
23375
|
+
height: height,
|
|
23350
23376
|
dpr: this.window.dpr,
|
|
23351
23377
|
canvasControled: !0,
|
|
23352
23378
|
offscreen: !0,
|
|
23353
23379
|
title: ""
|
|
23354
|
-
});
|
|
23355
|
-
const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x),
|
|
23356
|
-
height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
|
|
23357
|
-
window.create({
|
|
23358
|
-
width: width,
|
|
23359
|
-
height: height,
|
|
23360
|
-
dpr: this.window.dpr,
|
|
23361
|
-
canvasControled: !0,
|
|
23362
|
-
offscreen: !0,
|
|
23363
|
-
title: ""
|
|
23364
|
-
});
|
|
23365
|
-
}
|
|
23366
|
-
const x = viewBox ? -viewBox.x1 : 0,
|
|
23367
|
-
y = viewBox ? -viewBox.y1 : 0;
|
|
23368
|
-
return this.renderTo(window, {
|
|
23369
|
-
x: x,
|
|
23370
|
-
y: y,
|
|
23371
|
-
width: viewBox ? viewBox.x2 : window.width,
|
|
23372
|
-
height: viewBox ? viewBox.y2 : window.height
|
|
23373
|
-
}), window;
|
|
23380
|
+
}), this.renderTo(window), window;
|
|
23374
23381
|
}
|
|
23375
23382
|
toCanvas() {
|
|
23376
23383
|
let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
@@ -23400,7 +23407,7 @@
|
|
|
23400
23407
|
__metadata$M = undefined && undefined.__metadata || function (k, v) {
|
|
23401
23408
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
23402
23409
|
};
|
|
23403
|
-
const initMatrix
|
|
23410
|
+
const initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
23404
23411
|
globalPoint = {
|
|
23405
23412
|
x: 0,
|
|
23406
23413
|
y: 0
|
|
@@ -23410,7 +23417,7 @@
|
|
|
23410
23417
|
return this.path;
|
|
23411
23418
|
}
|
|
23412
23419
|
constructor(canvas, dpr) {
|
|
23413
|
-
this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D();
|
|
23420
|
+
this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D(), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
23414
23421
|
}
|
|
23415
23422
|
getCanvas() {
|
|
23416
23423
|
throw new Error("不支持getCanvas");
|
|
@@ -23594,7 +23601,10 @@
|
|
|
23594
23601
|
clearMatrix() {
|
|
23595
23602
|
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
23596
23603
|
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
23597
|
-
this.setTransformFromMatrix(initMatrix
|
|
23604
|
+
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
23605
|
+
}
|
|
23606
|
+
setClearMatrix(a, b, c, d, e, f) {
|
|
23607
|
+
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
23598
23608
|
}
|
|
23599
23609
|
onlyTranslate() {
|
|
23600
23610
|
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
@@ -23800,7 +23810,7 @@
|
|
|
23800
23810
|
};
|
|
23801
23811
|
let BaseWindowHandlerContribution = class {
|
|
23802
23812
|
constructor() {
|
|
23803
|
-
this._uid = Generator.GenAutoIncrementId();
|
|
23813
|
+
this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
23804
23814
|
}
|
|
23805
23815
|
onChange(cb) {
|
|
23806
23816
|
this._onChangeCb = cb;
|
|
@@ -23821,6 +23831,18 @@
|
|
|
23821
23831
|
left: 0
|
|
23822
23832
|
};
|
|
23823
23833
|
}
|
|
23834
|
+
setViewBox(vb) {
|
|
23835
|
+
this.viewBox.setValue(vb.x1, vb.y1, vb.x2, vb.y2);
|
|
23836
|
+
}
|
|
23837
|
+
getViewBox() {
|
|
23838
|
+
return this.viewBox;
|
|
23839
|
+
}
|
|
23840
|
+
setViewBoxTransform(a, b, c, d, e, f) {
|
|
23841
|
+
this.modelMatrix.setValue(a, b, c, d, e, f);
|
|
23842
|
+
}
|
|
23843
|
+
getViewBoxTransform() {
|
|
23844
|
+
return this.modelMatrix;
|
|
23845
|
+
}
|
|
23824
23846
|
};
|
|
23825
23847
|
BaseWindowHandlerContribution = __decorate$_([injectable(), __metadata$K("design:paramtypes", [])], BaseWindowHandlerContribution);
|
|
23826
23848
|
|
|
@@ -23852,23 +23874,14 @@
|
|
|
23852
23874
|
group: null
|
|
23853
23875
|
};
|
|
23854
23876
|
params.pickerService = this;
|
|
23855
|
-
|
|
23856
|
-
|
|
23857
|
-
if (
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
}
|
|
23861
|
-
if (this.pickContext) if (params.keepMatrix) {
|
|
23862
|
-
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
23863
|
-
const t = this.pickContext.nativeContext.getTransform();
|
|
23864
|
-
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
23865
|
-
}
|
|
23866
|
-
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
23867
|
-
params.pickContext = this.pickContext;
|
|
23868
|
-
const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
23877
|
+
const w = params.bounds.width(),
|
|
23878
|
+
h = params.bounds.height();
|
|
23879
|
+
if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
|
|
23880
|
+
this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
|
|
23881
|
+
const parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
23869
23882
|
let group;
|
|
23870
23883
|
for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
|
|
23871
|
-
if (result.graphic || (result.group = group), this.pickContext &&
|
|
23884
|
+
if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
|
|
23872
23885
|
let g = result.graphic;
|
|
23873
23886
|
for (; g.parent;) g = g.parent;
|
|
23874
23887
|
g.shadowHost && (result.params = {
|
|
@@ -27995,7 +28008,6 @@
|
|
|
27995
28008
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
27996
28009
|
};
|
|
27997
28010
|
const outP = [0, 0, 0],
|
|
27998
|
-
initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
27999
28011
|
addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) => {
|
|
28000
28012
|
if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
|
|
28001
28013
|
const step = pi$1 / 3 * (endAngle > startAngle ? 1 : -1);
|
|
@@ -28126,7 +28138,7 @@
|
|
|
28126
28138
|
}), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
|
|
28127
28139
|
const context = canvas.nativeCanvas.getContext("2d");
|
|
28128
28140
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
28129
|
-
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
28141
|
+
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
28130
28142
|
}
|
|
28131
28143
|
reset() {
|
|
28132
28144
|
this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
@@ -28488,7 +28500,10 @@
|
|
|
28488
28500
|
clearMatrix() {
|
|
28489
28501
|
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
28490
28502
|
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
28491
|
-
this.setTransformFromMatrix(
|
|
28503
|
+
this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
|
|
28504
|
+
}
|
|
28505
|
+
setClearMatrix(a, b, c, d, e, f) {
|
|
28506
|
+
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
28492
28507
|
}
|
|
28493
28508
|
onlyTranslate() {
|
|
28494
28509
|
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
@@ -28719,7 +28734,7 @@
|
|
|
28719
28734
|
return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
|
|
28720
28735
|
}
|
|
28721
28736
|
constructor() {
|
|
28722
|
-
super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global;
|
|
28737
|
+
super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
|
|
28723
28738
|
}
|
|
28724
28739
|
getTitle() {
|
|
28725
28740
|
return this.canvas.id.toString();
|
|
@@ -28849,8 +28864,9 @@
|
|
|
28849
28864
|
bottom: 0
|
|
28850
28865
|
};
|
|
28851
28866
|
}
|
|
28852
|
-
clearViewBox(
|
|
28853
|
-
const
|
|
28867
|
+
clearViewBox(color) {
|
|
28868
|
+
const vb = this.viewBox,
|
|
28869
|
+
context = this.getContext(),
|
|
28854
28870
|
dpr = this.getDpr();
|
|
28855
28871
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
28856
28872
|
}
|
|
@@ -29284,8 +29300,9 @@
|
|
|
29284
29300
|
bottom: 0
|
|
29285
29301
|
};
|
|
29286
29302
|
}
|
|
29287
|
-
clearViewBox(
|
|
29288
|
-
const
|
|
29303
|
+
clearViewBox(color) {
|
|
29304
|
+
const vb = this.viewBox,
|
|
29305
|
+
context = this.getContext(),
|
|
29289
29306
|
dpr = this.getDpr();
|
|
29290
29307
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
29291
29308
|
}
|
|
@@ -29746,8 +29763,9 @@
|
|
|
29746
29763
|
bottom: 0
|
|
29747
29764
|
};
|
|
29748
29765
|
}
|
|
29749
|
-
clearViewBox(
|
|
29750
|
-
const
|
|
29766
|
+
clearViewBox(color) {
|
|
29767
|
+
const vb = this.viewBox,
|
|
29768
|
+
context = this.getContext(),
|
|
29751
29769
|
dpr = this.getDpr();
|
|
29752
29770
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
29753
29771
|
}
|
|
@@ -30026,7 +30044,7 @@
|
|
|
30026
30044
|
getBoundingClientRect() {
|
|
30027
30045
|
return null;
|
|
30028
30046
|
}
|
|
30029
|
-
clearViewBox(
|
|
30047
|
+
clearViewBox(color) {}
|
|
30030
30048
|
};
|
|
30031
30049
|
NodeWindowHandlerContribution.env = "node", NodeWindowHandlerContribution = __decorate$C([injectable(), __param$p(0, inject(VGlobal)), __metadata$t("design:paramtypes", [Object])], NodeWindowHandlerContribution);
|
|
30032
30050
|
const nodeWindowModule = new ContainerModule(bind => {
|
|
@@ -30391,8 +30409,9 @@
|
|
|
30391
30409
|
bottom: 0
|
|
30392
30410
|
};
|
|
30393
30411
|
}
|
|
30394
|
-
clearViewBox(
|
|
30395
|
-
const
|
|
30412
|
+
clearViewBox(color) {
|
|
30413
|
+
const vb = this.viewBox,
|
|
30414
|
+
context = this.getContext(),
|
|
30396
30415
|
dpr = this.getDpr();
|
|
30397
30416
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
30398
30417
|
}
|
|
@@ -30696,8 +30715,9 @@
|
|
|
30696
30715
|
bottom: 0
|
|
30697
30716
|
};
|
|
30698
30717
|
}
|
|
30699
|
-
clearViewBox(
|
|
30700
|
-
const
|
|
30718
|
+
clearViewBox(color) {
|
|
30719
|
+
const vb = this.viewBox,
|
|
30720
|
+
context = this.getContext(),
|
|
30701
30721
|
dpr = this.getDpr();
|
|
30702
30722
|
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
30703
30723
|
}
|
|
@@ -37320,10 +37340,10 @@
|
|
|
37320
37340
|
}, this._statePointToData = state => state, this._onHandlerPointerDown = (e, tag) => {
|
|
37321
37341
|
e.stopPropagation(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vglobal.env && (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37322
37342
|
capture: !0
|
|
37323
|
-
}), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37343
|
+
}), vglobal.addEventListener("pointerup", this._onHandlerPointerUp.bind(this))), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37324
37344
|
capture: !0
|
|
37325
37345
|
});
|
|
37326
|
-
}, this.
|
|
37346
|
+
}, this._onHandlerPointerMove = delayMap$2[this.attribute.delayType](e => {
|
|
37327
37347
|
e.stopPropagation();
|
|
37328
37348
|
const {
|
|
37329
37349
|
start: startAttr,
|
|
@@ -37341,33 +37361,12 @@
|
|
|
37341
37361
|
start: start,
|
|
37342
37362
|
end: end
|
|
37343
37363
|
} = this.state;
|
|
37344
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1),
|
|
37364
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), this._dispatchEvent("change", {
|
|
37345
37365
|
start: start,
|
|
37346
37366
|
end: end,
|
|
37347
37367
|
tag: this._activeTag
|
|
37348
37368
|
}));
|
|
37349
|
-
}, this.
|
|
37350
|
-
e.preventDefault();
|
|
37351
|
-
const {
|
|
37352
|
-
start: start,
|
|
37353
|
-
end: end,
|
|
37354
|
-
brushSelect: brushSelect,
|
|
37355
|
-
realTime = !0
|
|
37356
|
-
} = this.attribute;
|
|
37357
|
-
if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
|
|
37358
|
-
const pos = this.eventPosToStagePos(e);
|
|
37359
|
-
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
37360
|
-
}
|
|
37361
|
-
this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
|
|
37362
|
-
start: this.state.start,
|
|
37363
|
-
end: this.state.end,
|
|
37364
|
-
tag: this._activeTag
|
|
37365
|
-
})), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37366
|
-
capture: !0
|
|
37367
|
-
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37368
|
-
capture: !0
|
|
37369
|
-
}), this.removeEventListener("pointerup", this._onHandlerPointerUp);
|
|
37370
|
-
};
|
|
37369
|
+
}, this.attribute.delayTime);
|
|
37371
37370
|
const {
|
|
37372
37371
|
position: position,
|
|
37373
37372
|
showDetail: showDetail
|
|
@@ -37420,6 +37419,28 @@
|
|
|
37420
37419
|
y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
|
|
37421
37420
|
};
|
|
37422
37421
|
}
|
|
37422
|
+
_onHandlerPointerUp(e) {
|
|
37423
|
+
e.preventDefault();
|
|
37424
|
+
const {
|
|
37425
|
+
start: start,
|
|
37426
|
+
end: end,
|
|
37427
|
+
brushSelect: brushSelect,
|
|
37428
|
+
realTime = !0
|
|
37429
|
+
} = this.attribute;
|
|
37430
|
+
if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
|
|
37431
|
+
const pos = this.eventPosToStagePos(e);
|
|
37432
|
+
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
37433
|
+
}
|
|
37434
|
+
this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
|
|
37435
|
+
start: this.state.start,
|
|
37436
|
+
end: this.state.end,
|
|
37437
|
+
tag: this._activeTag
|
|
37438
|
+
})), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37439
|
+
capture: !0
|
|
37440
|
+
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp.bind(this))), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
37441
|
+
capture: !0
|
|
37442
|
+
});
|
|
37443
|
+
}
|
|
37423
37444
|
_onHandlerPointerEnter(e) {
|
|
37424
37445
|
e.stopPropagation(), this._showText = !0, this.renderText();
|
|
37425
37446
|
}
|
|
@@ -37608,7 +37629,7 @@
|
|
|
37608
37629
|
}, this._layoutAttrFromConfig;
|
|
37609
37630
|
}
|
|
37610
37631
|
render() {
|
|
37611
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
37632
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
37612
37633
|
this._layoutAttrFromConfig = null;
|
|
37613
37634
|
const {
|
|
37614
37635
|
orient: orient,
|
|
@@ -37641,15 +37662,15 @@
|
|
|
37641
37662
|
height: height,
|
|
37642
37663
|
cursor: brushSelect ? "crosshair" : "auto"
|
|
37643
37664
|
}, backgroundStyle), {
|
|
37644
|
-
pickable: !zoomLock
|
|
37645
|
-
}), "rect"), (null === (
|
|
37665
|
+
pickable: !zoomLock
|
|
37666
|
+
}), "rect"), (null === (_c = backgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setPreviewAttributes("line", group), (null === (_d = backgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("area", group), brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
37646
37667
|
x: position.x + start * width,
|
|
37647
37668
|
y: position.y,
|
|
37648
37669
|
width: (end - start) * width,
|
|
37649
37670
|
height: height,
|
|
37650
37671
|
cursor: brushSelect ? "crosshair" : "move"
|
|
37651
37672
|
}, selectedBackgroundStyle), {
|
|
37652
|
-
pickable: !zoomLock
|
|
37673
|
+
pickable: !zoomLock
|
|
37653
37674
|
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
37654
37675
|
x: position.x,
|
|
37655
37676
|
y: position.y + start * height,
|
|
@@ -37657,41 +37678,41 @@
|
|
|
37657
37678
|
height: (end - start) * height,
|
|
37658
37679
|
cursor: brushSelect ? "crosshair" : "move"
|
|
37659
37680
|
}, selectedBackgroundStyle), {
|
|
37660
|
-
pickable: !zoomLock
|
|
37661
|
-
}), "rect"), (null === (
|
|
37681
|
+
pickable: !zoomLock
|
|
37682
|
+
}), "rect"), (null === (_e = selectedBackgroundChartStyle.line) || void 0 === _e ? void 0 : _e.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_f = selectedBackgroundChartStyle.area) || void 0 === _f ? void 0 : _f.visible) && this.setSelectedPreviewAttributes("area", group), this._isHorizontal) {
|
|
37662
37683
|
if (middleHandlerStyle.visible) {
|
|
37663
|
-
const middleHandlerBackgroundSize = (null === (
|
|
37684
|
+
const middleHandlerBackgroundSize = (null === (_g = middleHandlerStyle.background) || void 0 === _g ? void 0 : _g.size) || 10;
|
|
37664
37685
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
37665
37686
|
x: position.x + start * width,
|
|
37666
37687
|
y: position.y - middleHandlerBackgroundSize,
|
|
37667
37688
|
width: (end - start) * width,
|
|
37668
37689
|
height: middleHandlerBackgroundSize
|
|
37669
|
-
}, null === (
|
|
37670
|
-
pickable: !zoomLock
|
|
37690
|
+
}, null === (_h = middleHandlerStyle.background) || void 0 === _h ? void 0 : _h.style), {
|
|
37691
|
+
pickable: !zoomLock
|
|
37671
37692
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
37672
37693
|
x: position.x + (start + end) / 2 * width,
|
|
37673
37694
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
37674
37695
|
strokeBoundsBuffer: 0,
|
|
37675
37696
|
angle: 0,
|
|
37676
|
-
symbolType: null !== (
|
|
37697
|
+
symbolType: null !== (_k = null === (_j = middleHandlerStyle.icon) || void 0 === _j ? void 0 : _j.symbolType) && void 0 !== _k ? _k : "square"
|
|
37677
37698
|
}, middleHandlerStyle.icon), {
|
|
37678
|
-
pickable: !zoomLock
|
|
37699
|
+
pickable: !zoomLock
|
|
37679
37700
|
}), "symbol");
|
|
37680
37701
|
}
|
|
37681
37702
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
37682
37703
|
x: position.x + start * width,
|
|
37683
37704
|
y: position.y + height / 2,
|
|
37684
37705
|
size: height,
|
|
37685
|
-
symbolType: null !== (
|
|
37706
|
+
symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
|
|
37686
37707
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
37687
|
-
pickable: !zoomLock
|
|
37708
|
+
pickable: !zoomLock
|
|
37688
37709
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
37689
37710
|
x: position.x + end * width,
|
|
37690
37711
|
y: position.y + height / 2,
|
|
37691
37712
|
size: height,
|
|
37692
|
-
symbolType: null !== (
|
|
37713
|
+
symbolType: null !== (_m = endHandlerStyle.symbolType) && void 0 !== _m ? _m : "square"
|
|
37693
37714
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
37694
|
-
pickable: !zoomLock
|
|
37715
|
+
pickable: !zoomLock
|
|
37695
37716
|
}), "symbol");
|
|
37696
37717
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
37697
37718
|
startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
|
|
@@ -37720,38 +37741,38 @@
|
|
|
37720
37741
|
}), "rect");
|
|
37721
37742
|
} else {
|
|
37722
37743
|
if (middleHandlerStyle.visible) {
|
|
37723
|
-
const middleHandlerBackgroundSize = (null === (
|
|
37744
|
+
const middleHandlerBackgroundSize = (null === (_o = middleHandlerStyle.background) || void 0 === _o ? void 0 : _o.size) || 10;
|
|
37724
37745
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
37725
37746
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
37726
37747
|
y: position.y + start * height,
|
|
37727
37748
|
width: middleHandlerBackgroundSize,
|
|
37728
37749
|
height: (end - start) * height
|
|
37729
|
-
}, null === (
|
|
37730
|
-
pickable: !zoomLock
|
|
37750
|
+
}, null === (_p = middleHandlerStyle.background) || void 0 === _p ? void 0 : _p.style), {
|
|
37751
|
+
pickable: !zoomLock
|
|
37731
37752
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
37732
37753
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
|
|
37733
37754
|
y: position.y + (start + end) / 2 * height,
|
|
37734
37755
|
angle: Math.PI / 180 * 90,
|
|
37735
|
-
symbolType: null !== (
|
|
37756
|
+
symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square",
|
|
37736
37757
|
strokeBoundsBuffer: 0
|
|
37737
37758
|
}, middleHandlerStyle.icon), {
|
|
37738
|
-
pickable: !zoomLock
|
|
37759
|
+
pickable: !zoomLock
|
|
37739
37760
|
}), "symbol");
|
|
37740
37761
|
}
|
|
37741
37762
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
37742
37763
|
x: position.x + width / 2,
|
|
37743
37764
|
y: position.y + start * height,
|
|
37744
37765
|
size: width,
|
|
37745
|
-
symbolType: null !== (
|
|
37766
|
+
symbolType: null !== (_s = startHandlerStyle.symbolType) && void 0 !== _s ? _s : "square"
|
|
37746
37767
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
37747
|
-
pickable: !zoomLock
|
|
37768
|
+
pickable: !zoomLock
|
|
37748
37769
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
37749
37770
|
x: position.x + width / 2,
|
|
37750
37771
|
y: position.y + end * height,
|
|
37751
37772
|
size: width,
|
|
37752
|
-
symbolType: null !== (
|
|
37773
|
+
symbolType: null !== (_t = endHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
|
|
37753
37774
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
37754
|
-
pickable: !zoomLock
|
|
37775
|
+
pickable: !zoomLock
|
|
37755
37776
|
}), "symbol");
|
|
37756
37777
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
37757
37778
|
startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
|
|
@@ -58832,7 +58853,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58832
58853
|
registerChartPlugin(MediaQuery);
|
|
58833
58854
|
};
|
|
58834
58855
|
|
|
58835
|
-
const version = "1.9.3-alpha.
|
|
58856
|
+
const version = "1.9.3-alpha.1";
|
|
58836
58857
|
|
|
58837
58858
|
const addVChartProperty = (data, op) => {
|
|
58838
58859
|
const context = op.beforeCall();
|