Skip to main content

Parse graphviz’ xdot draw instructions

Project description

CI docs.rs Crates.io

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();

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

xdot_rs-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

xdot_rs-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

Supported by

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