ronds-metadata 1.2.88 → 1.2.89

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,6 +55,7 @@ declare class DPGraph extends GraphCore<BaseNode, BaseEdge> {
55
55
  }): void;
56
56
  onContextMenu(data: ContextMenuInfo): any;
57
57
  clearContextMenuInfo: () => void;
58
+ clearGraphCells: () => void;
58
59
  onMoveNodes(movedNodes: any[]): Promise<void>;
59
60
  dispose(): void;
60
61
  }
@@ -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-28 08:19:02
16
+ * @LastEditTime: 2023-07-28 09:01:28
17
17
  */
18
18
  import _regeneratorRuntime from "@babel/runtime/regenerator";
19
19
  import produce from 'immer';
@@ -195,15 +195,19 @@ 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, dpNodes, dpEdges;
198
+ var _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:
202
202
  // 清除已有的图谱
203
- oldGraph = _this.factory$.dpGraph.getValue();
204
- _this.deleteNodes(oldGraph.nodes.map(function (it) {
205
- return it.id;
206
- }));
203
+ // const oldGraph = this.factory$.dpGraph.getValue();
204
+ // console.log('清除已有的图谱', oldGraph);
205
+ // this.deleteNodes(
206
+ // oldGraph.nodes.map((it) => {
207
+ // return it.id;
208
+ // }),
209
+ // );
210
+ _this.clearGraphCells;
207
211
  _formatGraphData2 = formatGraphData(graphData), nodes = _formatGraphData2.nodes, edges = _formatGraphData2.edges;
208
212
  dpNodes = nodes.map(function (it) {
209
213
  return new DPNode(_objectSpread(_objectSpread({}, it), {}, {
@@ -217,6 +221,7 @@ var DPGraph = /*#__PURE__*/function (_GraphCore) {
217
221
  // edges!.forEach((edgeMeta) => this.renderEdge(edgeMeta));
218
222
  _this.graph.addNodes(dpNodes);
219
223
  _this.graph.addEdges(dpEdges);
224
+ _this.zoomGraphToFit();
220
225
  _this.loadDPGraph(graphData);
221
226
  case 8:
222
227
  case "end":
@@ -260,6 +265,9 @@ var DPGraph = /*#__PURE__*/function (_GraphCore) {
260
265
  _this.clearContextMenuInfo = function () {
261
266
  _this.factory$.contextMenuInfo.next(null);
262
267
  };
268
+ _this.clearGraphCells = function () {
269
+ _this.graph.clearCells();
270
+ };
263
271
  _this.initialize(_graphData);
264
272
  return _this;
265
273
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.2.88",
4
+ "version": "1.2.89",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",