Example #1
0
def spring(GV,**kwargs):
	"""
	Use a `spring-embedder <http://en.wikipedia.org/wiki/Force-based_algorithms_(graph_drawing)>`_ algorithm for
	deriving positions for the nodes.  Edges follow a straight path between their endpoints.
	
	**Args**:
		
		* ``GV``: the graph or view (containing a graph) whose layout will be built.
	
	**KwArgs**:
	
		* ``num_iterations [=100]`` (int): the number of times to update the positions of nodes based on the forces among them.
		* ``bbox [=(0,0,100,100)]`` (:py:class:`tuple`): the spatial box into which all nodes should be confined.
	
	**Returns**:
		:py:class:`zen.View`. A view object with the position array set to the positions determined by this layout.
	"""
	if BBOX_NAME not in kwargs:
		kwargs[BBOX_NAME] = BBOX_DEFAULT_VALUE
		
	return spring_layout.layout(GV,**kwargs)
Example #2
0
def spring(GV, **kwargs):
    """
	Use a `spring-embedder <http://en.wikipedia.org/wiki/Force-based_algorithms_(graph_drawing)>`_ algorithm for
	deriving positions for the nodes.  Edges follow a straight path between their endpoints.
	
	**Args**:
		
		* ``GV``: the graph or view (containing a graph) whose layout will be built.
	
	**KwArgs**:
	
		* ``num_iterations [=100]`` (int): the number of times to update the positions of nodes based on the forces among them.
		* ``bbox [=(0,0,100,100)]`` (:py:class:`tuple`): the spatial box into which all nodes should be confined.
	
	**Returns**:
		:py:class:`zen.View`. A view object with the position array set to the positions determined by this layout.
	"""
    if BBOX_NAME not in kwargs:
        kwargs[BBOX_NAME] = BBOX_DEFAULT_VALUE

    return spring_layout.layout(GV, **kwargs)
Example #3
0
def spring(GV,**kwargs):
	if BBOX_NAME not in kwargs:
		kwargs[BBOX_NAME] = BBOX_DEFAULT_VALUE
		
	return spring_layout.layout(GV,**kwargs)