Changeset 8257:6fcf55800869 in orange


Ignore:
Timestamp:
08/22/11 15:24:48 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
9a787c9226a8c29e2891b2b525ef0c8f501ea5aa
Message:

Check whether a point is valid before calculating its color. Fixes bug #921.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize Qt/OWScatterPlotGraphQt.py

    r8228 r8257  
    175175        if colorIndex != -1: 
    176176            if self.dataDomain[colorIndex].varType == orange.VarTypes.Continuous: 
    177                 colorData = [QColor(*self.contPalette.getRGB(i)) for i in self.noJitteringScaledData[colorIndex]] 
     177                c_data = self.noJitteringScaledData[colorIndex] 
     178                palette = self.continuous_palette 
    178179            else: 
    179                 colorData = [QColor(*self.discPalette.getRGB(i)) for i in self.originalData[colorIndex]] 
    180         else: colorData = [def_color] 
     180                c_data = self.originalData[colorIndex] 
     181                palette = self.discrete_palette 
     182            checked_color_data = [(c_data[i] if validData[i] else 0) for i in range(len(c_data))] 
     183            colorData = [QColor(*palette.getRGB(i)) for i in checked_color_data] 
     184        else: 
     185            colorData = [def_color] 
    181186 
    182187        if sizeIndex != -1: 
Note: See TracChangeset for help on using the changeset viewer.