shiftNodes
function is called on each group to make sure no
nodes overlap with the group. The function moves overlapping nodes rightwards or downwards or both.
A layout normally happens whenever any node changes size, so groups do not need to be expanded
in order for any overlapping nodes to be shifted.