Skip to content

Commit

Permalink
Add util comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsteff committed Jul 10, 2024
1 parent f2e6461 commit 6b12951
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/layout/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ export const calculateScrollPosition = ({ nodes, viewportWidth, viewportHeight,
return [scrollX, scrollY];
};

/**
* Calculates the bounding box of a group of nodes
* @param nodes - The nodes to calculate the bounding box for
* @returns The bounding box
*/
export const getNodesBoundingBox = (nodes: LayoutNodeData[]) => {
return nodes.reduce(
(acc, node) => ({
Expand Down

0 comments on commit 6b12951

Please sign in to comment.