Changeset 3547:88be040f259c in orange


Ignore:
Timestamp:
04/17/07 11:52:15 (7 years ago)
Author:
Gregor <Gregor@…>
Branch:
default
Convert:
5b45fd3bd9d2d75c09b161ecd4c6f070ca635111
Message:
  • added argumentCount
  • use of RectangleCurve
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWkNNOptimization.py

    r3539 r3547  
    155155        self.findArgumentsButton = OWGUI.button(self.argumentationBox, self, "Find Arguments", callback = self.findArguments, debuggingEnabled = 0) 
    156156        f = self.findArgumentsButton.font(); f.setBold(1);  self.findArgumentsButton.setFont(f) 
     157        self.argumentCountEdit = OWGUI.lineEdit(self.argumentationBox , self, "argumentCount", "Number of best projections to consider:     ", orientation = "horizontal", tooltip = "How many of the top ranked projections do you wish to consider?", valueType = int, validator = QIntValidator(self)) 
     158 
    157159        self.classValueList = OWGUI.comboBox(self.ArgumentationTab, self, "argumentationClassValue", box = "Arguments for Class:", tooltip = "Select the class value that you wish to see arguments for", callback = self.argumentationClassChanged, debuggingEnabled = 0) 
    158160        self.argumentBox = OWGUI.widgetBox(self.ArgumentationTab, "Arguments for the Selected Class Value") 
     
    873875        classInd = self.classValueList.currentItem() 
    874876        generalDict = self.results[self.arguments[classInd][ind][3]][GENERAL_DICT] 
    875         self.graph.updateData(self.arguments[classInd][ind][2], setAnchors = 1, XAnchors = generalDict.get("XAnchors"), YAnchors = generalDict.get("YAnchors")) 
     877        if self.visualizationMethod == SCATTERPLOT: 
     878            attrs = self.arguments[classInd][ind][2] 
     879            self.graph.updateData(attrs[0], attrs[1], self.data.domain.classVar.name) 
     880        else: 
     881            self.graph.updateData(self.arguments[classInd][ind][2], setAnchors = 1, XAnchors = generalDict.get("XAnchors"), YAnchors = generalDict.get("YAnchors")) 
     882        self.graph.repaint() 
    876883 
    877884    def setStatusBarText(self, text): 
     
    10911098                    s += "<hr>Gene sets for individual genes:<br>&nbsp; &nbsp; <b>%s</b>: %s<br>&nbsp; &nbsp; <b>%s</b>: %s" % (attributes[x], getGeneSet(self.geneToSet, attributes[x]), attributes[yy], getGeneSet(self.geneToSet, attributes[yy])) 
    10921099 
    1093                 key = self.graph.insertCurve(PolygonCurve(self.graph, QPen(color, 1), QBrush(color), [x-0.5+eps, x+0.5-eps, x+0.5-eps, x-0.5+eps, x-0.5+eps], [y+1-0.5+eps, y+1-0.5+eps, y+1+0.5-eps, y+1+0.5-eps, y+1-0.5+eps])) 
     1100                key = self.graph.insertCurve(RectangleCurve(self.graph, QPen(color, 1), QBrush(color), [x-0.5+eps, x+0.5-eps, x+0.5-eps, x-0.5+eps], [y+1-0.5+eps, y+1-0.5+eps, y+1+0.5-eps, y+1+0.5-eps])) 
    10941101 
    10951102                if self.useGeneSets and self.geneToSet and sharedGeneSets != []: 
    1096                     key = self.graph.insertCurve(PolygonCurve(self.graph, QPen(color, 1), QBrush(Qt.NoBrush), [x-0.5+eps2, x+0.5-eps2, x+0.5-eps2, x-0.5+eps2, x-0.5+eps2], [y+1-0.5+eps2, y+1-0.5+eps2, y+1+0.5-eps2, y+1+0.5-eps2, y+1-0.5+eps2])) 
     1103                    key = self.graph.insertCurve(RectangleCurve(self.graph, QPen(color, 1), QBrush(Qt.NoBrush), [x-0.5+eps2, x+0.5-eps2, x+0.5-eps2, x-0.5+eps2], [y+1-0.5+eps2, y+1-0.5+eps2, y+1+0.5-eps2, y+1+0.5-eps2])) 
    10971104                if s != "": 
    10981105                    self.graph.tips.addToolTip(x, y+1, s, 0.5, 0.5) 
    10991106 
    11001107                if not self.onlyLower: 
    1101                     key = self.graph.insertCurve(PolygonCurve(self.graph, QPen(color, 1), QBrush(color), [num-1-0.5-y+eps, num-1-0.5-y+eps, num-1+0.5-y-eps, num-1+0.5-y-eps, num-1-0.5-y+eps], [num-0.5-x+eps, num+0.5-x-eps, num+0.5-x-eps, num-0.5-x+eps, num-0.5-x+eps])) 
     1108                    key = self.graph.insertCurve(RectangleCurve(self.graph, QPen(color, 1), QBrush(color), [num-1-0.5-y+eps, num-1-0.5-y+eps, num-1+0.5-y-eps, num-1+0.5-y-eps], [num-0.5-x+eps, num+0.5-x-eps, num+0.5-x-eps, num-0.5-x+eps])) 
    11021109 
    11031110                    if self.useGeneSets and self.geneToSet and sharedGeneSets != []: 
    1104                         key = self.graph.insertCurve(PolygonCurve(self.graph, QPen(color, 1), QBrush(Qt.NoBrush), [num-1-0.5-y+eps2, num-1-0.5-y+eps2, num-1+0.5-y-eps2, num-1+0.5-y-eps2, num-1-0.5-y+eps2], [num-0.5-x+eps2, num+0.5-x-eps2, num+0.5-x-eps2, num-0.5-x+eps2, num-0.5-x+eps2])) 
     1111                        key = self.graph.insertCurve(RectangleCurve(self.graph, QPen(color, 1), QBrush(Qt.NoBrush), [num-1-0.5-y+eps2, num-1-0.5-y+eps2, num-1+0.5-y-eps2, num-1+0.5-y-eps2], [num-0.5-x+eps2, num+0.5-x-eps2, num+0.5-x-eps2, num-0.5-x+eps2])) 
    11051112                    if s != "": 
    11061113                        self.graph.tips.addToolTip(num-1-y, num-x, s, 0.5, 0.5) 
     
    11081115        # draw empty boxes at the diagonal 
    11091116        for x in range(num): 
    1110             key = self.graph.insertCurve(PolygonCurve(self.graph, QPen(black), QBrush(Qt.NoBrush), [x-0.5+2*eps2, x+0.5-2*eps2, x+0.5-2*eps2, x-0.5+2*eps2, x-0.5+2*eps2], [num-x-0.5+2*eps2, num-x-0.5+2*eps2, num-x+0.5-2*eps2, num-x+0.5-2*eps2, num-x-0.5+2*eps2])) 
     1117            key = self.graph.insertCurve(RectangleCurve(self.graph, QPen(black), QBrush(Qt.NoBrush), [x-0.5+2*eps2, x+0.5-2*eps2, x+0.5-2*eps2, x-0.5+2*eps2], [num-x-0.5+2*eps2, num-x-0.5+2*eps2, num-x+0.5-2*eps2, num-x+0.5-2*eps2])) 
    11111118 
    11121119        """ 
     
    13311338                color = black 
    13321339 
    1333             curve = PolygonCurve(self.graph, QPen(color, 1), QBrush(color), [ind-0.5+eps, ind+0.5-eps, ind+0.5-eps, ind-0.5+eps, ind-0.5+eps], [0, 0, count, count, 0]) 
     1340            curve = RectangleCurve(self.graph, QPen(color, 1), QBrush(color), [ind-0.5+eps, ind+0.5-eps, ind+0.5-eps, ind-0.5+eps], [0, 0, count, count]) 
    13341341            key = self.graph.insertCurve(curve) 
    13351342 
     
    18201827                    continue 
    18211828                xDiff = self.graphMatrix[j][index] 
    1822                 self.graph.insertCurve(PolygonCurve(self.graph, QPen(classColors.getColor(j)), QBrush(classColors.getColor(j)), [x, x+xDiff, x+xDiff, x, x], [i, i, i+1, i+1, i])) 
     1829                self.graph.insertCurve(RectangleCurve(self.graph, QPen(classColors.getColor(j)), QBrush(classColors.getColor(j)), [x, x+xDiff, x+xDiff, x], [i, i, i+1, i+1])) 
    18231830                x += xDiff 
    18241831            self.graph.tips.addToolTip(0, i, s[:-4], 1, 1) 
     
    18431850        if self.showClickedProjection and y >= 0 and y < len(self.projectionIndices): 
    18441851            diff  = 0.005 
    1845             self.selectedRectangle = self.graph.insertCurve(PolygonCurve(self.graph, brush = QBrush(Qt.NoBrush), xData = [0-diff, 1+diff, 1+diff, 0-diff, 0-diff], yData = [y-diff, y-diff, y+1+diff, y+1+diff, y-diff])) 
     1852            self.selectedRectangle = self.graph.insertCurve(RectangleCurve(self.graph, brush = QBrush(Qt.NoBrush), xData = [0-diff, 1+diff, 1+diff, 0-diff], yData = [y-diff, y-diff, y+1+diff, y+1+diff])) 
    18461853            self.graph.replot() 
    18471854 
Note: See TracChangeset for help on using the changeset viewer.