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 .vit examples organized by topic (basics/, rendering/, integration/, applications/).

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.11.0.tar.gz (418.1 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.11.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for visiter-0.11.0.tar.gz
Algorithm Hash digest
SHA256 f39a9e49a094102515bffd1d15ed242dfcd18feb462b2ad1849b5cf225866f74
MD5 c5cd4b664ac09b54d1cfc6c34fcd6b8a
BLAKE2b-256 8aba3921699d097f4bb801836770298c7ac2724df445483ee00d07268d12610f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: visiter-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 28.7 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.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 375186d9afac771382341e1034c7b4664f5d772ce82cd6535e10e89dc1f97215
MD5 dc37e68d1309d3946ca2ad0b8dd8d28a
BLAKE2b-256 f205b20789afd31b091c58919be8b972803e1970d6872ea6c6bda26da93c1c18

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