ronds-metadata 1.2.87 → 1.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
13
13
|
/*
|
|
14
14
|
* @Author: wangxian
|
|
15
15
|
* @Date: 2022-05-24 14:31:01
|
|
16
|
-
* @LastEditTime: 2023-07-
|
|
16
|
+
* @LastEditTime: 2023-07-28 08:19:02
|
|
17
17
|
*/
|
|
18
18
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
19
19
|
import produce from 'immer';
|
|
@@ -195,7 +195,7 @@ var DPGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
195
195
|
// 画布已经渲染的情况下,再次渲染图数据
|
|
196
196
|
_this.renderGraphData = /*#__PURE__*/function () {
|
|
197
197
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(graphData) {
|
|
198
|
-
var oldGraph, _formatGraphData2, nodes, edges;
|
|
198
|
+
var oldGraph, _formatGraphData2, nodes, edges, dpNodes, dpEdges;
|
|
199
199
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
200
200
|
while (1) switch (_context.prev = _context.next) {
|
|
201
201
|
case 0:
|
|
@@ -205,14 +205,20 @@ var DPGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
205
205
|
return it.id;
|
|
206
206
|
}));
|
|
207
207
|
_formatGraphData2 = formatGraphData(graphData), nodes = _formatGraphData2.nodes, edges = _formatGraphData2.edges;
|
|
208
|
-
nodes.
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
dpNodes = nodes.map(function (it) {
|
|
209
|
+
return new DPNode(_objectSpread(_objectSpread({}, it), {}, {
|
|
210
|
+
shape: 'dp-rect-port',
|
|
211
|
+
component: /*#__PURE__*/React.createElement(NodeElement, null)
|
|
212
|
+
}));
|
|
213
213
|
});
|
|
214
|
+
dpEdges = edges.map(function (it) {
|
|
215
|
+
return new DPEdge(it);
|
|
216
|
+
}); // nodes!.forEach((nodeMeta) => this.renderNode(nodeMeta));
|
|
217
|
+
// edges!.forEach((edgeMeta) => this.renderEdge(edgeMeta));
|
|
218
|
+
_this.graph.addNodes(dpNodes);
|
|
219
|
+
_this.graph.addEdges(dpEdges);
|
|
214
220
|
_this.loadDPGraph(graphData);
|
|
215
|
-
case
|
|
221
|
+
case 8:
|
|
216
222
|
case "end":
|
|
217
223
|
return _context.stop();
|
|
218
224
|
}
|
|
@@ -6,7 +6,7 @@ var _excluded = ["wrapper", "container", "nodes", "edges"];
|
|
|
6
6
|
/*
|
|
7
7
|
* @Author: wangxian
|
|
8
8
|
* @Date: 2022-05-24 13:55:44
|
|
9
|
-
* @LastEditTime: 2023-07-
|
|
9
|
+
* @LastEditTime: 2023-07-28 08:14:22
|
|
10
10
|
*/
|
|
11
11
|
import { Graph } from '@antv/x6';
|
|
12
12
|
import { debounceTime, fromEventPattern, map, merge, scan, tap } from 'rxjs';
|
|
@@ -329,6 +329,7 @@ export var GraphCore = /*#__PURE__*/function () {
|
|
|
329
329
|
}, {
|
|
330
330
|
key: "render",
|
|
331
331
|
value: function render(params) {
|
|
332
|
+
var _this3 = this;
|
|
332
333
|
this.setMeta(params);
|
|
333
334
|
if (this.isMetaValid) {
|
|
334
335
|
var wrapper = this.wrapper,
|
|
@@ -342,10 +343,14 @@ export var GraphCore = /*#__PURE__*/function () {
|
|
|
342
343
|
height: height
|
|
343
344
|
}));
|
|
344
345
|
this.graph = graph;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
nodeMetas.forEach(function (nodeMeta) {
|
|
347
|
+
return _this3.renderNode(nodeMeta);
|
|
348
|
+
});
|
|
349
|
+
edgeMetas.forEach(function (edgeMeta) {
|
|
350
|
+
return _this3.renderEdge(edgeMeta);
|
|
351
|
+
});
|
|
352
|
+
// this.graph!.addNodes(nodeMetas);
|
|
353
|
+
// this.graph!.addEdges(edgeMetas);
|
|
349
354
|
this.afterLayout();
|
|
350
355
|
if (graph.isFrozen()) {
|
|
351
356
|
graph.unfreeze();
|