rustworkx.spiral_layout#

spiral_layout(graph, scale=1, center=None, resolution=0.35, equidistant=False)[source]#

Generate a spiral layout of the graph

Parameters:
  • graph – The graph to generate the layout for. Can either be a PyGraph or PyDiGraph

  • scale (float) – An optional scaling factor to scale positions

  • center (tuple) – An optional center position. This is a 2 tuple of two float values for the center position

  • resolution (float) – The compactness of the spiral layout returned. Lower values result in more compressed spiral layouts.

  • equidistant (bool) – If true, nodes will be plotted equidistant from each other.

Returns:

The spiral layout of the graph.

Return type:

Pos2DMapping