Ignore:
Timestamp:
04/26/12 09:53:01 (2 years ago)
Author:
mstajdohar
Branch:
default
Message:

Fixes #1183.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Unsupervised/OWNxExplorer.py

    r10797 r10852  
    230230            ib = OWGUI.indentedBox(ribg, orientation=0) 
    231231            self.ctrlMarkDistance = OWGUI.spin(ib, self, "markDistance", 0, 100, 1, label="Distance ", 
    232                 callback=(lambda: self.set_mark_mode(2 if not self.hubs==3 else 3))) 
     232                callback=(lambda: self.set_mark_mode(2 if not self.hubs == 3 else 3))) 
    233233            #self.ctrlMarkFreeze = OWGUI.button(ib, self, "&Freeze", value="graph.freezeNeighbours", toggleButton = True) 
    234234            OWGUI.widgetLabel(ribg, "Mark nodes with ...") 
     
    236236            OWGUI.appendRadioButton(ribg, self, "hubs", "at most N connections", callback=self.set_mark_mode) 
    237237            self.ctrlMarkNConnections = OWGUI.spin(OWGUI.indentedBox(ribg), self, "markNConnections", 0, 1000000, 1, label="N ", 
    238                 callback=(lambda: self.set_mark_mode(4 if not self.hubs==5 else 5))) 
     238                callback=(lambda: self.set_mark_mode(4 if not self.hubs == 5 else 5))) 
    239239            OWGUI.appendRadioButton(ribg, self, "hubs", "more connections than any neighbour", callback=self.set_mark_mode) 
    240240            OWGUI.appendRadioButton(ribg, self, "hubs", "more connections than avg neighbour", callback=self.set_mark_mode) 
     
    492492                        return 
    493493 
    494                     cut = self.markNumber 
     494                    cut = min(self.markNumber, len(powers)) 
    495495                    cutPower = powers[cut - 1][1] 
    496496                    while cut < len(powers) and powers[cut][1] == cutPower: 
     
    816816            self.networkCanvas.set_graph(self.graph, curve, items=self.graph_base.items(), links=self.graph_base.links()) 
    817817 
    818             if self._items is not None and 'x' in self._items.domain and 'y' in self._items.domain: 
    819                 positions = dict((node, (self._items[node]['x'].value, self._items[node]['y'].value)) \ 
    820                              for node in self.graph if self._items[node]['x'].value != '?' \ 
    821                              and self._items[node]['y'].value != '?') 
     818            items = self.graph.items() 
     819            if items is not None and 'x' in items.domain and 'y' in items.domain: 
     820                positions = dict((node, (items[node]['x'].value, items[node]['y'].value)) \ 
     821                             for node in self.graph if items[node]['x'].value != '?' \ 
     822                             and items[node]['y'].value != '?') 
    822823 
    823824                self.networkCanvas.networkCurve.set_node_coordinates(positions) 
Note: See TracChangeset for help on using the changeset viewer.