@gravity-ui/graph
Version:
Modern graph editor component
7 lines (6 loc) • 337 B
JavaScript
export function selectConnectionById(graph, id) {
return graph.rootStore.connectionsList.$connectionsMap.value.get(id);
}
export function selectConnectionsByBlockId(graph, id) {
return graph.rootStore.connectionsList.$connections.value.filter((connection) => [connection.targetBlockId, connection.sourceBlockId].includes(id));
}