Skip to main content

Build and visualize orbit graphs for discrete iterations under guarded rules.

Project description

VisIter

See what a discrete iteration actually does — as a graph.

The simplest case

Integers 1–9. Rule: divisible by 3 → divide by 3. Everything else → add 2. Where does each value end up?

echo 'range(1, 10), [Rule(lambda x: x%3==0, Op(lambda x: x//3))], Op(lambda x: x+2)' | viter

descent graph, range 1–9

One line, auto-derived edge labels, SVG on stdout.

Install

pip install visiter

Graphviz must be available on PATH (brew install graphviz / apt install graphviz).

Going further

Put the iteration in a .vit file — shebang-executable, with comments:

#!/usr/bin/env viter
# descent graph, range 1–9
range(1, 10),
[Rule(lambda x: x%3==0, Op(lambda x: x//3, label="÷3"))],
Op(lambda x: x+2, label="+2")
chmod +x descent.vit
./descent.vit > descent.svg       # shebang
viter descent.vit -o descent.svg  # explicit

Crop the view around a node, render only what reaches it:

viter descent.vit --render 'anchor=1, radius=8, direction="backward"' -o crop.svg

Use the Python API instead of the CLI:

from visiter import iterate, Op, Rule, to_dot

graph = iterate(
    range(1, 10),
    [Rule(lambda x: x % 3 == 0, Op(lambda x: x // 3))],
    Op(lambda x: x + 2),
)
to_dot(graph).render("descent", format="svg")

Two entry points

  • viter — one-shot: .vit file (or stdin) in, image out. Safe defaults (--max-nodes 10000, --time-limit 00:00:30) keep a typo'd rule from running away. Output goes to stdout or -o FILE.

  • visiter — pipe-composable subcommands for full control:

    visiter build descent.vit | visiter to-dot 'anchor=1' | dot -Tsvg > out.svg
    

    build writes JSON; to-dot reads JSON, writes DOT; validate checks the JSON against the bundled schema; analyze bridges to NetworkX for graph algorithms.

Why VisIter?

Free, scriptable, Graphviz-native, Unix-pipe-composable orbit-graph rendering for discrete iterations under guarded rules — with cutoff boundaries (bounds, depth limits, render crops) as a first-class visual primitive, not silent truncation.

Full honest comparison against NetworkX, NestGraph (Mathematica), Maude, LoLA, and continuous-dynamics tooling: docs/comparison.md.

Documentation

  • docs/tutorial.md — gentle introduction: what problem the tool solves, smallest example, what each piece does, what the dashed arrows mean. Start here.
  • docs/manual.md — reference: every parameter, every data field, the rendering model in full, design decisions.
  • docs/comparison.md — how VisIter relates to other tools in the ecosystem, and when to pick something else.
  • demos/ — runnable end-to-end examples: make demo writes SVG/PDF/DOT into demos/out/.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visiter-0.8.0.tar.gz (188.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visiter-0.8.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file visiter-0.8.0.tar.gz.

File metadata

  • Download URL: visiter-0.8.0.tar.gz
  • Upload date:
  • Size: 188.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for visiter-0.8.0.tar.gz
Algorithm Hash digest
SHA256 4046440d52431754724908a832ea50a02920e09d4f669ccc91864d7dc582ed14
MD5 6ff9afb6816d3f780e527dad3253341d
BLAKE2b-256 a3af06eebfb426930895d795f498e42300dcb25ddb96906af45be5c4fce834f1

See more details on using hashes here.

File details

Details for the file visiter-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: visiter-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for visiter-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b57b807327015db7f11dd3026ea6e9e4e4102a2bd8d19449f8268deacee4dd24
MD5 3a32d4ff096153a4d592d2728161981e
BLAKE2b-256 0bfd9da28a145007f35335d17b590d8912cb5e17033df17080248f4aab302639

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page