prepare linear tree layout for collapsing and transitions