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

Function clearSelectedState

packages/plugin-tools/src/common/utils.ts:128–139  ·  view source on GitHub ↗
(graph: G6.Graph, shouldUpdate: (item: G6.Item) => boolean = () => true)

Source from the content-addressed store, hash-verified

126
127/** 清除选中状态 */
128export 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 */
142export function getFlowRecallEdges(graph: G6.Graph, node: G6.Node, targetIds: string[] = [], edges: G6.Edge[] = []) {

Callers

nothing calls this directly

Calls 3

getSelectedNodesFunction · 0.70
getSelectedEdgesFunction · 0.70
executeBatchFunction · 0.70

Tested by

no test coverage detected