Metadata-Version: 2.4
Name: graphlay
Version: 0.3.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Dist: networkx>=3.0 ; extra == 'networkx'
Provides-Extra: networkx
Summary: Deterministic layered graph layout, tidy trees and SVG rendering, in Rust
Keywords: graph,layout,sugiyama,layered,svg,networkx
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://aarkue.github.io/graphlay/
Project-URL: Repository, https://github.com/aarkue/graphlay

# graphlay

Deterministic graph layout for Python: a layered (Sugiyama-style) engine with orthogonal or
diagonal edge routing, a tidy-tree layout, quality metrics and an SVG renderer. The engine is
[graphlay](https://github.com/aarkue/graphlay), written in Rust. The wheels are prebuilt, so there
is nothing to compile.

```sh
pip install graphlay
```

```python
import graphlay

g = graphlay.Graph()
g.node("start", width=60, height=30, shape="ellipse")
g.node("work", label="Do the work")
g.node("end", width=60, height=30, shape="ellipse")
g.edge("start", "work")
g.edge("work", "end")

drawing = graphlay.layout(g, preset="process_map", options={"routing": {"style": "diagonal"}})
drawing.positions()   # {"start": (x, y), ...}
drawing.edges[0]["points"]   # the polyline, border to border
drawing                      # in a notebook: the drawing itself
drawing.sketch().save("drawing.svg")
```

A networkx graph works directly, and `positions()` feeds `networkx.draw`:

```python
import networkx as nx

g = nx.DiGraph([("a", "b"), ("b", "c"), ("a", "c")])
pos = graphlay.layout(g).positions(flip_y=True)
nx.draw(g, pos)
```

`drawing.sketch_scene()` returns the same drawing as a scene dict. Change colours or labels in
it and draw it with `graphlay.render_scene(scene)`.

The [guide](https://aarkue.github.io/graphlay/docs/guide) explains the options and the
[gallery](https://aarkue.github.io/graphlay/docs/gallery) shows what they do.

