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 build, Op, Rule, to_dot

graph = build(
    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.10.0.tar.gz (222.3 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.10.0-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for visiter-0.10.0.tar.gz
Algorithm Hash digest
SHA256 7b69bbbcca3ddc954a8c6e3ada9dc222dcd830a0e0e7e2124a94fcb2d17ae832
MD5 372bef3dd4c408e09e6a38638f95d1d3
BLAKE2b-256 81d915d0c6249714ec165955b079d641dda52aba7355eb574be5833b849954a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: visiter-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 29.2 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.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa5339319a4fe3f511cdd880a8b760b796acc6e7db9b100d394f112b74fa1cb9
MD5 2b2ed24bc9f51ef6a3f462e6d3eda496
BLAKE2b-256 8db8d89abe589e5207e919f1bec1042b21d85082a2fcad6d3dfddce4dda84468

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