Skip to content

Commit

Permalink
Move and update last new release note
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed May 31, 2021
1 parent af35224 commit b80948b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 6 deletions.
68 changes: 68 additions & 0 deletions releasenotes/notes/0.9.0/simple-layouts-93db8f7f5fa1fe83.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
features:
- |
Four simple layout functions were added:
* :func:`~retworkx.bipartite_layout`
* :func:`~retworkx.circular_layout`
* :func:`~retworkx.shell_layout`
* :func:`~retworkx.spiral_layout`
These can be used to adjust the layout used in visualizations, for example:
.. jupyter-execute::
import retworkx
from retworkx.visualization import mpl_draw
graph = retworkx.generators.path_graph(weights=list(range(24)))
layout = retworkx.bipartite_layout(graph, set(range(12)))
mpl_draw(graph, pos=layout)
.. jupyter-execute::
import retworkx
from retworkx.visualization import mpl_draw
graph = retworkx.generators.path_graph(weights=list(range(24)))
layout = retworkx.circular_layout(graph)
mpl_draw(graph, pos=layout)
.. jupyter-execute::
import retworkx
from retworkx.visualization import mpl_draw
graph = retworkx.generators.star_graph(25)
layout = retworkx.shell_layout(graph)
mpl_draw(graph, pos=layout)
.. jupyter-execute::
import retworkx
from retworkx.visualization import mpl_draw
graph = retworkx.generators.path_graph(weights=list(range(24)))
layout = retworkx.spiral_layout(graph)
mpl_draw(graph, pos=layout)
Or with the :func:`~retworkx.visualization.graphviz_drawer` function:
.. jupyter-execute::
import retworkx
from retworkx.visualization import graphviz_draw
graph = retworkx.generators.path_graph(weights=list(range(24)))
layout = retworkx.spiral_layout(graph)
def node_attr_fn(node):
point = layout[node]
return {
"shape": "circle",
"pos": '"%s,%s!"' % (point[0], point[1]),
"fillcolor": "yellow",
"style": "filled",
}
graphviz_draw(graph, node_attr_fn=node_attr_fn, method='fdp')
6 changes: 0 additions & 6 deletions releasenotes/notes/simple-layouts-93db8f7f5fa1fe83.yaml

This file was deleted.

0 comments on commit b80948b

Please sign in to comment.