@visactor/vchart 1.9.2 → 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 +317 -253
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/stack.js +2 -1
- package/cjs/compile/grammar-item.js +1 -2
- package/cjs/component/axis/cartesian/axis.js +4 -4
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/label/util.js +3 -3
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +15 -10
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/player/utils/transform.js +2 -2
- package/cjs/component/player/utils/transform.js.map +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/cjs/data/transforms/pie.js +4 -4
- package/cjs/data/transforms/pie.js.map +1 -1
- package/cjs/series/word-cloud/config.js +1 -1
- package/cjs/series/word-cloud/config.js.map +1 -1
- package/cjs/util/math.d.ts +1 -0
- package/cjs/util/math.js +18 -2
- package/cjs/util/math.js.map +1 -1
- package/esm/chart/stack.js +2 -1
- package/esm/compile/grammar-item.js +1 -2
- package/esm/component/axis/cartesian/axis.js +1 -1
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/label/util.js +1 -6
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +15 -9
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/player/utils/transform.js +2 -2
- package/esm/component/player/utils/transform.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/esm/data/transforms/pie.js +5 -5
- package/esm/data/transforms/pie.js.map +1 -1
- package/esm/series/word-cloud/config.js +1 -1
- package/esm/series/word-cloud/config.js.map +1 -1
- package/esm/util/math.d.ts +1 -0
- package/esm/util/math.js +16 -0
- package/esm/util/math.js.map +1 -1
- package/package.json +14 -14
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 = {
|
|
@@ -26305,6 +26318,45 @@
|
|
|
26305
26318
|
function distance(p1, p2 = { x: 0, y: 0 }) {
|
|
26306
26319
|
return PointService.distancePP(p1, p2);
|
|
26307
26320
|
}
|
|
26321
|
+
function getPercentValue(valueList, idx, precision = 2) {
|
|
26322
|
+
if (!valueList[idx]) {
|
|
26323
|
+
return 0;
|
|
26324
|
+
}
|
|
26325
|
+
const sum = valueList.reduce((a, c) => {
|
|
26326
|
+
return (a += isNaN(c) ? 0 : c);
|
|
26327
|
+
}, 0);
|
|
26328
|
+
if (sum === 0) {
|
|
26329
|
+
return 0;
|
|
26330
|
+
}
|
|
26331
|
+
const digits = Math.pow(10, precision);
|
|
26332
|
+
const votesPerQuota = valueList.map(val => {
|
|
26333
|
+
return ((isNaN(val) ? 0 : val) / sum) * digits * 100;
|
|
26334
|
+
});
|
|
26335
|
+
const targetSeats = digits * 100;
|
|
26336
|
+
const seats = votesPerQuota.map(votes => {
|
|
26337
|
+
return Math.floor(votes);
|
|
26338
|
+
});
|
|
26339
|
+
let currentSum = seats.reduce((a, c) => {
|
|
26340
|
+
return a + c;
|
|
26341
|
+
}, 0);
|
|
26342
|
+
const remainder = votesPerQuota.map((votes, idx) => {
|
|
26343
|
+
return votes - seats[idx];
|
|
26344
|
+
});
|
|
26345
|
+
while (currentSum < targetSeats) {
|
|
26346
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
26347
|
+
let maxId = null;
|
|
26348
|
+
for (let i = 0; i < remainder.length; i++) {
|
|
26349
|
+
if (remainder[i] > max) {
|
|
26350
|
+
max = remainder[i];
|
|
26351
|
+
maxId = i;
|
|
26352
|
+
}
|
|
26353
|
+
}
|
|
26354
|
+
++seats[maxId];
|
|
26355
|
+
remainder[maxId] = 0;
|
|
26356
|
+
++currentSum;
|
|
26357
|
+
}
|
|
26358
|
+
return seats[idx] / digits;
|
|
26359
|
+
}
|
|
26308
26360
|
|
|
26309
26361
|
function eachSeries(regions, callback, filter) {
|
|
26310
26362
|
let flag = false;
|
|
@@ -27956,7 +28008,6 @@
|
|
|
27956
28008
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
27957
28009
|
};
|
|
27958
28010
|
const outP = [0, 0, 0],
|
|
27959
|
-
initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
|
|
27960
28011
|
addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) => {
|
|
27961
28012
|
if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
|
|
27962
28013
|
const step = pi$1 / 3 * (endAngle > startAngle ? 1 : -1);
|
|
@@ -28087,7 +28138,7 @@
|
|
|
28087
28138
|
}), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
|
|
28088
28139
|
const context = canvas.nativeCanvas.getContext("2d");
|
|
28089
28140
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
28090
|
-
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);
|
|
28091
28142
|
}
|
|
28092
28143
|
reset() {
|
|
28093
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);
|
|
@@ -28449,7 +28500,10 @@
|
|
|
28449
28500
|
clearMatrix() {
|
|
28450
28501
|
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
28451
28502
|
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
28452
|
-
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);
|
|
28453
28507
|
}
|
|
28454
28508
|
onlyTranslate() {
|
|
28455
28509
|
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
@@ -28680,7 +28734,7 @@
|
|
|
28680
28734
|
return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
|
|
28681
28735
|
}
|
|
28682
28736
|
constructor() {
|
|
28683
|
-
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);
|
|
28684
28738
|
}
|
|
28685
28739
|
getTitle() {
|
|
28686
28740
|
return this.canvas.id.toString();
|
|
@@ -28810,8 +28864,9 @@
|
|
|
28810
28864
|
bottom: 0
|
|
28811
28865
|
};
|
|
28812
28866
|
}
|
|
28813
|
-
clearViewBox(
|
|
28814
|
-
const
|
|
28867
|
+
clearViewBox(color) {
|
|
28868
|
+
const vb = this.viewBox,
|
|
28869
|
+
context = this.getContext(),
|
|
28815
28870
|
dpr = this.getDpr();
|
|
28816
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();
|
|
28817
28872
|
}
|
|
@@ -29245,8 +29300,9 @@
|
|
|
29245
29300
|
bottom: 0
|
|
29246
29301
|
};
|
|
29247
29302
|
}
|
|
29248
|
-
clearViewBox(
|
|
29249
|
-
const
|
|
29303
|
+
clearViewBox(color) {
|
|
29304
|
+
const vb = this.viewBox,
|
|
29305
|
+
context = this.getContext(),
|
|
29250
29306
|
dpr = this.getDpr();
|
|
29251
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();
|
|
29252
29308
|
}
|
|
@@ -29707,8 +29763,9 @@
|
|
|
29707
29763
|
bottom: 0
|
|
29708
29764
|
};
|
|
29709
29765
|
}
|
|
29710
|
-
clearViewBox(
|
|
29711
|
-
const
|
|
29766
|
+
clearViewBox(color) {
|
|
29767
|
+
const vb = this.viewBox,
|
|
29768
|
+
context = this.getContext(),
|
|
29712
29769
|
dpr = this.getDpr();
|
|
29713
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();
|
|
29714
29771
|
}
|
|
@@ -29987,7 +30044,7 @@
|
|
|
29987
30044
|
getBoundingClientRect() {
|
|
29988
30045
|
return null;
|
|
29989
30046
|
}
|
|
29990
|
-
clearViewBox(
|
|
30047
|
+
clearViewBox(color) {}
|
|
29991
30048
|
};
|
|
29992
30049
|
NodeWindowHandlerContribution.env = "node", NodeWindowHandlerContribution = __decorate$C([injectable(), __param$p(0, inject(VGlobal)), __metadata$t("design:paramtypes", [Object])], NodeWindowHandlerContribution);
|
|
29993
30050
|
const nodeWindowModule = new ContainerModule(bind => {
|
|
@@ -30352,8 +30409,9 @@
|
|
|
30352
30409
|
bottom: 0
|
|
30353
30410
|
};
|
|
30354
30411
|
}
|
|
30355
|
-
clearViewBox(
|
|
30356
|
-
const
|
|
30412
|
+
clearViewBox(color) {
|
|
30413
|
+
const vb = this.viewBox,
|
|
30414
|
+
context = this.getContext(),
|
|
30357
30415
|
dpr = this.getDpr();
|
|
30358
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();
|
|
30359
30417
|
}
|
|
@@ -30657,8 +30715,9 @@
|
|
|
30657
30715
|
bottom: 0
|
|
30658
30716
|
};
|
|
30659
30717
|
}
|
|
30660
|
-
clearViewBox(
|
|
30661
|
-
const
|
|
30718
|
+
clearViewBox(color) {
|
|
30719
|
+
const vb = this.viewBox,
|
|
30720
|
+
context = this.getContext(),
|
|
30662
30721
|
dpr = this.getDpr();
|
|
30663
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();
|
|
30664
30723
|
}
|
|
@@ -58794,7 +58853,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58794
58853
|
registerChartPlugin(MediaQuery);
|
|
58795
58854
|
};
|
|
58796
58855
|
|
|
58797
|
-
const version = "1.9.
|
|
58856
|
+
const version = "1.9.3-alpha.1";
|
|
58798
58857
|
|
|
58799
58858
|
const addVChartProperty = (data, op) => {
|
|
58800
58859
|
const context = op.beforeCall();
|
|
@@ -68138,11 +68197,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68138
68197
|
max = Math.max(angleFieldValue, max);
|
|
68139
68198
|
data[index][ARC_TRANSFORM_VALUE] = angleFieldValue;
|
|
68140
68199
|
}
|
|
68200
|
+
const valueList = data.map(d => Number(d[angleField]));
|
|
68141
68201
|
const angleRange = endAngle - startAngle;
|
|
68142
68202
|
let lastAngle = startAngle;
|
|
68143
68203
|
let restAngle = angleRange;
|
|
68144
68204
|
let largeThanMinAngleTotal = 0;
|
|
68145
|
-
data.forEach(d => {
|
|
68205
|
+
data.forEach((d, i) => {
|
|
68146
68206
|
const angleFieldValue = d[ARC_TRANSFORM_VALUE];
|
|
68147
68207
|
const ratio = total ? angleFieldValue / total : 0;
|
|
68148
68208
|
let radian = ratio * angleRange;
|
|
@@ -68157,6 +68217,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68157
68217
|
const dEndAngle = lastAngle + radian;
|
|
68158
68218
|
d[asRatio] = ratio;
|
|
68159
68219
|
d[asK] = max ? angleFieldValue / max : 0;
|
|
68220
|
+
d._percent_ = getPercentValue(valueList, i);
|
|
68160
68221
|
appendArcInfo(d, dStartAngle, radian);
|
|
68161
68222
|
lastAngle = dEndAngle;
|
|
68162
68223
|
});
|
|
@@ -70930,7 +70991,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
70930
70991
|
'star',
|
|
70931
70992
|
'cardioid',
|
|
70932
70993
|
'circle',
|
|
70933
|
-
'pentagon'
|
|
70994
|
+
'pentagon',
|
|
70995
|
+
'rect'
|
|
70934
70996
|
];
|
|
70935
70997
|
|
|
70936
70998
|
const WORD_CLOUD_ANGLE = `${PREFIX}_WORD_CLOUD_ANGLE`;
|
|
@@ -81668,7 +81730,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81668
81730
|
}
|
|
81669
81731
|
else {
|
|
81670
81732
|
if (isXAxis(this.getOrient())) {
|
|
81671
|
-
field = s.
|
|
81733
|
+
field = s.getSpec().x2Field
|
|
81672
81734
|
? [...s.fieldX, s.fieldX2]
|
|
81673
81735
|
: s.fieldX;
|
|
81674
81736
|
}
|
|
@@ -81676,7 +81738,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81676
81738
|
field = s.fieldZ;
|
|
81677
81739
|
}
|
|
81678
81740
|
else {
|
|
81679
|
-
field = s.
|
|
81741
|
+
field = s.getSpec().y2Field
|
|
81742
|
+
? [...s.fieldY, s.fieldY2]
|
|
81743
|
+
: s.fieldY;
|
|
81680
81744
|
}
|
|
81681
81745
|
}
|
|
81682
81746
|
field = (isArray$1(field) ? (isContinuous(this._scale.type) ? field : [field[0]]) : [field]);
|
|
@@ -88872,22 +88936,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88872
88936
|
let lines = [];
|
|
88873
88937
|
if (isXYLayout) {
|
|
88874
88938
|
lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
|
|
88875
|
-
|
|
88876
|
-
|
|
88877
|
-
|
|
88878
|
-
|
|
88879
|
-
|
|
88880
|
-
|
|
88881
|
-
|
|
88882
|
-
|
|
88883
|
-
|
|
88884
|
-
|
|
88885
|
-
|
|
88886
|
-
|
|
88939
|
+
const [start, end] = lines;
|
|
88940
|
+
if (start && start.length && end && end.length) {
|
|
88941
|
+
points = [
|
|
88942
|
+
{
|
|
88943
|
+
x: start[0].x,
|
|
88944
|
+
y: end[0].y
|
|
88945
|
+
},
|
|
88946
|
+
start[0],
|
|
88947
|
+
{
|
|
88948
|
+
x: end[0].x,
|
|
88949
|
+
y: start[0].y
|
|
88950
|
+
},
|
|
88951
|
+
end[0]
|
|
88952
|
+
];
|
|
88953
|
+
}
|
|
88887
88954
|
}
|
|
88888
88955
|
else if (isXLayout || isYLayout) {
|
|
88889
88956
|
lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
|
|
88890
|
-
|
|
88957
|
+
const [start, end] = lines;
|
|
88958
|
+
if (start && start.length && end && end.length) {
|
|
88959
|
+
points = [...start, end[1], end[0]];
|
|
88960
|
+
}
|
|
88891
88961
|
}
|
|
88892
88962
|
else if (isCoordinateLayout) {
|
|
88893
88963
|
points = coordinateLayout(data, relativeSeries, autoRange, spec.coordinatesOffset);
|
|
@@ -88992,7 +89062,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88992
89062
|
return result;
|
|
88993
89063
|
};
|
|
88994
89064
|
const transformToAttrs = (spec) => {
|
|
88995
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
89065
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
88996
89066
|
const trackStyle = rectToAttribute((_b = (_a = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _a === void 0 ? void 0 : _a.trackStyle) !== null && _b !== void 0 ? _b : {});
|
|
88997
89067
|
const railStyle = rectToAttribute((_d = (_c = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _c === void 0 ? void 0 : _c.railStyle) !== null && _d !== void 0 ? _d : {});
|
|
88998
89068
|
const handlerStyle = symbolToAttribute((_f = (_e = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _e === void 0 ? void 0 : _e.handlerStyle) !== null && _f !== void 0 ? _f : {});
|
|
@@ -89000,7 +89070,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89000
89070
|
const pause = baseToAttribute((_k = (_j = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _j === void 0 ? void 0 : _j.pause) !== null && _k !== void 0 ? _k : {});
|
|
89001
89071
|
const backward = baseToAttribute((_m = (_l = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _l === void 0 ? void 0 : _l.backward) !== null && _m !== void 0 ? _m : {});
|
|
89002
89072
|
const forward = baseToAttribute((_p = (_o = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _o === void 0 ? void 0 : _o.forward) !== null && _p !== void 0 ? _p : {});
|
|
89003
|
-
return Object.assign(Object.assign({}, spec), { direction: spec.direction, interval: spec.interval, visible: spec.visible, orient: spec.orient, slider: Object.assign(Object.assign({}, spec.slider), { trackStyle: trackStyle, railStyle: railStyle, handlerStyle: handlerStyle }), controller: Object.assign(Object.assign({}, spec.controller), { start: start, pause: pause, backward: backward, forward: forward }) });
|
|
89073
|
+
return Object.assign(Object.assign({}, spec), { direction: spec.direction, interval: spec.interval, visible: spec.visible, orient: (_q = spec.orient) !== null && _q !== void 0 ? _q : 'bottom', slider: Object.assign(Object.assign({}, spec.slider), { trackStyle: trackStyle, railStyle: railStyle, handlerStyle: handlerStyle }), controller: Object.assign(Object.assign({}, spec.controller), { start: start, pause: pause, backward: backward, forward: forward }) });
|
|
89004
89074
|
};
|
|
89005
89075
|
const transformContinuousSpecToAttrs = (spec, data) => (Object.assign(Object.assign({}, transformToAttrs(spec)), { data, type: 'continuous' }));
|
|
89006
89076
|
const transformDiscreteSpecToAttrs = (spec, data) => (Object.assign(Object.assign({}, transformToAttrs(spec)), { data, type: 'discrete' }));
|
|
@@ -89320,12 +89390,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89320
89390
|
textAttribute.text = formatMethod(textAttribute.text, datum, { series });
|
|
89321
89391
|
}
|
|
89322
89392
|
if (formatter) {
|
|
89323
|
-
if (series.type === 'pie') {
|
|
89324
|
-
datum._percent_ = (datum[ARC_RATIO] * 100).toFixed(2) + '%';
|
|
89325
|
-
}
|
|
89326
|
-
else if (datum[STACK_FIELD_END_PERCENT]) {
|
|
89327
|
-
datum._percent_ = (datum[STACK_FIELD_END_PERCENT] * 100).toFixed(2) + '%';
|
|
89328
|
-
}
|
|
89329
89393
|
textAttribute.text = substitute(formatter, datum);
|
|
89330
89394
|
}
|
|
89331
89395
|
return textAttribute;
|