Skip to main content

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, written in Rust. The wheels are prebuilt, so there is nothing to compile.

pip install graphlay
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:

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 explains the options and the gallery shows what they do.

Metadata

Release files for graphlay 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphlay 0.2.0
File Size Uploaded
graphlay-0.2.0.tar.gz 797.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphlay 0.2.0
File Interpreter ABI Platform
graphlay-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details

Total release size: 2.1 MB

Release files / graphlay-0.2.0.tar.gz

Download URL graphlay-0.2.0.tar.gz
Size 797.2 kB
Tags Source
SHA-256 checksum
How to use checksums
286328e48d0c480cfff6eefdc63aa1fc762c74b8a75dbff84b1c3128ed550147
BLAKE2b-256 checksum
How to use checksums
f60a253694c3efe3eb8b81151c87e67697c6cd227850bbab2a9b216b60b11e08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / graphlay-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL graphlay-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
28e9848208a268f97955e083c753774be71732a8e8472c0b3802de972ccf2b5f
BLAKE2b-256 checksum
How to use checksums
2eca7167f9b6a47b667ea237d77071c84079ed267333a9b08292161fe7f36730
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.3.0

5 release files

0.2.1

5 release files

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page