Changeset 8839:166368cc7252 in orange


Ignore:
Timestamp:
08/30/11 08:40:39 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
2629afa98017c982f761184cef32f80d7a238760
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Unsupervised/OWNxCanvas.py

    r8086 r8839  
    725725    #          edges = [(ind / matrix.dim, ind % matrix.dim) for v, ind in vals] 
    726726    #          print "number of component edges:", len(edges), "number of components:", len(components) 
    727             components_c = [(sum(self.networkCurve.coors[c][0]) / len(c), sum(self.networkCurve.coors[c][1]) / len(c)) for c in components] 
    728             weights = [1 - matrix[u,v] for u,v in edges] 
    729              
    730             max_weight = max(weights) 
    731             min_weight = min(weights) 
    732             span_weights = max_weight - min_weight 
    733            
    734             for u,v in edges: 
    735                 x = [components_c[u][0], components_c[v][0]] 
    736                 y = [components_c[u][1], components_c[v][1]] 
    737                 w = ((1 - matrix[u,v]) - min_weight) / span_weights * (self.maxComponentEdgeWidth - self.minComponentEdgeWidth) + self.minComponentEdgeWidth 
    738                  
    739                 pen = QPen() 
    740                 pen.setWidth(int(w)) 
    741                 pen.setBrush(QColor(50,200,255,15)) 
    742                 pen.setCapStyle(Qt.FlatCap) 
    743                 pen.setJoinStyle(Qt.RoundJoin) 
    744                 self.addCurve("component_edges", Qt.green, Qt.green, 0, style=QwtPlotCurve.Lines, symbol = QwtSymbol.NoSymbol, xData=x, yData=y, pen=pen, showFilledSymbols=False) 
     727#            components_c = [(sum(self.networkCurve.coors[c][0]) / len(c), sum(self.networkCurve.coors[c][1]) / len(c)) for c in components] 
     728#            weights = [1 - matrix[u,v] for u,v in edges] 
     729#             
     730#            max_weight = max(weights) 
     731#            min_weight = min(weights) 
     732#            span_weights = max_weight - min_weight 
     733#           
     734#            for u,v in edges: 
     735#                x = [components_c[u][0], components_c[v][0]] 
     736#                y = [components_c[u][1], components_c[v][1]] 
     737#                w = ((1 - matrix[u,v]) - min_weight) / span_weights * (self.maxComponentEdgeWidth - self.minComponentEdgeWidth) + self.minComponentEdgeWidth 
     738#                 
     739#                pen = QPen() 
     740#                pen.setWidth(int(w)) 
     741#                pen.setBrush(QColor(50,200,255,15)) 
     742#                pen.setCapStyle(Qt.FlatCap) 
     743#                pen.setJoinStyle(Qt.RoundJoin) 
     744#                self.addCurve("component_edges", Qt.green, Qt.green, 0, style=QwtPlotCurve.Lines, symbol = QwtSymbol.NoSymbol, xData=x, yData=y, pen=pen, showFilledSymbols=False) 
    745745         
    746746         
Note: See TracChangeset for help on using the changeset viewer.