(self, root)
Set the root cluster tree node for display.

        Parameters
        ----------
        root : Tree
            The tree root node.
Set the root cluster tree node for display.
Set the root cluster tree node for display .
def setRoot(self, root):
        # type: (Tree) -> None
        """
        Set the root cluster tree node for display.

        Parameters
        ----------
        root : Tree
            The tree root node.
        """
        self.clear()
        self._root = root
        if root is not None:
            pen = make_pen(Qt.blue, width=1, cosmetic=True,
                           join_style=Qt.MiterJoin)
            for node in postorder(root):
                item = DendrogramWidget.ClusterGraphicsItem(self._itemgroup)
                item.setAcceptHoverEvents(True)
                item.setPen(pen)
                item.node = node
                for branch in node.branches:
                    assert branch in self._items
                    self._cluster_parent[branch] = node
                self._items[node] = item

            self._relayout()
            self._rescale()
        self.updateGeometry()
def setRoot ( self , root ) : # type: (Tree) -> None self . clear ( ) self . _root = root if root is not None : pen = make_pen ( Qt . blue , width = 1 , cosmetic = True , join_style = Qt . MiterJoin ) for node in postorder ( root ) : item = DendrogramWidget . ClusterGraphicsItem ( self . _itemgroup ) item . setAcceptHoverEvents ( True ) item . setPen ( pen ) item . node = node for branch in node . branches : assert branch in self . _items self . _cluster_parent [ branch ] = node self . _items [ node ] = item self . _relayout ( ) self . _rescale ( ) self . updateGeometry ( )