From 3626a6eb196d94aac05b9f9bc1d4d6166ab0719e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=99=BA=E6=B4=B2?= <1543046129@qq.com> Date: Wed, 15 Dec 2021 19:51:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B4=E4=BD=93=E6=A0=B7=E5=BC=8F=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demoV2/Layouter/Array.js | 76 ++---------------------- demoV2/demo2.html | 23 +------- dist/sv.js | 40 ++++++++++--- package.json | 4 +- src/Model/SVLink.ts | 3 +- src/Model/SVModel.ts | 31 +++++++++- src/Model/SVNode.ts | 2 +- src/Model/SVNodeAppendage.ts | 7 +-- src/Model/modelConstructor.ts | 20 +++---- src/RegisteredShape/arrayNode.ts | 13 ++++ src/RegisteredShape/binaryTreeNode.ts | 2 +- src/RegisteredShape/linkListNode.ts | 2 +- src/RegisteredShape/triTreeNode.ts | 2 +- src/RegisteredShape/twoCellNode.ts | 2 +- src/StructV.ts | 29 ++++----- src/View/reconcile.ts | 12 +--- src/engine.ts | 85 +++++++++++++++------------ src/sources.ts | 1 - 18 files changed, 166 insertions(+), 188 deletions(-) create mode 100644 src/RegisteredShape/arrayNode.ts diff --git a/demoV2/Layouter/Array.js b/demoV2/Layouter/Array.js index 2d722ba..b1c34d5 100644 --- a/demoV2/Layouter/Array.js +++ b/demoV2/Layouter/Array.js @@ -6,7 +6,7 @@ SV.registerLayout('Array', { sourcesPreprocess(sources) { const firstElement = sources[0]; - if(firstElement.external) { + if (firstElement.external) { firstElement.headExternal = firstElement.external; delete firstElement.external; } @@ -16,9 +16,9 @@ SV.registerLayout('Array', { defineOptions() { return { - node: { + node: { default: { - type: 'rect', + type: 'array-node', label: '[id]', size: [60, 30], labelOptions: { @@ -56,77 +56,13 @@ SV.registerLayout('Array', { layout(elements) { let arr = elements; - for(let i = 0; i < arr.length; i++) { + for (let i = 0; i < arr.length; i++) { let width = arr[i].get('size')[0]; - if(i > 0) { + if (i > 0) { arr[i].set('x', arr[i - 1].get('x') + width); } } } -}); +}); - - - -SV.registerLayout('Array', { - - sourcesPreprocess(sources) { - const firstElement = sources[0]; - - if(firstElement.external) { - firstElement.headExternal = firstElement.external; - delete firstElement.external; - } - - return sources; - }, - - defineOptions() { - return { - node: { - default: { - type: 'indexed-node', - label: '[id]', - size: [60, 30], - style: { - stroke: '#333', - fill: '#355c7d' - } - } - }, - marker: { - headExternal: { - type: 'pointer', - anchor: 3, - style: { - fill: '#f08a5d' - } - }, - external: { - type: 'pointer', - anchor: 0, - style: { - fill: '#f08a5d' - } - } - }, - indexLabel: { - index: { position: 'bottom' }, - indexTop: { position: 'top' } - } - }; - }, - - layout(elements) { - let arr = elements; - - for(let i = 0; i < arr.length; i++) { - let width = arr[i].get('size')[0]; - - if(i > 0) { - arr[i].set('x', arr[i - 1].get('x') + width); - } - } - } -}, 'colorful'); \ No newline at end of file diff --git a/demoV2/demo2.html b/demoV2/demo2.html index 652bbd8..e8e5840 100644 --- a/demoV2/demo2.html +++ b/demoV2/demo2.html @@ -100,27 +100,8 @@ let data = [{ - PTree: { - data: [ - { - id: '1001', - data: 'A', - parent: -1, - index: 0 - }, - { - id: '1002', - data: 'B', - parent: 0, - index: 1 - }, - ], - layouter: 'PTree' - - } - }, { Array: { - data: [{ id: 1, data: 1 }, { id: 2, data: 2 }, { id: 3, data: 3 }], + data: [{ id: 1, data: 1, external: 'list' }, { id: 2, data: 2 }, { id: 3, data: 3 }], layouter: 'Array' } }, { @@ -172,7 +153,7 @@ }); document.getElementById('switch-mode').addEventListener('click', e => { - cur.switchMode('Array', 'colorful'); + cur.updateStyle('Array', newArrayOption); }); const leak = document.getElementById('leak'); diff --git a/dist/sv.js b/dist/sv.js index e4bb1f6..f8d0ab8 100644 --- a/dist/sv.js +++ b/dist/sv.js @@ -13232,6 +13232,18 @@ eval("var assignValue = __webpack_require__(/*! ./_assignValue */ \"./node_modul /***/ }), +/***/ "./node_modules/_merge@2.1.1@merge/lib/src/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/_merge@2.1.1@merge/lib/src/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.isPlainObject = exports.clone = exports.recursive = exports.merge = exports.main = void 0;\r\nmodule.exports = exports = main;\r\nexports.default = main;\r\nfunction main() {\r\n var items = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n items[_i] = arguments[_i];\r\n }\r\n return merge.apply(void 0, items);\r\n}\r\nexports.main = main;\r\nmain.clone = clone;\r\nmain.isPlainObject = isPlainObject;\r\nmain.recursive = recursive;\r\nfunction merge() {\r\n var items = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n items[_i] = arguments[_i];\r\n }\r\n return _merge(items[0] === true, false, items);\r\n}\r\nexports.merge = merge;\r\nfunction recursive() {\r\n var items = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n items[_i] = arguments[_i];\r\n }\r\n return _merge(items[0] === true, true, items);\r\n}\r\nexports.recursive = recursive;\r\nfunction clone(input) {\r\n if (Array.isArray(input)) {\r\n var output = [];\r\n for (var index = 0; index < input.length; ++index)\r\n output.push(clone(input[index]));\r\n return output;\r\n }\r\n else if (isPlainObject(input)) {\r\n var output = {};\r\n for (var index in input)\r\n output[index] = clone(input[index]);\r\n return output;\r\n }\r\n else {\r\n return input;\r\n }\r\n}\r\nexports.clone = clone;\r\nfunction isPlainObject(input) {\r\n return input && typeof input === 'object' && !Array.isArray(input);\r\n}\r\nexports.isPlainObject = isPlainObject;\r\nfunction _recursiveMerge(base, extend) {\r\n if (!isPlainObject(base))\r\n return extend;\r\n for (var key in extend) {\r\n if (key === '__proto__' || key === 'constructor' || key === 'prototype')\r\n continue;\r\n base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ?\r\n _recursiveMerge(base[key], extend[key]) :\r\n extend[key];\r\n }\r\n return base;\r\n}\r\nfunction _merge(isClone, isRecursive, items) {\r\n var result;\r\n if (isClone || !isPlainObject(result = items.shift()))\r\n result = {};\r\n for (var index = 0; index < items.length; ++index) {\r\n var item = items[index];\r\n if (!isPlainObject(item))\r\n continue;\r\n for (var key in item) {\r\n if (key === '__proto__' || key === 'constructor' || key === 'prototype')\r\n continue;\r\n var value = isClone ? clone(item[key]) : item[key];\r\n result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;\r\n }\r\n }\r\n return result;\r\n}\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvX21lcmdlQDIuMS4xQG1lcmdlL2xpYi9zcmMvaW5kZXguanM/Yzk5OSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE4QyxjQUFjO0FBQzVEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQkFBb0IsdUJBQXVCO0FBQzNDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esb0JBQW9CLHVCQUF1QjtBQUMzQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLG9CQUFvQix1QkFBdUI7QUFDM0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDJCQUEyQixzQkFBc0I7QUFDakQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ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clxuICAgIHZhciByZXN1bHQ7XHJcbiAgICBpZiAoaXNDbG9uZSB8fCAhaXNQbGFpbk9iamVjdChyZXN1bHQgPSBpdGVtcy5zaGlmdCgpKSlcclxuICAgICAgICByZXN1bHQgPSB7fTtcclxuICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCBpdGVtcy5sZW5ndGg7ICsraW5kZXgpIHtcclxuICAgICAgICB2YXIgaXRlbSA9IGl0ZW1zW2luZGV4XTtcclxuICAgICAgICBpZiAoIWlzUGxhaW5PYmplY3QoaXRlbSkpXHJcbiAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgIGZvciAodmFyIGtleSBpbiBpdGVtKSB7XHJcbiAgICAgICAgICAgIGlmIChrZXkgPT09ICdfX3Byb3RvX18nIHx8IGtleSA9PT0gJ2NvbnN0cnVjdG9yJyB8fCBrZXkgPT09ICdwcm90b3R5cGUnKVxyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IGlzQ2xvbmUgPyBjbG9uZShpdGVtW2tleV0pIDogaXRlbVtrZXldO1xyXG4gICAgICAgICAgICByZXN1bHRba2V5XSA9IGlzUmVjdXJzaXZlID8gX3JlY3Vyc2l2ZU1lcmdlKHJlc3VsdFtrZXldLCB2YWx1ZSkgOiB2YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gcmVzdWx0O1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/_merge@2.1.1@merge/lib/src/index.js\n"); + +/***/ }), + /***/ "./node_modules/_ml-array-max@1.2.3@ml-array-max/lib-es6/index.js": /*!************************************************************************!*\ !*** ./node_modules/_ml-array-max@1.2.3@ml-array-max/lib-es6/index.js ***! @@ -13892,7 +13904,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nex /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SVModel = void 0;\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nclass SVModel {\r\n constructor(id, type, group, layout, modelType) {\r\n this.id = id;\r\n this.sourceType = type;\r\n this.group = group;\r\n this.layout = layout;\r\n this.shadowG6Item = null;\r\n this.G6Item = null;\r\n this.preLayout = false;\r\n this.discarded = false;\r\n this.freed = false;\r\n this.leaked = false;\r\n this.transformMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\r\n this.modelType = modelType;\r\n }\r\n generateG6ModelProps(options) {\r\n return null;\r\n }\r\n get(attr) {\r\n return this.G6ModelProps[attr];\r\n }\r\n set(attr, value) {\r\n if (this.discarded) {\r\n return;\r\n }\r\n if (typeof attr === 'object') {\r\n Object.keys(attr).map(item => {\r\n this.set(item, attr[item]);\r\n });\r\n return;\r\n }\r\n if (this.G6ModelProps[attr] === value) {\r\n return;\r\n }\r\n if (attr === 'style' || attr === 'labelCfg') {\r\n Object.assign(this.G6ModelProps[attr], value);\r\n }\r\n else {\r\n this.G6ModelProps[attr] = value;\r\n }\r\n if (attr === 'rotation') {\r\n const matrix = util_1.Util.calcRotateMatrix(this.getMatrix(), value);\r\n this.setMatrix(matrix);\r\n }\r\n if (this.G6Item) {\r\n if (this.preLayout) {\r\n const G6ItemModel = this.G6Item.getModel();\r\n G6ItemModel[attr] = value;\r\n }\r\n else {\r\n this.g6Instance.updateItem(this.G6Item, this.G6ModelProps);\r\n }\r\n }\r\n if (this.shadowG6Item) {\r\n this.shadowG6Instance.updateItem(this.shadowG6Item, this.G6ModelProps);\r\n }\r\n }\r\n getBound() {\r\n return this.shadowG6Item.getBBox();\r\n }\r\n getMatrix() {\r\n return [...this.transformMatrix];\r\n }\r\n setMatrix(matrix) {\r\n this.transformMatrix = matrix;\r\n this.set('style', { matrix });\r\n }\r\n getG6ModelProps() {\r\n return util_1.Util.objectClone(this.G6ModelProps);\r\n }\r\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gICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHR5cGVvZiBhdHRyID09PSAnb2JqZWN0Jykge1xyXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhhdHRyKS5tYXAoaXRlbSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNldChpdGVtLCBhdHRyW2l0ZW1dKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuRzZNb2RlbFByb3BzW2F0dHJdID09PSB2YWx1ZSkge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChhdHRyID09PSAnc3R5bGUnIHx8IGF0dHIgPT09ICdsYWJlbENmZycpIHtcclxuICAgICAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLkc2TW9kZWxQcm9wc1thdHRyXSwgdmFsdWUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy5HNk1vZGVsUHJvcHNbYXR0cl0gPSB2YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGF0dHIgPT09ICdyb3RhdGlvbicpIHtcclxuICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gdXRpbF8xLlV0aWwuY2FsY1JvdGF0ZU1hdHJpeCh0aGlzLmdldE1hdHJpeCgpLCB2YWx1ZSk7XHJcbiAgICAgICAgICAgIHRoaXMuc2V0TWF0cml4KG1hdHJpeCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLkc2SXRlbSkge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5wcmVMYXlvdXQpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IEc2SXRlbU1vZGVsID0gdGhpcy5HNkl0ZW0uZ2V0TW9kZWwoKTtcclxuICAgICAgICAgICAgICAgIEc2SXRlbU1vZGVsW2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HJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Model/SVModel.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SVModel = void 0;\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nconst merge_1 = __webpack_require__(/*! merge */ \"./node_modules/_merge@2.1.1@merge/lib/src/index.js\");\r\nclass SVModel {\r\n constructor(id, type, group, layout, modelType) {\r\n this.id = id;\r\n this.sourceType = type;\r\n this.group = group;\r\n this.layout = layout;\r\n this.shadowG6Item = null;\r\n this.G6Item = null;\r\n this.preLayout = false;\r\n this.discarded = false;\r\n this.freed = false;\r\n this.leaked = false;\r\n this.transformMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\r\n this.modelType = modelType;\r\n }\r\n generateG6ModelProps(options) {\r\n return null;\r\n }\r\n get(attr) {\r\n return this.G6ModelProps[attr];\r\n }\r\n set(attr, value) {\r\n if (this.discarded) {\r\n return;\r\n }\r\n if (typeof attr === 'object') {\r\n Object.keys(attr).map(item => {\r\n this.set(item, attr[item]);\r\n });\r\n return;\r\n }\r\n if (this.G6ModelProps[attr] === value) {\r\n return;\r\n }\r\n if (attr === 'style' || attr === 'labelCfg') {\r\n this.G6ModelProps[attr] = merge_1.default(this.G6ModelProps[attr] || {}, value);\r\n }\r\n else {\r\n this.G6ModelProps[attr] = value;\r\n }\r\n if (attr === 'rotation') {\r\n const matrix = util_1.Util.calcRotateMatrix(this.getMatrix(), value);\r\n this.setMatrix(matrix);\r\n }\r\n if (this.G6Item) {\r\n if (this.preLayout) {\r\n const G6ItemModel = this.G6Item.getModel();\r\n G6ItemModel[attr] = value;\r\n }\r\n else {\r\n this.g6Instance.updateItem(this.G6Item, this.G6ModelProps);\r\n }\r\n }\r\n if (this.shadowG6Item) {\r\n this.shadowG6Instance.updateItem(this.shadowG6Item, this.G6ModelProps);\r\n }\r\n }\r\n updateG6ModelStyle(G6ModelProps) {\r\n const newG6ModelProps = {\r\n style: Object.assign({}, G6ModelProps.style),\r\n labelCfg: Object.assign({}, G6ModelProps.labelCfg)\r\n };\r\n this.G6ModelProps = merge_1.default(this.G6ModelProps, newG6ModelProps);\r\n if (this.G6Item) {\r\n this.g6Instance.updateItem(this.G6Item, this.G6ModelProps);\r\n }\r\n if (this.shadowG6Item) {\r\n this.shadowG6Instance.updateItem(this.shadowG6Item, this.G6ModelProps);\r\n }\r\n }\r\n getBound() {\r\n return this.shadowG6Item.getBBox();\r\n }\r\n getMatrix() {\r\n return [...this.transformMatrix];\r\n }\r\n setMatrix(matrix) {\r\n this.transformMatrix = matrix;\r\n this.set('style', { matrix });\r\n }\r\n getG6ModelProps() {\r\n return util_1.Util.objectClone(this.G6ModelProps);\r\n }\r\n getModelType() {\r\n return this.modelType;\r\n }\r\n isNode() {\r\n return false;\r\n }\r\n}\r\nexports.SVModel = SVModel;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvTW9kZWwvU1ZNb2RlbC50cz9iOWZmIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQ7QUFDQSxlQUFlLG1CQUFPLENBQUMsNENBQWdCO0FBQ3ZDLGdCQUFnQixtQkFBTyxDQUFDLGlFQUFPO0FBQy9CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLG1GQUFtRjtBQUNuRjt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tID0gbnVsbDtcclxuICAgICAgICB0aGlzLkc2SXRlbSA9IG51bGw7XHJcbiAgICAgICAgdGhpcy5wcmVMYXlvdXQgPSBmYWxzZTtcclxuICAgICAgICB0aGlzLmRpc2NhcmRlZCA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMuZnJlZWQgPSBmYWxzZTtcclxuICAgICAgICB0aGlzLmxlYWtlZCA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMudHJhbnNmb3JtTWF0cml4ID0gWzEsIDAsIDAsIDAsIDEsIDAsIDAsIDAsIDFdO1xyXG4gICAgICAgIHRoaXMubW9kZWxUeXBlID0gbW9kZWxUeXBlO1xyXG4gICAgfVxyXG4gICAgZ2VuZXJhdGVHNk1vZGVsUHJvcHMob3B0aW9ucykge1xyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfVxyXG4gICAgZ2V0KGF0dHIpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5HNk1vZGVsUHJvcHNbYXR0cl07XHJcbiAgICB9XHJcbiAgICBzZXQoYXR0ciwgdmFsdWUpIHtcclxuICAgICAgICBpZiAodGhpcy5kaXNjYXJkZWQpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodHlwZW9mIGF0dHIgPT09ICdvYmplY3QnKSB7XHJcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGF0dHIpLm1hcChpdGVtID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuc2V0KGl0ZW0sIGF0dHJbaXRlbV0pO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5HNk1vZGVsUHJvcHNbYXR0cl0gPT09IHZhbHVlKSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGF0dHIgPT09ICdzdHlsZScgfHwgYXR0ciA9PT0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3N0eWxlJywgeyBtYXRyaXggfSk7XHJcbiAgICB9XHJcbiAgICBnZXRHNk1vZGVsUHJvcHMoKSB7XHJcbiAgICAgICAgcmV0dXJuIHV0aWxfMS5VdGlsLm9iamVjdENsb25lKHRoaXMuRzZNb2RlbFByb3BzKTtcclxuICAgIH1cclxuICAgIGdldE1vZGVsVHlwZSgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5tb2RlbFR5cGU7XHJcbiAgICB9XHJcbiAgICBpc05vZGUoKSB7XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfVxyXG59XHJcbmV4cG9ydHMuU1ZNb2RlbCA9IFNWTW9kZWw7XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Model/SVModel.ts\n"); /***/ }), @@ -13928,7 +13940,19 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nex /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ModelConstructor = void 0;\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nconst StructV_1 = __webpack_require__(/*! ../StructV */ \"./src/StructV.ts\");\r\nconst SVLink_1 = __webpack_require__(/*! ./SVLink */ \"./src/Model/SVLink.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ./SVNode */ \"./src/Model/SVNode.ts\");\r\nconst SVNodeAppendage_1 = __webpack_require__(/*! ./SVNodeAppendage */ \"./src/Model/SVNodeAppendage.ts\");\r\nclass ModelConstructor {\r\n constructor(engine) {\r\n this.engine = engine;\r\n this.prevSourcesStringMap = {};\r\n }\r\n construct(sources) {\r\n const layoutGroupTable = new Map(), layoutMap = StructV_1.SV.registeredLayout;\r\n Object.keys(sources).forEach(group => {\r\n let sourceGroup = sources[group], layout = sourceGroup.layouter, mode = sourceGroup.mode || 'default', layoutCreator = layoutMap[layout][mode];\r\n if (!layout || !layoutCreator) {\r\n return;\r\n }\r\n let sourceDataString = JSON.stringify(sourceGroup.data), prevString = this.prevSourcesStringMap[group], nodeList = [], freedLabelList = [], addressLabelList = [], indexLabelList = [], markerList = [];\r\n if (prevString === sourceDataString) {\r\n return;\r\n }\r\n const options = layoutCreator.defineOptions(sourceGroup.data), sourceData = layoutCreator.sourcesPreprocess(sourceGroup.data, options), nodeOptions = options.node || options['element'] || {}, markerOptions = options.marker || {}, indexLabelOptions = options.indexLabel || {}, addressLabelOption = options.addressLabel || {};\r\n nodeList = this.constructNodes(group, layout, nodeOptions, sourceData);\r\n markerList = this.constructMarkers(group, layout, markerOptions, nodeList);\r\n indexLabelList = this.constructIndexLabel(group, layout, indexLabelOptions, nodeList);\r\n addressLabelList = this.constructAddressLabel(group, layout, addressLabelOption, nodeList);\r\n nodeList.forEach(item => {\r\n if (item.freedLabel) {\r\n freedLabelList.push(item.freedLabel);\r\n }\r\n });\r\n layoutGroupTable.set(group, {\r\n name: group,\r\n node: nodeList,\r\n freedLabel: freedLabelList,\r\n addressLabel: addressLabelList,\r\n indexLabel: indexLabelList,\r\n link: [],\r\n marker: markerList,\r\n options: options,\r\n layoutCreator,\r\n modelList: [\r\n ...nodeList,\r\n ...markerList,\r\n ...freedLabelList,\r\n ...addressLabelList,\r\n ...indexLabelList\r\n ],\r\n layout,\r\n isHide: false\r\n });\r\n });\r\n layoutGroupTable.forEach((layoutGroup, group) => {\r\n const linkOptions = layoutGroup.options.link || {}, linkList = this.constructLinks(group, layoutGroup.layout, linkOptions, layoutGroup.node, layoutGroupTable);\r\n layoutGroup.link = linkList;\r\n layoutGroup.modelList.push(...linkList);\r\n });\r\n this.layoutGroupTable = layoutGroupTable;\r\n return this.layoutGroupTable;\r\n }\r\n getLayoutGroupTable() {\r\n return this.layoutGroupTable;\r\n }\r\n constructNodes(group, layout, nodeOptions, sourceList) {\r\n let defaultSourceNodeType = 'default', nodeList = [];\r\n sourceList.forEach(item => {\r\n if (item === null) {\r\n return;\r\n }\r\n if (item.type === undefined || item.type === null) {\r\n item.type = defaultSourceNodeType;\r\n }\r\n nodeList.push(this.createNode(item, item.type, group, layout, nodeOptions[item.type]));\r\n });\r\n return nodeList;\r\n }\r\n constructLinks(group, layout, linkOptions, nodes, layoutGroupTable) {\r\n let linkList = [], linkNames = Object.keys(linkOptions);\r\n linkNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], sourceLinkData = node.sourceNode[name], targetNode = null, link = null;\r\n if (sourceLinkData === undefined || sourceLinkData === null) {\r\n node[name] = null;\r\n continue;\r\n }\r\n if (Array.isArray(sourceLinkData)) {\r\n node[name] = sourceLinkData.map((item, index) => {\r\n targetNode = this.fetchTargetNodes(layoutGroupTable, node, item);\r\n let isGeneralLink = this.isGeneralLink(sourceLinkData.toString());\r\n if (targetNode) {\r\n link = this.createLink(name, group, layout, node, targetNode, index, linkOptions[name]);\r\n linkList.push(link);\r\n }\r\n return isGeneralLink ? targetNode : null;\r\n });\r\n }\r\n else {\r\n targetNode = this.fetchTargetNodes(layoutGroupTable, node, sourceLinkData);\r\n let isGeneralLink = this.isGeneralLink(sourceLinkData.toString());\r\n if (targetNode) {\r\n link = this.createLink(name, group, layout, node, targetNode, null, linkOptions[name]);\r\n linkList.push(link);\r\n }\r\n node[name] = isGeneralLink ? targetNode : null;\r\n }\r\n }\r\n });\r\n return linkList;\r\n }\r\n constructIndexLabel(group, layout, indexLabelOptions, nodes) {\r\n let indexLabelList = [], indexNames = Object.keys(indexLabelOptions);\r\n indexNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], value = node[name];\r\n if (!value)\r\n continue;\r\n let id = `${group}.${name}#${value}`, indexLabel = new SVNodeAppendage_1.SVIndexLabel(id, name, group, layout, value, node, indexLabelOptions[name]);\r\n indexLabelList.push(indexLabel);\r\n }\r\n });\r\n return indexLabelList;\r\n }\r\n constructAddressLabel(group, layout, addressLabelOption, nodes) {\r\n let addressLabelList = [];\r\n nodes.forEach(item => {\r\n const addressLabel = new SVNodeAppendage_1.SVAddressLabel(`${item.id}-address-label`, item.sourceType, group, layout, item, addressLabelOption);\r\n addressLabelList.push(addressLabel);\r\n });\r\n return addressLabelList;\r\n }\r\n constructMarkers(group, layout, markerOptions, nodes) {\r\n let markerList = [], markerNames = Object.keys(markerOptions);\r\n markerNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], markerData = node[name];\r\n if (!markerData)\r\n continue;\r\n let id = `${group}.${name}.${Array.isArray(markerData) ? markerData.join('-') : markerData}`, marker = new SVNodeAppendage_1.SVMarker(id, name, group, layout, markerData, node, markerOptions[name]);\r\n markerList.push(marker);\r\n }\r\n });\r\n return markerList;\r\n }\r\n resolveNodeLabel(label, sourceNode) {\r\n let targetLabel = '';\r\n if (Array.isArray(label)) {\r\n targetLabel = label.map(item => { var _a; return (_a = this.parserNodeContent(sourceNode, item)) !== null && _a !== void 0 ? _a : ''; });\r\n }\r\n else {\r\n targetLabel = this.parserNodeContent(sourceNode, label);\r\n }\r\n if (targetLabel === 'undefined') {\r\n targetLabel = '';\r\n }\r\n return targetLabel !== null && targetLabel !== void 0 ? targetLabel : '';\r\n }\r\n createNode(sourceNode, sourceNodeType, group, layout, options) {\r\n let label = this.resolveNodeLabel(options.label, sourceNode), id = sourceNodeType + '.' + sourceNode.id.toString(), node = new SVNode_1.SVNode(id, sourceNodeType, group, layout, sourceNode, label, options);\r\n if (node.freed) {\r\n node.freedLabel = new SVNodeAppendage_1.SVFreedLabel(`${id}-freed-label`, sourceNodeType, group, layout, node);\r\n }\r\n return node;\r\n }\r\n createLink(linkName, group, layout, node, target, index, options) {\r\n let id = `${linkName}(${node.id}-${target.id})`;\r\n return new SVLink_1.SVLink(id, linkName, group, layout, node, target, index, options);\r\n }\r\n parserNodeContent(sourceNode, formatLabel) {\r\n let fields = util_1.Util.textParser(formatLabel);\r\n if (Array.isArray(fields)) {\r\n let values = fields.map(item => sourceNode[item]);\r\n values.map((item, index) => {\r\n formatLabel = formatLabel.replace('[' + fields[index] + ']', item);\r\n });\r\n }\r\n return formatLabel;\r\n }\r\n fetchTargetNodes(layoutGroupTable, node, linkTarget) {\r\n let group = node.group, sourceNodeType = node.sourceType, nodeList, targetId = linkTarget, targetGroupName = group, targetNode = null;\r\n if (linkTarget === null || linkTarget === undefined) {\r\n return null;\r\n }\r\n if (typeof linkTarget === 'number' || (typeof linkTarget === 'string' && !linkTarget.includes('#'))) {\r\n linkTarget = 'default#' + linkTarget;\r\n }\r\n let info = linkTarget.split('#');\r\n targetId = info.pop();\r\n if (info.length > 1) {\r\n sourceNodeType = info.pop();\r\n targetGroupName = info.pop();\r\n }\r\n else {\r\n let field = info.pop();\r\n if (layoutGroupTable.get(targetGroupName).node.find(item => item.sourceType === field)) {\r\n sourceNodeType = field;\r\n }\r\n else if (layoutGroupTable.has(field)) {\r\n targetGroupName = field;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n nodeList = layoutGroupTable.get(targetGroupName).node.filter(item => item.sourceType === sourceNodeType);\r\n if (nodeList === undefined) {\r\n return null;\r\n }\r\n targetNode = nodeList.find(item => item.sourceId === targetId);\r\n return targetNode || null;\r\n }\r\n isGeneralLink(linkId) {\r\n let counter = 0;\r\n for (let i = 0; i < linkId.length; i++) {\r\n if (linkId[i] === '#') {\r\n counter++;\r\n }\r\n }\r\n return counter <= 2;\r\n }\r\n destroy() {\r\n this.layoutGroupTable = null;\r\n this.prevSourcesStringMap = null;\r\n }\r\n}\r\nexports.ModelConstructor = ModelConstructor;\r\n;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvTW9kZWwvbW9kZWxDb25zdHJ1Y3Rvci50cz81NmMyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQ7QUFDQSxl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gICAgICAgICBpbmRleExhYmVsOiBpbmRleExhYmVsTGlzdCxcclxuICAgICAgICAgICAgICAgIGxpbms6IFtdLFxyXG4gICAgICAgICAgICAgICAgbWFya2VyOiBtYXJrZXJMaXN0LFxyXG4gICAgICAgICAgICAgICAgb3B0aW9uczogb3B0aW9ucyxcclxuICAgICAgICAgICAgICAgIGxheW91dENyZWF0b3IsXHJcbiAgICAgICAgICAgICAgICBtb2RlbExpc3Q6IFtcclxuICAgICAgICAgICAgICAgICAgICAuLi5ub2RlTGlzdCxcclxuICAgICAgICAgICAgICAgICAgICAuLi5tYXJrZXJMaXN0LFxyXG4gICAgICAgICAgICAgICAgICAgIC4uLmZyZWVkTGFiZWxMaXN0LFxyXG4gICAgICAgICAgICAgICAgICAgIC4uLmFkZHJlc3NMYWJlbExpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgLi4uaW5kZXhMYWJlbExpc3RcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgICAgICBsYXlvdXQsXHJcbiAgICAgICAgICAgICAgICBpc0hpZGU6IGZhbHNlXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGxheW91dEdyb3VwVGFibGUuZm9yRWFjaCgobGF5b3V0R3JvdXAsIGdyb3VwKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IGxpbmtPcHRpb25zID0gbGF5b3V0R3JvdXAub3B0aW9ucy5saW5rIHx8IHt9LCBsaW5rTGlzdCA9IHRoaXMuY29uc3RydWN0TGlua3MoZ3JvdXAsIGxheW91dEdyb3VwLmxheW91dCwgbGlua09wdGlvbnMsIGxheW91dEdyb3VwLm5vZGUsIGxheW91dEdyb3VwVGFibGUpO1xyXG4gICAgICAgICAgICBsYXlvdXRHcm91cC5saW5rID0gbGlua0xpc3Q7XHJcbiAgICAgICAgICAgIGxheW91dEdyb3VwLm1vZGVsTGlzdC5wdXNoKC4uLmxpbmtMaXN0KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmxheW91dEdyb3VwVGFibGUgPSBsYXlvdXRHcm91cFRhYmxlO1xyXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dEdyb3VwVGFibGU7XHJcbiAgICB9XHJcbiAgICBnZXRMYXlvdXRHcm91cFRhYmxlKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dEdyb3VwVGFibGU7XHJcbiAgICB9XHJcbiAgICBjb25zdHJ1Y3ROb2Rlcyhncm91cCwgbGF5b3V0LCBub2RlT3B0aW9ucywgc291cmNlTGlzdCkge1xyXG4gICAgICAgIGxldCBkZWZhdWx0U291cmNlTm9kZVR5cGUgPSAnZGVmYXVsdCcsIG5vZGVMaXN0ID0gW107XHJcbiAgICAgICAgc291cmNlTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xyXG4gICAgICAgICAgICBpZiAoaXRlbSA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChpdGVtLnR5cGUgPT09IHVuZGVmaW5lZCB8fCBpdGVtLnR5cGUgPT09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgIGl0ZW0udHlwZSA9IGRlZmF1bHRTb3VyY2VOb2RlVHlwZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBub2RlTGlzdC5wdXNoKHRoaXMuY3JlYXRlTm9kZShpdGVtLCBpdGVtLnR5cGUsIGdyb3VwLCBsYXlvdXQsIG5vZGVPcHRpb25zW2l0ZW0udHlwZV0pKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gbm9kZUxpc3Q7XHJcbiAgICB9XHJcbiAgICBjb25zdHJ1Y3RMaW5rcyhncm91cCwgbGF5b3V0LCBsaW5rT3B0aW9ucywgbm9kZXMsIGxheW91dEdyb3VwVGFibGUpIHtcclxuICAgICAgICBsZXQgbGlua0xpc3QgPSBbXSwgbGlua05hbWVzID0gT2JqZWN0LmtleXMobGlua09wdGlvbnMpO1xyXG4gICAgICAgIGxpbmtOYW1lcy5mb3JFYWNoKG5hbWUgPT4ge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGVzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgbm9kZSA9IG5vZGVzW2ldLCBzb3VyY2VMaW5rRGF0YSA9IG5vZGUuc291cmNlTm9kZVtuYW1lXSwgdGFyZ2V0Tm9kZSA9IG51bGwsIGxpbmsgPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgaWYgKHNvdXJjZUxpbmtEYXRhID09PSB1bmRlZmluZWQgfHwgc291cmNlTGlua0RhdGEgPT09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICBub2RlW25hbWVdID0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHNvdXJjZUxpbmtEYXRhKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIG5vZGVbbmFtZV0gPSBzb3VyY2VMaW5rRGF0YS5tYXAoKGl0ZW0sIGluZGV4KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldE5vZGUgPSB0aGlzLmZldGNoVGFyZ2V0Tm9kZXMobGF5b3V0R3JvdXBUYWJsZSwgbm9kZSwgaXRlbSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpc0dlbmVyYWxMaW5rID0gdGhpcy5pc0dlbmVyYWxMaW5rKHNvdXJjZUxpbmtEYXRhLnRvU3RyaW5nKCkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFyZ2V0Tm9kZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluayA9IHRoaXMuY3JlYXRlTGluayhuYW1lLCBncm91cCwgbGF5b3V0LCBub2RlLCB0YXJnZXROb2RlLCBpbmRleCwgbGlua09wdGlvbnNbbmFtZV0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua0xpc3QucHVzaChsaW5rKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNHZW5lcmFsTGluayA/IHRhcmdldE5vZGUgOiBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0Tm9kZSA9IHRoaXMuZmV0Y2hUYXJnZXROb2RlcyhsYXlvdXRHcm91cFRhYmxlLCBub2RlLCBzb3VyY2VMaW5rRGF0YSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlzR2VuZXJhbExpbmsgPSB0aGlzLmlzR2VuZXJhbExpbmsoc291cmNlTGlua0RhdGEudG9TdHJpbmcoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldE5vZGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGluayA9IHRoaXMuY3JlYXRlTGluayhuYW1lLCBncm91cCwgbGF5b3V0LCBub2RlLCB0YXJnZXROb2RlLCBudWxsLCBsaW5rT3B0aW9uc1tuYW1lXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtMaXN0LnB1c2gobGluayk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIG5vZGVbbmFtZV0gPSBpc0dlbmVyYWxMaW5rID8gdGFyZ2V0Tm9kZSA6IG51bGw7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gbGlua0xpc3Q7XHJcbiAgICB9XHJcbiAgICBjb25zdHJ1Y3RJbmRleExhYmVsKGd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gKGxldCBpID0gMDsgaSA8IGxpbmtJZC5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBpZiAobGlua0lkW2ldID09PSAnIycpIHtcclxuICAgICAgICAgICAgICAgIGNvdW50ZXIrKztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gY291bnRlciA8PSAyO1xyXG4gICAgfVxyXG4gICAgZGVzdHJveSgpIHtcclxuICAgICAgICB0aGlzLmxheW91dEdyb3VwVGFibGUgPSBudWxsO1xyXG4gICAgICAgIHRoaXMucHJldlNvdXJjZXNTdHJpbmdNYXAgPSBudWxsO1xyXG4gICAgfVxyXG59XHJcbmV4cG9ydHMuTW9kZWxDb25zdHJ1Y3RvciA9IE1vZGVsQ29uc3RydWN0b3I7XHJcbjtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/Model/modelConstructor.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ModelConstructor = void 0;\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nconst StructV_1 = __webpack_require__(/*! ../StructV */ \"./src/StructV.ts\");\r\nconst SVLink_1 = __webpack_require__(/*! ./SVLink */ \"./src/Model/SVLink.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ./SVNode */ \"./src/Model/SVNode.ts\");\r\nconst SVNodeAppendage_1 = __webpack_require__(/*! ./SVNodeAppendage */ \"./src/Model/SVNodeAppendage.ts\");\r\nclass ModelConstructor {\r\n constructor(engine) {\r\n this.engine = engine;\r\n this.prevSourcesStringMap = {};\r\n }\r\n construct(sources) {\r\n const layoutGroupTable = new Map(), layoutMap = StructV_1.SV.registeredLayout;\r\n Object.keys(sources).forEach(group => {\r\n let sourceGroup = sources[group], layout = sourceGroup.layouter, layoutCreator = layoutMap[layout];\r\n if (!layout || !layoutCreator) {\r\n return;\r\n }\r\n let sourceDataString = JSON.stringify(sourceGroup.data), prevString = this.prevSourcesStringMap[group], nodeList = [], freedLabelList = [], addressLabelList = [], indexLabelList = [], markerList = [];\r\n if (prevString === sourceDataString) {\r\n return;\r\n }\r\n const options = layoutCreator.defineOptions(sourceGroup.data), sourceData = layoutCreator.sourcesPreprocess(sourceGroup.data, options), nodeOptions = options.node || options['element'] || {}, markerOptions = options.marker || {}, indexLabelOptions = options.indexLabel || {}, addressLabelOption = options.addressLabel || {};\r\n nodeList = this.constructNodes(group, layout, nodeOptions, sourceData);\r\n markerList = this.constructMarkers(group, layout, markerOptions, nodeList);\r\n indexLabelList = this.constructIndexLabel(group, layout, indexLabelOptions, nodeList);\r\n addressLabelList = this.constructAddressLabel(group, layout, addressLabelOption, nodeList);\r\n nodeList.forEach(item => {\r\n if (item.freedLabel) {\r\n freedLabelList.push(item.freedLabel);\r\n }\r\n });\r\n layoutGroupTable.set(group, {\r\n name: group,\r\n node: nodeList,\r\n freedLabel: freedLabelList,\r\n addressLabel: addressLabelList,\r\n indexLabel: indexLabelList,\r\n link: [],\r\n marker: markerList,\r\n options: options,\r\n layoutCreator,\r\n modelList: [\r\n ...nodeList,\r\n ...markerList,\r\n ...freedLabelList,\r\n ...addressLabelList,\r\n ...indexLabelList\r\n ],\r\n layout,\r\n isHide: false\r\n });\r\n });\r\n layoutGroupTable.forEach((layoutGroup, group) => {\r\n const linkOptions = layoutGroup.options.link || {}, linkList = this.constructLinks(group, layoutGroup.layout, linkOptions, layoutGroup.node, layoutGroupTable);\r\n layoutGroup.link = linkList;\r\n layoutGroup.modelList.push(...linkList);\r\n });\r\n this.layoutGroupTable = layoutGroupTable;\r\n return this.layoutGroupTable;\r\n }\r\n constructNodes(group, layout, nodeOptions, sourceList) {\r\n let defaultSourceNodeType = 'default', nodeList = [];\r\n sourceList.forEach(item => {\r\n if (item === null) {\r\n return;\r\n }\r\n if (item.type === undefined || item.type === null) {\r\n item.type = defaultSourceNodeType;\r\n }\r\n nodeList.push(this.createNode(item, item.type, group, layout, nodeOptions[item.type]));\r\n });\r\n return nodeList;\r\n }\r\n constructLinks(group, layout, linkOptions, nodes, layoutGroupTable) {\r\n let linkList = [], linkNames = Object.keys(linkOptions);\r\n linkNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], sourceLinkData = node.sourceNode[name], targetNode = null, link = null;\r\n if (sourceLinkData === undefined || sourceLinkData === null) {\r\n node[name] = null;\r\n continue;\r\n }\r\n if (Array.isArray(sourceLinkData)) {\r\n node[name] = sourceLinkData.map((item, index) => {\r\n targetNode = this.fetchTargetNodes(layoutGroupTable, node, item);\r\n let isGeneralLink = this.isGeneralLink(sourceLinkData.toString());\r\n if (targetNode) {\r\n link = this.createLink(name, group, layout, node, targetNode, index, linkOptions[name]);\r\n linkList.push(link);\r\n }\r\n return isGeneralLink ? targetNode : null;\r\n });\r\n }\r\n else {\r\n targetNode = this.fetchTargetNodes(layoutGroupTable, node, sourceLinkData);\r\n let isGeneralLink = this.isGeneralLink(sourceLinkData.toString());\r\n if (targetNode) {\r\n link = this.createLink(name, group, layout, node, targetNode, null, linkOptions[name]);\r\n linkList.push(link);\r\n }\r\n node[name] = isGeneralLink ? targetNode : null;\r\n }\r\n }\r\n });\r\n return linkList;\r\n }\r\n constructIndexLabel(group, layout, indexLabelOptions, nodes) {\r\n let indexLabelList = [], indexNames = Object.keys(indexLabelOptions);\r\n indexNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], value = node[name];\r\n if (!value)\r\n continue;\r\n let id = `${group}.${name}#${value}`, indexLabel = new SVNodeAppendage_1.SVIndexLabel(id, name, group, layout, value, node, indexLabelOptions[name]);\r\n indexLabelList.push(indexLabel);\r\n }\r\n });\r\n return indexLabelList;\r\n }\r\n constructAddressLabel(group, layout, addressLabelOption, nodes) {\r\n let addressLabelList = [];\r\n nodes.forEach(item => {\r\n const addressLabel = new SVNodeAppendage_1.SVAddressLabel(`${item.id}-address-label`, item.sourceType, group, layout, item, addressLabelOption);\r\n addressLabelList.push(addressLabel);\r\n });\r\n return addressLabelList;\r\n }\r\n constructMarkers(group, layout, markerOptions, nodes) {\r\n let markerList = [], markerNames = Object.keys(markerOptions);\r\n markerNames.forEach(name => {\r\n for (let i = 0; i < nodes.length; i++) {\r\n let node = nodes[i], markerData = node[name];\r\n if (!markerData)\r\n continue;\r\n let id = `${group}.${name}.${Array.isArray(markerData) ? markerData.join('-') : markerData}`, marker = new SVNodeAppendage_1.SVMarker(id, name, group, layout, markerData, node, markerOptions[name]);\r\n markerList.push(marker);\r\n }\r\n });\r\n return markerList;\r\n }\r\n resolveNodeLabel(label, sourceNode) {\r\n let targetLabel = '';\r\n if (Array.isArray(label)) {\r\n targetLabel = label.map(item => { var _a; return (_a = this.parserNodeContent(sourceNode, item)) !== null && _a !== void 0 ? _a : ''; });\r\n }\r\n else {\r\n targetLabel = this.parserNodeContent(sourceNode, label);\r\n }\r\n if (targetLabel === 'undefined') {\r\n targetLabel = '';\r\n }\r\n return targetLabel !== null && targetLabel !== void 0 ? targetLabel : '';\r\n }\r\n createNode(sourceNode, sourceNodeType, group, layout, options) {\r\n let label = this.resolveNodeLabel(options.label, sourceNode), id = sourceNodeType + '.' + sourceNode.id.toString(), node = new SVNode_1.SVNode(id, sourceNodeType, group, layout, sourceNode, label, options);\r\n if (node.freed) {\r\n node.freedLabel = new SVNodeAppendage_1.SVFreedLabel(`${id}-freed-label`, sourceNodeType, group, layout, node);\r\n }\r\n return node;\r\n }\r\n createLink(linkName, group, layout, node, target, index, options) {\r\n let id = `${linkName}(${node.id}-${target.id})`;\r\n return new SVLink_1.SVLink(id, linkName, group, layout, node, target, index, options);\r\n }\r\n parserNodeContent(sourceNode, formatLabel) {\r\n let fields = util_1.Util.textParser(formatLabel);\r\n if (Array.isArray(fields)) {\r\n let values = fields.map(item => sourceNode[item]);\r\n values.map((item, index) => {\r\n formatLabel = formatLabel.replace('[' + fields[index] + ']', item);\r\n });\r\n }\r\n return formatLabel;\r\n }\r\n fetchTargetNodes(layoutGroupTable, node, linkTarget) {\r\n let group = node.group, sourceNodeType = node.sourceType, nodeList, targetId = linkTarget, targetGroupName = group, targetNode = null;\r\n if (linkTarget === null || linkTarget === undefined) {\r\n return null;\r\n }\r\n if (typeof linkTarget === 'number' || (typeof linkTarget === 'string' && !linkTarget.includes('#'))) {\r\n linkTarget = 'default#' + linkTarget;\r\n }\r\n let info = linkTarget.split('#');\r\n targetId = info.pop();\r\n if (info.length > 1) {\r\n sourceNodeType = info.pop();\r\n targetGroupName = info.pop();\r\n }\r\n else {\r\n let field = info.pop();\r\n if (layoutGroupTable.get(targetGroupName).node.find(item => item.sourceType === field)) {\r\n sourceNodeType = field;\r\n }\r\n else if (layoutGroupTable.has(field)) {\r\n targetGroupName = field;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n nodeList = layoutGroupTable.get(targetGroupName).node.filter(item => item.sourceType === sourceNodeType);\r\n if (nodeList === undefined) {\r\n return null;\r\n }\r\n targetNode = nodeList.find(item => item.sourceId === targetId);\r\n return targetNode || null;\r\n }\r\n isGeneralLink(linkId) {\r\n let counter = 0;\r\n for (let i = 0; i < linkId.length; i++) {\r\n if (linkId[i] === '#') {\r\n counter++;\r\n }\r\n }\r\n return counter <= 2;\r\n }\r\n getLayoutGroupTable() {\r\n return this.layoutGroupTable;\r\n }\r\n destroy() {\r\n this.layoutGroupTable = null;\r\n this.prevSourcesStringMap = null;\r\n }\r\n}\r\nexports.ModelConstructor = ModelConstructor;\r\n;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvTW9kZWwvbW9kZWxDb25zdHJ1Y3Rvci50cz81NmMyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQ7QUFDQSxlQUFlLG1CQUFPLENBQUMsNENBQWdCO0FBQ3ZDLGtCQU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LmNvbnN0cnVjdE5vZGVzKGdyb3VwLCBsYXlvdXQsIG5vZGVPcHRpb25zLCBzb3VyY2VEYXRhKTtcclxuICAgICAgICAgICAgbWFya2VyTGlzdCA9IHRoaXMuY29uc3RydWN0TWFya2Vycyhncm91cCwgbGF5b3V0LCBtYXJrZXJPcHRpb25zLCBub2RlTGlzdCk7XHJcbiAgICAgICAgICAgIGluZGV4TGFiZWxMaXN0ID0gdGhpcy5jb25zdHJ1Y3RJbmRleExhYmVsKGdyb3VwLCBsYXlvdXQsIGluZGV4TGFiZWxPcHRpb25zLCBub2RlTGlzdCk7XHJcbiAgICAgICAgICAgIGFkZHJlc3NMYWJlbExpc3QgPSB0aGlzLmNvbnN0cnVjdEFkZHJlc3NMYWJlbChncm91cCwgbGF5b3V0LCBhZGRyZXNzTGFiZWxPcHRpb24sIG5vZGVMaXN0KTtcclxuICAgICAgICAgICAgbm9kZUxpc3QuZm9yRWFjaChpdGVtID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChpdGVtLmZyZWVkTGFiZWwpIHtcclxuICAgICAgICAgICAgICAgICAgICBmcmVlZExhYmVsTGlzdC5wdXNoKGl0ZW0uZnJlZWRMYWJlbCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBsYXlvdXRHcm91cFRhYmxlLnNldChncm91cCwge1xyXG4gICAgICAgICAgICAgICAgbmFtZTogZ3JvdXAsXHJcbiAgICAgICAgICAgICAgICBub2RlOiBub2RlTGlzdCxcclxuICAgICAgICAgICAgICAgIGZyZWVkTGFiZWw6IGZyZWVkTGFiZWxMaXN0LFxyXG4gICAgICAgICAgICAgICAgYWRkcmVzc0xhYmVsOiBhZGRyZXNzTGFiZWxMaXN0LFxyXG4gICAgICAgICAgICAgICAgaW5kZXhMYWJlbDogaW5kZXhMYWJlbExpc3QsXHJcbiAgICAgICAgICAgICAgICBsaW5rOiBbXSxcclxuICAgICAgICAgICAgICAgIG1hcmtlcjogbWFya2VyTGlzdCxcclxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IG9wdGlvbnMsXHJcbiAgICAgICAgICAgICAgICBsYXlvdXRDcmVhdG9yLFxyXG4gICAgICAgICAgICAgICAgbW9kZWxMaXN0OiBbXHJcbiAgICAgICAgICAgICAgICAgICAgLi4ubm9kZUxpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgLi4ubWFya2VyTGlzdCxcclxuICAgICAgICAgICAgICAgICAgICAuLi5mcmVlZExhYmVsTGlzdCxcclxuICAgICAgICAgICAgICAgICAgICAuLi5hZGRyZXNzTGFiZWxMaXN0LFxyXG4gICAgICAgICAgICAgICAgICAgIC4uLmluZGV4TGFiZWxMaXN0XHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgbGF5b3V0LFxyXG4gICAgICAgICAgICAgICAgaXNIaWRlOiBmYWxzZVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBsYXlvdXRHcm91cFRhYmxlLmZvckVhY2goKGxheW91dEdyb3VwLCBncm91cCkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBsaW5rT3B0aW9ucyA9IGxheW91dEdyb3VwLm9wdGlvbnMubGluayB8fCB7fSwgbGlua0xpc3QgPSB0aGlzLmNvbnN0cnVjdExpbmtzKGdyb3VwLCBsYXlvdXRHcm91cC5sYXlvdXQsIGxpbmtPcHRpb25zLCBsYXlvdXRHcm91cC5ub2RlLCBsYXlvdXRHcm91cFRhYmxlKTtcclxuICAgICAgICAgICAgbGF5b3V0R3JvdXAubGluayA9IGxpbmtMaXN0O1xyXG4gICAgICAgICAgICBsYXlvdXRHcm91cC5tb2RlbExpc3QucHVzaCguLi5saW5rTGlzdCk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5sYXlvdXRHcm91cFRhYmxlID0gbGF5b3V0R3JvdXBUYWJsZTtcclxuICAgICAgICByZXR1cm4gdGhpcy5sYXlv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Swgc291cmNlTGlua0RhdGEgPSBub2RlLnNvdXJjZU5vZGVbbmFtZV0sIHRhcmdldE5vZGUgPSBudWxsLCBsaW5rID0gbnVsbDtcclxuICAgICAgICAgICAgICAgIGlmIChzb3VyY2VMaW5rRGF0YSA9PT0gdW5kZWZpbmVkIHx8IHNvdXJjZUxpbmtEYXRhID09PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbm9kZVtuYW1lXSA9IG51bGw7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzb3VyY2VMaW5rRGF0YSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBub2RlW25hbWVdID0gc291cmNlTGlua0RhdGEubWFwKChpdGVtLCBpbmRleCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXROb2RlID0gdGhpcy5mZXRjaFRhcmdldE5vZGVzKGxheW91dEdyb3VwVGFibGUsIG5vZGUsIGl0ZW0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXNHZW5lcmFsTGluayA9IHRoaXMuaXNHZW5lcmFsTGluayhzb3VyY2VMaW5rRGF0YS50b1N0cmluZygpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldE5vZGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsgPSB0aGlzLmNyZWF0ZUxpbmsobmFtZSwgZ3JvdXAsIGxheW91dCwgbm9kZSwgdGFyZ2V0Tm9kZSwgaW5kZXgsIGxpbmtPcHRpb25zW25hbWVdKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtMaXN0LnB1c2gobGluayk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlzR2VuZXJhbExpbmsgPyB0YXJnZXROb2RlIDogbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldE5vZGUgPSB0aGlzLmZldGNoVGFyZ2V0Tm9kZXMobGF5b3V0R3JvdXBUYWJsZSwgbm9kZSwgc291cmNlTGlua0RhdGEpO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc0dlbmVyYWxMaW5rID0gdGhpcy5pc0dlbmVyYWxMaW5rKHNvdXJjZUxpbmtEYXRhLnRvU3RyaW5nKCkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0YXJnZXROb2RlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmsgPSB0aGlzLmNyZWF0ZUxpbmsobmFtZSwgZ3JvdXAsIGxheW91dCwgbm9kZSwgdGFyZ2V0Tm9kZSwgbnVsbCwgbGlua09wdGlvbnNbbmFtZV0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5rTGlzdC5wdXNoKGxpbmspO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBub2RlW25hbWVdID0gaXNHZW5lcmFsTGluayA/IHRhcmdldE5vZGUgOiBudWxsO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgcmV0dXJuIGxpbmtMaXN0O1xyXG4gICAgfVxyXG4gICAgY29uc3RydWN0SW5kZXhMYWJlbChncm91cCwgbGF5b3V0LCBpbmRleExhYmVsT3B0aW9ucywgbm9kZXMpIHtcclxuICAgICAgICBsZXQgaW5kZXhMYWJlbExpc3QgPSBbXSwgaW5kZXhOYW1lcyA9IE9iamVjdC5rZXlzKGluZGV4TGFiZWxPcHRpb25zKTtcclxuICAgICAgICBpbmRleE5hbWVzLmZvckVhY2gobmFtZSA9PiB7XHJcbiAgICAg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lbS5zb3VyY2VUeXBlID09PSBmaWVsZCkpIHtcclxuICAgICAgICAgICAgICAgIHNvdXJjZU5vZGVUeXBlID0gZmllbGQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAobGF5b3V0R3JvdXBUYWJsZS5oYXMoZmllbGQpKSB7XHJcbiAgICAgICAgICAgICAgICB0YXJnZXRHcm91cE5hbWUgPSBmaWVsZDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIG5vZGVMaXN0ID0gbGF5b3V0R3JvdXBUYWJsZS5nZXQodGFyZ2V0R3JvdXBOYW1lKS5ub2RlLmZpbHRlcihpdGVtID0+IGl0ZW0uc291cmNlVHlwZSA9PT0gc291cmNlTm9kZVR5cGUpO1xyXG4gICAgICAgIGlmIChub2RlTGlzdCA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0YXJnZXROb2RlID0gbm9kZUxpc3QuZmluZChpdGVtID0+IGl0ZW0uc291cmNlSWQgPT09IHRhcmdldElkKTtcclxuICAgICAgICByZXR1cm4gdGFyZ2V0Tm9kZSB8fCBudWxsO1xyXG4gICAgfVxyXG4gICAgaXNHZW5lcmFsTGluayhsaW5rSWQpIHtcclxuICAgICAgICBsZXQgY291bnRlciA9IDA7XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5rSWQubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYgKGxpbmtJZFtpXSA9PT0gJyMnKSB7XHJcbiAgICAgICAgICAgICAgICBjb3VudGVyKys7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGNvdW50ZXIgPD0gMjtcclxuICAgIH1cclxuICAgIGdldExheW91dEdyb3VwVGFibGUoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMubGF5b3V0R3JvdXBUYWJsZTtcclxuICAgIH1cclxuICAgIGRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy5sYXlvdXRHcm91cFRhYmxlID0gbnVsbDtcclxuICAgICAgICB0aGlzLnByZXZTb3VyY2VzU3RyaW5nTWFwID0gbnVsbDtcclxuICAgIH1cclxufVxyXG5leHBvcnRzLk1vZGVsQ29uc3RydWN0b3IgPSBNb2RlbENvbnN0cnVjdG9yO1xyXG47XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/Model/modelConstructor.ts\n"); + +/***/ }), + +/***/ "./src/RegisteredShape/arrayNode.ts": +/*!******************************************!*\ + !*** ./src/RegisteredShape/arrayNode.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.default.registerNode('array-node', {\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [1, 0.5],\r\n [0.5, 1],\r\n [0, 0.5]\r\n ];\r\n }\r\n}, 'rect');\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2FycmF5Tm9kZS50cz83NWQxIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQsYUFBYSxtQkFBTyxDQUFDLHFFQUFVO0FBQy9CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUMiLCJmaWxlIjoiLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2FycmF5Tm9kZS50cy5qcyIsInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xyXG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XHJcbmNvbnN0IGc2XzEgPSByZXF1aXJlKFwiQGFudHYvZzZcIik7XHJcbmV4cG9ydHMuZGVmYXVsdCA9IGc2XzEuZGVmYXVsdC5yZWdpc3Rlck5vZGUoJ2FycmF5LW5vZGUnLCB7XHJcbiAgICBnZXRBbmNob3JQb2ludHMoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgWzAuNSwgMF0sXHJcbiAgICAgICAgICAgIFsxLCAwLjVdLFxyXG4gICAgICAgICAgICBbMC41LCAxXSxcclxuICAgICAgICAgICAgWzAsIDAuNV1cclxuICAgICAgICBdO1xyXG4gICAgfVxyXG59LCAncmVjdCcpO1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/RegisteredShape/arrayNode.ts\n"); /***/ }), @@ -13940,7 +13964,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nex /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('binary-tree-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size;\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor,\r\n fill: '#eee'\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 4 + width / 2,\r\n y: height / 2,\r\n width: width / 2,\r\n height: height,\r\n fill: cfg.color || cfg.style.fill,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'mid',\r\n draggable: true\r\n });\r\n if (cfg.label) {\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n group.addShape('text', {\r\n attrs: {\r\n x: width,\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [0.875, 0.5],\r\n [0.5, 1],\r\n [0.125, 0.5]\r\n ];\r\n },\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2JpbmFyeVRyZWVOb2RlLnRzPzc1YjAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBOEMsY0FBYztBQUM1RCxhQUFhLG1CQUFPLENBQUMscUVBQVU7QUFDL0I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF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cnNvcixcclxuICAgICAgICAgICAgICAgIGZpbGw6ICcjZWVlJ1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBuYW1lOiAnd3JhcHBlcidcclxuICAgICAgICB9KTtcclxuICAgICAgICBncm91cC5hZGRTaGFwZSgncmVjdCcsIHtcclxuICAgICAgICAgICAgYXR0cnM6IHtcclxuICAgICAgICAgICAgICAgIHg6IHdpZHRoIC8gNCArIHdpZHRoIC8gMixcclxuICAgICAgICAgICAgICAgIHk6IGhlaWdodCAvIDIsXHJcbiAgICAgICAgICAgICAgICB3aWR0aDogd2lkdGggLyAyLFxyXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICBmaWxsOiBjZmcuY29sb3IgfHwgY2ZnLnN0eWxlLmZpbGwsXHJcbiAgICAgICAgICAgICAgICBzdHJva2U6IGNmZy5zdHlsZS5zdHJva2UgfHwgJyMzMzMnLFxyXG4gICAgICAgICAgICAgICAgY3Vyc29yOiBjZmcuc3R5bGUuY3Vyc29yXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG5hbWU6ICdtaWQnLFxyXG4gICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICB9KTtcclxuICAgICAgICBpZiAoY2ZnLmxhYmVsKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHN0eWxlID0gKGNmZy5sYWJlbENmZyAmJiBjZmcubGFiZWxDZmcuc3R5bGUpIHx8IHt9O1xyXG4gICAgICAgICAgICBncm91cC5hZGRTaGFwZSgndGV4dCcsIHtcclxuICAgICAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgeDogd2lkdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgeTogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEJhc2VsaW5lOiAnbWlkZGxlJyxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiBjZmcubGFiZWwsXHJcbiAgICAgICAgICAgICAgICAgICAgZmlsbDogc3R5bGUuZmlsbCB8fCAnIzAwMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZm9udFNpemU6IHN0eWxlLmZvbnRTaXplIHx8IDE2LFxyXG4gICAgICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvclxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIG5hbWU6ICd0ZXh0JyxcclxuICAgICAgICAgICAgICAgIGRyYWdnYWJsZTogdHJ1ZVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHdyYXBwZXJSZWN0O1xyXG4gICAgfSxcclxuICAgIGdldEFuY2hvclBvaW50cygpIHtcclxuICAgICAgICByZXR1cm4gW1xyXG4gICAgICAgICAgICBbMC41LCAwXSxcclxuICAgICAgICAgICAgWzAuODc1LCAwLjVdLFxyXG4gICAgICAgICAgICBbMC41LCAxXSxcclxuICAgICAgICAgICAgWzAuMTI1LCAwLjVdXHJcbiAgICAgICAgXTtcclxuICAgIH0sXHJcbn0pO1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/RegisteredShape/binaryTreeNode.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('binary-tree-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size;\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor,\r\n fill: cfg.style.backgroundFill || '#eee'\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 4 + width / 2,\r\n y: height / 2,\r\n width: width / 2,\r\n height: height,\r\n fill: cfg.color || cfg.style.fill,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'mid',\r\n draggable: true\r\n });\r\n if (cfg.label) {\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n group.addShape('text', {\r\n attrs: {\r\n x: width,\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [0.875, 0.5],\r\n [0.5, 1],\r\n [0.125, 0.5]\r\n ];\r\n },\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2JpbmFyeVRyZWVOb2RlLnRzPzc1YjAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBOEMsY0FBYztBQUM1RCxhQUFhLG1CQUFPLENBQUMscUVBQVU7QUFDL0I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E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1cnNvcjogY2ZnLnN0eWxlLmN1cnNvcixcclxuICAgICAgICAgICAgICAgIGZpbGw6IGNmZy5zdHlsZS5iYWNrZ3JvdW5kRmlsbCB8fCAnI2VlZSdcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbmFtZTogJ3dyYXBwZXInXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3JlY3QnLCB7XHJcbiAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICB4OiB3aWR0aCAvIDQgKyB3aWR0aCAvIDIsXHJcbiAgICAgICAgICAgICAgICB5OiBoZWlnaHQgLyAyLFxyXG4gICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoIC8gMixcclxuICAgICAgICAgICAgICAgIGhlaWdodDogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgZmlsbDogY2ZnLmNvbG9yIHx8IGNmZy5zdHlsZS5maWxsLFxyXG4gICAgICAgICAgICAgICAgc3Ryb2tlOiBjZmcuc3R5bGUuc3Ryb2tlIHx8ICcjMzMzJyxcclxuICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvclxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBuYW1lOiAnbWlkJyxcclxuICAgICAgICAgICAgZHJhZ2dhYmxlOiB0cnVlXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKGNmZy5sYWJlbCkge1xyXG4gICAgICAgICAgICBjb25zdCBzdHlsZSA9IChjZmcubGFiZWxDZmcgJiYgY2ZnLmxhYmVsQ2ZnLnN0eWxlKSB8fCB7fTtcclxuICAgICAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3RleHQnLCB7XHJcbiAgICAgICAgICAgICAgICBhdHRyczoge1xyXG4gICAgICAgICAgICAgICAgICAgIHg6IHdpZHRoLFxyXG4gICAgICAgICAgICAgICAgICAgIHk6IGhlaWdodCxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0QWxpZ246ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHRCYXNlbGluZTogJ21pZGRsZScsXHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dDogY2ZnLmxhYmVsLFxyXG4gICAgICAgICAgICAgICAgICAgIGZpbGw6IHN0eWxlLmZpbGwgfHwgJyMwMDAnLFxyXG4gICAgICAgICAgICAgICAgICAgIGZvbnRTaXplOiBzdHlsZS5mb250U2l6ZSB8fCAxNixcclxuICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IGNmZy5zdHlsZS5jdXJzb3JcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBuYW1lOiAndGV4dCcsXHJcbiAgICAgICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB3cmFwcGVyUmVjdDtcclxuICAgIH0sXHJcbiAgICBnZXRBbmNob3JQb2ludHMoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgWzAuNSwgMF0sXHJcbiAgICAgICAgICAgIFswLjg3NSwgMC41XSxcclxuICAgICAgICAgICAgWzAuNSwgMV0sXHJcbiAgICAgICAgICAgIFswLjEyNSwgMC41XVxyXG4gICAgICAgIF07XHJcbiAgICB9LFxyXG59KTtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/RegisteredShape/binaryTreeNode.ts\n"); /***/ }), @@ -13976,7 +14000,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nco /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('link-list-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size || [30, 10];\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke || '#333',\r\n fill: '#eee',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width * (2 / 3),\r\n height: height,\r\n fill: cfg.style.fill,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'main-rect',\r\n draggable: true\r\n });\r\n if (cfg.label) {\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (5 / 6),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [5 / 6, 0],\r\n [5 / 6, 0.5],\r\n [1, 0.5],\r\n [5 / 6, 1],\r\n [0.5, 1],\r\n [0, 0.5]\r\n ];\r\n }\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2xpbmtMaXN0Tm9kZS50cz8yZjZjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQsYUFBYSxtQkFBTyxDQUFDLHFFQUFVO0FBQy9CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QU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ICAgICAgICB5OiBoZWlnaHQgLyAyLFxyXG4gICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoLFxyXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICBzdHJva2U6IGNmZy5zdHlsZS5zdHJva2UgfHwgJyMzMzMnLFxyXG4gICAgICAgICAgICAgICAgZmlsbDogJyNlZWUnLFxyXG4gICAgICAgICAgICAgICAgY3Vyc29yOiBjZmcuc3R5bGUuY3Vyc29yXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG5hbWU6ICd3cmFwcGVyJ1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGdyb3VwLmFkZFNoYXBlKCdyZWN0Jywge1xyXG4gICAgICAgICAgICBhdHRyczoge1xyXG4gICAgICAgICAgICAgICAgeDogd2lkdGggLyAyLFxyXG4gICAgICAgICAgICAgICAgeTogaGVpZ2h0IC8gMixcclxuICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCAqICgyIC8gMyksXHJcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCxcclxuICAgICAgICAgICAgICAgIGZpbGw6IGNmZy5zdHlsZS5maWxsLFxyXG4gICAgICAgICAgICAgICAgc3Ryb2tlOiBjZmcuc3R5bGUuc3Ryb2tlIHx8ICcjMzMzJyxcclxuICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvclxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBuYW1lOiAnbWFpbi1yZWN0JyxcclxuICAgICAgICAgICAgZHJhZ2dhYmxlOiB0cnVlXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKGNmZy5sYWJlbCkge1xyXG4gICAgICAgICAgICBjb25zdCBzdHlsZSA9IChjZmcubGFiZWxDZmcgJiYgY2ZnLmxhYmVsQ2ZnLnN0eWxlKSB8fCB7fTtcclxuICAgICAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3RleHQnLCB7XHJcbiAgICAgICAgICAgICAgICBhdHRyczoge1xyXG4gICAgICAgICAgICAgICAgICAgIHg6IHdpZHRoICogKDUgLyA2KSxcclxuICAgICAgICAgICAgICAgICAgICB5OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEFsaWduOiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICdtaWRkbGUnLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IGNmZy5sYWJlbCxcclxuICAgICAgICAgICAgICAgICAgICBmaWxsOiBzdHlsZS5maWxsIHx8ICcjMDAwJyxcclxuICAgICAgICAgICAgICAgICAgICBmb250U2l6ZTogc3R5bGUuZm9udFNpemUgfHwgMTZcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBuYW1lOiAndGV4dCcsXHJcbiAgICAgICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB3cmFwcGVyUmVjdDtcclxuICAgIH0sXHJcbiAgICBnZXRBbmNob3JQb2ludHMoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgWzAuNSwgMF0sXHJcbiAgICAgICAgICAgIFs1IC8gNiwgMF0sXHJcbiAgICAgICAgICAgIFs1IC8gNiwgMC41XSxcclxuICAgICAgICAgICAgWzEsIDAuNV0sXHJcbiAgICAgICAgICAgIFs1IC8gNiwgMV0sXHJcbiAgICAgICAgICAgIFswLjUsIDFdLFxyXG4gICAgICAgICAgICBbMCwgMC41XVxyXG4gICAgICAgIF07XHJcbiAgICB9XHJcbn0pO1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/RegisteredShape/linkListNode.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('link-list-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size || [30, 10];\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke || '#333',\r\n fill: cfg.style.backgroundFill || '#eee',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width * (2 / 3),\r\n height: height,\r\n fill: cfg.style.fill,\r\n stroke: cfg.style.stroke || '#333',\r\n cursor: cfg.style.cursor\r\n },\r\n name: 'main-rect',\r\n draggable: true\r\n });\r\n if (cfg.label) {\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (5 / 6),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [5 / 6, 0],\r\n [5 / 6, 0.5],\r\n [1, 0.5],\r\n [5 / 6, 1],\r\n [0.5, 1],\r\n [0, 0.5]\r\n ];\r\n }\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL2xpbmtMaXN0Tm9kZS50cz8yZjZjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQsYUFBYSxtQ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hhcGUoJ3JlY3QnLCB7XHJcbiAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICB4OiB3aWR0aCAvIDIsXHJcbiAgICAgICAgICAgICAgICB5OiBoZWlnaHQgLyAyLFxyXG4gICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoLFxyXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICBzdHJva2U6IGNmZy5zdHlsZS5zdHJva2UgfHwgJyMzMzMnLFxyXG4gICAgICAgICAgICAgICAgZmlsbDogY2ZnLnN0eWxlLmJhY2tncm91bmRGaWxsIHx8ICcjZWVlJyxcclxuICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvclxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBuYW1lOiAnd3JhcHBlcidcclxuICAgICAgICB9KTtcclxuICAgICAgICBncm91cC5hZGRTaGFwZSgncmVjdCcsIHtcclxuICAgICAgICAgICAgYXR0cnM6IHtcclxuICAgICAgICAgICAgICAgIHg6IHdpZHRoIC8gMixcclxuICAgICAgICAgICAgICAgIHk6IGhlaWdodCAvIDIsXHJcbiAgICAgICAgICAgICAgICB3aWR0aDogd2lkdGggKiAoMiAvIDMpLFxyXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICBmaWxsOiBjZmcuc3R5bGUuZmlsbCxcclxuICAgICAgICAgICAgICAgIHN0cm9rZTogY2ZnLnN0eWxlLnN0cm9rZSB8fCAnIzMzMycsXHJcbiAgICAgICAgICAgICAgICBjdXJzb3I6IGNmZy5zdHlsZS5jdXJzb3JcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbmFtZTogJ21haW4tcmVjdCcsXHJcbiAgICAgICAgICAgIGRyYWdnYWJsZTogdHJ1ZVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmIChjZmcubGFiZWwpIHtcclxuICAgICAgICAgICAgY29uc3Qgc3R5bGUgPSAoY2ZnLmxhYmVsQ2ZnICYmIGNmZy5sYWJlbENmZy5zdHlsZSkgfHwge307XHJcbiAgICAgICAgICAgIGdyb3VwLmFkZFNoYXBlKCd0ZXh0Jywge1xyXG4gICAgICAgICAgICAgICAgYXR0cnM6IHtcclxuICAgICAgICAgICAgICAgICAgICB4OiB3aWR0aCAqICg1IC8gNiksXHJcbiAgICAgICAgICAgICAgICAgICAgeTogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEJhc2VsaW5lOiAnbWlkZGxlJyxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiBjZmcubGFiZWwsXHJcbiAgICAgICAgICAgICAgICAgICAgZmlsbDogc3R5bGUuZmlsbCB8fCAnIzAwMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZm9udFNpemU6IHN0eWxlLmZvbnRTaXplIHx8IDE2XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgbmFtZTogJ3RleHQnLFxyXG4gICAgICAgICAgICAgICAgZHJhZ2dhYmxlOiB0cnVlXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gd3JhcHBlclJlY3Q7XHJcbiAgICB9LFxyXG4gICAgZ2V0QW5jaG9yUG9pbnRzKCkge1xyXG4gICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgIFswLjUsIDBdLFxyXG4gICAgICAgICAgICBbNSAvIDYsIDBdLFxyXG4gICAgICAgICAgICBbNSAvIDYsIDAuNV0sXHJcbiAgICAgICAgICAgIFsxLCAwLjVdLFxyXG4gICAgICAgICAgICBbNSAvIDYsIDFdLFxyXG4gICAgICAgICAgICBbMC41LCAxXSxcclxuICAgICAgICAgICAgWzAsIDAuNV1cclxuICAgICAgICBdO1xyXG4gICAgfVxyXG59KTtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/RegisteredShape/linkListNode.ts\n"); /***/ }), @@ -14000,7 +14024,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nco /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('two-cell-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size || [30, 10];\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke,\r\n fill: '#eee'\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width / 2,\r\n height: height,\r\n fill: cfg.style.fill,\r\n stroke: cfg.style.stroke\r\n },\r\n name: 'left-rect',\r\n draggable: true\r\n });\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n if (cfg.label) {\r\n if (Array.isArray(cfg.label)) {\r\n let tag = cfg.label[0], data = cfg.label[1];\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (3 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: tag,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (5 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: data,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n else {\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (3 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [3 / 4, 0.5],\r\n [0.5, 1],\r\n [0, 0.5]\r\n ];\r\n }\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL3R3b0NlbGxOb2RlLnRzP2ZkMDUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBOEMsY0FBYztBQUM1RCxhQUFhLG1CQUFPLENBQUMscUVBQVU7QUFDL0I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCO0FBQ3JCO0FBQ0E7QUFDQSxpQkFBaUI7QUFDakI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxxQkFBcUI7QUFDckI7QUFDQTtBQUNBLGlCQUFp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mZy5zdHlsZS5zdHJva2UsXHJcbiAgICAgICAgICAgICAgICBmaWxsOiAnI2VlZSdcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbmFtZTogJ3dyYXBwZXInXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3JlY3QnLCB7XHJcbiAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICB4OiB3aWR0aCAvIDIsXHJcbiAgICAgICAgICAgICAgICB5OiBoZWlnaHQgLyAyLFxyXG4gICAgICAgICAgICAgICAgd2lkdGg6IHdpZHRoIC8gMixcclxuICAgICAgICAgICAgICAgIGhlaWdodDogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgZmlsbDogY2ZnLnN0eWxlLmZpbGwsXHJcbiAgICAgICAgICAgICAgICBzdHJva2U6IGNmZy5zdHlsZS5zdHJva2VcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbmFtZTogJ2xlZnQtcmVjdCcsXHJcbiAgICAgICAgICAgIGRyYWdnYWJsZTogdHJ1ZVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGNvbnN0IHN0eWxlID0gKGNmZy5sYWJlbENmZyAmJiBjZmcubGFiZWxDZmcuc3R5bGUpIHx8IHt9O1xyXG4gICAgICAgIGlmIChjZmcubGFiZWwpIHtcclxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoY2ZnLmxhYmVsKSkge1xyXG4gICAgICAgICAgICAgICAgbGV0IHRhZyA9IGNmZy5sYWJlbFswXSwgZGF0YSA9IGNmZy5sYWJlbFsxXTtcclxuICAgICAgICAgICAgICAgIGdyb3VwLmFkZFNoYXBlKCd0ZXh0Jywge1xyXG4gICAgICAgICAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6IHdpZHRoICogKDMgLyA0KSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeTogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QWxpZ246ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICdtaWRkbGUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiB0YWcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGw6IHN0eWxlLmZpbGwgfHwgJyMwMDAnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb250U2l6ZTogc3R5bGUuZm9udFNpemUgfHwgMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvcixcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6ICd0ZXh0JyxcclxuICAgICAgICAgICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3RleHQnLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgYXR0cnM6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDogd2lkdGggKiAoNSAvIDQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRCYXNlbGluZTogJ21pZGRsZScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGRhdGEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGw6IHN0eWxlLmZpbGwgfHwgJyMwMDAnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb250U2l6ZTogc3R5bGUuZm9udFNpemUgfHwgMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvcixcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6ICd0ZXh0JyxcclxuICAgICAgICAgICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgZ3JvdXAuYWRkU2hhcGUoJ3RleHQnLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgYXR0cnM6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgeDogd2lkdGggKiAoMyAvIDQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB5OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRCYXNlbGluZTogJ21pZGRsZScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGNmZy5sYWJlbCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsbDogc3R5bGUuZmlsbCB8fCAnIzAwMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnRTaXplOiBzdHlsZS5mb250U2l6ZSB8fCAxNixcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yOiBjZmcuc3R5bGUuY3Vyc29yLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogJ3RleHQnLFxyXG4gICAgICAgICAgICAgICAgICAgIGRyYWdnYWJsZTogdHJ1ZVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHdyYXBwZXJSZWN0O1xyXG4gICAgfSxcclxuICAgIGdldEFuY2hvclBvaW50cygpIHtcclxuICAgICAgICByZXR1cm4gW1xyXG4gICAgICAgICAgICBbMC41LCAwXSxcclxuICAgICAgICAgICAgWzMgLyA0LCAwLjVdLFxyXG4gICAgICAgICAgICBbMC41LCAxXSxcclxuICAgICAgICAgICAgWzAsIDAuNV1cclxuICAgICAgICBdO1xyXG4gICAgfVxyXG59KTtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/RegisteredShape/twoCellNode.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nexports.default = g6_1.registerNode('two-cell-node', {\r\n draw(cfg, group) {\r\n cfg.size = cfg.size || [30, 10];\r\n const width = cfg.size[0], height = cfg.size[1];\r\n const wrapperRect = group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width,\r\n height: height,\r\n stroke: cfg.style.stroke,\r\n fill: cfg.style.backgroundFill || '#eee'\r\n },\r\n name: 'wrapper'\r\n });\r\n group.addShape('rect', {\r\n attrs: {\r\n x: width / 2,\r\n y: height / 2,\r\n width: width / 2,\r\n height: height,\r\n fill: cfg.style.fill,\r\n stroke: cfg.style.stroke\r\n },\r\n name: 'left-rect',\r\n draggable: true\r\n });\r\n const style = (cfg.labelCfg && cfg.labelCfg.style) || {};\r\n if (cfg.label) {\r\n if (Array.isArray(cfg.label)) {\r\n let tag = cfg.label[0], data = cfg.label[1];\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (3 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: tag,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (5 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: data,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n else {\r\n group.addShape('text', {\r\n attrs: {\r\n x: width * (3 / 4),\r\n y: height,\r\n textAlign: 'center',\r\n textBaseline: 'middle',\r\n text: cfg.label,\r\n fill: style.fill || '#000',\r\n fontSize: style.fontSize || 16,\r\n cursor: cfg.style.cursor,\r\n },\r\n name: 'text',\r\n draggable: true\r\n });\r\n }\r\n }\r\n return wrapperRect;\r\n },\r\n getAnchorPoints() {\r\n return [\r\n [0.5, 0],\r\n [3 / 4, 0.5],\r\n [0.5, 1],\r\n [0, 0.5]\r\n ];\r\n }\r\n});\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvUmVnaXN0ZXJlZFNoYXBlL3R3b0NlbGxOb2RlLnRzP2ZkMDUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBOEMsY0FBYztBQUM1RCxhQUFhLG1CQUFPLENBQUMscUVBQVU7QUFDL0I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCO0FBQ3JCO0FBQ0E7QUFDQSxpQkFBaUI7QUFDakI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFD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ICAgICAgaGVpZ2h0OiBoZWlnaHQsXHJcbiAgICAgICAgICAgICAgICBzdHJva2U6IGNmZy5zdHlsZS5zdHJva2UsXHJcbiAgICAgICAgICAgICAgICBmaWxsOiBjZmcuc3R5bGUuYmFja2dyb3VuZEZpbGwgfHwgJyNlZWUnXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG5hbWU6ICd3cmFwcGVyJ1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGdyb3VwLmFkZFNoYXBlKCdyZWN0Jywge1xyXG4gICAgICAgICAgICBhdHRyczoge1xyXG4gICAgICAgICAgICAgICAgeDogd2lkdGggLyAyLFxyXG4gICAgICAgICAgICAgICAgeTogaGVpZ2h0IC8gMixcclxuICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCAvIDIsXHJcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCxcclxuICAgICAgICAgICAgICAgIGZpbGw6IGNmZy5zdHlsZS5maWxsLFxyXG4gICAgICAgICAgICAgICAgc3Ryb2tlOiBjZmcuc3R5bGUuc3Ryb2tlXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIG5hbWU6ICdsZWZ0LXJlY3QnLFxyXG4gICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICB9KTtcclxuICAgICAgICBjb25zdCBzdHlsZSA9IChjZmcubGFiZWxDZmcgJiYgY2ZnLmxhYmVsQ2ZnLnN0eWxlKSB8fCB7fTtcclxuICAgICAgICBpZiAoY2ZnLmxhYmVsKSB7XHJcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGNmZy5sYWJlbCkpIHtcclxuICAgICAgICAgICAgICAgIGxldCB0YWcgPSBjZmcubGFiZWxbMF0sIGRhdGEgPSBjZmcubGFiZWxbMV07XHJcbiAgICAgICAgICAgICAgICBncm91cC5hZGRTaGFwZSgndGV4dCcsIHtcclxuICAgICAgICAgICAgICAgICAgICBhdHRyczoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB4OiB3aWR0aCAqICgzIC8gNCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHk6IGhlaWdodCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEFsaWduOiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEJhc2VsaW5lOiAnbWlkZGxlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogdGFnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxsOiBzdHlsZS5maWxsIHx8ICcjMDAwJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZm9udFNpemU6IHN0eWxlLmZvbnRTaXplIHx8IDE2LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IGNmZy5zdHlsZS5jdXJzb3IsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBuYW1lOiAndGV4dCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZHJhZ2dhYmxlOiB0cnVlXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIGdyb3VwLmFkZFNoYXBlKCd0ZXh0Jywge1xyXG4gICAgICAgICAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6IHdpZHRoICogKDUgLyA0KSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeTogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QWxpZ246ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICdtaWRkbGUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBkYXRhLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxsOiBzdHlsZS5maWxsIHx8ICcjMDAwJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZm9udFNpemU6IHN0eWxlLmZvbnRTaXplIHx8IDE2LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IGNmZy5zdHlsZS5jdXJzb3IsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBuYW1lOiAndGV4dCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZHJhZ2dhYmxlOiB0cnVlXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGdyb3VwLmFkZFNoYXBlKCd0ZXh0Jywge1xyXG4gICAgICAgICAgICAgICAgICAgIGF0dHJzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6IHdpZHRoICogKDMgLyA0KSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgeTogaGVpZ2h0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QWxpZ246ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICdtaWRkbGUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBjZmcubGFiZWwsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGw6IHN0eWxlLmZpbGwgfHwgJyMwMDAnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb250U2l6ZTogc3R5bGUuZm9udFNpemUgfHwgMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogY2ZnLnN0eWxlLmN1cnNvcixcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6ICd0ZXh0JyxcclxuICAgICAgICAgICAgICAgICAgICBkcmFnZ2FibGU6IHRydWVcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB3cmFwcGVyUmVjdDtcclxuICAgIH0sXHJcbiAgICBnZXRBbmNob3JQb2ludHMoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgWzAuNSwgMF0sXHJcbiAgICAgICAgICAgIFszIC8gNCwgMC41XSxcclxuICAgICAgICAgICAgWzAuNSwgMV0sXHJcbiAgICAgICAgICAgIFswLCAwLjVdXHJcbiAgICAgICAgXTtcclxuICAgIH1cclxufSk7XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/RegisteredShape/twoCellNode.ts\n"); /***/ }), @@ -14012,7 +14036,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nco /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SV = void 0;\r\nconst engine_1 = __webpack_require__(/*! ./engine */ \"./src/engine.ts\");\r\nconst boundingRect_1 = __webpack_require__(/*! ./Common/boundingRect */ \"./src/Common/boundingRect.ts\");\r\nconst group_1 = __webpack_require__(/*! ./Common/group */ \"./src/Common/group.ts\");\r\nconst pointer_1 = __webpack_require__(/*! ./RegisteredShape/pointer */ \"./src/RegisteredShape/pointer.ts\");\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nconst linkListNode_1 = __webpack_require__(/*! ./RegisteredShape/linkListNode */ \"./src/RegisteredShape/linkListNode.ts\");\r\nconst binaryTreeNode_1 = __webpack_require__(/*! ./RegisteredShape/binaryTreeNode */ \"./src/RegisteredShape/binaryTreeNode.ts\");\r\nconst clenQueuePointer_1 = __webpack_require__(/*! ./RegisteredShape/clenQueuePointer */ \"./src/RegisteredShape/clenQueuePointer.ts\");\r\nconst twoCellNode_1 = __webpack_require__(/*! ./RegisteredShape/twoCellNode */ \"./src/RegisteredShape/twoCellNode.ts\");\r\nconst cursor_1 = __webpack_require__(/*! ./RegisteredShape/cursor */ \"./src/RegisteredShape/cursor.ts\");\r\nconst vector_1 = __webpack_require__(/*! ./Common/vector */ \"./src/Common/vector.ts\");\r\nexports.SV = function (DOMContainer, engineOptions = {}) {\r\n return new engine_1.Engine(DOMContainer, engineOptions);\r\n};\r\nexports.SV.Group = group_1.Group;\r\nexports.SV.Bound = boundingRect_1.Bound;\r\nexports.SV.Vector = vector_1.Vector;\r\nexports.SV.Mat3 = g6_1.Util.mat3;\r\nexports.SV.G6 = g6_1.default;\r\nexports.SV.registeredLayout = {};\r\nexports.SV.registeredShape = [\r\n pointer_1.default,\r\n linkListNode_1.default,\r\n binaryTreeNode_1.default,\r\n twoCellNode_1.default,\r\n cursor_1.default,\r\n clenQueuePointer_1.default,\r\n];\r\nexports.SV.registerShape = g6_1.default.registerNode;\r\nexports.SV.registerLayout = function (name, layoutCreator, mode = 'default') {\r\n if (typeof layoutCreator.sourcesPreprocess !== 'function') {\r\n layoutCreator.sourcesPreprocess = function (data) {\r\n return data;\r\n };\r\n }\r\n if (typeof layoutCreator.defineLeakRule !== 'function') {\r\n layoutCreator.defineLeakRule = function (nodes) {\r\n return nodes;\r\n };\r\n }\r\n if (typeof layoutCreator.defineOptions !== 'function' || typeof layoutCreator.layout !== 'function') {\r\n return;\r\n }\r\n if (exports.SV.registeredLayout[name] === undefined) {\r\n exports.SV.registeredLayout[name] = {};\r\n }\r\n exports.SV.registeredLayout[name][mode] = layoutCreator;\r\n};\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvU3RydWN0Vi50cz83OTRiIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQ7QUFDQSxpQkFBaUIsbUJBQU8sQ0FBQyxpQ0FBVTtBQUNuQyx1QkFBdUIsbUJBQU8sQ0FBQywyREFBdUI7QUFDd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F0b3IuZGVmaW5lT3B0aW9ucyAhPT0gJ2Z1bmN0aW9uJyB8fCB0eXBlb2YgbGF5b3V0Q3JlYXRvci5sYXlvdXQgIT09ICdmdW5jdGlvbicpIHtcclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICBpZiAoZXhwb3J0cy5TVi5yZWdpc3RlcmVkTGF5b3V0W25hbWVdID09PSB1bmRlZmluZWQpIHtcclxuICAgICAgICBleHBvcnRzLlNWLnJlZ2lzdGVyZWRMYXlvdXRbbmFtZV0gPSB7fTtcclxuICAgIH1cclxuICAgIGV4cG9ydHMuU1YucmVnaXN0ZXJlZExheW91dFtuYW1lXVttb2RlXSA9IGxheW91dENyZWF0b3I7XHJcbn07XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/StructV.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SV = void 0;\r\nconst engine_1 = __webpack_require__(/*! ./engine */ \"./src/engine.ts\");\r\nconst boundingRect_1 = __webpack_require__(/*! ./Common/boundingRect */ \"./src/Common/boundingRect.ts\");\r\nconst group_1 = __webpack_require__(/*! ./Common/group */ \"./src/Common/group.ts\");\r\nconst g6_1 = __webpack_require__(/*! @antv/g6 */ \"./node_modules/_@antv_g6@4.5.0@@antv/g6/es/index.js\");\r\nconst pointer_1 = __webpack_require__(/*! ./RegisteredShape/pointer */ \"./src/RegisteredShape/pointer.ts\");\r\nconst linkListNode_1 = __webpack_require__(/*! ./RegisteredShape/linkListNode */ \"./src/RegisteredShape/linkListNode.ts\");\r\nconst binaryTreeNode_1 = __webpack_require__(/*! ./RegisteredShape/binaryTreeNode */ \"./src/RegisteredShape/binaryTreeNode.ts\");\r\nconst clenQueuePointer_1 = __webpack_require__(/*! ./RegisteredShape/clenQueuePointer */ \"./src/RegisteredShape/clenQueuePointer.ts\");\r\nconst twoCellNode_1 = __webpack_require__(/*! ./RegisteredShape/twoCellNode */ \"./src/RegisteredShape/twoCellNode.ts\");\r\nconst arrayNode_1 = __webpack_require__(/*! ./RegisteredShape/arrayNode */ \"./src/RegisteredShape/arrayNode.ts\");\r\nconst cursor_1 = __webpack_require__(/*! ./RegisteredShape/cursor */ \"./src/RegisteredShape/cursor.ts\");\r\nconst vector_1 = __webpack_require__(/*! ./Common/vector */ \"./src/Common/vector.ts\");\r\nexports.SV = function (DOMContainer, engineOptions = {}) {\r\n return new engine_1.Engine(DOMContainer, engineOptions);\r\n};\r\nexports.SV.Group = group_1.Group;\r\nexports.SV.Bound = boundingRect_1.Bound;\r\nexports.SV.Vector = vector_1.Vector;\r\nexports.SV.Mat3 = g6_1.Util.mat3;\r\nexports.SV.G6 = g6_1.default;\r\nexports.SV.registeredLayout = {};\r\nexports.SV.registeredShape = [\r\n pointer_1.default,\r\n linkListNode_1.default,\r\n binaryTreeNode_1.default,\r\n twoCellNode_1.default,\r\n cursor_1.default,\r\n arrayNode_1.default,\r\n clenQueuePointer_1.default,\r\n];\r\nexports.SV.registerShape = g6_1.default.registerNode;\r\nexports.SV.registerLayout = function (name, layoutCreator) {\r\n if (typeof layoutCreator.sourcesPreprocess !== 'function') {\r\n layoutCreator.sourcesPreprocess = function (data) {\r\n return data;\r\n };\r\n }\r\n if (typeof layoutCreator.defineLeakRule !== 'function') {\r\n layoutCreator.defineLeakRule = function (nodes) {\r\n return nodes;\r\n };\r\n }\r\n if (typeof layoutCreator.defineOptions !== 'function' || typeof layoutCreator.layout !== 'function') {\r\n return;\r\n }\r\n exports.SV.registeredLayout[name] = layoutCreator;\r\n};\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvU3RydWN0Vi50cz83OTRiIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhO0FBQ2IsOENBQThDLGNBQWM7QUFDNUQ7QUFDQSxpQkFBaUIsbUJBQU8sQ0FBQy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1bmN0aW9uJykge1xyXG4gICAgICAgIGxheW91dENyZWF0b3IuZGVmaW5lTGVha1J1bGUgPSBmdW5jdGlvbiAobm9kZXMpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG5vZGVzO1xyXG4gICAgICAgIH07XHJcbiAgICB9XHJcbiAgICBpZiAodHlwZW9mIGxheW91dENyZWF0b3IuZGVmaW5lT3B0aW9ucyAhPT0gJ2Z1bmN0aW9uJyB8fCB0eXBlb2YgbGF5b3V0Q3JlYXRvci5sYXlvdXQgIT09ICdmdW5jdGlvbicpIHtcclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICBleHBvcnRzLlNWLnJlZ2lzdGVyZWRMYXlvdXRbbmFtZV0gPSBsYXlvdXRDcmVhdG9yO1xyXG59O1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/StructV.ts\n"); /***/ }), @@ -14048,7 +14072,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nex /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Reconcile = void 0;\r\nconst eventBus_1 = __webpack_require__(/*! ../Common/eventBus */ \"./src/Common/eventBus.ts\");\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nconst SVLink_1 = __webpack_require__(/*! ../Model/SVLink */ \"./src/Model/SVLink.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ../Model/SVNode */ \"./src/Model/SVNode.ts\");\r\nconst SVNodeAppendage_1 = __webpack_require__(/*! ../Model/SVNodeAppendage */ \"./src/Model/SVNodeAppendage.ts\");\r\nconst animation_1 = __webpack_require__(/*! ./animation */ \"./src/View/animation.ts\");\r\nclass Reconcile {\r\n constructor(engine, renderer) {\r\n this.engine = engine;\r\n this.renderer = renderer;\r\n this.prevChangeModels = [];\r\n this.isFirstPatch = true;\r\n }\r\n getContinuousModels(prevModelList, modelList) {\r\n const continuousModels = modelList.filter(item => prevModelList.find(prevModel => item.id === prevModel.id));\r\n return continuousModels;\r\n }\r\n getAppendModels(prevModelList, modelList, accumulateLeakModels) {\r\n const appendModels = modelList.filter(item => !prevModelList.find(model => model.id === item.id));\r\n appendModels.forEach(item => {\r\n let removeIndex = accumulateLeakModels.findIndex(leakModel => item.id === leakModel.id);\r\n if (removeIndex > -1) {\r\n accumulateLeakModels.splice(removeIndex, 1);\r\n }\r\n });\r\n return appendModels;\r\n }\r\n getLeakModels(prevModelList, modelList) {\r\n const potentialLeakModels = prevModelList.filter(item => !modelList.find(model => model.id === item.id) && !item.freed);\r\n const leakModels = [];\r\n potentialLeakModels.forEach(item => {\r\n if (item instanceof SVNode_1.SVNode) {\r\n item.leaked = true;\r\n leakModels.push(item);\r\n item.appendages.forEach(appendage => {\r\n appendage.leaked = true;\r\n leakModels.push(appendage);\r\n });\r\n }\r\n });\r\n potentialLeakModels.forEach(item => {\r\n if (item instanceof SVLink_1.SVLink && item.node.leaked !== false && item.target.leaked !== false) {\r\n item.leaked = true;\r\n leakModels.push(item);\r\n }\r\n });\r\n leakModels.forEach(item => {\r\n item.G6Item = null;\r\n });\r\n return leakModels;\r\n }\r\n getRemoveModels(prevModelList, modelList) {\r\n let removedModels = [];\r\n for (let i = 0; i < prevModelList.length; i++) {\r\n let prevModel = prevModelList[i], target = modelList.find(item => item.id === prevModel.id);\r\n if (target === undefined && !prevModel.leaked) {\r\n removedModels.push(prevModel);\r\n }\r\n }\r\n return removedModels;\r\n }\r\n getReTargetMarkers(prevModelList, modelList) {\r\n const prevMarkers = prevModelList.filter(item => item instanceof SVNodeAppendage_1.SVMarker), markers = modelList.filter(item => item instanceof SVNodeAppendage_1.SVMarker);\r\n return markers.filter(item => prevMarkers.find(prevItem => {\r\n return prevItem.id === item.id && prevItem.target.id !== item.target.id;\r\n }));\r\n }\r\n getLabelChangeModels(prevModelList, modelList) {\r\n let labelChangeModels = [];\r\n modelList.forEach(item => {\r\n const prevItem = prevModelList.find(prevItem => prevItem.id === item.id);\r\n if (prevItem === undefined) {\r\n return;\r\n }\r\n const prevLabel = prevItem.get('label'), label = item.get('label');\r\n if (prevLabel !== label) {\r\n labelChangeModels.push(item);\r\n }\r\n });\r\n return labelChangeModels;\r\n }\r\n getFreedModels(prevModelList, modelList) {\r\n const freedNodes = modelList.filter(item => item instanceof SVNode_1.SVNode && item.freed);\r\n freedNodes.forEach(item => {\r\n const prev = prevModelList.find(prevModel => item.id === prevModel.id);\r\n if (prev) {\r\n item.set('label', prev.get('label'));\r\n }\r\n });\r\n return freedNodes;\r\n }\r\n handleContinuousModels(continuousModels) {\r\n for (let i = 0; i < continuousModels.length; i++) {\r\n let model = continuousModels[i];\r\n if (model instanceof SVNode_1.SVNode) {\r\n const group = model.G6Item.getContainer();\r\n group.attr({ opacity: 1 });\r\n }\r\n }\r\n }\r\n handleAppendModels(appendModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n appendModels.forEach(item => {\r\n if (item instanceof SVNodeAppendage_1.SVNodeAppendage) {\r\n if (item instanceof SVNodeAppendage_1.SVAddressLabel) {\r\n const AddressLabelG6Group = item.G6Item.getContainer();\r\n AddressLabelG6Group.attr({ opacity: 0 });\r\n }\r\n else {\r\n animation_1.Animations.FADE_IN(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n }\r\n else {\r\n animation_1.Animations.APPEND(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n });\r\n }\r\n handleRemoveModels(removeModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n removeModels.forEach(item => {\r\n animation_1.Animations.REMOVE(item.G6Item, {\r\n duration,\r\n timingFunction,\r\n callback: () => {\r\n this.renderer.removeModel(item);\r\n }\r\n });\r\n });\r\n }\r\n handleLeakModels(leakModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n leakModels.forEach(item => {\r\n if (item instanceof SVNodeAppendage_1.SVAddressLabel) {\r\n animation_1.Animations.FADE_IN(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n });\r\n eventBus_1.EventBus.emit('onLeak', leakModels);\r\n }\r\n handleAccumulateLeakModels(accumulateModels) {\r\n accumulateModels.forEach(item => {\r\n if (item.generalStyle) {\r\n item.set('style', Object.assign({}, item.generalStyle));\r\n }\r\n });\r\n }\r\n handleFreedModels(freedModes) {\r\n const { duration, timingFunction } = this.engine.animationOptions, alpha = 0.4;\r\n freedModes.forEach(item => {\r\n const nodeGroup = item.G6Item.getContainer();\r\n item.set('style', { fill: '#ccc' });\r\n nodeGroup.attr({ opacity: alpha });\r\n if (item.marker) {\r\n const markerGroup = item.marker.G6Item.getContainer();\r\n item.marker.set('style', { fill: '#ccc' });\r\n markerGroup.attr({ opacity: alpha + 0.5 });\r\n }\r\n item.freedLabel.G6Item.toFront();\r\n animation_1.Animations.FADE_IN(item.freedLabel.G6Item, { duration, timingFunction });\r\n });\r\n eventBus_1.EventBus.emit('onFreed', freedModes);\r\n }\r\n handleChangeModels(models) {\r\n if (models.length === 0) {\r\n models = this.prevChangeModels;\r\n }\r\n const changeHighlightColor = this.engine.viewOptions.updateHighlight;\r\n if (!changeHighlightColor || typeof changeHighlightColor !== 'string') {\r\n return;\r\n }\r\n models.forEach(item => {\r\n if (item.generalStyle === undefined) {\r\n item.generalStyle = util_1.Util.objectClone(item.G6ModelProps.style);\r\n }\r\n if (item instanceof SVLink_1.SVLink) {\r\n item.set('style', {\r\n stroke: changeHighlightColor\r\n });\r\n }\r\n else {\r\n item.set('style', {\r\n fill: changeHighlightColor\r\n });\r\n }\r\n });\r\n this.prevChangeModels = models;\r\n }\r\n diff(prevModelList, modelList, accumulateLeakModels) {\r\n const continuousModels = this.getContinuousModels(prevModelList, modelList);\r\n const leakModels = this.getLeakModels(prevModelList, modelList);\r\n const appendModels = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);\r\n const removeModels = this.getRemoveModels(prevModelList, modelList);\r\n const updateModels = [\r\n ...this.getReTargetMarkers(prevModelList, modelList),\r\n ...this.getLabelChangeModels(prevModelList, modelList),\r\n ...appendModels,\r\n ...leakModels\r\n ];\r\n const freedModels = this.getFreedModels(prevModelList, modelList);\r\n return {\r\n CONTINUOUS: continuousModels,\r\n APPEND: appendModels,\r\n REMOVE: removeModels,\r\n FREED: freedModels,\r\n LEAKED: leakModels,\r\n UPDATE: updateModels,\r\n ACCUMULATE_LEAK: [...accumulateLeakModels]\r\n };\r\n }\r\n patch(diffResult) {\r\n const { APPEND, REMOVE, FREED, LEAKED, UPDATE, CONTINUOUS, ACCUMULATE_LEAK } = diffResult;\r\n this.handleAccumulateLeakModels(ACCUMULATE_LEAK);\r\n if (this.isFirstPatch === false) {\r\n this.handleChangeModels(UPDATE);\r\n }\r\n this.handleContinuousModels(CONTINUOUS);\r\n this.handleFreedModels(FREED);\r\n this.handleAppendModels(APPEND);\r\n this.handleLeakModels(LEAKED);\r\n this.handleRemoveModels(REMOVE);\r\n if (this.isFirstPatch) {\r\n this.isFirstPatch = false;\r\n }\r\n }\r\n destroy() {\r\n this.prevChangeModels.length = 0;\r\n }\r\n}\r\nexports.Reconcile = Reconcile;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvVmlldy9yZWNvbmNpbGUudHM/NDRmYiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE4QyxjQUFjO0FBQzVEO0FBQ0EsbUJBQW1CLG1CQUFPLENBQUMsb0RBQW9CO0FBQy9DLGVBQWUsbUJBQU8sQ0FBQyw0Q0FBZ0I7QUFDdkMsaUJBQWlCLG1CQUFPLENBQUMsOENBQWlCO0FBQzFDLGlCQUFpQixtQkFBTyxDQUFDLDhDQUFpQjtBQUMxQywwQkFBMEIsbUJBQU8sQ0FBQyxnRUFBMEI7QUFDNUQsb0JBQW9CLG1CQUF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WQWRkcmVzc0xhYmVsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgQWRkcmVzc0xhYmVsRzZHcm91cCA9IGl0ZW0uRzZJdGVtLmdldENvbnRhaW5lcigpO1xyXG4gICAgICAgICAgICAgICAgICAgIEFkZHJlc3NMYWJlbEc2R3JvdXAuYXR0cih7IG9wYWNpdHk6IDAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBhbmltYXRpb25fMS5BbmltYXRpb25zLkZBREVfSU4oaXRlbS5HNkl0ZW0sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWluZ0Z1bmN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBhbmltYXRpb25fMS5BbmltYXRpb25zLkFQUEVORChpdGVtLkc2SXRlbSwge1xyXG4gICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgIHRpbWluZ0Z1bmN0aW9uXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaGFuZGxlUmVtb3ZlTW9kZWxzKHJlbW92ZU1vZGVscykge1xyXG4gICAgICAgIGxldCB7IGR1cmF0aW9uLCB0aW1pbmdGdW5jdGlvbiB9ID0gdGhpcy5lbmdpbmUuYW5pbWF0aW9uT3B0aW9ucztcclxuICAgICAgICByZW1vdmVNb2RlbHMuZm9yRWFjaChpdGVtID0+IHtcclxuICAgICAgICAgICAgYW5pbWF0aW9uXzEuQW5pbWF0aW9ucy5SRU1PVkUoaXRlbS5HNkl0ZW0sIHtcclxu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bmRNb2RlbHMoQVBQRU5EKTtcclxuICAgICAgICB0aGlzLmhhbmRsZUxlYWtNb2RlbHMoTEVBS0VEKTtcclxuICAgICAgICB0aGlzLmhhbmRsZVJlbW92ZU1vZGVscyhSRU1PVkUpO1xyXG4gICAgICAgIGlmICh0aGlzLmlzRmlyc3RQYXRjaCkge1xyXG4gICAgICAgICAgICB0aGlzLmlzRmlyc3RQYXRjaCA9IGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy5wcmV2Q2hhbmdlTW9kZWxzLmxlbmd0aCA9IDA7XHJcbiAgICB9XHJcbn1cclxuZXhwb3J0cy5SZWNvbmNpbGUgPSBSZWNvbmNpbGU7XHJcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/View/reconcile.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Reconcile = void 0;\r\nconst eventBus_1 = __webpack_require__(/*! ../Common/eventBus */ \"./src/Common/eventBus.ts\");\r\nconst util_1 = __webpack_require__(/*! ../Common/util */ \"./src/Common/util.ts\");\r\nconst SVLink_1 = __webpack_require__(/*! ../Model/SVLink */ \"./src/Model/SVLink.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ../Model/SVNode */ \"./src/Model/SVNode.ts\");\r\nconst SVNodeAppendage_1 = __webpack_require__(/*! ../Model/SVNodeAppendage */ \"./src/Model/SVNodeAppendage.ts\");\r\nconst animation_1 = __webpack_require__(/*! ./animation */ \"./src/View/animation.ts\");\r\nclass Reconcile {\r\n constructor(engine, renderer) {\r\n this.engine = engine;\r\n this.renderer = renderer;\r\n this.isFirstPatch = true;\r\n }\r\n getContinuousModels(prevModelList, modelList) {\r\n const continuousModels = modelList.filter(item => prevModelList.find(prevModel => item.id === prevModel.id));\r\n return continuousModels;\r\n }\r\n getAppendModels(prevModelList, modelList, accumulateLeakModels) {\r\n const appendModels = modelList.filter(item => !prevModelList.find(model => model.id === item.id));\r\n appendModels.forEach(item => {\r\n let removeIndex = accumulateLeakModels.findIndex(leakModel => item.id === leakModel.id);\r\n if (removeIndex > -1) {\r\n accumulateLeakModels.splice(removeIndex, 1);\r\n }\r\n });\r\n return appendModels;\r\n }\r\n getLeakModels(prevModelList, modelList) {\r\n const potentialLeakModels = prevModelList.filter(item => !modelList.find(model => model.id === item.id) && !item.freed);\r\n const leakModels = [];\r\n potentialLeakModels.forEach(item => {\r\n if (item instanceof SVNode_1.SVNode) {\r\n item.leaked = true;\r\n leakModels.push(item);\r\n item.appendages.forEach(appendage => {\r\n appendage.leaked = true;\r\n leakModels.push(appendage);\r\n });\r\n }\r\n });\r\n potentialLeakModels.forEach(item => {\r\n if (item instanceof SVLink_1.SVLink && item.node.leaked !== false && item.target.leaked !== false) {\r\n item.leaked = true;\r\n leakModels.push(item);\r\n }\r\n });\r\n leakModels.forEach(item => {\r\n item.G6Item = null;\r\n });\r\n return leakModels;\r\n }\r\n getRemoveModels(prevModelList, modelList) {\r\n let removedModels = [];\r\n for (let i = 0; i < prevModelList.length; i++) {\r\n let prevModel = prevModelList[i], target = modelList.find(item => item.id === prevModel.id);\r\n if (target === undefined && !prevModel.leaked) {\r\n removedModels.push(prevModel);\r\n }\r\n }\r\n return removedModels;\r\n }\r\n getReTargetMarkers(prevModelList, modelList) {\r\n const prevMarkers = prevModelList.filter(item => item instanceof SVNodeAppendage_1.SVMarker), markers = modelList.filter(item => item instanceof SVNodeAppendage_1.SVMarker);\r\n return markers.filter(item => prevMarkers.find(prevItem => {\r\n return prevItem.id === item.id && prevItem.target.id !== item.target.id;\r\n }));\r\n }\r\n getLabelChangeModels(prevModelList, modelList) {\r\n let labelChangeModels = [];\r\n modelList.forEach(item => {\r\n const prevItem = prevModelList.find(prevItem => prevItem.id === item.id);\r\n if (prevItem === undefined) {\r\n return;\r\n }\r\n const prevLabel = prevItem.get('label'), label = item.get('label');\r\n if (prevLabel !== label) {\r\n labelChangeModels.push(item);\r\n }\r\n });\r\n return labelChangeModels;\r\n }\r\n getFreedModels(prevModelList, modelList) {\r\n const freedNodes = modelList.filter(item => item instanceof SVNode_1.SVNode && item.freed);\r\n freedNodes.forEach(item => {\r\n const prev = prevModelList.find(prevModel => item.id === prevModel.id);\r\n if (prev) {\r\n item.set('label', prev.get('label'));\r\n }\r\n });\r\n return freedNodes;\r\n }\r\n handleContinuousModels(continuousModels) {\r\n for (let i = 0; i < continuousModels.length; i++) {\r\n let model = continuousModels[i];\r\n if (model instanceof SVNode_1.SVNode) {\r\n const group = model.G6Item.getContainer();\r\n group.attr({ opacity: 1 });\r\n }\r\n }\r\n }\r\n handleAppendModels(appendModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n appendModels.forEach(item => {\r\n if (item instanceof SVNodeAppendage_1.SVNodeAppendage) {\r\n if (item instanceof SVNodeAppendage_1.SVAddressLabel) {\r\n const AddressLabelG6Group = item.G6Item.getContainer();\r\n AddressLabelG6Group.attr({ opacity: 0 });\r\n }\r\n else {\r\n animation_1.Animations.FADE_IN(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n }\r\n else {\r\n animation_1.Animations.APPEND(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n });\r\n }\r\n handleRemoveModels(removeModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n removeModels.forEach(item => {\r\n animation_1.Animations.REMOVE(item.G6Item, {\r\n duration,\r\n timingFunction,\r\n callback: () => {\r\n this.renderer.removeModel(item);\r\n }\r\n });\r\n });\r\n }\r\n handleLeakModels(leakModels) {\r\n let { duration, timingFunction } = this.engine.animationOptions;\r\n leakModels.forEach(item => {\r\n if (item instanceof SVNodeAppendage_1.SVAddressLabel) {\r\n animation_1.Animations.FADE_IN(item.G6Item, {\r\n duration,\r\n timingFunction\r\n });\r\n }\r\n });\r\n eventBus_1.EventBus.emit('onLeak', leakModels);\r\n }\r\n handleAccumulateLeakModels(accumulateModels) {\r\n accumulateModels.forEach(item => {\r\n if (item.generalStyle) {\r\n item.set('style', Object.assign({}, item.generalStyle));\r\n }\r\n });\r\n }\r\n handleFreedModels(freedModes) {\r\n const { duration, timingFunction } = this.engine.animationOptions, alpha = 0.4;\r\n freedModes.forEach(item => {\r\n const nodeGroup = item.G6Item.getContainer();\r\n item.set('style', { fill: '#ccc' });\r\n nodeGroup.attr({ opacity: alpha });\r\n if (item.marker) {\r\n const markerGroup = item.marker.G6Item.getContainer();\r\n item.marker.set('style', { fill: '#ccc' });\r\n markerGroup.attr({ opacity: alpha + 0.5 });\r\n }\r\n item.freedLabel.G6Item.toFront();\r\n animation_1.Animations.FADE_IN(item.freedLabel.G6Item, { duration, timingFunction });\r\n });\r\n eventBus_1.EventBus.emit('onFreed', freedModes);\r\n }\r\n handleChangeModels(models) {\r\n const changeHighlightColor = this.engine.viewOptions.updateHighlight;\r\n if (!changeHighlightColor || typeof changeHighlightColor !== 'string') {\r\n return;\r\n }\r\n models.forEach(item => {\r\n if (item.generalStyle === undefined) {\r\n item.generalStyle = util_1.Util.objectClone(item.G6ModelProps.style);\r\n }\r\n if (item instanceof SVLink_1.SVLink) {\r\n item.set('style', {\r\n stroke: changeHighlightColor\r\n });\r\n }\r\n else {\r\n item.set('style', {\r\n fill: changeHighlightColor\r\n });\r\n }\r\n });\r\n }\r\n diff(prevModelList, modelList, accumulateLeakModels) {\r\n const continuousModels = this.getContinuousModels(prevModelList, modelList);\r\n const leakModels = this.getLeakModels(prevModelList, modelList);\r\n const appendModels = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);\r\n const removeModels = this.getRemoveModels(prevModelList, modelList);\r\n const updateModels = [\r\n ...this.getReTargetMarkers(prevModelList, modelList),\r\n ...this.getLabelChangeModels(prevModelList, modelList),\r\n ...appendModels,\r\n ...leakModels\r\n ];\r\n const freedModels = this.getFreedModels(prevModelList, modelList);\r\n return {\r\n CONTINUOUS: continuousModels,\r\n APPEND: appendModels,\r\n REMOVE: removeModels,\r\n FREED: freedModels,\r\n LEAKED: leakModels,\r\n UPDATE: updateModels,\r\n ACCUMULATE_LEAK: [...accumulateLeakModels]\r\n };\r\n }\r\n patch(diffResult) {\r\n const { APPEND, REMOVE, FREED, LEAKED, UPDATE, CONTINUOUS, ACCUMULATE_LEAK } = diffResult;\r\n this.handleAccumulateLeakModels(ACCUMULATE_LEAK);\r\n if (this.isFirstPatch === false) {\r\n this.handleChangeModels(UPDATE);\r\n }\r\n this.handleContinuousModels(CONTINUOUS);\r\n this.handleFreedModels(FREED);\r\n this.handleAppendModels(APPEND);\r\n this.handleLeakModels(LEAKED);\r\n this.handleRemoveModels(REMOVE);\r\n if (this.isFirstPatch) {\r\n this.isFirstPatch = false;\r\n }\r\n }\r\n destroy() { }\r\n}\r\nexports.Reconcile = Reconcile;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvVmlldy9yZWNvbmNpbGUudHM/NDRmYiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE4QyxjQUFjO0FBQzVEO0FBQ0EsbUJBQW1CLG1CQUFPLENBQUMsb0RBQW9CO0FBQy9DLGVBQWUsbUJBQU8sQ0FBQyw0Q0FBZ0I7QUFDdkMsaUJBQWlCLG1CQUFPLENBQUMsOENBQWlCO0FBQzFDLGlCQUFpQixtQkFBTyxDQUFDLDhDQUFpQjtBQUMxQywwQkFBMEIsbUJBQU8sQ0FBQyxnRUFBMEI7QUFDNUQsb0JBQW9CLG1CQUFPLENBQUMsNENBQWE7QUFDekM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0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YXRpb25zLkZBREVfSU4oaXRlbS5HNkl0ZW0sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWluZ0Z1bmN0aW9uXHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBhbmltYXRpb25fMS5BbmltYXRpb25zLkFQUEVORChpdGVtLkc2SXRlbSwge1xyXG4gICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgIHRpbWluZ0Z1bmN0aW9uXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaGFuZGxlUmVtb3ZlTW9kZWxzKHJlbW92ZU1vZGVscykge1xyXG4gICAgICAgIGxldCB7IGR1cmF0aW9uLCB0aW1pbmdGdW5jdGlvbiB9ID0gdGhpcy5lbmdpbmUuYW5pbWF0aW9uT3B0aW9ucztcclxuICAgICAgICByZW1vdmVNb2RlbHMuZm9yRWFjaChpdGVtID0+IHtcclxuICAgICAgICAgICAgYW5pbWF0aW9uXzEuQW5pbWF0aW9ucy5SRU1PVkUoaXRlbS5HNkl0ZW0sIHtcclxuICAgICAgICAgICAgICAgIGR1cmF0aW9uLFxyXG4gICAgICAgICAgICAgICAgdGltaW5nRnVuY3Rpb24sXHJcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIucmVtb3ZlTW9kZWwoaXRlbSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaGFuZGxlTGVha01vZGVscyhsZWFrTW9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ICghY2hhbmdlSGlnaGxpZ2h0Q29sb3IgfHwgdHlwZW9mIGNoYW5nZUhpZ2hsaWdodENvbG9yICE9PSAnc3RyaW5nJykge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIG1vZGVscy5mb3JFYWNoKGl0ZW0gPT4ge1xyXG4gICAgICAgICAgICBpZiAoaXRlbS5nZW5lcmFsU3R5bGUgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgaXRlbS5nZW5lcmFsU3R5bGUgPSB1dGlsXzEuVXRpbC5vYmplY3RDbG9uZShpdGVtLkc2TW9kZWxQcm9wcy5zdHlsZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGl0ZW0gaW5zdGFuY2VvZiBTVkxpbmtfMS5TVkxpbmspIHtcclxuICAgICAgICAgICAgICAgIGl0ZW0uc2V0KCdzdHlsZScsIHtcclxuICAgICAgICAgICAgICAgICAgICBzdHJva2U6IGNoYW5nZUhpZ2hsaWdodENvbG9yXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGl0ZW0uc2V0KCdzdHlsZScsIHtcclxuICAgICAgICAgICAgICAgICAgICBmaWxsOiBjaGFuZ2VIaWdobGlnaHRDb2xvclxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGRpZmYocHJldk1vZGVsTGlzdCwgbW9kZWxMaXN0LCBhY2N1bXVsYXRlTGVha01vZGVscykge1xyXG4gICAgICAgIGNvbnN0IGNvbnRpbnVvdXNNb2RlbHMgPSB0aGlzLmdldENvbnRpbnVvdXNNb2RlbHMocHJldk1vZGVsTGlzdCwgbW9kZWxMaXN0KTtcclxuICAgICAgICBjb25zdCBsZWFrTW9kZWxzID0gdGhpcy5nZXRMZWFr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xlYWtNb2RlbHNdXHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuICAgIHBhdGNoKGRpZmZSZXN1bHQpIHtcclxuICAgICAgICBjb25zdCB7IEFQUEVORCwgUkVNT1ZFLCBGUkVFRCwgTEVBS0VELCBVUERBVEUsIENPTlRJTlVPVVMsIEFDQ1VNVUxBVEVfTEVBSyB9ID0gZGlmZlJlc3VsdDtcclxuICAgICAgICB0aGlzLmhhbmRsZUFjY3VtdWxhdGVMZWFrTW9kZWxzKEFDQ1VNVUxBVEVfTEVBSyk7XHJcbiAgICAgICAgaWYgKHRoaXMuaXNGaXJzdFBhdGNoID09PSBmYWxzZSkge1xyXG4gICAgICAgICAgICB0aGlzLmhhbmRsZUNoYW5nZU1vZGVscyhVUERBVEUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmhhbmRsZUNvbnRpbnVvdXNNb2RlbHMoQ09OVElOVU9VUyk7XHJcbiAgICAgICAgdGhpcy5oYW5kbGVGcmVlZE1vZGVscyhGUkVFRCk7XHJcbiAgICAgICAgdGhpcy5oYW5kbGVBcHBlbmRNb2RlbHMoQVBQRU5EKTtcclxuICAgICAgICB0aGlzLmhhbmRsZUxlYWtNb2RlbHMoTEVBS0VEKTtcclxuICAgICAgICB0aGlzLmhhbmRsZVJlbW92ZU1vZGVscyhSRU1PVkUpO1xyXG4gICAgICAgIGlmICh0aGlzLmlzRmlyc3RQYXRjaCkge1xyXG4gICAgICAgICAgICB0aGlzLmlzRmlyc3RQYXRjaCA9IGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGRlc3Ryb3koKSB7IH1cclxufVxyXG5leHBvcnRzLlJlY29uY2lsZSA9IFJlY29uY2lsZTtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/View/reconcile.ts\n"); /***/ }), @@ -14084,7 +14108,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nex /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Engine = void 0;\r\nconst modelConstructor_1 = __webpack_require__(/*! ./Model/modelConstructor */ \"./src/Model/modelConstructor.ts\");\r\nconst eventBus_1 = __webpack_require__(/*! ./Common/eventBus */ \"./src/Common/eventBus.ts\");\r\nconst viewContainer_1 = __webpack_require__(/*! ./View/viewContainer */ \"./src/View/viewContainer.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ./Model/SVNode */ \"./src/Model/SVNode.ts\");\r\nconst util_1 = __webpack_require__(/*! ./Common/util */ \"./src/Common/util.ts\");\r\nclass Engine {\r\n constructor(DOMContainer, engineOptions) {\r\n this.engineOptions = Object.assign({}, engineOptions);\r\n this.viewOptions = Object.assign({\r\n fitCenter: true,\r\n fitView: false,\r\n groupPadding: 20,\r\n leakAreaHeight: 150,\r\n updateHighlight: '#fc5185'\r\n }, engineOptions.view);\r\n this.animationOptions = Object.assign({\r\n enable: true,\r\n duration: 750,\r\n timingFunction: 'easePolyOut'\r\n }, engineOptions.animation);\r\n this.interactionOptions = Object.assign({\r\n drag: true,\r\n zoom: true,\r\n dragNode: true,\r\n selectNode: true\r\n }, engineOptions.interaction);\r\n this.modelConstructor = new modelConstructor_1.ModelConstructor(this);\r\n this.viewContainer = new viewContainer_1.ViewContainer(this, DOMContainer);\r\n }\r\n render(source) {\r\n if (source === undefined || source === null) {\r\n return;\r\n }\r\n ``;\r\n let stringSource = JSON.stringify(source);\r\n if (this.prevStringSource === stringSource) {\r\n return;\r\n }\r\n this.prevSource = source;\r\n this.prevStringSource = stringSource;\r\n const layoutGroupTable = this.modelConstructor.construct(source);\r\n this.viewContainer.render(layoutGroupTable);\r\n }\r\n switchMode(layout, mode) {\r\n if (this.prevSource === undefined || this.prevSource === null) {\r\n return;\r\n }\r\n Object.keys(this.prevSource).map(group => {\r\n let sourceGroup = this.prevSource[group];\r\n if (sourceGroup.layouter === layout) {\r\n sourceGroup.mode = mode;\r\n }\r\n });\r\n this.render(this.prevSource);\r\n }\r\n reLayout() {\r\n this.viewContainer.reLayout();\r\n }\r\n getGraphInstance() {\r\n return this.viewContainer.getG6Instance();\r\n }\r\n hideGroups(groupNames) {\r\n const names = Array.isArray(groupNames) ? groupNames : [groupNames], instance = this.viewContainer.getG6Instance(), layoutGroupTable = this.modelConstructor.getLayoutGroupTable();\r\n layoutGroupTable.forEach(item => {\r\n const hasName = names.find(name => name === item.layout);\r\n if (hasName && !item.isHide) {\r\n item.modelList.forEach(model => instance.hideItem(model.G6Item));\r\n item.isHide = true;\r\n }\r\n if (!hasName && item.isHide) {\r\n item.modelList.forEach(model => instance.showItem(model.G6Item));\r\n item.isHide = false;\r\n }\r\n });\r\n }\r\n getAllModels() {\r\n const modelList = util_1.Util.convertGroupTable2ModelList(this.modelConstructor.getLayoutGroupTable());\r\n const accumulateLeakModels = this.viewContainer.getAccumulateLeakModels();\r\n return [...modelList, ...accumulateLeakModels];\r\n }\r\n findNode(id) {\r\n const modelList = this.getAllModels();\r\n const stringId = id.toString();\r\n const targetNode = modelList.find(item => item instanceof SVNode_1.SVNode && item.sourceId === stringId);\r\n return targetNode;\r\n }\r\n resize(width, height) {\r\n this.viewContainer.resize(width, height);\r\n }\r\n on(eventName, callback) {\r\n if (typeof callback !== 'function') {\r\n return;\r\n }\r\n if (eventName === 'onFreed' || eventName === 'onLeak') {\r\n eventBus_1.EventBus.on(eventName, callback);\r\n return;\r\n }\r\n if (eventName === 'onLeakAreaUpdate') {\r\n eventBus_1.EventBus.on(eventName, callback);\r\n return;\r\n }\r\n this.viewContainer.getG6Instance().on(eventName, event => {\r\n callback(event.item['SVModel']);\r\n });\r\n }\r\n destroy() {\r\n this.modelConstructor.destroy();\r\n this.viewContainer.destroy();\r\n }\r\n}\r\nexports.Engine = Engine;\r\n;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2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ICBpZiAodGhpcy5wcmV2U3RyaW5nU291cmNlID09PSBzdHJpbmdTb3VyY2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnByZXZTb3VyY2UgPSBzb3VyY2U7XHJcbiAgICAgICAgdGhpcy5wcmV2U3RyaW5nU291cmNlID0gc3RyaW5nU291cmNlO1xyXG4gICAgICAgIGNvbnN0IGxheW91dEdyb3VwVGFibGUgPSB0aGlzLm1vZGVsQ29uc3RydWN0b3IuY29uc3RydWN0KHNvdXJjZSk7XHJcbiAgICAgICAgdGhpcy52aWV3Q29udGFpbmVyLnJlbmRlcihsYXlvdXRHcm91cFRhYmxlKTtcclxuICAgIH1cclxuICAgIHN3aXRjaE1vZGUobGF5b3V0LCBtb2RlKSB7XHJcbiAgICAgICAgaWYgKHRoaXMucHJldlNvdXJjZSA9PT0gdW5kZWZpbmVkIHx8IHRoaXMucHJldlNvdXJjZSA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXMucHJldlNvdXJjZSkubWFwKGdyb3VwID0+IHtcclxuICAgICAgICAgICAgbGV0IHNvdXJjZUdyb3VwID0gdGhpcy5wcmV2U291cmNlW2dyb3VwXTtcclxuICAgICAgICAgICAgaWYgKHNvdXJjZUdyb3VwLmxheW91dGVyID09PSBsYXlvdXQpIHtcclxuICAgICAgICAgICAgICAgIHNvdXJjZUdyb3VwLm1vZGUgPSBtb2RlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5yZW5kZXIodGhpcy5wcmV2U291cmNlKTtcclxuICAgIH1cclxuICAgIHJlTGF5b3V0KCkge1xyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lci5yZUxheW91dCgpO1xyXG4gICAgfVxyXG4gICAgZ2V0R3JhcGhJbnN0YW5jZSgpIHtcclxuICA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S5FdmVudEJ1cy5vbihldmVudE5hbWUsIGNhbGxiYWNrKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZXZlbnROYW1lID09PSAnb25MZWFrQXJlYVVwZGF0ZScpIHtcclxuICAgICAgICAgICAgZXZlbnRCdXNfMS5FdmVudEJ1cy5vbihldmVudE5hbWUsIGNhbGxiYWNrKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnZpZXdDb250YWluZXIuZ2V0RzZJbnN0YW5jZSgpLm9uKGV2ZW50TmFtZSwgZXZlbnQgPT4ge1xyXG4gICAgICAgICAgICBjYWxsYmFjayhldmVudC5pdGVtWydTVk1vZGVsJ10pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgZGVzdHJveSgpIHtcclxuICAgICAgICB0aGlzLm1vZGVsQ29uc3RydWN0b3IuZGVzdHJveSgpO1xyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lci5kZXN0cm95KCk7XHJcbiAgICB9XHJcbn1cclxuZXhwb3J0cy5FbmdpbmUgPSBFbmdpbmU7XHJcbjtcclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/engine.ts\n"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Engine = void 0;\r\nconst modelConstructor_1 = __webpack_require__(/*! ./Model/modelConstructor */ \"./src/Model/modelConstructor.ts\");\r\nconst eventBus_1 = __webpack_require__(/*! ./Common/eventBus */ \"./src/Common/eventBus.ts\");\r\nconst viewContainer_1 = __webpack_require__(/*! ./View/viewContainer */ \"./src/View/viewContainer.ts\");\r\nconst SVNode_1 = __webpack_require__(/*! ./Model/SVNode */ \"./src/Model/SVNode.ts\");\r\nconst util_1 = __webpack_require__(/*! ./Common/util */ \"./src/Common/util.ts\");\r\nclass Engine {\r\n constructor(DOMContainer, engineOptions) {\r\n this.engineOptions = Object.assign({}, engineOptions);\r\n this.viewOptions = Object.assign({\r\n fitCenter: true,\r\n fitView: false,\r\n groupPadding: 20,\r\n leakAreaHeight: 150,\r\n updateHighlight: '#fc5185'\r\n }, engineOptions.view);\r\n this.animationOptions = Object.assign({\r\n enable: true,\r\n duration: 750,\r\n timingFunction: 'easePolyOut'\r\n }, engineOptions.animation);\r\n this.interactionOptions = Object.assign({\r\n drag: true,\r\n zoom: true,\r\n dragNode: true,\r\n selectNode: true\r\n }, engineOptions.interaction);\r\n this.modelConstructor = new modelConstructor_1.ModelConstructor(this);\r\n this.viewContainer = new viewContainer_1.ViewContainer(this, DOMContainer);\r\n }\r\n render(source, force = false) {\r\n if (source === undefined || source === null) {\r\n return;\r\n }\r\n ``;\r\n let stringSource = JSON.stringify(source);\r\n if (force === false && this.prevStringSource === stringSource) {\r\n return;\r\n }\r\n this.prevSource = source;\r\n this.prevStringSource = stringSource;\r\n const layoutGroupTable = this.modelConstructor.construct(source);\r\n this.viewContainer.render(layoutGroupTable);\r\n }\r\n reLayout() {\r\n this.viewContainer.reLayout();\r\n }\r\n getGraphInstance() {\r\n return this.viewContainer.getG6Instance();\r\n }\r\n hideGroups(groupNames) {\r\n const names = Array.isArray(groupNames) ? groupNames : [groupNames], instance = this.viewContainer.getG6Instance(), layoutGroupTable = this.modelConstructor.getLayoutGroupTable();\r\n layoutGroupTable.forEach(item => {\r\n const hasName = names.find(name => name === item.layout);\r\n if (hasName && !item.isHide) {\r\n item.modelList.forEach(model => instance.hideItem(model.G6Item));\r\n item.isHide = true;\r\n }\r\n if (!hasName && item.isHide) {\r\n item.modelList.forEach(model => instance.showItem(model.G6Item));\r\n item.isHide = false;\r\n }\r\n });\r\n }\r\n getAllModels() {\r\n const modelList = util_1.Util.convertGroupTable2ModelList(this.modelConstructor.getLayoutGroupTable());\r\n const accumulateLeakModels = this.viewContainer.getAccumulateLeakModels();\r\n return [...modelList, ...accumulateLeakModels];\r\n }\r\n updateStyle(group, newOptions) {\r\n const models = this.getAllModels(), layoutGroup = this.modelConstructor.getLayoutGroupTable().get(group);\r\n layoutGroup.options = newOptions;\r\n models.forEach(item => {\r\n if (item.group !== group) {\r\n return;\r\n }\r\n const modelType = item.getModelType(), optionsType = layoutGroup.options[modelType];\r\n if (optionsType) {\r\n if (modelType === 'addressLabel') {\r\n item.updateG6ModelStyle(item.generateG6ModelProps(optionsType));\r\n }\r\n else {\r\n const targetModelOption = optionsType[item.sourceType];\r\n if (targetModelOption) {\r\n item.updateG6ModelStyle(item.generateG6ModelProps(targetModelOption));\r\n }\r\n }\r\n }\r\n });\r\n }\r\n findNode(id) {\r\n const modelList = this.getAllModels();\r\n const stringId = id.toString();\r\n const targetNode = modelList.find(item => item instanceof SVNode_1.SVNode && item.sourceId === stringId);\r\n return targetNode;\r\n }\r\n resize(width, height) {\r\n this.viewContainer.resize(width, height);\r\n }\r\n on(eventName, callback) {\r\n if (typeof callback !== 'function') {\r\n return;\r\n }\r\n if (eventName === 'onFreed' || eventName === 'onLeak') {\r\n eventBus_1.EventBus.on(eventName, callback);\r\n return;\r\n }\r\n if (eventName === 'onLeakAreaUpdate') {\r\n eventBus_1.EventBus.on(eventName, callback);\r\n return;\r\n }\r\n this.viewContainer.getG6Instance().on(eventName, event => {\r\n callback(event.item['SVModel']);\r\n });\r\n }\r\n destroy() {\r\n this.modelConstructor.destroy();\r\n this.viewContainer.destroy();\r\n }\r\n}\r\nexports.Engine = Engine;\r\n;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvZW5naW5lLnRzP2ZlNDgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBOEMsY0FBYztBQUM1RDtBQUNBLDJCQUEyQixtQkFBTyxDQUFDLGlFQUEwQjtBQUM3RCxtQkFBbUIsbUJBQU8sQ0FBQyxtREFBbUI7QUFD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jdC5hc3NpZ24oe1xyXG4gICAgICAgICAgICBlbmFibGU6IHRydWUsXHJcbiAgICAgICAgICAgIGR1cmF0aW9uOiA3NTAsXHJcbiAgICAgICAgICAgIHRpbWluZ0Z1bmN0aW9uOiAnZWFzZVBvbHlPdXQnXHJcbiAgICAgICAgfSwgZW5naW5lT3B0aW9ucy5hbmltYXRpb24pO1xyXG4gICAgICAgIHRoaXMuaW50ZXJhY3Rpb25PcHRpb25zID0gT2JqZWN0LmFzc2lnbih7XHJcbiAgICAgICAgICAgIGRyYWc6IHRydWUsXHJcbiAgICAgICAgICAgIHpvb206IHRydWUsXHJcbiAgICAgICAgICAgIGRyYWdOb2RlOiB0cnVlLFxyXG4gICAgICAgICAgICBzZWxlY3ROb2RlOiB0cnVlXHJcbiAgICAgICAgfSwgZW5naW5lT3B0aW9ucy5pbnRlcmFjdGlvbik7XHJcbiAgICAgICAgdGhpcy5tb2RlbENvbnN0cnVjdG9yID0gbmV3IG1vZGVsQ29uc3RydWN0b3JfMS5Nb2RlbENvbnN0cnVjdG9yKHRoaXMpO1xyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lciA9IG5ldyB2aWV3Q29udGFpbmVyXzEuVmlld0NvbnRhaW5lcih0aGlzLCBET01Db250YWluZXIpO1xyXG4gICAgfVxyXG4gICAgcmVuZGVyKHNvdXJjZSwgZm9yY2UgPSBmYWxzZSkge1xyXG4gICAgICAgIGlmIChzb3VyY2UgPT09IHVuZGVmaW5lZCB8fCBzb3VyY2UgPT09IG51bGwpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBgYDtcclxuICAgICAgICBsZXQgc3RyaW5nU291cmNlID0gSlNPTi5zdHJpbmdpZnkoc291cmNlKTtcclxuICAgICAgICBpZiAoZm9yY2UgPT09IGZhbHNlICYmIHRoaXMucHJldlN0cmluZ1NvdXJjZSA9PT0gc3RyaW5nU291cmNlKSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5wcmV2U291cmNlID0gc291cmNlO1xyXG4gICAgICAgIHRoaXMucHJldlN0cmluZ1NvdXJjZSA9IHN0cmluZ1NvdXJjZTtcclxuICAgICAgICBjb25zdCBsYXlvdXRHcm91cFRhYmxlID0gdGhpcy5tb2RlbENvbnN0cnVjdG9yLmNvbnN0cnVjdChzb3VyY2UpO1xyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lci5yZW5kZXIobGF5b3V0R3JvdXBUYWJsZSk7XHJcbiAgICB9XHJcbiAgICByZUxheW91dCgpIHtcclxuICAgICAgICB0aGlzLnZpZXdDb250YWluZXIucmVMYXlvdXQoKTtcclxuICAgIH1cclxuICAgIGdldEdyYXBoSW5zdGFuY2UoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMudmlld0NvbnRhaW5lci5nZXRHNkluc3RhbmNlKCk7XHJcbiAgICB9XHJcbiAgICBoaWRlR3JvdXBzKGdyb3VwTmFtZXMpIHtcclxuICAgICAgICBjb25zdCBuYW1lcyA9IEFycmF5LmlzQXJyYXkoZ3JvdXBOYW1lcykgPyBncm91cE5hbWVzIDogW2dyb3VwTmFtZXNdLCBpbnN0YW5jZSA9IHRoaXMudmlld0NvbnRhaW5lci5nZXRHNkluc3RhbmNlKCksIGxheW91dEdyb3VwVGFibGUgPSB0aGlzLm1vZGVsQ29uc3RydWN0b3IuZ2V0TGF5b3V0R3JvdXBUYWJsZSgpO1xyXG4gICAgICAgIGxheW91dEdyb3VwVGFibGUuZm9yRWFjaChpdGVtID0+IHtcclxuICAgICAgICAgICAgY29uc3QgaGFzTmFtZSA9IG5hbWVzLmZpbmQobmFtZSA9PiBuYW1lID09PSBpdGVtLmxheW91dCk7XHJcbiAgICAgICAgICAgIGlmIChoYXNOYW1lICYmICFpdGVtLmlzSGlkZSkge1xyXG4gICAgICAgICAgICAgICAgaXRlbS5tb2RlbExpc3QuZm9yRWFjaChtb2RlbCA9PiBpbnN0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RlbSA9PiB7XHJcbiAgICAgICAgICAgIGlmIChpdGVtLmdyb3VwICE9PSBncm91cCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IG1vZGVsVHlwZSA9IGl0ZW0uZ2V0TW9kZWxUeXBlKCksIG9wdGlvbnNUeXBlID0gbGF5b3V0R3JvdXAub3B0aW9uc1ttb2RlbFR5cGVdO1xyXG4gICAgICAgICAgICBpZiAob3B0aW9uc1R5cGUpIHtcclxuICAgICAgICAgICAgICAgIGlmIChtb2RlbFR5cGUgPT09ICdhZGRyZXNzTGFiZWwnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaXRlbS51cGRhdGVHNk1vZGVsU3R5bGUoaXRlbS5nZW5lcmF0ZUc2TW9kZWxQcm9wcyhvcHRpb25zVHlwZSkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdGFyZ2V0TW9kZWxPcHRpb24gPSBvcHRpb25zVHlwZVtpdGVtLnNvdXJjZVR5cGVdO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0YXJnZXRNb2RlbE9wdGlvbikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnVwZGF0ZUc2TW9kZWxTdHlsZShpdGVtLmdlbmVyYXRlRzZNb2RlbFByb3BzKHRhcmdldE1vZGVsT3B0aW9uKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBmaW5kTm9kZShpZCkge1xyXG4gICAgICAgIGNvbnN0IG1vZGVsTGlzdCA9IHRoaXMuZ2V0QWxsTW9kZWxzKCk7XHJcbiAgICAgICAgY29uc3Qgc3RyaW5nSWQgPSBpZC50b1N0cmluZygpO1xyXG4gICAgICAgIGNvbnN0IHRhcmdldE5vZGUgPSBtb2RlbExpc3QuZmluZChpdGVtID0+IGl0ZW0gaW5zdGFuY2VvZiBTVk5vZGVfMS5TVk5vZGUgJiYgaXRlbS5zb3VyY2VJZCA9PT0gc3RyaW5nSWQpO1xyXG4gICAgICAgIHJldHVybiB0YXJnZXROb2RlO1xyXG4gICAgfVxyXG4gICAgcmVzaXplKHdpZHRoLCBoZWlnaHQpIHtcclxuICAgICAgICB0aGlzLnZpZXdDb250YWluZXIucmVzaXplKHdpZHRoLCBoZWlnaHQpO1xyXG4gICAgfVxyXG4gICAgb24oZXZlbnROYW1lLCBjYWxsYmFjaykge1xyXG4gICAgICAgIGlmICh0eXBlb2YgY2FsbGJhY2sgIT09ICdmdW5jdGlvbicpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZXZlbnROYW1lID09PSAnb25GcmVlZCcgfHwgZXZlbnROYW1lID09PSAnb25MZWFrJykge1xyXG4gICAgICAgICAgICBldmVudEJ1c18xLkV2ZW50QnVzLm9uKGV2ZW50TmFtZSwgY2FsbGJhY2spO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChldmVudE5hbWUgPT09ICdvbkxlYWtBcmVhVXBkYXRlJykge1xyXG4gICAgICAgICAgICBldmVudEJ1c18xLkV2ZW50QnVzLm9uKGV2ZW50TmFtZSwgY2FsbGJhY2spO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lci5nZXRHNkluc3RhbmNlKCkub24oZXZlbnROYW1lLCBldmVudCA9PiB7XHJcbiAgICAgICAgICAgIGNhbGxiYWNrKGV2ZW50Lml0ZW1bJ1NWTW9kZWwnXSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBkZXN0cm95KCkge1xyXG4gICAgICAgIHRoaXMubW9kZWxDb25zdHJ1Y3Rvci5kZXN0cm95KCk7XHJcbiAgICAgICAgdGhpcy52aWV3Q29udGFpbmVyLmRlc3Ryb3koKTtcclxuICAgIH1cclxufVxyXG5leHBvcnRzLkVuZ2luZSA9IEVuZ2luZTtcclxuO1xyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/engine.ts\n"); /***/ }) diff --git a/package.json b/package.json index 47cdb7d..7eb1500 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { "dependencies": { - "@antv/g6": "^4.4.1" + "@antv/g6": "^4.4.1", + "merge": "^2.1.1" }, "devDependencies": { + "merge": "^2.1.1", "ts-loader": "^5.2.1", "typescript": "^3.2.2", "webpack": "^4.46.0", diff --git a/src/Model/SVLink.ts b/src/Model/SVLink.ts index be490ea..0180bf1 100644 --- a/src/Model/SVLink.ts +++ b/src/Model/SVLink.ts @@ -24,8 +24,7 @@ export class SVLink extends SVModel { this.G6ModelProps = this.generateG6ModelProps(options); } - - protected generateG6ModelProps(options: LinkOption): EdgeConfig { + generateG6ModelProps(options: LinkOption): EdgeConfig { let sourceAnchor = options.sourceAnchor, targetAnchor = options.targetAnchor; diff --git a/src/Model/SVModel.ts b/src/Model/SVModel.ts index 0f15769..c44453c 100644 --- a/src/Model/SVModel.ts +++ b/src/Model/SVModel.ts @@ -3,7 +3,7 @@ import { Style } from "../options"; import { BoundingRect } from "../Common/boundingRect"; import { EdgeConfig, Item, NodeConfig } from "@antv/g6-core"; import { Graph } from "_@antv_g6-pc@0.5.0@@antv/g6-pc"; - +import merge from 'merge'; @@ -52,7 +52,7 @@ export class SVModel { * 定义 G6 model 的属性 * @param option */ - protected generateG6ModelProps(options: unknown) { + generateG6ModelProps(options: unknown): NodeConfig | EdgeConfig { return null; } @@ -87,7 +87,7 @@ export class SVModel { } if (attr === 'style' || attr === 'labelCfg') { - Object.assign(this.G6ModelProps[attr], value); + this.G6ModelProps[attr] = merge(this.G6ModelProps[attr] || {}, value); } else { this.G6ModelProps[attr] = value; @@ -115,6 +115,31 @@ export class SVModel { } } + /** + * + * @param G6ModelProps + */ + updateG6ModelStyle(G6ModelProps: NodeConfig | EdgeConfig) { + const newG6ModelProps = { + style: { + ...G6ModelProps.style + }, + labelCfg: { + ...G6ModelProps.labelCfg + } + }; + + this.G6ModelProps = merge(this.G6ModelProps, newG6ModelProps); + + if (this.G6Item) { + this.g6Instance.updateItem(this.G6Item, this.G6ModelProps); + } + + if (this.shadowG6Item) { + this.shadowG6Instance.updateItem(this.shadowG6Item, this.G6ModelProps); + } + } + /** * 获取包围盒 * @returns diff --git a/src/Model/SVNode.ts b/src/Model/SVNode.ts index 816e80d..f8e21a9 100644 --- a/src/Model/SVNode.ts +++ b/src/Model/SVNode.ts @@ -51,7 +51,7 @@ export class SVNode extends SVModel { this.G6ModelProps = this.generateG6ModelProps(options); } - protected generateG6ModelProps(options: NodeOption): NodeConfig { + generateG6ModelProps(options: NodeOption): NodeConfig { const style = Util.objectClone