diff --git a/sites/reactflow.dev/src/page-data/reference/types/ReactFlowInstance.fields.ts b/sites/reactflow.dev/src/page-data/reference/types/ReactFlowInstance.fields.ts index 38bb3b86f..a07175681 100644 --- a/sites/reactflow.dev/src/page-data/reference/types/ReactFlowInstance.fields.ts +++ b/sites/reactflow.dev/src/page-data/reference/types/ReactFlowInstance.fields.ts @@ -70,7 +70,12 @@ export const nodesAndEdgesFields: PropsTableProps = { name: 'getHandleConnections', type: `({ type, nodeId, id }: { type: HandleType, nodeId: string, id?: string | null }) => HandleConnection[]`, description: `Get all the connections of a handle belonging to a specific node. The type parameter be either 'source' or 'target'.`, - } + }, + { + name: 'getNodesBounds', + type: `(nodes: (NodeType | InternalNode | string)[]) => Rect`, + description: 'Returns the bounds of the given nodes or node ids.', + }, ], }; diff --git a/sites/reactflow.dev/src/pages/api-reference/types/react-flow-instance.mdx b/sites/reactflow.dev/src/pages/api-reference/types/react-flow-instance.mdx index e2d23b2f4..b1af5e362 100644 --- a/sites/reactflow.dev/src/pages/api-reference/types/react-flow-instance.mdx +++ b/sites/reactflow.dev/src/pages/api-reference/types/react-flow-instance.mdx @@ -40,6 +40,7 @@ export type ReactFlowInstance = { nodes?: (Partial & { id: Node['id'] })[]; edges?: (Partial & { id: Edge['id'] })[]; }) => void; + getNodesBounds: (nodes: (NodeType | InternalNode | string)[]) => Rect; // Intersections getIntersectingNodes: ( diff --git a/sites/svelteflow.dev/src/page-data/reference/hooks/useSvelteFlow.ts b/sites/svelteflow.dev/src/page-data/reference/hooks/useSvelteFlow.ts index 12faf405d..6d0503694 100644 --- a/sites/svelteflow.dev/src/page-data/reference/hooks/useSvelteFlow.ts +++ b/sites/svelteflow.dev/src/page-data/reference/hooks/useSvelteFlow.ts @@ -75,6 +75,11 @@ export const signature: PropsTableProps = { type: '(options?: FitViewOptions) => void', description: '', }, + { + name: 'getNodesBounds', + type: `(nodes: (NodeType | InternalNode | string)[]) => Rect`, + description: 'Returns the bounds of the given nodes or node ids.', + }, { name: 'getIntersectingNodes', type: `(