Commits

Miha Stajdohar committed ba33718

Added FragViz optimization on network view.

  • Participants
  • Parent commits 0d01d94

Comments (0)

Files changed (1)

_modelmaps/widgets/OWModelMap.py

 <contact>Miha Stajdohar (miha.stajdohar(@at@)gmail.com)</contact> 
 <priority>6520</priority>
 """
+
 import os.path, itertools
 from operator import itemgetter
 
-#import OWToolbars
-#import OWColorPalette
-
 from Orange import classification, data, feature, misc, modelmaps, network, utils
 from Orange.network.community import CommunityDetection
 from OWNxCanvasQt import OWNxCanvas
         if not node.is_representative():
             return
 
-        self._nx_explorer.networkCanvas.unselect_all_points()
-
         nodes = set(self._representatives[node.index()])
         nodes.remove(node.index())
         graph_nodes = set(self._nx_explorer.graph.nodes_iter())
             nodes = graph_nodes | nodes
             self._expanded_nodes.add(node)
 
-        subgraph = network.nx.Graph.subgraph(self._network, nodes)
         self.select_expanded()
         qApp.processEvents()
+
+        subgraph = network.nx.Graph.subgraph(self._network, nodes)
         self._nx_explorer.change_graph(subgraph)
         self.set_representatives()
 
     def select_expanded(self):
+        self._nx_explorer.networkCanvas.unmark_all_points()
         map(lambda n: ModelItem.set_marked(n, True), self._expanded_nodes)
 
 class OWModelMap(OWNxExplorer, OWNxHist):