@aloudata/ink-lineage 0.0.1-beta.39 → 0.0.1-beta.40

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.
Files changed (127) hide show
  1. package/dist/assets/big/lineageIcon.d.ts +1 -0
  2. package/dist/assets/big/lineageIcon.d.ts.map +1 -1
  3. package/dist/assets/big/lineageIcon.js +1 -0
  4. package/dist/assets/big/lineageIcon.js.map +1 -1
  5. package/dist/components/Edges/ClickEdge.d.ts +8 -0
  6. package/dist/components/Edges/ClickEdge.d.ts.map +1 -0
  7. package/dist/components/Edges/ClickEdge.js +46 -0
  8. package/dist/components/Edges/ClickEdge.js.map +1 -0
  9. package/dist/components/Edges/DefaultEdge.d.ts +2 -2
  10. package/dist/components/Edges/DefaultEdge.d.ts.map +1 -1
  11. package/dist/components/Edges/DefaultEdge.js +13 -2
  12. package/dist/components/Edges/DefaultEdge.js.map +1 -1
  13. package/dist/components/Edges/FoldEdge.js +4 -4
  14. package/dist/components/Edges/FoldEdge.js.map +1 -1
  15. package/dist/components/Edges/LineageEdge.d.ts.map +1 -1
  16. package/dist/components/Edges/LineageEdge.js +3 -3
  17. package/dist/components/Edges/LineageEdge.js.map +1 -1
  18. package/dist/components/Nodes/AssetNode.d.ts +1 -0
  19. package/dist/components/Nodes/AssetNode.d.ts.map +1 -1
  20. package/dist/components/Nodes/AssetNode.js.map +1 -1
  21. package/dist/components/Nodes/Table/TableNode.d.ts +4 -0
  22. package/dist/components/Nodes/Table/TableNode.d.ts.map +1 -1
  23. package/dist/components/Nodes/Table/TableNode.js +64 -1
  24. package/dist/components/Nodes/Table/TableNode.js.map +1 -1
  25. package/dist/constant/nodeStyle.d.ts +1 -0
  26. package/dist/constant/nodeStyle.d.ts.map +1 -1
  27. package/dist/constant/nodeStyle.js +1 -0
  28. package/dist/constant/nodeStyle.js.map +1 -1
  29. package/dist/decorators/Table/BaseHeaderComponent.d.ts.map +1 -1
  30. package/dist/decorators/Table/BaseHeaderComponent.js +16 -2
  31. package/dist/decorators/Table/BaseHeaderComponent.js.map +1 -1
  32. package/dist/manager/FoldLineageManager.d.ts.map +1 -1
  33. package/dist/manager/FoldLineageManager.js +3 -1
  34. package/dist/manager/FoldLineageManager.js.map +1 -1
  35. package/dist/manager/LineageManager.d.ts +6 -3
  36. package/dist/manager/LineageManager.d.ts.map +1 -1
  37. package/dist/manager/LineageManager.js +33 -18
  38. package/dist/manager/LineageManager.js.map +1 -1
  39. package/dist/manager/dataProcessor/ScheduleDataProcessor.d.ts +21 -0
  40. package/dist/manager/dataProcessor/ScheduleDataProcessor.d.ts.map +1 -0
  41. package/dist/manager/dataProcessor/ScheduleDataProcessor.js +349 -0
  42. package/dist/manager/dataProcessor/ScheduleDataProcessor.js.map +1 -0
  43. package/dist/manager/dataProcessor/TableDataProcessor.d.ts +26 -0
  44. package/dist/manager/dataProcessor/TableDataProcessor.d.ts.map +1 -0
  45. package/dist/manager/{DataProcessor.js → dataProcessor/TableDataProcessor.js} +325 -273
  46. package/dist/manager/dataProcessor/TableDataProcessor.js.map +1 -0
  47. package/dist/manager/dataProcessor/TaskDataProcessor.d.ts +82 -0
  48. package/dist/manager/dataProcessor/TaskDataProcessor.d.ts.map +1 -0
  49. package/dist/manager/dataProcessor/TaskDataProcessor.js +307 -0
  50. package/dist/manager/dataProcessor/TaskDataProcessor.js.map +1 -0
  51. package/dist/manager/graphEventManager/BaseGraphEventManager.d.ts +10 -0
  52. package/dist/manager/graphEventManager/BaseGraphEventManager.d.ts.map +1 -0
  53. package/dist/manager/graphEventManager/BaseGraphEventManager.js +81 -0
  54. package/dist/manager/graphEventManager/BaseGraphEventManager.js.map +1 -0
  55. package/dist/manager/graphEventManager/TableGraphEventManager.d.ts +6 -0
  56. package/dist/manager/graphEventManager/TableGraphEventManager.d.ts.map +1 -0
  57. package/dist/manager/graphEventManager/TableGraphEventManager.js +28 -0
  58. package/dist/manager/graphEventManager/TableGraphEventManager.js.map +1 -0
  59. package/dist/manager/graphEventManager/TaskGraphEventManager.d.ts +6 -0
  60. package/dist/manager/graphEventManager/TaskGraphEventManager.d.ts.map +1 -0
  61. package/dist/manager/graphEventManager/TaskGraphEventManager.js +22 -0
  62. package/dist/manager/graphEventManager/TaskGraphEventManager.js.map +1 -0
  63. package/dist/manager/index.d.ts +8 -8
  64. package/dist/manager/index.d.ts.map +1 -1
  65. package/dist/manager/index.js +8 -8
  66. package/dist/manager/index.js.map +1 -1
  67. package/dist/manager/nodeManager/AssetEventManager.d.ts.map +1 -1
  68. package/dist/manager/nodeManager/AssetEventManager.js +63 -23
  69. package/dist/manager/nodeManager/AssetEventManager.js.map +1 -1
  70. package/dist/manager/nodeManager/BaseEventManager.d.ts.map +1 -1
  71. package/dist/manager/nodeManager/BaseEventManager.js +3 -3
  72. package/dist/manager/nodeManager/BaseEventManager.js.map +1 -1
  73. package/dist/manager/nodeManager/ColumnEventManager.d.ts.map +1 -1
  74. package/dist/manager/nodeManager/ColumnEventManager.js +7 -2
  75. package/dist/manager/nodeManager/ColumnEventManager.js.map +1 -1
  76. package/dist/manager/nodeManager/task/TaskTableEventManager.d.ts.map +1 -1
  77. package/dist/manager/nodeManager/task/TaskTableEventManager.js +1 -1
  78. package/dist/manager/nodeManager/task/TaskTableEventManager.js.map +1 -1
  79. package/dist/manager/rightKeyMenu/BaseRightKeyMenuManager.d.ts +40 -0
  80. package/dist/manager/rightKeyMenu/BaseRightKeyMenuManager.d.ts.map +1 -0
  81. package/dist/manager/rightKeyMenu/BaseRightKeyMenuManager.js +95 -0
  82. package/dist/manager/rightKeyMenu/BaseRightKeyMenuManager.js.map +1 -0
  83. package/dist/manager/rightKeyMenu/TableRightKeyMenuManager.d.ts +10 -0
  84. package/dist/manager/rightKeyMenu/TableRightKeyMenuManager.d.ts.map +1 -0
  85. package/dist/manager/rightKeyMenu/TableRightKeyMenuManager.js +29 -0
  86. package/dist/manager/rightKeyMenu/TableRightKeyMenuManager.js.map +1 -0
  87. package/dist/manager/rightKeyMenu/TaskRightKeyMenuManager.d.ts +20 -0
  88. package/dist/manager/rightKeyMenu/TaskRightKeyMenuManager.d.ts.map +1 -0
  89. package/dist/manager/rightKeyMenu/TaskRightKeyMenuManager.js +149 -0
  90. package/dist/manager/rightKeyMenu/TaskRightKeyMenuManager.js.map +1 -0
  91. package/dist/types/eventEnum.d.ts +4 -0
  92. package/dist/types/eventEnum.d.ts.map +1 -1
  93. package/dist/types/eventEnum.js +7 -0
  94. package/dist/types/eventEnum.js.map +1 -1
  95. package/dist/types/manager.d.ts +20 -0
  96. package/dist/types/manager.d.ts.map +1 -1
  97. package/dist/types/manager.js +14 -0
  98. package/dist/types/manager.js.map +1 -1
  99. package/dist/types/node.d.ts +2 -0
  100. package/dist/types/node.d.ts.map +1 -1
  101. package/dist/utils/getIconByType.d.ts.map +1 -1
  102. package/dist/utils/manager.d.ts.map +1 -1
  103. package/dist/utils/node.d.ts +1 -0
  104. package/dist/utils/node.d.ts.map +1 -1
  105. package/dist/utils/node.js +9 -0
  106. package/dist/utils/node.js.map +1 -1
  107. package/package.json +1 -1
  108. package/dist/components/Nodes/ColumnNode.d.ts +0 -27
  109. package/dist/components/Nodes/ColumnNode.d.ts.map +0 -1
  110. package/dist/components/Nodes/ColumnNode.js +0 -327
  111. package/dist/components/Nodes/ColumnNode.js.map +0 -1
  112. package/dist/components/Nodes/CustomNode.d.ts.map +0 -1
  113. package/dist/components/Nodes/CustomNode.js +0 -53
  114. package/dist/components/Nodes/CustomNode.js.map +0 -1
  115. package/dist/components/Nodes/TableNode.d.ts.map +0 -1
  116. package/dist/components/Nodes/TableNode.js +0 -384
  117. package/dist/components/Nodes/TableNode.js.map +0 -1
  118. package/dist/manager/DataProcessor.d.ts +0 -27
  119. package/dist/manager/DataProcessor.d.ts.map +0 -1
  120. package/dist/manager/DataProcessor.js.map +0 -1
  121. package/dist/manager/GraphEventManager.d.ts.map +0 -1
  122. package/dist/manager/GraphEventManager.js +0 -72
  123. package/dist/manager/GraphEventManager.js.map +0 -1
  124. package/dist/manager/RightKeyMenuManager.d.ts +0 -29
  125. package/dist/manager/RightKeyMenuManager.d.ts.map +0 -1
  126. package/dist/manager/RightKeyMenuManager.js +0 -78
  127. package/dist/manager/RightKeyMenuManager.js.map +0 -1
@@ -1,27 +1,28 @@
1
- import { __assign, __extends, __read, __spreadArray, __values } from "tslib";
2
- import { getNodeHeight, groupNodesByEdgesAndDirection, } from '@aloudata/ink-graph-new';
3
- import { EEntityType, EDirection, EDashType, } from '../types';
1
+ import { __assign, __extends, __read, __values } from "tslib";
2
+ import { EDirection, getNodeHeight, groupNodesByEdgesAndDirection, } from '@aloudata/ink-graph-new';
3
+ import { EEntityType, EDashType, } from '../../types';
4
4
  import _ from 'lodash';
5
- import { BaseManager } from './BaseManager';
6
- import { COL_HEIGHT, CUSTOM_NODE, LINEAGE_EDGE, NODE_WIDTH, TABLE_HEADER_HEIGHT, TABLE_NODE, } from '../constant';
7
- var DataProcessor = /** @class */ (function (_super) {
8
- __extends(DataProcessor, _super);
9
- function DataProcessor() {
5
+ import { BaseManager } from '../BaseManager';
6
+ import { CLICK_EDGE, COL_HEIGHT, CUSTOM_NODE, LINEAGE_EDGE, NODE_WIDTH, TABLE_HEADER_HEIGHT, TABLE_NODE, } from '../../constant';
7
+ var TableDataProcessor = /** @class */ (function (_super) {
8
+ __extends(TableDataProcessor, _super);
9
+ function TableDataProcessor() {
10
10
  return _super !== null && _super.apply(this, arguments) || this;
11
11
  }
12
- DataProcessor.parseData = function (data, startNodes) {
13
- DataProcessor.startNodes = startNodes;
12
+ TableDataProcessor.parseData = function (data, startNodes) {
13
+ TableDataProcessor.startNodes = startNodes;
14
14
  // parse data here
15
15
  var entities = data.entities, relations = data.relations;
16
- var nodes = DataProcessor.parseEntities(entities, startNodes);
17
- var edges = DataProcessor.parseRelations(relations);
16
+ var nodes = TableDataProcessor.parseEntities(entities, startNodes);
17
+ var edges = TableDataProcessor.parseRelations(relations);
18
18
  var res = {
19
19
  nodes: nodes,
20
20
  edges: edges,
21
21
  };
22
22
  return res;
23
23
  };
24
- DataProcessor.parseEntities = function (entities, startNodes) {
24
+ TableDataProcessor.parseEntities = function (entities, startNodes) {
25
+ var _this = this;
25
26
  var nodesId = [];
26
27
  var nodes = [];
27
28
  entities.forEach(function (entity) {
@@ -32,38 +33,52 @@ var DataProcessor = /** @class */ (function (_super) {
32
33
  switch (entity.typeCode) {
33
34
  case 'Table':
34
35
  case 'View':
35
- node = DataProcessor.parseTableEntity(entity, isStartNode);
36
+ node = TableDataProcessor.parseTableEntity(entity, isStartNode);
36
37
  break;
37
38
  default:
38
- node = DataProcessor.parseCustomEntity(entity, isStartNode);
39
+ node = TableDataProcessor.parseCustomEntity(entity, isStartNode);
39
40
  break;
40
41
  }
41
42
  if (node) {
42
43
  nodes.push(node);
43
44
  nodesId.push(node.id);
45
+ _this.nodesIdMap.set(node.id, node);
44
46
  }
45
47
  });
46
48
  return nodes;
47
49
  };
48
- DataProcessor.parseRelations = function (relations) {
50
+ TableDataProcessor.parseRelations = function (relations) {
51
+ var _this = this;
49
52
  var existedEdgesMap = new Map();
50
53
  var edges = [];
51
54
  relations.forEach(function (relation) {
55
+ var _a, _b, _c, _d;
52
56
  var edgeId = "".concat(relation.srcGuid, "___").concat(relation.dstGuid);
57
+ var isIndirect = relation.relationTypeCode.includes('Indirect');
58
+ var edgeType = LINEAGE_EDGE;
59
+ var srcGuid = relation.srcGuid, dstGuid = relation.dstGuid;
60
+ var srcNode = _this.nodesIdMap.get(srcGuid);
61
+ var tgtNode = _this.nodesIdMap.get(dstGuid);
62
+ if ((((_a = srcNode === null || srcNode === void 0 ? void 0 : srcNode.data) === null || _a === void 0 ? void 0 : _a.isNarrowTable) || ((_b = tgtNode === null || tgtNode === void 0 ? void 0 : tgtNode.data) === null || _b === void 0 ? void 0 : _b.isNarrowTable)) && !isIndirect) {
63
+ edgeType = CLICK_EDGE;
64
+ }
53
65
  if (existedEdgesMap.has(edgeId)) {
54
66
  if (existedEdgesMap.get(edgeId) !== relation.relationTypeCode) {
55
67
  var edge_1 = edges.find(function (e) { return e.id === edgeId; });
56
68
  if (edge_1) {
57
69
  edge_1.relationType = EDashType.ALL;
58
70
  edge_1.style.strokeDasharray = [0];
71
+ if (((_c = srcNode === null || srcNode === void 0 ? void 0 : srcNode.data) === null || _c === void 0 ? void 0 : _c.isNarrowTable) || ((_d = tgtNode === null || tgtNode === void 0 ? void 0 : tgtNode.data) === null || _d === void 0 ? void 0 : _d.isNarrowTable)) {
72
+ edge_1.type = CLICK_EDGE;
73
+ }
74
+ edge_1.data = __assign({}, relation);
59
75
  }
60
76
  }
61
77
  return;
62
78
  }
63
- var isIndirect = relation.relationTypeCode.includes('Indirect');
64
79
  var edge = {
65
80
  id: edgeId,
66
- type: LINEAGE_EDGE,
81
+ type: edgeType,
67
82
  data: __assign({}, relation),
68
83
  source: relation.srcGuid,
69
84
  target: relation.dstGuid,
@@ -84,19 +99,19 @@ var DataProcessor = /** @class */ (function (_super) {
84
99
  });
85
100
  return edges;
86
101
  };
87
- DataProcessor.parseTableEntity = function (entity, isStartNode) {
102
+ TableDataProcessor.parseTableEntity = function (entity, isStartNode) {
88
103
  var _a, _b, _c, _d, _e, _f, _g;
89
104
  var cols = Array.isArray((_a = entity.properties) === null || _a === void 0 ? void 0 : _a.columns)
90
105
  ? ((_c = (_b = entity.properties) === null || _b === void 0 ? void 0 : _b.columns) === null || _c === void 0 ? void 0 : _c.map(function (col) {
91
106
  var _a;
92
- return DataProcessor.parseColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
107
+ return TableDataProcessor.parseColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
93
108
  })) || []
94
109
  : [];
95
110
  // 只有起始资产的relatedCols一开始有元素
96
111
  var relatedCols = Array.isArray((_d = entity.properties) === null || _d === void 0 ? void 0 : _d.columns)
97
112
  ? ((_f = (_e = entity.properties) === null || _e === void 0 ? void 0 : _e.columns) === null || _f === void 0 ? void 0 : _f.map(function (col) {
98
113
  var _a;
99
- return DataProcessor.parseRelatedColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
114
+ return TableDataProcessor.parseRelatedColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
100
115
  })) || []
101
116
  : [];
102
117
  var data = {
@@ -137,7 +152,7 @@ var DataProcessor = /** @class */ (function (_super) {
137
152
  data.style.height = getNodeHeight(data);
138
153
  return data;
139
154
  };
140
- DataProcessor.parseColumn = function (column, isStartNode, tableId, tableName) {
155
+ TableDataProcessor.parseColumn = function (column, isStartNode, tableId, tableName) {
141
156
  return {
142
157
  data: __assign({}, column),
143
158
  type: '',
@@ -162,7 +177,7 @@ var DataProcessor = /** @class */ (function (_super) {
162
177
  hasMoreOutput: true,
163
178
  };
164
179
  };
165
- DataProcessor.parseRelatedColumn = function (column, isStartNode, tableId, tableName) {
180
+ TableDataProcessor.parseRelatedColumn = function (column, isStartNode, tableId, tableName) {
166
181
  return {
167
182
  data: __assign({}, column),
168
183
  type: '',
@@ -188,7 +203,7 @@ var DataProcessor = /** @class */ (function (_super) {
188
203
  hasMoreOutput: true,
189
204
  };
190
205
  };
191
- DataProcessor.parseCustomEntity = function (entity, isStartNode) {
206
+ TableDataProcessor.parseCustomEntity = function (entity, isStartNode) {
192
207
  var _a, _b, _c, _d;
193
208
  var data = {
194
209
  id: entity.guid,
@@ -216,7 +231,7 @@ var DataProcessor = /** @class */ (function (_super) {
216
231
  children: Array.isArray((_b = entity.properties) === null || _b === void 0 ? void 0 : _b.columns)
217
232
  ? ((_d = (_c = entity.properties) === null || _c === void 0 ? void 0 : _c.columns) === null || _d === void 0 ? void 0 : _d.map(function (col) {
218
233
  var _a;
219
- return DataProcessor.parseColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
234
+ return TableDataProcessor.parseColumn(col, isStartNode, entity.guid, (_a = entity.properties) === null || _a === void 0 ? void 0 : _a.name);
220
235
  })) || []
221
236
  : [],
222
237
  pagination: {
@@ -230,13 +245,227 @@ var DataProcessor = /** @class */ (function (_super) {
230
245
  data.style.height = getNodeHeight(data);
231
246
  return data;
232
247
  };
233
- DataProcessor.prototype.updateSideIconVisible = function (data) {
234
- var e_1, _a, e_2, _b;
248
+ // 刷新相关节点和边
249
+ TableDataProcessor.prototype.refreshRelatedNodesAndEdges = function (relatedNodes, relatedEdges) {
250
+ var _this = this;
251
+ relatedNodes.forEach(function (n) {
252
+ if (!n)
253
+ return;
254
+ var nodeConfig = _this.lineageManager.getNodeConfigById(n.id);
255
+ if (!nodeConfig)
256
+ return;
257
+ nodeConfig.isRelated = true;
258
+ if (nodeConfig.style.zIndex < 4) {
259
+ nodeConfig.style.zIndex = 3;
260
+ nodeConfig.style.stroke = '#3271C9';
261
+ if (!nodeConfig.isActive) {
262
+ nodeConfig.style.fill = '#E4EFFF';
263
+ }
264
+ else {
265
+ nodeConfig.style.fill = '#A9CFFB';
266
+ }
267
+ }
268
+ });
269
+ relatedEdges.forEach(function (e) {
270
+ if (!e)
271
+ return;
272
+ var edge = _this.lineageManager.getEdgeConfigById(e.id);
273
+ if (!edge)
274
+ return;
275
+ if ((edge.inFoldLink &&
276
+ _this.lineageManager.foldLineageManager.isFoldChecked) ||
277
+ edge.isExtraFoldEdge)
278
+ return;
279
+ edge.style.stroke = '#3271C9';
280
+ });
281
+ };
282
+ // 更新节点和边可见性
283
+ TableDataProcessor.prototype.updateNodesAndEdgesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
284
+ this.updateEdgesVisible(data, edgeDashVisible, onlyShowRelated, isFoldChecked);
285
+ // 更新节点本身、列、节点children的可见性
286
+ this.updateNodesVisible(data, edgeDashVisible, onlyShowRelated, isFoldChecked);
287
+ };
288
+ // 获取边可见性
289
+ TableDataProcessor.prototype.getEdgeVisible = function (edgeCfg, edgeDashVisible, onlyShowRelated, isFoldChecked, relatedNodes) {
290
+ var _a, _b, _c;
291
+ // 如果边被折叠了,那么该边就隐藏
292
+ if (edgeCfg.isFolded)
293
+ return false;
294
+ var visible = false;
295
+ // 折叠
296
+ if (isFoldChecked) {
297
+ var foldStatus = (_c = (_b = (_a = this.lineageManager) === null || _a === void 0 ? void 0 : _a.foldLineageManager) === null || _b === void 0 ? void 0 : _b.foldStatusMap) === null || _c === void 0 ? void 0 : _c.get(edgeCfg.foldTableId);
298
+ if (foldStatus) {
299
+ visible = !!edgeCfg.isExtraFoldEdge;
300
+ if (!visible) {
301
+ return visible;
302
+ }
303
+ }
304
+ }
305
+ // 仅相关
306
+ if (onlyShowRelated) {
307
+ var source = edgeCfg.source, target = edgeCfg.target;
308
+ if (relatedNodes[source] && relatedNodes[target]) {
309
+ visible = true;
310
+ }
311
+ else {
312
+ return false;
313
+ }
314
+ }
315
+ switch (edgeDashVisible) {
316
+ case EDashType.DIRECT:
317
+ visible =
318
+ edgeCfg.relationType === EDashType.DIRECT ||
319
+ edgeCfg.relationType === EDashType.ALL;
320
+ break;
321
+ case EDashType.INDIRECT:
322
+ visible = true;
323
+ break;
324
+ }
325
+ return visible;
326
+ };
327
+ // 获取相关节点可见性
328
+ TableDataProcessor.prototype.getRelatedNodeVisible = function (nodeConfig, data, edgeDashVisible) {
329
+ var _a, _b, _c, _d, _e, _f;
330
+ // 仅相关开启的情况下,如果高亮链路是表链路,隐藏非相关的列
331
+ if ((_b = (_a = this.lineageManager) === null || _a === void 0 ? void 0 : _a.rightKeyMenuManager) === null || _b === void 0 ? void 0 : _b.onlyShowRelated) {
332
+ if (!((_e = (_d = (_c = this.lineageManager) === null || _c === void 0 ? void 0 : _c.activeNodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.tableName)) {
333
+ if (!_.some((_f = this.lineageManager) === null || _f === void 0 ? void 0 : _f.relatedNodes, { id: nodeConfig.id }))
334
+ return false;
335
+ }
336
+ }
337
+ var cacheBit = this.nodeEdgeRelationCache.get(nodeConfig.id);
338
+ if (!cacheBit)
339
+ return false;
340
+ var isAllIndirectEdges = cacheBit < 0;
341
+ // 开关只有true false,直接、间接
342
+ if (edgeDashVisible === EDashType.INDIRECT) {
343
+ return true;
344
+ }
345
+ else {
346
+ // 如果边都是间接边,那么该节点就隐藏
347
+ if (isAllIndirectEdges)
348
+ return false;
349
+ return true;
350
+ }
351
+ };
352
+ // 获取节点可见性
353
+ TableDataProcessor.prototype.getNodeVisible = function (nodeConfig, data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
354
+ if (nodeConfig.isStartNode)
355
+ return true;
356
+ if (nodeConfig.isFolded)
357
+ return false;
358
+ // 只显示相关节点 & 该节点不是相关节点 & 该节点不是表,则该节点不可见
359
+ if (onlyShowRelated && !nodeConfig.isRelated && !nodeConfig.tableId)
360
+ return false;
361
+ if (nodeConfig.canBeFold && isFoldChecked)
362
+ return false;
363
+ var cacheBit = this.nodeEdgeRelationCache.get(nodeConfig.id);
364
+ if (!cacheBit)
365
+ return false;
366
+ var isAllIndirectEdges = cacheBit < 0;
367
+ // 开关只有true false,直接、间接
368
+ if (edgeDashVisible === EDashType.INDIRECT) {
369
+ return true;
370
+ }
371
+ else {
372
+ // 如果边都是间接边,那么该节点就隐藏
373
+ if (isAllIndirectEdges)
374
+ return false;
375
+ return true;
376
+ }
377
+ };
378
+ // 更新边可见性
379
+ TableDataProcessor.prototype.updateEdgesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
380
+ var _this = this;
381
+ if (_.isNil(data))
382
+ return;
383
+ var relatedNodes = {};
384
+ data.nodes.forEach(function (node) {
385
+ var _a;
386
+ if (node.isRelated) {
387
+ relatedNodes[node.id] = node;
388
+ (_a = node.relatedColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {
389
+ if (col.visible) {
390
+ relatedNodes[col.id] = col;
391
+ }
392
+ });
393
+ }
394
+ });
395
+ data.edges.forEach(function (edge) {
396
+ edge.visible = _this.getEdgeVisible(edge, edgeDashVisible, onlyShowRelated, isFoldChecked, relatedNodes);
397
+ });
398
+ };
399
+ // 构建节点/列可见性缓存。根据关联的边类型和当前配置决定是否可见
400
+ TableDataProcessor.prototype.buildVisibilityCache = function (data, isFoldChecked) {
401
+ var nodeIdToNodeMap = new Map();
402
+ var columnIdToTableIdMap = new Map();
403
+ data.nodes.forEach(function (node) {
404
+ var _a, _b;
405
+ (_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
406
+ columnIdToTableIdMap.set(child.id, child.tableId);
407
+ });
408
+ (_b = node.relatedColumns) === null || _b === void 0 ? void 0 : _b.forEach(function (col) {
409
+ columnIdToTableIdMap.set(col.id, col.tableId);
410
+ });
411
+ nodeIdToNodeMap.set(node.id, node);
412
+ });
413
+ this.nodeEdgeRelationCache = new Map();
414
+ var cache = this.nodeEdgeRelationCache;
415
+ var updateBit = function (id, isIndirect) {
416
+ if (!id)
417
+ return;
418
+ var bit = cache.get(id);
419
+ if (!bit) {
420
+ cache.set(id, isIndirect ? -1 : 1);
421
+ }
422
+ if (bit < 0 && !isIndirect) {
423
+ cache.set(id, 1);
424
+ }
425
+ };
426
+ data.edges.forEach(function (edge) {
427
+ var srcNode = nodeIdToNodeMap.get(edge.source);
428
+ var tgtNode = nodeIdToNodeMap.get(edge.target);
429
+ if (!edge.visible)
430
+ return;
431
+ // 合并链路,折叠的边忽略
432
+ if (((srcNode === null || srcNode === void 0 ? void 0 : srcNode.canBeFold) || (tgtNode === null || tgtNode === void 0 ? void 0 : tgtNode.canBeFold)) && isFoldChecked) {
433
+ return;
434
+ }
435
+ var isIndirect = edge.relationType === EDashType.INDIRECT;
436
+ updateBit(edge.source, isIndirect);
437
+ updateBit(edge.target, isIndirect);
438
+ // 更新列对应的表(如果是列
439
+ updateBit(columnIdToTableIdMap.get(edge.source), isIndirect);
440
+ updateBit(columnIdToTableIdMap.get(edge.target), isIndirect);
441
+ });
442
+ };
443
+ // 更新节点的可见性
444
+ TableDataProcessor.prototype.updateNodesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
445
+ var _this = this;
446
+ if (_.isNil(data))
447
+ return;
448
+ this.buildVisibilityCache(data, isFoldChecked);
449
+ data.nodes.forEach(function (node) {
450
+ var _a, _b;
451
+ node.visible = _this.getNodeVisible(node, data, edgeDashVisible, onlyShowRelated, isFoldChecked);
452
+ (_a = node.relatedColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {
453
+ col.visible = _this.getRelatedNodeVisible(col, data, edgeDashVisible);
454
+ });
455
+ (_b = node.children) === null || _b === void 0 ? void 0 : _b.forEach(function (child) {
456
+ child.visible = _this.getNodeVisible(child, data, edgeDashVisible, onlyShowRelated, isFoldChecked);
457
+ });
458
+ });
459
+ };
460
+ // 更新icon的可见性
461
+ TableDataProcessor.prototype.updateSideIconVisible = function (data) {
462
+ var e_1, _a;
463
+ var _this = this;
235
464
  if (_.isNil(data))
236
465
  return;
237
466
  var nodesConfig = data.nodes.filter(function (cfg) { return cfg.visible; });
238
467
  var edgesConfig = data.edges.filter(function (cfg) { return cfg.visible; });
239
- if (!nodesConfig)
468
+ if (!nodesConfig.length)
240
469
  return;
241
470
  var startNodeIndex = nodesConfig.findIndex(function (node) { return node.isStartNode; });
242
471
  if (startNodeIndex < 0)
@@ -245,7 +474,7 @@ var DataProcessor = /** @class */ (function (_super) {
245
474
  if (!startNodeCfg)
246
475
  return;
247
476
  var nodesConfigMap = new Map();
248
- nodesConfig === null || nodesConfig === void 0 ? void 0 : nodesConfig.forEach(function (n) {
477
+ nodesConfig.forEach(function (n) {
249
478
  var _a;
250
479
  nodesConfigMap.set(n.id, n);
251
480
  (_a = n.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
@@ -258,46 +487,66 @@ var DataProcessor = /** @class */ (function (_super) {
258
487
  return;
259
488
  var inputGroupNodes = inputGroupedData.groupedNodes;
260
489
  var outputGroupNodes = outputGroupedData.groupedNodes;
261
- // 两个map合并
262
- var groupedNodes = new Map();
263
- if (inputGroupNodes) {
490
+ // 优化Map合并:直接使用inputGroupNodes作为基础,避免重复has()调用
491
+ var groupedNodes = new Map(inputGroupNodes || []);
492
+ if (outputGroupNodes) {
264
493
  try {
265
- for (var inputGroupNodes_1 = __values(inputGroupNodes), inputGroupNodes_1_1 = inputGroupNodes_1.next(); !inputGroupNodes_1_1.done; inputGroupNodes_1_1 = inputGroupNodes_1.next()) {
266
- var _c = __read(inputGroupNodes_1_1.value, 2), key = _c[0], value = _c[1];
267
- if (groupedNodes.has(key))
268
- continue;
269
- groupedNodes.set(key, value);
494
+ for (var outputGroupNodes_1 = __values(outputGroupNodes), outputGroupNodes_1_1 = outputGroupNodes_1.next(); !outputGroupNodes_1_1.done; outputGroupNodes_1_1 = outputGroupNodes_1.next()) {
495
+ var _b = __read(outputGroupNodes_1_1.value, 2), key = _b[0], value = _b[1];
496
+ if (!groupedNodes.has(key)) {
497
+ groupedNodes.set(key, value);
498
+ }
270
499
  }
271
500
  }
272
501
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
273
502
  finally {
274
503
  try {
275
- if (inputGroupNodes_1_1 && !inputGroupNodes_1_1.done && (_a = inputGroupNodes_1.return)) _a.call(inputGroupNodes_1);
504
+ if (outputGroupNodes_1_1 && !outputGroupNodes_1_1.done && (_a = outputGroupNodes_1.return)) _a.call(outputGroupNodes_1);
276
505
  }
277
506
  finally { if (e_1) throw e_1.error; }
278
507
  }
279
508
  }
280
- if (outputGroupNodes) {
281
- try {
282
- for (var outputGroupNodes_1 = __values(outputGroupNodes), outputGroupNodes_1_1 = outputGroupNodes_1.next(); !outputGroupNodes_1_1.done; outputGroupNodes_1_1 = outputGroupNodes_1.next()) {
283
- var _d = __read(outputGroupNodes_1_1.value, 2), key = _d[0], value = _d[1];
284
- if (groupedNodes.has(key))
285
- continue;
286
- groupedNodes.set(key, value);
509
+ var dstNodeIdsSet = new Set();
510
+ var srcNodeIdsSet = new Set();
511
+ edgesConfig.forEach(function (item) {
512
+ var _a, _b, _c, _d, _e, _f;
513
+ var target = item.target, source = item.source;
514
+ var dstNode = _this.lineageManager.getNodeConfigById(target);
515
+ var srcNode = _this.lineageManager.getNodeConfigById(source);
516
+ // 列
517
+ if ((srcNode === null || srcNode === void 0 ? void 0 : srcNode.tableId) || (dstNode === null || dstNode === void 0 ? void 0 : dstNode.tableId)) {
518
+ var parentSrcNode = _this.lineageManager.getNodeConfigById(srcNode === null || srcNode === void 0 ? void 0 : srcNode.tableId);
519
+ var parentDstNode = _this.lineageManager.getNodeConfigById(dstNode === null || dstNode === void 0 ? void 0 : dstNode.tableId);
520
+ // 列所在父节点正常
521
+ if (((_a = parentSrcNode === null || parentSrcNode === void 0 ? void 0 : parentSrcNode.position) === null || _a === void 0 ? void 0 : _a.x) < ((_b = parentDstNode === null || parentDstNode === void 0 ? void 0 : parentDstNode.position) === null || _b === void 0 ? void 0 : _b.x)) {
522
+ srcNodeIdsSet.add(source);
523
+ dstNodeIdsSet.add(target);
524
+ }
525
+ else {
526
+ if ((srcNode === null || srcNode === void 0 ? void 0 : srcNode.tableId) && source === ((_c = _this.lineageManager.activeNodes[0]) === null || _c === void 0 ? void 0 : _c.id)) {
527
+ srcNodeIdsSet.add(source);
528
+ }
529
+ if ((dstNode === null || dstNode === void 0 ? void 0 : dstNode.tableId) && target === ((_d = _this.lineageManager.activeNodes[0]) === null || _d === void 0 ? void 0 : _d.id)) {
530
+ dstNodeIdsSet.add(target);
531
+ }
287
532
  }
288
533
  }
289
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
290
- finally {
291
- try {
292
- if (outputGroupNodes_1_1 && !outputGroupNodes_1_1.done && (_b = outputGroupNodes_1.return)) _b.call(outputGroupNodes_1);
534
+ else if (srcNode && dstNode && srcNode.position.x < dstNode.position.x) {
535
+ srcNodeIdsSet.add(source);
536
+ dstNodeIdsSet.add(target);
537
+ }
538
+ else {
539
+ if (source === ((_e = _this.lineageManager.activeNodes[0]) === null || _e === void 0 ? void 0 : _e.id)) {
540
+ srcNodeIdsSet.add(source);
541
+ }
542
+ if (target === ((_f = _this.lineageManager.activeNodes[0]) === null || _f === void 0 ? void 0 : _f.id)) {
543
+ dstNodeIdsSet.add(target);
293
544
  }
294
- finally { if (e_2) throw e_2.error; }
295
545
  }
296
- }
297
- var dstNodeIds = edgesConfig.map(function (edge) { return edge.target; });
298
- var srcNodeIds = edgesConfig.map(function (edge) { return edge.source; });
299
- // table
300
- nodesConfig === null || nodesConfig === void 0 ? void 0 : nodesConfig.forEach(function (n) {
546
+ });
547
+ // 优化节点处理逻辑
548
+ nodesConfig.forEach(function (n) {
549
+ // 重置状态
301
550
  n.canExpandInput = false;
302
551
  n.canExpandOutput = false;
303
552
  n.canFoldInput = false;
@@ -307,17 +556,18 @@ var DataProcessor = /** @class */ (function (_super) {
307
556
  console.warn("get node level error '".concat(n.id, "'"));
308
557
  return;
309
558
  }
559
+ // 优化:使用Set的has()方法进行O(1)查找
310
560
  var isInputLeaf = false;
311
561
  var isOutputLeaf = false;
312
562
  if (currNodeLevel === 0) {
313
- isInputLeaf = !dstNodeIds.includes(n.id);
314
- isOutputLeaf = !srcNodeIds.includes(n.id);
563
+ isInputLeaf = !dstNodeIdsSet.has(n.id);
564
+ isOutputLeaf = !srcNodeIdsSet.has(n.id);
315
565
  }
316
566
  else if (currNodeLevel < 0) {
317
- isInputLeaf = !dstNodeIds.includes(n.id);
567
+ isInputLeaf = !dstNodeIdsSet.has(n.id);
318
568
  }
319
569
  else {
320
- isOutputLeaf = !srcNodeIds.includes(n.id);
570
+ isOutputLeaf = !srcNodeIdsSet.has(n.id);
321
571
  }
322
572
  // input node exist & left of start node
323
573
  if (currNodeLevel <= 0 && !isInputLeaf) {
@@ -337,25 +587,29 @@ var DataProcessor = /** @class */ (function (_super) {
337
587
  }
338
588
  // column: always true if isStartNode === true
339
589
  var columnRefreshList = n.isStartNode
340
- ? __spreadArray(__spreadArray([], __read(n.children), false), __read(n.relatedColumns), false) : n.relatedColumns;
341
- columnRefreshList === null || columnRefreshList === void 0 ? void 0 : columnRefreshList.forEach(function (col) {
590
+ ? (n.children || []).concat(n.relatedColumns || [])
591
+ : n.relatedColumns || [];
592
+ // 处理列的展开/折叠状态
593
+ columnRefreshList.forEach(function (col) {
594
+ // 重置列状态
342
595
  col.canExpandInput = false;
343
596
  col.canExpandOutput = false;
344
597
  col.canFoldInput = false;
345
598
  col.canFoldOutput = false;
346
599
  if (!col.isStartNode && !col.isRelatedColumn)
347
600
  return;
601
+ // 优化:使用Set进行O(1)查找
348
602
  var isInputLeaf_col = false;
349
603
  var isOutputLeaf_col = false;
350
604
  if (currNodeLevel === 0) {
351
- isInputLeaf_col = !dstNodeIds.includes(col.id);
352
- isOutputLeaf_col = !srcNodeIds.includes(col.id);
605
+ isInputLeaf_col = !dstNodeIdsSet.has(col.id);
606
+ isOutputLeaf_col = !srcNodeIdsSet.has(col.id);
353
607
  }
354
608
  else if (currNodeLevel < 0) {
355
- isInputLeaf_col = !dstNodeIds.includes(col.id);
609
+ isInputLeaf_col = !dstNodeIdsSet.has(col.id);
356
610
  }
357
611
  else {
358
- isOutputLeaf_col = !srcNodeIds.includes(col.id);
612
+ isOutputLeaf_col = !srcNodeIdsSet.has(col.id);
359
613
  }
360
614
  // input node exist & left of start node
361
615
  if (currNodeLevel <= 0 && !isInputLeaf_col) {
@@ -376,212 +630,10 @@ var DataProcessor = /** @class */ (function (_super) {
376
630
  });
377
631
  });
378
632
  };
379
- DataProcessor.prototype.getNodeType = function (typeCode) {
380
- return typeCode === 'Table' ? TABLE_NODE : CUSTOM_NODE;
381
- };
382
- DataProcessor.prototype.updateNodesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
383
- var _this = this;
384
- if (_.isNil(data))
385
- return;
386
- data.nodes.forEach(function (node) {
387
- var _a, _b;
388
- node.visible = _this.getNodeVisible(node, data, edgeDashVisible, onlyShowRelated, isFoldChecked);
389
- (_a = node.relatedColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {
390
- col.visible = _this.getRelatedNodeVisible(col, data, edgeDashVisible);
391
- });
392
- (_b = node.children) === null || _b === void 0 ? void 0 : _b.forEach(function (child) {
393
- child.visible = _this.getNodeVisible(child, data, edgeDashVisible, onlyShowRelated, isFoldChecked);
394
- });
395
- });
396
- };
397
- DataProcessor.prototype.updateEdgesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
398
- var _this = this;
399
- if (_.isNil(data))
400
- return;
401
- var relatedNodes = {};
402
- data.nodes.forEach(function (node) {
403
- var _a;
404
- if (node.isRelated) {
405
- relatedNodes[node.id] = node;
406
- (_a = node.relatedColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {
407
- if (col.visible) {
408
- relatedNodes[col.id] = col;
409
- }
410
- });
411
- }
412
- });
413
- data.edges.forEach(function (edge) {
414
- edge.visible = _this.getEdgeVisible(edge, edgeDashVisible, onlyShowRelated, isFoldChecked, relatedNodes);
415
- });
416
- };
417
- DataProcessor.prototype.getNodeVisible = function (nodeConfig, data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
418
- if (nodeConfig.isStartNode)
419
- return true;
420
- if (nodeConfig.isFolded)
421
- return false;
422
- // 只显示相关节点 & 该节点不是相关节点 & 该节点不是表,则该节点不可见
423
- if (onlyShowRelated && !nodeConfig.isRelated && !nodeConfig.tableId)
424
- return false;
425
- if (nodeConfig.canBeFold && isFoldChecked)
426
- return false;
427
- // 找出所有target、source为该节点的边
428
- var relatedEdges = data.edges.filter(function (edge) {
429
- var _a;
430
- return (
431
- // 上游表-当前表、当前表-下游表
432
- edge.target === nodeConfig.id ||
433
- edge.source === nodeConfig.id ||
434
- (
435
- // 上游列-当前列、当前列-下游列
436
- (_a = nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.relatedColumns) === null || _a === void 0 ? void 0 : _a.some(function (col) {
437
- return edge.target === col.id || edge.source === col.id;
438
- })));
439
- });
440
- if (!relatedEdges.length)
441
- return false;
442
- var allRelatedNodeInvisible = relatedEdges.every(function (edgeCfg) {
443
- var srcNode = data.nodes.find(function (node) { return node.id === edgeCfg.source; });
444
- var tgtNode = data.nodes.find(function (node) { return node.id === edgeCfg.target; });
445
- if (((srcNode === null || srcNode === void 0 ? void 0 : srcNode.canBeFold) || (tgtNode === null || tgtNode === void 0 ? void 0 : tgtNode.canBeFold)) && isFoldChecked)
446
- return true;
447
- });
448
- if (allRelatedNodeInvisible)
449
- return false;
450
- var isAllIndirectEdges = relatedEdges.every(function (edge) { return edge.relationType === EDashType.INDIRECT; });
451
- // 开关只有true false,直接、间接
452
- if (edgeDashVisible === EDashType.INDIRECT) {
453
- return true;
454
- }
455
- else {
456
- // 如果边都是间接边,那么该节点就隐藏
457
- if (isAllIndirectEdges)
458
- return false;
459
- return true;
460
- }
461
- };
462
- DataProcessor.prototype.getRelatedNodeVisible = function (nodeConfig, data, edgeDashVisible) {
463
- var _a, _b, _c, _d, _e, _f;
464
- // 仅相关开启的情况下,如果高亮链路是表链路,隐藏非相关的列
465
- if ((_b = (_a = this.lineageManager) === null || _a === void 0 ? void 0 : _a.rightKeyMenuManager) === null || _b === void 0 ? void 0 : _b.onlyShowRelated) {
466
- if (!((_e = (_d = (_c = this.lineageManager) === null || _c === void 0 ? void 0 : _c.activeNodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.tableName)) {
467
- if (!_.some((_f = this.lineageManager) === null || _f === void 0 ? void 0 : _f.relatedNodes, { id: nodeConfig.id }))
468
- return false;
469
- }
470
- }
471
- // 找出所有target、source为该节点的边
472
- var relatedEdges = data.edges.filter(function (edge) {
473
- return (edge.target === nodeConfig.id || edge.source === nodeConfig.id) &&
474
- edge.visible;
475
- });
476
- if (!relatedEdges.length)
477
- return false;
478
- var isAllIndirectEdges = relatedEdges.every(function (edge) { return edge.relationType === EDashType.INDIRECT; });
479
- // 开关只有true false,直接、间接
480
- if (edgeDashVisible === EDashType.INDIRECT) {
481
- return true;
482
- }
483
- else {
484
- // 如果边都是间接边,那么该节点就隐藏
485
- if (isAllIndirectEdges)
486
- return false;
487
- return true;
488
- }
489
- };
490
- DataProcessor.prototype.getEdgeVisible = function (edgeCfg, edgeDashVisible, onlyShowRelated, isFoldChecked, relatedNodes) {
491
- var _a, _b, _c;
492
- // 如果边被折叠了,那么该边就隐藏
493
- if (edgeCfg.isFolded)
494
- return false;
495
- var visible = false;
496
- // 折叠
497
- if (isFoldChecked) {
498
- var foldStatus = (_c = (_b = (_a = this.lineageManager) === null || _a === void 0 ? void 0 : _a.foldLineageManager) === null || _b === void 0 ? void 0 : _b.foldStatusMap) === null || _c === void 0 ? void 0 : _c.get(edgeCfg.foldTableId);
499
- if (foldStatus) {
500
- visible = !!edgeCfg.isExtraFoldEdge;
501
- if (!visible) {
502
- return visible;
503
- }
504
- }
505
- }
506
- // 仅相关
507
- if (onlyShowRelated) {
508
- var source = edgeCfg.source, target = edgeCfg.target;
509
- if (relatedNodes[source] && relatedNodes[target]) {
510
- visible = true;
511
- }
512
- else {
513
- return false;
514
- }
515
- }
516
- switch (edgeDashVisible) {
517
- case EDashType.DIRECT:
518
- visible =
519
- edgeCfg.relationType === EDashType.DIRECT ||
520
- edgeCfg.relationType === EDashType.ALL;
521
- break;
522
- case EDashType.INDIRECT:
523
- visible = true;
524
- break;
525
- }
526
- return visible;
527
- };
528
- DataProcessor.prototype.updateNodesAndEdgesVisible = function (data, edgeDashVisible, onlyShowRelated, isFoldChecked) {
529
- this.updateEdgesVisible(data, edgeDashVisible, onlyShowRelated, isFoldChecked);
530
- // 更新节点本身、列、节点children的可见性
531
- this.updateNodesVisible(data, edgeDashVisible, onlyShowRelated, isFoldChecked);
532
- };
533
- DataProcessor.prototype.refreshRelatedNodesAndEdges = function (relatedNodes, relatedEdges) {
534
- var _this = this;
535
- relatedNodes.forEach(function (n) {
536
- if (!n)
537
- return;
538
- var nodeConfig = _this.lineageManager.getNodeConfigById(n.id);
539
- if (!nodeConfig)
540
- return;
541
- nodeConfig.isRelated = true;
542
- nodeConfig.style.stroke = '#3271C9';
543
- if (!nodeConfig.isActive) {
544
- nodeConfig.style.fill = '#E4EFFF';
545
- }
546
- nodeConfig.style.zIndex = 3;
547
- });
548
- relatedEdges.forEach(function (e) {
549
- if (!e)
550
- return;
551
- var edge = _this.lineageManager.getEdgeConfigById(e.id);
552
- if (!edge)
553
- return;
554
- if ((edge.inFoldLink &&
555
- _this.lineageManager.foldLineageManager.isFoldChecked) ||
556
- edge.isExtraFoldEdge)
557
- return;
558
- edge.style.stroke = '#3271C9';
559
- });
560
- };
561
- DataProcessor.prototype.updateNodeHeight = function (data) {
562
- var _this = this;
563
- data.nodes.forEach(function (node) {
564
- node.style.height = _this.calcNodeHeight(node);
565
- });
566
- };
567
- DataProcessor.prototype.updateColumnPosition = function (data) {
568
- data.nodes.forEach(function (node) {
569
- var _a, _b;
570
- var visibleRelatedColumns = (_a = node.relatedColumns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return col.visible; });
571
- visibleRelatedColumns === null || visibleRelatedColumns === void 0 ? void 0 : visibleRelatedColumns.forEach(function (col, i) {
572
- col.position.y = i * COL_HEIGHT;
573
- });
574
- var visibleColumns = (_b = node.children) === null || _b === void 0 ? void 0 : _b.filter(function (col) { return col.visible; });
575
- visibleColumns === null || visibleColumns === void 0 ? void 0 : visibleColumns.forEach(function (col, i) {
576
- col.position.y = node.position.y + COL_HEIGHT * i;
577
- });
578
- });
579
- };
580
- DataProcessor.prototype.calcNodeHeight = function (node) {
581
- return getNodeHeight(node);
582
- };
583
- DataProcessor.startNodes = [];
584
- return DataProcessor;
633
+ TableDataProcessor.startNodes = [];
634
+ // 放在这里,是因为parseData相当于一个工具方法,可以在lineageManager没有初始化的时候,就调用
635
+ TableDataProcessor.nodesIdMap = new Map();
636
+ return TableDataProcessor;
585
637
  }(BaseManager));
586
- export { DataProcessor };
587
- //# sourceMappingURL=DataProcessor.js.map
638
+ export { TableDataProcessor };
639
+ //# sourceMappingURL=TableDataProcessor.js.map