Changeset 8870:1b9496f166cd in orange


Ignore:
Timestamp:
09/01/11 10:54:20 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
d6f37d8093f994bb1d58cadaf8def109dd6291ad
Message:

Fixed graph statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWNxHist.py

    r7956 r8870  
    4444        b = OWGUI.appendRadioButton(ribg, self, "andor", "AND", callback = self.generateGraph) 
    4545        b.setEnabled(False) 
    46         OWGUI.spin(boxGeneral, self, "kNN", 0, 1000, 1, label="kNN:", orientation='horizontal', callback=self.generateGraph) 
     46        OWGUI.spin(boxGeneral, self, "kNN", 0, 1000, 1, label="kNN:", orientation='horizontal', callback=self.generateGraph, callbackOnReturn=1) 
    4747        OWGUI.doubleSpin(boxGeneral, self, "percentil", 0, 100, 0.1, label="Percentil:", orientation='horizontal', callback=self.setPercentil, callbackOnReturn=1) 
    4848         
     
    192192                graph.add_edges_from(((u,v,{'weight':d}) for u,v,d in edge_list)) 
    193193             
    194             edges = graph.edges() 
    195             n = len(edges) 
    196194            # exclude unconnected 
    197195            if str(self.netOption) == '1': 
     
    250248            self.graph_matrix = matrix 
    251249             
    252         self.pconnected = self.graph.number_of_edges() 
    253         self.nedges = n 
     250        self.pconnected = self.graph.number_of_nodes() 
     251        self.nedges = self.graph.number_of_edges() 
    254252        if hasattr(self, "infoa"): 
    255             self.infoa.setText("%d vertices" % self.matrix.dim) 
     253            self.infoa.setText("Matrix size: %d" % self.matrix.dim) 
    256254        if hasattr(self, "infob"): 
    257             self.infob.setText("%d connected (%3.1f%%)" % (self.graph.number_of_edges(), self.graph.number_of_edges() / float(self.matrix.dim) * 100)) 
     255            self.infob.setText("Graph nodes: %d (%3.1f%%)" % (self.pconnected, self.pconnected / float(self.matrix.dim) * 100)) 
    258256        if hasattr(self, "infoc"): 
    259             self.infoc.setText("%d edges (%d average)" % (n, n / float(self.matrix.dim))) 
     257            self.infoc.setText("Graph edges: %d (%.2f edges/node)" % (self.nedges, self.nedges / float(self.pconnected))) 
    260258         
    261259        #print 'self.graph:',self.graph+ 
Note: See TracChangeset for help on using the changeset viewer.