Skip to main content

spaday-dagre

dagre graph rendering for spaday

Build Status codecov License PyPI

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)

Source distribution for spaday-dagre 0.1.0
File Size Uploaded
spaday_dagre-0.1.0.tar.gz 158.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spaday-dagre 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.0

1 release file

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