Changeset 4037:1584dba64930 in orange


Ignore:
Timestamp:
08/03/07 18:07:28 (7 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
157da47cf745a8539275de169f37e49996c9e893
Message:

one can now manually set steps for F-R algorithm

File:
1 edited

Legend:

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

    r4033 r4037  
    107107        self.markSearchString = "" 
    108108        self.markDistance = 2 
     109        self.frSteps = 1 
    109110        self.hubs = 0 
    110111        self.color = 0 
     
    136137        OWGUI.button(self.optimizeBox, self, "Random", callback=self.random) 
    137138        OWGUI.button(self.optimizeBox, self, "Fruchterman Reingold", callback=self.fr) 
     139        OWGUI.spin(self.optimizeBox, self, "frSteps", 1, 10000, 1, label="Steps ") 
    138140        OWGUI.button(self.optimizeBox, self, "F-R Radial", callback=self.frRadial) 
    139141        OWGUI.button(self.optimizeBox, self, "Circular Original", callback=self.circularOriginal) 
     
    355357        #print "done." 
    356358        #print "OWNetwork/setGraph: display random..." 
     359        k = 1.13850193174e-008 
     360        nodes = self.visualize.nVertices() 
     361        t = k * nodes * nodes 
     362        self.frSteps = int(5.0 / t) 
     363        if self.frSteps <   1: self.frSteps = 1; 
     364        if self.frSteps > 1500: self.frSteps = 1500; 
     365         
    357366        self.random() 
    358367        #print "done." 
     
    416425            return 
    417426         
    418         k = 1.13850193174e-008 
    419         #k = 1.61735442033e-008 
    420         nodes = self.visualize.nVertices() 
    421         t = k * nodes * nodes 
    422         refreshRate = int(5.0 / t) 
    423         if refreshRate <   1: refreshRate = 1; 
    424         if refreshRate > 1500: refreshRate = 1500; 
    425         print "refreshRate: " + str(refreshRate)         
     427#        k = 1.13850193174e-008 
     428#        #k = 1.61735442033e-008 
     429#        nodes = self.visualize.nVertices() 
     430#        t = k * nodes * nodes 
     431#        refreshRate = int(5.0 / t) 
     432#        if refreshRate <   1: refreshRate = 1; 
     433#        if refreshRate > 1500: refreshRate = 1500; 
     434        print "refreshRate: " + str(self.frSteps)         
    426435        tolerance = 5 
    427436        initTemp = 1000 
    428         initTemp = self.visualize.fruchtermanReingold(refreshRate, initTemp, self.graph.hiddenNodes) 
     437        initTemp = self.visualize.fruchtermanReingold(self.frSteps, initTemp, self.graph.hiddenNodes) 
    429438        self.updateCanvas() 
    430439        #print "done." 
Note: See TracChangeset for help on using the changeset viewer.