ronds-metadata 1.2.86 → 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-27 13:59:50
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.forEach(function (nodeMeta) {
209
- return _this.renderNode(nodeMeta);
210
- });
211
- edges.forEach(function (edgeMeta) {
212
- return _this.renderEdge(edgeMeta);
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 6:
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-27 14:04:35
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';
@@ -349,6 +349,8 @@ export var GraphCore = /*#__PURE__*/function () {
349
349
  edgeMetas.forEach(function (edgeMeta) {
350
350
  return _this3.renderEdge(edgeMeta);
351
351
  });
352
+ // this.graph!.addNodes(nodeMetas);
353
+ // this.graph!.addEdges(edgeMetas);
352
354
  this.afterLayout();
353
355
  if (graph.isFrozen()) {
354
356
  graph.unfreeze();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.2.86",
4
+ "version": "1.2.88",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",