Changeset 4955:7b4f705f2b6c in orange


Ignore:
Timestamp:
07/14/08 09:24:51 (6 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
9ec95b48c2832203fdd6ef2d26c441ad9abebb7d
Message:

color by continuous attr

Location:
orange/OrangeWidgets/Prototypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWNetwork.py

    r4953 r4955  
    148148        OWGUI.separator(self.displayTab) 
    149149 
    150         OWGUI.button(self.displayTab, self, "Show degree distribution", callback=self.showDegreeDistribution) 
    151150        OWGUI.button(self.displayTab, self, "Save network", callback=self.saveNetwork) 
    152151         
     
    222221        OWGUI.label(ib, self, "Diameter: %(diameter)i") 
    223222        OWGUI.label(ib, self, "Clustering Coefficient: %(clustering_coefficient).1f%%") 
     223         
     224        OWGUI.button(self.infoTab, self, "Show degree distribution", callback=self.showDegreeDistribution) 
     225         
    224226         
    225227        #OWGUI.button(self.settingsTab, self, "Clustering", callback=self.clustering) 
  • orange/OrangeWidgets/Prototypes/OWNetworkCanvas.py

    r4953 r4955  
    687687      self.discPalette.setNumberOfColors(len(colorIndices)) 
    688688       
     689      if self.visualizer.graph.items.domain[colorIndex].varType == orange.VarTypes.Continuous: 
     690          minValue = float(min([float(x[colorIndex].value) for x in self.visualizer.graph.items])) 
     691          maxValue = float(max([float(x[colorIndex].value) for x in self.visualizer.graph.items])) 
     692       
    689693      for v in range(self.nVertices): 
    690694          if colorIndex > -1:     
    691695              if self.visualizer.graph.items.domain[colorIndex].varType == orange.VarTypes.Continuous: 
    692                   newColor = self.contPalette[self.noJitteringScaledData[colorIndex][v]] 
     696                  value = (float(self.visualizer.graph.items[v][colorIndex].value) - minValue) / (maxValue - minValue) 
     697                  newColor = self.contPalette[value] 
     698                  self.networkCurve.setVertexColor(v, newColor) 
    693699                   
    694700              elif self.visualizer.graph.items.domain[colorIndex].varType == orange.VarTypes.Discrete: 
Note: See TracChangeset for help on using the changeset viewer.