MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / apply

Function apply

yaml-flow-editor/src/App.tsx:1017–1026  ·  view source on GitHub ↗
(dir: 'TB' | 'LR')

Source from the content-addressed store, hash-verified

1015 // 1) Layout with current (possibly estimated) sizes
1016 // 2) After ReactFlow updates measured sizes, layout again to eliminate overlaps
1017 const apply = (dir: 'TB' | 'LR') => {
1018 const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
1019 nodesRef.current,
1020 edgesRef.current,
1021 dir,
1022 { compact: layoutCompact }
1023 );
1024 setNodes(layoutedNodes);
1025 setEdges(layoutedEdges);
1026 };
1027 apply(layoutDirection);
1028 // Next frames: measured sizes (node.measured) are more likely available, then optionally fit the whole graph
1029 requestAnimationFrame(() => {

Callers 1

App.tsxFile · 0.85

Calls 1

getLayoutedElementsFunction · 0.90

Tested by

no test coverage detected