(graph: G6.Graph, shouldUpdate: (item: G6.Item) => boolean = () => true)
| 126 | |
| 127 | /** 清除选中状态 */ |
| 128 | export function clearSelectedState(graph: G6.Graph, shouldUpdate: (item: G6.Item) => boolean = () => true) { |
| 129 | const selectedNodes = getSelectedNodes(graph); |
| 130 | const selectedEdges = getSelectedEdges(graph); |
| 131 | |
| 132 | executeBatch(graph, () => { |
| 133 | [...selectedNodes, ...selectedEdges].forEach(item => { |
| 134 | if (shouldUpdate(item)) { |
| 135 | graph.setItemState(item, ItemState.Selected, false); |
| 136 | } |
| 137 | }); |
| 138 | }); |
| 139 | } |
| 140 | |
| 141 | /** 获取回溯路径 - Flow */ |
| 142 | export function getFlowRecallEdges(graph: G6.Graph, node: G6.Node, targetIds: string[] = [], edges: G6.Edge[] = []) { |
nothing calls this directly
no test coverage detected