@visactor/vrender 0.17.23-alpha.0 → 0.17.23
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.js +52 -33
- 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 +3 -3
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,14 +21,13 @@ 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.17.23
|
|
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
|
-
(
|
|
34
|
-
__exportStar(require("@visactor/vrender-kits"), exports);
|
|
24
|
+
exports.version = "0.17.23", (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
|
+
__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,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,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;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } 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.17.23\";\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();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -4784,6 +4784,11 @@
|
|
|
4784
4784
|
value: function clear() {
|
|
4785
4785
|
this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
|
|
4786
4786
|
}
|
|
4787
|
+
}, {
|
|
4788
|
+
key: "beginPath",
|
|
4789
|
+
value: function beginPath() {
|
|
4790
|
+
this.clear();
|
|
4791
|
+
}
|
|
4787
4792
|
}, {
|
|
4788
4793
|
key: "toString",
|
|
4789
4794
|
value: function toString() {
|
|
@@ -4803,6 +4808,8 @@
|
|
|
4803
4808
|
var path = "";
|
|
4804
4809
|
for (var i = 0; i < bezierPathList.length; i += 6) path += "C".concat(bezierPathList[i], " ").concat(bezierPathList[i + 1], " ").concat(bezierPathList[i + 2], " ").concat(bezierPathList[i + 3], " ").concat(bezierPathList[i + 4], " ").concat(bezierPathList[i + 5]);
|
|
4805
4810
|
return path;
|
|
4811
|
+
}, _list[enumCommandMap.R] = function (cmd) {
|
|
4812
|
+
return "M".concat(cmd[1], " ").concat(cmd[2], " h").concat(cmd[3], " v").concat(cmd[4], " H").concat(cmd[1], "Z");
|
|
4806
4813
|
}, _list[enumCommandMap.Z] = function (cmd) {
|
|
4807
4814
|
return "Z";
|
|
4808
4815
|
}, this.toStringCbList = _list;
|
|
@@ -5188,6 +5195,7 @@
|
|
|
5188
5195
|
zIndex: 0,
|
|
5189
5196
|
layout: null,
|
|
5190
5197
|
boundsPadding: 0,
|
|
5198
|
+
renderStyle: "default",
|
|
5191
5199
|
pickMode: "accurate",
|
|
5192
5200
|
customPickShape: null,
|
|
5193
5201
|
boundsMode: "accurate",
|
|
@@ -6707,7 +6715,7 @@
|
|
|
6707
6715
|
}();
|
|
6708
6716
|
var globalTheme = new Theme();
|
|
6709
6717
|
function getTheme(graphic, theme) {
|
|
6710
|
-
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
6718
|
+
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
6711
6719
|
}
|
|
6712
6720
|
function getThemeFromGroup(graphic) {
|
|
6713
6721
|
var g;
|
|
@@ -6971,12 +6979,12 @@
|
|
|
6971
6979
|
}
|
|
6972
6980
|
}, {
|
|
6973
6981
|
key: "removeAllChild",
|
|
6974
|
-
value: function removeAllChild() {
|
|
6982
|
+
value: function removeAllChild(deep) {
|
|
6975
6983
|
if (!this._idMap) return;
|
|
6976
6984
|
var child = this._firstChild;
|
|
6977
6985
|
for (; child;) {
|
|
6978
6986
|
var next = child._next;
|
|
6979
|
-
child.parent = null, child._prev = null, child._next = null, child = next;
|
|
6987
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
6980
6988
|
}
|
|
6981
6989
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
6982
6990
|
}
|
|
@@ -11587,7 +11595,8 @@
|
|
|
11587
11595
|
}, {
|
|
11588
11596
|
key: "tryUpdateGlobalAABBBounds",
|
|
11589
11597
|
value: function tryUpdateGlobalAABBBounds() {
|
|
11590
|
-
|
|
11598
|
+
var b = this.AABBBounds;
|
|
11599
|
+
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
11591
11600
|
}
|
|
11592
11601
|
}, {
|
|
11593
11602
|
key: "tryUpdateGlobalTransMatrix",
|
|
@@ -12893,8 +12902,9 @@
|
|
|
12893
12902
|
}, {
|
|
12894
12903
|
key: "removeAllChild",
|
|
12895
12904
|
value: function removeAllChild() {
|
|
12905
|
+
var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
12896
12906
|
this.forEachChildren(function (child) {
|
|
12897
|
-
application.graphicService.onRemove(child);
|
|
12907
|
+
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
12898
12908
|
}), _get(_getPrototypeOf(Group.prototype), "removeAllChild", this).call(this), this.addUpdateBoundTag();
|
|
12899
12909
|
}
|
|
12900
12910
|
}, {
|
|
@@ -20248,9 +20258,10 @@
|
|
|
20248
20258
|
key: "drawLinearAreaHighPerformance",
|
|
20249
20259
|
value: function drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
20250
20260
|
var _a, _b, _c, _d, _e;
|
|
20261
|
+
var points = area.attribute.points;
|
|
20262
|
+
if (points.length < 2) return;
|
|
20251
20263
|
context.beginPath();
|
|
20252
20264
|
var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
20253
|
-
points = area.attribute.points,
|
|
20254
20265
|
startP = points[0];
|
|
20255
20266
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
20256
20267
|
for (var i = 1; i < points.length; i++) {
|
|
@@ -20427,6 +20438,7 @@
|
|
|
20427
20438
|
key: "_drawSegmentItem",
|
|
20428
20439
|
value: function _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20429
20440
|
var _a, _b, _c, _d;
|
|
20441
|
+
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20430
20442
|
var connectedType = attribute.connectedType,
|
|
20431
20443
|
connectedX = attribute.connectedX,
|
|
20432
20444
|
connectedY = attribute.connectedY,
|
|
@@ -20435,7 +20447,6 @@
|
|
|
20435
20447
|
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(function (i) {
|
|
20436
20448
|
return da.push(i);
|
|
20437
20449
|
}) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20438
|
-
if (!cache) return;
|
|
20439
20450
|
context.beginPath();
|
|
20440
20451
|
var _area$attribute4 = area.attribute,
|
|
20441
20452
|
points = _area$attribute4.points,
|
|
@@ -22266,7 +22277,7 @@
|
|
|
22266
22277
|
var d = context.dpr % 1;
|
|
22267
22278
|
(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);
|
|
22268
22279
|
var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
22269
|
-
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.
|
|
22280
|
+
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(function (a, b) {
|
|
22270
22281
|
var _a, _b;
|
|
22271
22282
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22272
22283
|
}).forEach(function (group) {
|
|
@@ -22329,7 +22340,7 @@
|
|
|
22329
22340
|
}, subLayers.set(group._uid, incrementalLayer));
|
|
22330
22341
|
var incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(),
|
|
22331
22342
|
idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
|
|
22332
|
-
idc.dirtyBounds.
|
|
22343
|
+
idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
|
|
22333
22344
|
drawContribution: idc,
|
|
22334
22345
|
clear: "transparent",
|
|
22335
22346
|
layer: incrementalLayer.layer,
|
|
@@ -22359,7 +22370,7 @@
|
|
|
22359
22370
|
key: "getRenderContribution",
|
|
22360
22371
|
value: function getRenderContribution(graphic) {
|
|
22361
22372
|
var renderer;
|
|
22362
|
-
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
22373
|
+
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType, graphic)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
22363
22374
|
}
|
|
22364
22375
|
}, {
|
|
22365
22376
|
key: "renderItem",
|
|
@@ -22398,8 +22409,13 @@
|
|
|
22398
22409
|
}
|
|
22399
22410
|
}, {
|
|
22400
22411
|
key: "selectRenderByNumberType",
|
|
22401
|
-
value: function selectRenderByNumberType(type) {
|
|
22402
|
-
|
|
22412
|
+
value: function selectRenderByNumberType(type, graphic) {
|
|
22413
|
+
var data;
|
|
22414
|
+
if (graphic.attribute.renderStyle) {
|
|
22415
|
+
var currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
|
|
22416
|
+
data = currentRenderMap && currentRenderMap.get(type);
|
|
22417
|
+
}
|
|
22418
|
+
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
22403
22419
|
}
|
|
22404
22420
|
}, {
|
|
22405
22421
|
key: "clearScreen",
|
|
@@ -23207,6 +23223,8 @@
|
|
|
23207
23223
|
var _this = this;
|
|
23208
23224
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, function (stage) {
|
|
23209
23225
|
stage && stage === _this.pluginService.stage && _this.drawHTML(context.stage.renderService);
|
|
23226
|
+
}), application.graphicService.hooks.onRemove.tap(this.key, function (graphic) {
|
|
23227
|
+
_this.removeDom(graphic);
|
|
23210
23228
|
}), application.graphicService.hooks.onRelease.tap(this.key, function (graphic) {
|
|
23211
23229
|
_this.removeDom(graphic);
|
|
23212
23230
|
});
|
|
@@ -23263,26 +23281,27 @@
|
|
|
23263
23281
|
anchorType = _html$anchorType === void 0 ? "boundsLeftTop" : _html$anchorType;
|
|
23264
23282
|
graphic.bindDom || (graphic.bindDom = new Map());
|
|
23265
23283
|
var lastDom = graphic.bindDom.get(dom);
|
|
23266
|
-
|
|
23267
|
-
|
|
23268
|
-
|
|
23269
|
-
|
|
23270
|
-
|
|
23271
|
-
|
|
23272
|
-
|
|
23273
|
-
|
|
23274
|
-
|
|
23275
|
-
|
|
23276
|
-
|
|
23277
|
-
|
|
23278
|
-
|
|
23279
|
-
|
|
23280
|
-
|
|
23281
|
-
|
|
23282
|
-
|
|
23283
|
-
|
|
23284
|
-
|
|
23285
|
-
}
|
|
23284
|
+
var wrapGroup, nativeContainer;
|
|
23285
|
+
if (!lastDom || container && container !== lastDom.container) {
|
|
23286
|
+
var nativeDom;
|
|
23287
|
+
graphic.bindDom.forEach(function (_ref) {
|
|
23288
|
+
var wrapGroup = _ref.wrapGroup;
|
|
23289
|
+
application.global.removeDom(wrapGroup);
|
|
23290
|
+
}), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
|
|
23291
|
+
var _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
23292
|
+
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
|
|
23293
|
+
tagName: "div",
|
|
23294
|
+
width: width,
|
|
23295
|
+
height: height,
|
|
23296
|
+
style: style,
|
|
23297
|
+
parent: nativeContainer
|
|
23298
|
+
}), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
23299
|
+
dom: nativeDom,
|
|
23300
|
+
container: container,
|
|
23301
|
+
wrapGroup: wrapGroup
|
|
23302
|
+
}));
|
|
23303
|
+
} else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
|
|
23304
|
+
wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
23286
23305
|
var left = 0,
|
|
23287
23306
|
top = 0;
|
|
23288
23307
|
var b = graphic.globalAABBBounds;
|
|
@@ -35035,7 +35054,7 @@
|
|
|
35035
35054
|
|
|
35036
35055
|
var roughModule = _roughModule;
|
|
35037
35056
|
|
|
35038
|
-
const version = "0.17.23
|
|
35057
|
+
const version = "0.17.23";
|
|
35039
35058
|
preLoadAllModule();
|
|
35040
35059
|
if (isBrowserEnv()) {
|
|
35041
35060
|
loadBrowserEnv(container);
|