Changeset 8880:e9e0d0cc89a0 in orange


Ignore:
Timestamp:
09/01/11 16:15:36 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
2f23e4e1d1c8d2f43cd8743d5421ef26985bc4dd
Message:

Added arrows on directed graphs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize Qt/OWNxCanvasQt.py

    r8860 r8880  
    2929         
    3030class EdgeItem(orangeqt.EdgeItem): 
    31     def __init__(self, u=None, v=None, weight=1, links_index=0, label='', parent=None): 
     31    def __init__(self, u=None, v=None, weight=1, links_index=0, arrows=None, label='', parent=None): 
    3232        orangeqt.EdgeItem.__init__(self, u, v, parent) 
    3333        self.set_weight(weight) 
    3434        self.set_links_index(links_index) 
     35        self.set_arrows(arrows) 
    3536 
    3637class NetworkCurve(orangeqt.NetworkCurve): 
     
    642643            if self.graph.is_directed(): 
    643644                edges = [EdgeItem(nodes[i], nodes[j], 
    644                     self.graph[i][j].get('weight', 1), 0, 1, links_index, \ 
     645                    self.graph[i][j].get('weight', 1), links_index, arrows=EdgeItem.ArrowV, \ 
    645646                    parent=self.networkCurve) for ((i, j), links_index) in \ 
    646647                         zip(new_edges, links_indices)] 
     
    652653        elif self.graph.is_directed(): 
    653654            edges = [EdgeItem(nodes[i], nodes[j], self.graph[i][j].get('weight', 1), \ 
    654                     0, 1, parent=self.networkCurve) for (i, j) in new_edges] 
     655                    arrows=EdgeItem.ArrowV, parent=self.networkCurve) for (i, j) in new_edges] 
    655656        else: 
    656657            edges = [EdgeItem(nodes[i], nodes[j], self.graph[i][j].get('weight', 1), \ 
     
    711712            if self.graph.is_directed(): 
    712713                edges = [EdgeItem(vertices[i], vertices[j], 
    713                     graph[i][j].get('weight', 1), 0, 1, links_index, \ 
     714                    graph[i][j].get('weight', 1), links_index, arrows=EdgeItem.ArrowV, \ 
    714715                    parent=self.networkCurve) for ((i, j), links_index) in \ 
    715716                         zip(self.graph.edges(), links_indices)] 
     
    722723        elif self.graph.is_directed(): 
    723724            edges = [EdgeItem(vertices[i], vertices[j], 
    724                                       graph[i][j].get('weight', 1), 0, 1, parent=self.networkCurve) for (i, j) in self.graph.edges()] 
     725                                      graph[i][j].get('weight', 1), arrows=EdgeItem.ArrowV, parent=self.networkCurve) for (i, j) in self.graph.edges()] 
    725726        else: 
    726727            edges = [EdgeItem(vertices[i], vertices[j], 
Note: See TracChangeset for help on using the changeset viewer.