if (type === IGroupBoundsCalculator.$class) {
return IGroupBoundsCalculator.create(
(graph: IGraph, groupNode: INode): Rect => {
let bounds: Rect = Rect.EMPTY
const children = graph.getChildren(groupNode)
children.forEach((child: INode): void => {
bounds = Rect.add(bounds, child.layout.toRect())
child.labels.forEach((label: ILabel): void => {
bounds = Rect.add(bounds, label.layout.bounds)
})
})
const insetsProvider = groupNode.lookup(INodeInsetsProvider.$class)
return insetsProvider
? bounds.getEnlarged(insetsProvider.getInsets(groupNode))
: bounds
}
)
}