Changeset 8587:49095b6a10cd in orange


Ignore:
Timestamp:
08/03/11 11:41:01 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
7fee5dc76ae9b68f72b741fd1a78965a0b6f6e5e
Message:
 
File:
1 edited

Legend:

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

    r8586 r8587  
    692692         
    693693        #add edges 
     694        new_edges = self.graph.edges(add_nodes) 
     695         
    694696        if self.links is not None and len(self.links) > 0: 
    695697            links = self.links 
    696             links_indices = (row_ind[i + 1][j + 1] for (i, j) in self.graph.edges(add_nodes)) 
     698            links_indices = (row_ind[i + 1][j + 1] for (i, j) in new_edges) 
    697699            labels = ([str(row[r].value) for r in range(2, len(row))] for row \ 
    698700                      in (links[links_index] for links_index in links_indices)) 
     
    702704                    self.graph[i][j].get('weight', 1), 0, 1, links_index, label, \ 
    703705                    parent=self.networkCurve) for ((i, j), links_index, label) in \ 
    704                          zip(self.graph.edges(add_nodes), links_indices, labels)] 
     706                         zip(new_edges, links_indices, labels)] 
    705707            else: 
    706708                edges = [EdgeItem(nodes[i], nodes[j], 
    707709                    self.graph[i][j].get('weight', 1), links_index, label) for \ 
    708                     ((i, j), links_index, label) in zip(self.graph.edges(add_nodes), \ 
     710                    ((i, j), links_index, label) in zip(new_edges, \ 
    709711                                        links_indices, labels, parent=self.networkCurve)] 
    710712        elif self.graph.is_directed(): 
    711713            edges = [EdgeItem(nodes[i], nodes[j], self.graph[i][j].get('weight', 1), \ 
    712                     0, 1, parent=self.networkCurve) for (i, j) in self.graph.edges(add_nodes)] 
     714                    0, 1, parent=self.networkCurve) for (i, j) in new_edges] 
    713715        else: 
    714716            edges = [EdgeItem(nodes[i], nodes[j], self.graph[i][j].get('weight', 1), \ 
    715                     parent=self.networkCurve) for (i, j) in self.graph.edges(add_nodes)] 
     717                    parent=self.networkCurve) for (i, j) in new_edges] 
    716718             
    717719        self.networkCurve.add_edges(edges) 
Note: See TracChangeset for help on using the changeset viewer.