mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Sort workflow steps based on the layout in the workflow editor.
Prior to the topological sort, steps are arranged based on distance from top left corner.
This commit is contained in:
@@ -5,7 +5,7 @@ pkg_resources.require( "simplejson" )
|
||||
pkg_resources.require( "SVGFig" )
|
||||
import simplejson
|
||||
import base64, httplib, urllib2, sgmllib, svgfig
|
||||
|
||||
import math
|
||||
from galaxy.web.framework.helpers import time_ago, grids
|
||||
from galaxy.tools.parameters import *
|
||||
from galaxy.tools import DefaultToolState
|
||||
@@ -1670,6 +1670,7 @@ def order_workflow_steps( steps ):
|
||||
"""
|
||||
Perform topological sort of the steps, return ordered or None
|
||||
"""
|
||||
steps.sort(cmp=lambda s1,s2: cmp( math.sqrt(s1.position['left']**2 + s1.position['top']**2), math.sqrt(s2.position['left']**2 + s2.position['top']**2)))
|
||||
try:
|
||||
edges = edgelist_for_workflow_steps( steps )
|
||||
node_order = topsort( edges )
|
||||
|
||||
Reference in New Issue
Block a user