def _draw(self):
    if self.use_ascii:
        top_across = '+'
        bot_across = '+'
        mid_parent = '+'
        mid_parent_child = '+'
        mid_child = '+'
    elif (self.orientation == LEFT):
        top_across = '┏'
        bot_across = '┗'
        mid_parent = '┫'
        mid_parent_child = '╋'
        mid_child = '┣'
    else:
        top_across = '┓'
        bot_across = '┛'
        mid_parent = '┣'
        mid_parent_child = '╋'
        mid_child = '┫'
    for u in self.tree.nodes():
        yu = self.traversal_position[u]
        xu = self.time_position[u]
        label = to_np_unicode(self.node_labels[u])
        if (self.orientation == LEFT):
            label = label[::(- 1)]
        label_len = label.shape[0]
        self.canvas[yu, xu:(xu + label_len)] = label
        children = self.tree.children(u)
        if (len(children) > 0):
            if (len(children) == 1):
                xv = self.time_position[children[0]]
                self.canvas[yu, xv:xu] = self.horizontal_line_char
            else:
                bot = min((self.traversal_position[v] for v in children))
                top = max((self.traversal_position[v] for v in children))
                x = (xu - 1)
                self.canvas[(bot + 1):top, x] = self.vertical_line_char
                self.canvas[(yu, x)] = mid_parent
                for v in children:
                    yv = self.traversal_position[v]
                    xv = self.time_position[v]
                    self.canvas[yv, xv:x] = self.horizontal_line_char
                    mid_char = (mid_parent_child if (yv == yu) else mid_child)
                    self.canvas[(yv, x)] = mid_char
                self.canvas[(bot, x)] = top_across
                self.canvas[(top, x)] = bot_across
    if (self.orientation == LEFT):
        self.canvas = np.flip(self.canvas, axis=1)
        self.canvas[:, :(- 1)] = self.canvas[:, 1:]
        self.canvas[:, (- 1)] = ' '
def _draw(self):
    if self.use_ascii:
        top_across = '+'
        bot_across = '+'
        mid_parent = '+'
        mid_parent_child = '+'
        mid_child = '+'
    elif (self.orientation == LEFT):
        top_across = '┏'
        bot_across = '┗'
        mid_parent = '┫'
        mid_parent_child = '╋'
        mid_child = '┣'
    else:
        top_across = '┓'
        bot_across = '┛'
        mid_parent = '┣'
        mid_parent_child = '╋'
        mid_child = '┫'
    for u in self.tree.nodes():
        yu = self.traversal_position[u]
        xu = self.time_position[u]
        label = to_np_unicode(self.node_labels[u])
        if (self.orientation == LEFT):
            label = label[::(- 1)]
        label_len = label.shape[0]
        self.canvas[yu, xu:(xu + label_len)] = label
        children = self.tree.children(u)
        if (len(children) > 0):
            if (len(children) == 1):
                xv = self.time_position[children[0]]
                self.canvas[yu, xv:xu] = self.horizontal_line_char
            else:
                bot = min((self.traversal_position[v] for v in children))
                top = max((self.traversal_position[v] for v in children))
                x = (xu - 1)
                self.canvas[(bot + 1):top, x] = self.vertical_line_char
                self.canvas[(yu, x)] = mid_parent
                for v in children:
                    yv = self.traversal_position[v]
                    xv = self.time_position[v]
                    self.canvas[yv, xv:x] = self.horizontal_line_char
                    mid_char = (mid_parent_child if (yv == yu) else mid_child)
                    self.canvas[(yv, x)] = mid_char
                self.canvas[(bot, x)] = top_across
                self.canvas[(top, x)] = bot_across
    if (self.orientation == LEFT):
        self.canvas = np.flip(self.canvas, axis=1)
        self.canvas[:, :(- 1)] = self.canvas[:, 1:]
        self.canvas[:, (- 1)] = ' '