def __init__(self, tree, node_labels=None, max_tree_height=None, use_ascii=False, orientation=None):
    self.tree = tree
    self.max_tree_height = check_max_tree_height(max_tree_height, allow_numeric=False)
    self.use_ascii = use_ascii
    self.orientation = check_orientation(orientation)
    self.horizontal_line_char = '━'
    self.vertical_line_char = '┃'
    if use_ascii:
        self.horizontal_line_char = '-'
        self.vertical_line_char = '|'
    self.width = None
    self.height = None
    self.canvas = None
    self.traversal_position = {}
    self.time_position = {}
    self.node_labels = {}
    for u in tree.nodes():
        if (node_labels is None):
            self.node_labels[u] = str(u)
        else:
            self.node_labels[u] = self.default_node_label
    if (node_labels is not None):
        for (node, label) in node_labels.items():
            self.node_labels[node] = label
    self._assign_time_positions()
    self._assign_traversal_positions()
    self.canvas = np.zeros((self.height, self.width), dtype=str)
    self.canvas[:] = ' '
    self._draw()
    self.canvas[:, (- 1)] = '\n'
def __init__(self, tree, node_labels=None, max_tree_height=None, use_ascii=False, orientation=None):
    self.tree = tree
    self.max_tree_height = check_max_tree_height(max_tree_height, allow_numeric=False)
    self.use_ascii = use_ascii
    self.orientation = check_orientation(orientation)
    self.horizontal_line_char = '━'
    self.vertical_line_char = '┃'
    if use_ascii:
        self.horizontal_line_char = '-'
        self.vertical_line_char = '|'
    self.width = None
    self.height = None
    self.canvas = None
    self.traversal_position = {}
    self.time_position = {}
    self.node_labels = {}
    for u in tree.nodes():
        if (node_labels is None):
            self.node_labels[u] = str(u)
        else:
            self.node_labels[u] = self.default_node_label
    if (node_labels is not None):
        for (node, label) in node_labels.items():
            self.node_labels[node] = label
    self._assign_time_positions()
    self._assign_traversal_positions()
    self.canvas = np.zeros((self.height, self.width), dtype=str)
    self.canvas[:] = ' '
    self._draw()
    self.canvas[:, (- 1)] = '\n'