Changeset 10862:6ff8fcae285e in orange


Ignore:
Timestamp:
05/07/12 16:47:08 (2 years ago)
Author:
mstajdohar
Branch:
default
Message:

Set node coordinates to original positions if found in the graph data.

File:
1 edited

Legend:

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

    r10861 r10862  
    999999            qApp.processEvents() 
    10001000 
    1001             if self.optMethod == 1: 
     1001            if self.optMethod == 0: 
     1002                items = self.graph.items() 
     1003                if items is not None and 'x' in items.domain and 'y' in items.domain: 
     1004                    positions = dict((node, (items[node]['x'].value, items[node]['y'].value)) \ 
     1005                                 for node in self.graph if items[node]['x'].value != '?' \ 
     1006                                 and items[node]['y'].value != '?') 
     1007 
     1008                    # ignore start position if all nodes are on the same coordinate 
     1009                    if len(set(positions.values())) > 1: 
     1010                        self.networkCanvas.networkCurve.set_node_coordinates(positions) 
     1011            elif self.optMethod == 1: 
    10021012                self.networkCanvas.networkCurve.random() 
    10031013            elif self.optMethod == 2: 
Note: See TracChangeset for help on using the changeset viewer.