spaday-dagre
dagre graph rendering for spaday
Overview
spaday-dagre renders directed graphs in spaday from a
serializable node/edge config, laid out by @dagrejs/dagre and
drawn as light-DOM SVG. Colors ride the spaday shell's --spa-* tokens, so
bind_root_class("wa-dark", ...) re-themes the graph with the rest of the page, and application CSS
reaches every shape. dagre-node-click bubbles the node id (scalar detail, so
SetField("selected", event_value()) just works); dagre-edge-click bubbles {source, target}.
Quick example
from spaday import element
from spaday.backends.starlette import serve
from spaday_dagre import Dagre, package
graph = Dagre(
graph={
"nodes": [{"id": "a", "label": "Alpha"}, {"id": "b"}],
"edges": [{"source": "a", "target": "b", "label": "flow"}],
},
layout={"rankdir": "LR"},
)
app = serve(element("main").child(graph), packages=[package])
Node sizes default from label measurement; per-node width/height/class and per-edge
label/class override. layout passes through to dagre (rankdir, align, nodesep,
ranksep, edgesep, marginx/marginy, ranker). Installing the package registers the dagre
entry point, so packages=["dagre"] also works.
Run the local example
python -m spaday_dagre.example
Open http://127.0.0.1:8016: a pipeline DAG with direction switching, node selection, and the dark-mode toggle.
[!NOTE] This library was generated using copier from the Base Python Project Template repository.
Metadata
Release files for spaday-dagre 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spaday_dagre-0.1.0.tar.gz | 158.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spaday_dagre-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 276.7 kB
Release files / spaday_dagre-0.1.0.tar.gz
| Download URL | spaday_dagre-0.1.0.tar.gz |
|---|---|
| Size | 158.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbc03a5bca092123d6d7668d1a90200b1e4751f130b9adcb75371a46ed5915e5
|
|
BLAKE2b-256 checksum How to use checksums |
ac0f7dc3cc4fadb103bc7fb586903bc695bebaa4ee0994b27072dd66ceca6351
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / spaday_dagre-0.1.0-py3-none-any.whl
| Download URL | spaday_dagre-0.1.0-py3-none-any.whl |
|---|---|
| Size | 117.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6f383b0c686838e289cae707cc565a8a42e8db4d611017cc3c60afa64e362ce
|
|
BLAKE2b-256 checksum How to use checksums |
853502cd052589cdfaaaf91dff2fcdaaa24f1a63b11ed86707a3a617f7f5f01f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|