@visactor/vrender 0.20.10-alpha.1 → 0.20.10
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +163 -78
- package/dist/index.js +163 -78
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,17 +21,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.20.10
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
34
|
-
vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
24
|
+
exports.version = "0.20.10", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
(0, vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
35
34
|
(0, vrender_core_1.registerHtmlAttributePlugin)(), (0, vrender_core_1.registerReactAttributePlugin)(),
|
|
36
35
|
(0, vrender_core_1.registerDirectionalLight)(), (0, vrender_core_1.registerOrthoCamera)(),
|
|
37
36
|
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.10\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -2726,11 +2726,12 @@ function parseSvgPath(str) {
|
|
|
2726
2726
|
for (let i = 0, len = paths.length; i < len; i++) if (currPath = paths[i], coordsStr = currPath.slice(1), commandChar = currPath[0], currCommandData = [commandChar], coordsStrArr = coordsStr.match(rePathCommand), null !== coordsStrArr) {
|
|
2727
2727
|
for (let i = 0, len = coordsStrArr.length; i < len; i++) coordStr = coordsStrArr[i], coordNumber = parseFloat(coordStr), Number.isNaN(coordNumber) || currCommandData.push(coordNumber);
|
|
2728
2728
|
if (standardCommandLen = commandLengths[commandChar], currCommandData.length - 1 > standardCommandLen) {
|
|
2729
|
-
let subCommand
|
|
2729
|
+
let subCommand,
|
|
2730
|
+
bestCommandChar = commandChar;
|
|
2730
2731
|
for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
|
|
2731
|
-
subCommand = [
|
|
2732
|
+
subCommand = [bestCommandChar];
|
|
2732
2733
|
for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) subCommand.push(currCommandData[j]);
|
|
2733
|
-
result.push(subCommand);
|
|
2734
|
+
result.push(subCommand), "m" === bestCommandChar ? bestCommandChar = "l" : "M" === bestCommandChar && (bestCommandChar = "L");
|
|
2734
2735
|
}
|
|
2735
2736
|
} else result.push(currCommandData);
|
|
2736
2737
|
} else result.push(currCommandData);
|
|
@@ -3979,6 +3980,7 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
3979
3980
|
zIndex: 0,
|
|
3980
3981
|
layout: null,
|
|
3981
3982
|
boundsPadding: 0,
|
|
3983
|
+
fillStrokeOrder: 0,
|
|
3982
3984
|
renderStyle: "default",
|
|
3983
3985
|
pickMode: "accurate",
|
|
3984
3986
|
customPickShape: null,
|
|
@@ -4057,6 +4059,7 @@ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, Defau
|
|
|
4057
4059
|
});
|
|
4058
4060
|
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4059
4061
|
path: new CustomPath2D(),
|
|
4062
|
+
fillStrokeOrder: 1,
|
|
4060
4063
|
customPath: () => {
|
|
4061
4064
|
Logger.getInstance().warn("空函数");
|
|
4062
4065
|
}
|
|
@@ -5082,7 +5085,7 @@ let DefaultWindow = class {
|
|
|
5082
5085
|
}
|
|
5083
5086
|
hasSubView() {
|
|
5084
5087
|
const viewBox = this._handler.getViewBox();
|
|
5085
|
-
return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width
|
|
5088
|
+
return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
|
|
5086
5089
|
}
|
|
5087
5090
|
isVisible(bbox) {
|
|
5088
5091
|
return this._handler.isVisible(bbox);
|
|
@@ -12497,7 +12500,8 @@ let DefaultCanvasArcRender = class extends BaseRender {
|
|
|
12497
12500
|
fill = arcAttribute.fill,
|
|
12498
12501
|
stroke = arcAttribute.stroke,
|
|
12499
12502
|
x: originX = arcAttribute.x,
|
|
12500
|
-
y: originY = arcAttribute.y
|
|
12503
|
+
y: originY = arcAttribute.y,
|
|
12504
|
+
fillStrokeOrder = arcAttribute.fillStrokeOrder
|
|
12501
12505
|
} = arc.attribute,
|
|
12502
12506
|
data = this.valid(arc, arcAttribute, fillCb, strokeCb);
|
|
12503
12507
|
if (!data) return;
|
|
@@ -12533,7 +12537,17 @@ let DefaultCanvasArcRender = class extends BaseRender {
|
|
|
12533
12537
|
isFullStroke: isFullStroke,
|
|
12534
12538
|
stroke: arrayStroke
|
|
12535
12539
|
} = parseStroke(stroke);
|
|
12536
|
-
if (
|
|
12540
|
+
if (doFill || isFullStroke) {
|
|
12541
|
+
context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
12542
|
+
const _runFill = () => {
|
|
12543
|
+
doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
|
|
12544
|
+
},
|
|
12545
|
+
_runStroke = () => {
|
|
12546
|
+
doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
|
|
12547
|
+
};
|
|
12548
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
12549
|
+
}
|
|
12550
|
+
if (!isFullStroke && doStroke) {
|
|
12537
12551
|
context.beginPath();
|
|
12538
12552
|
drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
|
|
12539
12553
|
beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
|
|
@@ -12551,14 +12565,20 @@ let DefaultCanvasArcRender = class extends BaseRender {
|
|
|
12551
12565
|
fill = arcAttribute.fill
|
|
12552
12566
|
} = arc.attribute,
|
|
12553
12567
|
startAngle = endAngle;
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12568
|
+
this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
12569
|
+
const _runFill = () => {
|
|
12570
|
+
if (doFill) {
|
|
12571
|
+
const color = fill;
|
|
12572
|
+
if ("conical" === color.gradient) {
|
|
12573
|
+
const lastColor = getConicGradientAt(0, 0, endAngle, color);
|
|
12574
|
+
fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
|
|
12575
|
+
}
|
|
12576
|
+
}
|
|
12577
|
+
},
|
|
12578
|
+
_runStroke = () => {
|
|
12579
|
+
doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
|
|
12580
|
+
};
|
|
12581
|
+
_runFill(), _runStroke();
|
|
12562
12582
|
}
|
|
12563
12583
|
}
|
|
12564
12584
|
this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
|
|
@@ -12596,7 +12616,8 @@ let DefaultCanvasCircleRender = class extends BaseRender {
|
|
|
12596
12616
|
startAngle = circleAttribute.startAngle,
|
|
12597
12617
|
endAngle = circleAttribute.endAngle,
|
|
12598
12618
|
x: originX = circleAttribute.x,
|
|
12599
|
-
y: originY = circleAttribute.y
|
|
12619
|
+
y: originY = circleAttribute.y,
|
|
12620
|
+
fillStrokeOrder = circleAttribute.fillStrokeOrder
|
|
12600
12621
|
} = circle.attribute,
|
|
12601
12622
|
data = this.valid(circle, circleAttribute, fillCb, strokeCb);
|
|
12602
12623
|
if (!data) return;
|
|
@@ -12606,7 +12627,14 @@ let DefaultCanvasCircleRender = class extends BaseRender {
|
|
|
12606
12627
|
doFill: doFill,
|
|
12607
12628
|
doStroke: doStroke
|
|
12608
12629
|
} = data;
|
|
12609
|
-
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb)
|
|
12630
|
+
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
12631
|
+
const _runFill = () => {
|
|
12632
|
+
doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
|
|
12633
|
+
},
|
|
12634
|
+
_runStroke = () => {
|
|
12635
|
+
doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
|
|
12636
|
+
};
|
|
12637
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
12610
12638
|
}
|
|
12611
12639
|
draw(circle, renderService, drawContext, params) {
|
|
12612
12640
|
const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle;
|
|
@@ -13047,7 +13075,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13047
13075
|
super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
|
|
13048
13076
|
}
|
|
13049
13077
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
13050
|
-
var _a, _b, _c
|
|
13078
|
+
var _a, _b, _c;
|
|
13051
13079
|
const {
|
|
13052
13080
|
points: points
|
|
13053
13081
|
} = area.attribute;
|
|
@@ -13071,28 +13099,31 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13071
13099
|
x: originX = 0,
|
|
13072
13100
|
x: originY = 0
|
|
13073
13101
|
} = area.attribute;
|
|
13074
|
-
|
|
13102
|
+
!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
13075
13103
|
attribute: area.attribute
|
|
13076
|
-
}),
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13104
|
+
}), (() => {
|
|
13105
|
+
var _a, _b;
|
|
13106
|
+
if (stroke) {
|
|
13107
|
+
const {
|
|
13108
|
+
stroke = areaAttribute && areaAttribute.stroke
|
|
13109
|
+
} = area.attribute;
|
|
13110
|
+
if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
13111
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
13112
|
+
for (let i = 1; i < points.length; i++) {
|
|
13113
|
+
const p = points[i];
|
|
13114
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
13115
|
+
}
|
|
13116
|
+
} else if (stroke[2]) {
|
|
13117
|
+
const endP = points[points.length - 1];
|
|
13118
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
13119
|
+
for (let i = points.length - 2; i >= 0; i--) {
|
|
13120
|
+
const p = points[i];
|
|
13121
|
+
context.lineTo((null !== (_a = p.x1) && void 0 !== _a ? _a : p.x) + offsetX, (null !== (_b = p.y1) && void 0 !== _b ? _b : p.y) + offsetY, z);
|
|
13122
|
+
}
|
|
13092
13123
|
}
|
|
13124
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
13093
13125
|
}
|
|
13094
|
-
|
|
13095
|
-
}
|
|
13126
|
+
})();
|
|
13096
13127
|
}
|
|
13097
13128
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
13098
13129
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -13257,23 +13288,24 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13257
13288
|
x: originX = 0,
|
|
13258
13289
|
x: originY = 0
|
|
13259
13290
|
} = attribute;
|
|
13260
|
-
|
|
13291
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
13261
13292
|
attribute: attribute
|
|
13262
|
-
}),
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13293
|
+
}), (() => {
|
|
13294
|
+
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
13295
|
+
const {
|
|
13296
|
+
stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
|
|
13297
|
+
} = attribute;
|
|
13298
|
+
isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
|
|
13299
|
+
offsetX: offsetX,
|
|
13300
|
+
offsetY: offsetY,
|
|
13301
|
+
offsetZ: offsetZ,
|
|
13302
|
+
drawConnect: connect,
|
|
13303
|
+
mode: connectedType,
|
|
13304
|
+
zeroX: connectedX,
|
|
13305
|
+
zeroY: connectedY
|
|
13306
|
+
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
13307
|
+
}
|
|
13308
|
+
})(), !1;
|
|
13277
13309
|
}
|
|
13278
13310
|
};
|
|
13279
13311
|
DefaultCanvasAreaRender = __decorate$1v([injectable(), __param$N(0, inject(ContributionProvider)), __param$N(0, named(AreaRenderContribution)), __metadata$19("design:paramtypes", [Object])], DefaultCanvasAreaRender);
|
|
@@ -13305,7 +13337,8 @@ let DefaultCanvasPathRender = class extends BaseRender {
|
|
|
13305
13337
|
const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path,
|
|
13306
13338
|
{
|
|
13307
13339
|
x: originX = pathAttribute.x,
|
|
13308
|
-
y: originY = pathAttribute.y
|
|
13340
|
+
y: originY = pathAttribute.y,
|
|
13341
|
+
fillStrokeOrder = pathAttribute.fillStrokeOrder
|
|
13309
13342
|
} = path.attribute,
|
|
13310
13343
|
z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
|
|
13311
13344
|
data = this.valid(path, pathAttribute, fillCb, strokeCb);
|
|
@@ -13320,7 +13353,14 @@ let DefaultCanvasPathRender = class extends BaseRender {
|
|
|
13320
13353
|
const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
|
|
13321
13354
|
renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
|
|
13322
13355
|
}
|
|
13323
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb)
|
|
13356
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
13357
|
+
const _runStroke = () => {
|
|
13358
|
+
doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
|
|
13359
|
+
},
|
|
13360
|
+
_runFill = () => {
|
|
13361
|
+
doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
|
|
13362
|
+
};
|
|
13363
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
13324
13364
|
}
|
|
13325
13365
|
draw(path, renderService, drawContext, params) {
|
|
13326
13366
|
const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
|
|
@@ -13364,7 +13404,8 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
13364
13404
|
x1: x1,
|
|
13365
13405
|
y1: y1,
|
|
13366
13406
|
x: originX = rectAttribute.x,
|
|
13367
|
-
y: originY = rectAttribute.y
|
|
13407
|
+
y: originY = rectAttribute.y,
|
|
13408
|
+
fillStrokeOrder = rectAttribute.fillStrokeOrder
|
|
13368
13409
|
} = rect.attribute;
|
|
13369
13410
|
let {
|
|
13370
13411
|
width: width,
|
|
@@ -13383,7 +13424,14 @@ let DefaultCanvasRectRender = class extends BaseRender {
|
|
|
13383
13424
|
doFill: doFill,
|
|
13384
13425
|
doStroke: doStroke
|
|
13385
13426
|
};
|
|
13386
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke)
|
|
13427
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
13428
|
+
const _runFill = () => {
|
|
13429
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
|
|
13430
|
+
},
|
|
13431
|
+
_runStroke = () => {
|
|
13432
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
|
|
13433
|
+
};
|
|
13434
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
13387
13435
|
}
|
|
13388
13436
|
draw(rect, renderService, drawContext, params) {
|
|
13389
13437
|
const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
|
|
@@ -13419,7 +13467,8 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
|
|
|
13419
13467
|
x: originX = symbolAttribute.x,
|
|
13420
13468
|
y: originY = symbolAttribute.y,
|
|
13421
13469
|
scaleX = symbolAttribute.scaleX,
|
|
13422
|
-
scaleY = symbolAttribute.scaleY
|
|
13470
|
+
scaleY = symbolAttribute.scaleY,
|
|
13471
|
+
fillStrokeOrder = symbolAttribute.fillStrokeOrder
|
|
13423
13472
|
} = symbol.attribute,
|
|
13424
13473
|
data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
|
|
13425
13474
|
if (!data) return;
|
|
@@ -13442,14 +13491,27 @@ let DefaultCanvasSymbolRender = class extends BaseRender {
|
|
|
13442
13491
|
const obj = Object.assign({}, a);
|
|
13443
13492
|
obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
|
|
13444
13493
|
}
|
|
13445
|
-
|
|
13494
|
+
const _runFill = () => {
|
|
13495
|
+
a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
13496
|
+
},
|
|
13497
|
+
_runStroke = () => {
|
|
13498
|
+
a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
13499
|
+
};
|
|
13500
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
13446
13501
|
};
|
|
13447
13502
|
if (keepDirIn3d && context.camera && context.project) {
|
|
13448
13503
|
const p = context.project(x, y, z),
|
|
13449
13504
|
camera = context.camera;
|
|
13450
13505
|
context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
|
|
13451
13506
|
} else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
|
|
13452
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb)
|
|
13507
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
13508
|
+
const _runFill = () => {
|
|
13509
|
+
doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
13510
|
+
},
|
|
13511
|
+
_runStroke = () => {
|
|
13512
|
+
doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
13513
|
+
};
|
|
13514
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
13453
13515
|
}
|
|
13454
13516
|
draw(symbol, renderService, drawContext, params) {
|
|
13455
13517
|
const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
|
|
@@ -13836,7 +13898,8 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
|
|
|
13836
13898
|
cornerRadius = polygonAttribute.cornerRadius,
|
|
13837
13899
|
x: originX = polygonAttribute.x,
|
|
13838
13900
|
y: originY = polygonAttribute.y,
|
|
13839
|
-
closePath = polygonAttribute.closePath
|
|
13901
|
+
closePath = polygonAttribute.closePath,
|
|
13902
|
+
fillStrokeOrder = polygonAttribute.fillStrokeOrder
|
|
13840
13903
|
} = polygon.attribute,
|
|
13841
13904
|
data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
|
|
13842
13905
|
if (!data) return;
|
|
@@ -13846,7 +13909,14 @@ let DefaultCanvasPolygonRender = class extends BaseRender {
|
|
|
13846
13909
|
doFill: doFill,
|
|
13847
13910
|
doStroke: doStroke
|
|
13848
13911
|
} = data;
|
|
13849
|
-
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb)
|
|
13912
|
+
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
13913
|
+
const _runFill = () => {
|
|
13914
|
+
doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
|
|
13915
|
+
},
|
|
13916
|
+
_runStroke = () => {
|
|
13917
|
+
doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
|
|
13918
|
+
};
|
|
13919
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
13850
13920
|
}
|
|
13851
13921
|
draw(polygon, renderService, drawContext, params) {
|
|
13852
13922
|
const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon;
|
|
@@ -13889,7 +13959,8 @@ let DefaultCanvasGroupRender = class {
|
|
|
13889
13959
|
cornerRadius = groupAttribute.cornerRadius,
|
|
13890
13960
|
path = groupAttribute.path,
|
|
13891
13961
|
lineWidth = groupAttribute.lineWidth,
|
|
13892
|
-
visible = groupAttribute.visible
|
|
13962
|
+
visible = groupAttribute.visible,
|
|
13963
|
+
fillStrokeOrder = groupAttribute.fillStrokeOrder
|
|
13893
13964
|
} = group.attribute,
|
|
13894
13965
|
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
13895
13966
|
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
@@ -13915,7 +13986,14 @@ let DefaultCanvasGroupRender = class {
|
|
|
13915
13986
|
};
|
|
13916
13987
|
this._groupRenderContribitions.forEach(c => {
|
|
13917
13988
|
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
13918
|
-
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute)
|
|
13989
|
+
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
|
|
13990
|
+
const _runFill = () => {
|
|
13991
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill()));
|
|
13992
|
+
},
|
|
13993
|
+
_runStroke = () => {
|
|
13994
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke()));
|
|
13995
|
+
};
|
|
13996
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
|
|
13919
13997
|
c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
13920
13998
|
});
|
|
13921
13999
|
}
|
|
@@ -13981,6 +14059,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
13981
14059
|
x: originX = imageAttribute.x,
|
|
13982
14060
|
y: originY = imageAttribute.y,
|
|
13983
14061
|
cornerRadius = imageAttribute.cornerRadius,
|
|
14062
|
+
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
13984
14063
|
image: url
|
|
13985
14064
|
} = image.attribute,
|
|
13986
14065
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -13991,20 +14070,26 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
13991
14070
|
doFill: doFill,
|
|
13992
14071
|
doStroke: doStroke
|
|
13993
14072
|
} = data;
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14073
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
14074
|
+
const _runFill = () => {
|
|
14075
|
+
if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
|
|
14076
|
+
if (!url || !image.resources) return;
|
|
14077
|
+
const res = image.resources.get(url);
|
|
14078
|
+
if ("success" !== res.state) return;
|
|
14079
|
+
let needRestore = !1;
|
|
14080
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
14081
|
+
let repeat = 0;
|
|
14082
|
+
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
14083
|
+
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
14084
|
+
context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
|
|
14085
|
+
} else context.drawImage(res.data, x, y, width, height);
|
|
14086
|
+
needRestore && context.restore();
|
|
14087
|
+
}
|
|
14088
|
+
},
|
|
14089
|
+
_runStroke = () => {
|
|
14090
|
+
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
|
|
14091
|
+
};
|
|
14092
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
14008
14093
|
}
|
|
14009
14094
|
draw(image, renderService, drawContext) {
|
|
14010
14095
|
const {
|
|
@@ -28472,7 +28557,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28472
28557
|
|
|
28473
28558
|
const roughModule = _roughModule;
|
|
28474
28559
|
|
|
28475
|
-
const version = "0.20.10
|
|
28560
|
+
const version = "0.20.10";
|
|
28476
28561
|
preLoadAllModule();
|
|
28477
28562
|
if (isBrowserEnv()) {
|
|
28478
28563
|
loadBrowserEnv(container);
|