Reshape tree data.