Ignore:
Timestamp:
06/16/12 13:27:11 (22 months ago)
Author:
mstajdohar
Branch:
default
rebase_source:
62bb80cf8d0f6b4bfbc98d8c6a3c7acf19c03d91
Message:

Color models by label.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Unsupervised/OWNxCanvasQt.py

    r10878 r10915  
    504504            colors.update((v, self.discPalette[colorIndices[self.items[v][colorIndex].value]]) for v in nodes) 
    505505 
     506        elif colorIndex is not None and self.items.domain[colorIndex].varType == core.VarTypes.String and self.items.domain[colorIndex].name == "label": 
     507            colorIndices = {v: i for i, v in enumerate(set(inst[colorIndex].value for inst in self.items))} 
     508            colors.update((v, self.discPalette[colorIndices[self.items[v][colorIndex].value]]) for v in nodes) 
    506509        else: 
    507510            colors.update((node, self.discPalette[0]) for node in nodes) 
Note: See TracChangeset for help on using the changeset viewer.