Changeset 4043:7c991afc7225 in orange


Ignore:
Timestamp:
08/04/07 00:40:40 (7 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
cb56e411940316011910eea9c85ff339d30bb2a8
Message:

added info tab

File:
1 edited

Legend:

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

    r4042 r4043  
    110110        self.hubs = 0 
    111111        self.color = 0 
    112         self.nVertices = self.nMarked = self.nSelected = self.nHidden = self.nShown = 0 
     112        self.nVertices = self.nMarked = self.nSelected = self.nHidden = self.nShown = self.nEdges = self.verticesPerEdge = self.edgesPerVertex = 0 
    113113        self.optimizeWhat = 1 
    114114         
     
    128128        self.mainTab = self.displayTab 
    129129        self.markTab = QVGroupBox(self) 
     130        self.infoTab = QVGroupBox(self) 
    130131#        self.tabs.insertTab(self.mainTab, "Main") 
    131132        self.tabs.insertTab(self.displayTab, "Display") 
    132133        self.tabs.insertTab(self.markTab, "Mark") 
     134        self.tabs.insertTab(self.infoTab, "Info") 
    133135        OWGUI.separator(self.controlArea) 
    134136 
     
    215217        OWGUI.button(self.controlArea, self, "Save network", callback=self.saveNetwork) 
    216218        OWGUI.button(self.controlArea, self, "test replot", callback=self.testRefresh) 
     219         
     220        ib = OWGUI.widgetBox(self.infoTab, "General", addSpace = True) 
     221        OWGUI.label(ib, self, "Number of vertices: %(nVertices)i") 
     222        OWGUI.label(ib, self, "Number of edges: %(nEdges)i") 
     223        OWGUI.label(ib, self, "Vertices per edge: %(verticesPerEdge).2f") 
     224        OWGUI.label(ib, self, "Edges per vertex: %(edgesPerVertex).2f") 
    217225 
    218226        self.icons = self.createAttributeIconDict() 
     
    345353        self.visualize = NetworkVisualizer(graph, self) 
    346354        self.nVertices = len(graph) 
     355        self.nEdges = len(graph.getEdges()) 
     356        self.verticesPerEdge = float(self.nVertices) / float(self.nEdges) 
     357        self.edgesPerVertex = float(self.nEdges) / float(self.nVertices) 
    347358        #print "done." 
    348359        vars = self.visualize.getVars() 
     
    434445#        if refreshRate <   1: refreshRate = 1; 
    435446#        if refreshRate > 1500: refreshRate = 1500; 
    436         print "refreshRate: " + str(self.frSteps)         
     447#        print "refreshRate: " + str(self.frSteps)         
    437448        tolerance = 5 
    438449        initTemp = 1000 
Note: See TracChangeset for help on using the changeset viewer.