(self)
Re enumerate the selection items and update the colors.
Re enumerate the selection items and update the colors.
Re enumerate the selection items and update the colors .
def _re_enumerate_selections(self):
        """Re enumerate the selection items and update the colors."""
        # Order the clusters
        items = sorted(self._selection.items(),
                       key=lambda item: item[0].node.value.first)

        palette = colorpalettes.LimitedDiscretePalette(len(items))
        for i, (item, selection_item) in enumerate(items):
            # delete and then reinsert to update the ordering
            del self._selection[item]
            self._selection[item] = selection_item
            selection_item.set_label(self._create_label(i))
            color = palette[i]
            color.setAlpha(150)
            selection_item.set_color(color)
def _re_enumerate_selections ( self ) : # Order the clusters items = sorted ( self . _selection . items ( ) , key = lambda item : item [ 0 ] . node . value . first ) palette = colorpalettes . LimitedDiscretePalette ( len ( items ) ) for i , ( item , selection_item ) in enumerate ( items ) : # delete and then reinsert to update the ordering del self . _selection [ item ] self . _selection [ item ] = selection_item selection_item . set_label ( self . _create_label ( i ) ) color = palette [ i ] color . setAlpha ( 150 ) selection_item . set_color ( color )