Skip to content

Commit

Permalink
add documentation for getNodesBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkogo committed Sep 12, 2024
1 parent 92e2224 commit 7ccc50b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type ReactFlowInstance<T, U> = {
nodes?: (Partial<Node> & { id: Node['id'] })[];
edges?: (Partial<Edge> & { id: Edge['id'] })[];
}) => void;
getNodesBounds: (nodes: (NodeType | InternalNode | string)[]) => Rect;

// Intersections
getIntersectingNodes: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: `(
Expand Down

0 comments on commit 7ccc50b

Please sign in to comment.