tree --> diagram