MCPcopy Create free account
hub / github.com/alibaba/lowcode-graph / getFlowRecallEdges

Function getFlowRecallEdges

packages/plugin-tools/src/common/utils.ts:142–165  ·  view source on GitHub ↗
(graph: G6.Graph, node: G6.Node, targetIds: string[] = [], edges: G6.Edge[] = [])

Source from the content-addressed store, hash-verified

140
141/** 获取回溯路径 - Flow */
142export function getFlowRecallEdges(graph: G6.Graph, node: G6.Node, targetIds: string[] = [], edges: G6.Edge[] = []) {
143 const inEdges: G6.Edge[] = node.getInEdges();
144
145 if (!inEdges.length) {
146 return [];
147 }
148
149 inEdges.map(edge => {
150 const sourceId = edge.getModel().source;
151 const sourceNode = graph.findById(sourceId);
152
153 edges.push(edge);
154
155 const targetId = node.get('id');
156
157 targetIds.push(targetId);
158
159 if (!targetIds.includes(sourceId)) {
160 getFlowRecallEdges(graph, sourceNode, targetIds, edges);
161 }
162 });
163
164 return edges;
165}
166
167/** 获取回溯路径 - Mind */
168export function getMindRecallEdges(graph: G6.TreeGraph, node: G6.Node, edges: G6.Edge[] = []) {

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected