Changeset 9421:bbfeb42cfe96 in orange


Ignore:
Timestamp:
12/29/11 09:36:14 (2 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
5c9908edc9861318af8cc6dc68d88883a945265e
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWNxHist.py

    r8870 r9421  
    3838        boxGeneral = OWGUI.widgetBox(parent, box = "Distance boundaries") 
    3939         
    40         OWGUI.lineEdit(boxGeneral, self, "spinLowerThreshold", "Lower:", orientation='horizontal', callback=self.changeLowerSpin, valueType=float) 
    41         OWGUI.lineEdit(boxGeneral, self, "spinUpperThreshold", "Upper:", orientation='horizontal', callback=self.changeUpperSpin, valueType=float) 
    42         ribg = OWGUI.radioButtonsInBox(boxGeneral, self, "andor", [], orientation='horizontal', callback = self.generateGraph) 
    43         OWGUI.appendRadioButton(ribg, self, "andor", "OR", callback = self.generateGraph) 
    44         b = OWGUI.appendRadioButton(ribg, self, "andor", "AND", callback = self.generateGraph) 
    45         b.setEnabled(False) 
    46         OWGUI.spin(boxGeneral, self, "kNN", 0, 1000, 1, label="kNN:", orientation='horizontal', callback=self.generateGraph, callbackOnReturn=1) 
    47         OWGUI.doubleSpin(boxGeneral, self, "percentil", 0, 100, 0.1, label="Percentil:", orientation='horizontal', callback=self.setPercentil, callbackOnReturn=1) 
    48          
     40        ribg = OWGUI.widgetBox(boxGeneral, None, orientation="horizontal", addSpace = False) 
     41        OWGUI.lineEdit(ribg, self, "spinLowerThreshold", "Lower", orientation='horizontal', callback=self.changeLowerSpin, valueType=float, enterPlaceholder=True, controlWidth=100) 
     42        OWGUI.lineEdit(ribg, self, "spinUpperThreshold", "Upper    ", orientation='horizontal', callback=self.changeUpperSpin, valueType=float, enterPlaceholder=True,controlWidth=100) 
     43        ribg.layout().addStretch(1) 
     44        #ribg = OWGUI.radioButtonsInBox(boxGeneral, self, "andor", [], orientation='horizontal', callback = self.generateGraph) 
     45        #OWGUI.appendRadioButton(ribg, self, "andor", "OR", callback = self.generateGraph) 
     46        #b = OWGUI.appendRadioButton(ribg, self, "andor", "AND", callback = self.generateGraph) 
     47        #b.setEnabled(False) 
     48        #ribg.hide(False) 
     49         
     50        ribg = OWGUI.widgetBox(boxGeneral, None, orientation="horizontal", addSpace = False) 
     51        OWGUI.spin(ribg, self, "kNN", 0, 1000, 1, label="kNN   ", orientation='horizontal', callback=self.generateGraph, callbackOnReturn=1, controlWidth=100) 
     52        OWGUI.doubleSpin(ribg, self, "percentil", 0, 100, 0.1, label="Percentil", orientation='horizontal', callback=self.setPercentil, callbackOnReturn=1, controlWidth=100) 
     53        ribg.layout().addStretch(1) 
    4954        # Options 
    5055        self.attrColor = "" 
    5156        ribg = OWGUI.radioButtonsInBox(parent, self, "netOption", [], "Options", callback = self.generateGraph) 
    5257        OWGUI.appendRadioButton(ribg, self, "netOption", "All vertices", callback = self.generateGraph) 
    53         OWGUI.appendRadioButton(ribg, self, "netOption", "Exclude small components", callback = self.generateGraph) 
    54         OWGUI.spin(OWGUI.indentedBox(ribg), self, "excludeLimit", 1, 100, 1, label="Less vertices than: ", callback = (lambda h=True: self.generateGraph(h))) 
     58        hb = OWGUI.widgetBox(ribg, None, orientation="horizontal", addSpace = False) 
     59        OWGUI.appendRadioButton(ribg, self, "netOption", "Exclude components with less nodes than:", insertInto=hb, callback=self.generateGraph) 
     60        OWGUI.spin(hb, self, "excludeLimit", 1, 100, 1, callback = (lambda h=True: self.generateGraph(h))) 
    5561        OWGUI.appendRadioButton(ribg, self, "netOption", "Largest connected component only", callback = self.generateGraph) 
    5662        OWGUI.appendRadioButton(ribg, self, "netOption", "Connected component with vertex") 
    5763        self.attribute = None 
    58         self.attributeCombo = OWGUI.comboBox(ribg, self, "attribute", box = "Filter attribute")#, callback=self.setVertexColor) 
    59          
    60         ribg = OWGUI.radioButtonsInBox(parent, self, "dstWeight", [], "Distance -> Weight", callback = self.generateGraph) 
    61         OWGUI.appendRadioButton(ribg, self, "dstWeight", "Weight := distance", callback = self.generateGraph) 
    62         OWGUI.appendRadioButton(ribg, self, "dstWeight", "Weight := 1 - distance", callback = self.generateGraph) 
     64        self.attributeCombo = OWGUI.comboBox(parent, self, "attribute", box="Filter attribute", orientation='horizontal')#, callback=self.setVertexColor) 
     65         
     66        ribg = OWGUI.radioButtonsInBox(parent, self, "dstWeight", [], "Distance -> Weight", callback=self.generateGraph) 
     67        hb = OWGUI.widgetBox(ribg, None, orientation="horizontal", addSpace = False) 
     68        OWGUI.appendRadioButton(ribg, self, "dstWeight", "Weight := distance", insertInto=hb, callback=self.generateGraph) 
     69        OWGUI.appendRadioButton(ribg, self, "dstWeight", "Weight := 1 - distance", insertInto=hb, callback=self.generateGraph) 
    6370         
    6471        self.label = '' 
     
    96103        low = min(values) 
    97104        upp = max(values) 
    98         self.spinLowerThreshold = self.spinUpperThreshold = low - (0.03 * (upp - low)) 
     105        self.spinLowerThreshold = self.spinUpperThreshold = math.floor(low - (0.03 * (upp - low))) 
    99106        self.generateGraph() 
    100107        self.attributeCombo.clear() 
Note: See TracChangeset for help on using the changeset viewer.