xdot

Crates.ioxdot
lib.rsxdot
version0.2.3
sourcesrc
created_at2023-02-04 00:52:09.253162
updated_at2023-04-20 15:43:49.380737
descriptionParse graphviz’ xdot draw instructions
homepage
repositoryhttps://github.com/flying-sheep/xdot-rust
max_upload_size
id776117
size42,401
Philipp A. (flying-sheep)

documentation

https://docs.rs/xdot

README

CI docs.rs Crates.io PyPI

xdot

The main function of this package is parse. It parses node/edge attributes on graphviz graphs created by xdot into drawable shapes.

use xdot::{parse, ShapeDraw};
let shapes: Vec<ShapeDraw> = parse("c 7 -#ff0000 p 4 4 4 36 4 36 36 4 36");

Each ShapeDraw struct contains a shape with geometry and a pen with drawing attributes (such as color, line style, and font). If you have the layout feature active, you can also use layout_and_draw_graph (and draw_graph):

use graphviz_rust::parse;
use graphviz_rust::dot_structures::Graph;
use xdot::{layout_and_draw_graph, ShapeDraw};

let graph: Graph = parse("graph { a -- b}").unwrap();
let shapes: Vec<ShapeDraw> = layout_and_draw_graph(graph).unwrap();

Release process

  1. A commit to main causes creation or update of a release PR. (release workflow)
  2. Merging a release PR causes the creation of a Git tag and GitHub release, and the upload of a Rust crate to crates.io.(also release workflow)
  3. Publishing this GitHub release in turn triggers building and uploading a Python package. (publish workflow)
Commit count: 67

cargo fmt