open-hypergraphs-dot

Crates.ioopen-hypergraphs-dot
lib.rsopen-hypergraphs-dot
version0.2.3
created_at2025-04-10 14:25:10.080463+00
updated_at2025-11-22 13:34:22.889838+00
descriptionA library for visualizing lax open hypergraphs in GraphViz DOT format
homepage
repositoryhttps://github.com/statusfailed/open-hypergraphs-dot
max_upload_size
id1628408
size176,240
Paul Wilson (statusfailed)

documentation

https://docs.rs/open-hypergraphs-dot

README

Open Hypergraphs Dot

A Rust library for visualizing lax open hypergraphs using the GraphViz DOT format.

Get Started

Add the crate with the svg feature for simplest use:

cargo add open-hypergraphs-dot --feature svg

Then you can save an Open Hypergraph to an SVG in one line:

use open_hypergraphs_dot::{Options, svg::to_svg_with};
std::fs::write("out.svg", to_svg_with(&term, &Options::default())?);

If you want non-standard options, you can use the fluent options interface:

// use defaults in Left-to-right orientation, using Display instance for nodes and edges
let opts = Options::default().display().lr();
std::fs::write("out.svg", to_svg_with(&term, &opts)?);

Examples

Run the adder example:

cargo run --example adder

This will produce the following depiction of an open hypergraph representing a 2-bit ripple-carry adder:

See ./examples/adder.rs for the source code producing this example.

Commit count: 23

cargo fmt