Convert decision tree structure for visualization