GraphML output support for petgraph
This crate extends petgraph with GraphML output support.
This crate exports a single type GraphMl
which combines a build-pattern for configuration and provides creating strings (GraphMl::to_string
) and writing to writers (GraphMl::to_writer
).
Usage
Add this to your Cargo.toml
:
[]
= "3.0.0"
Example
For a simple graph like this is the generated GraphML output.
let graph = make_graph;
// Configure output settings
// Enable pretty printing and exporting of node weights.
// Use the Display implementation of NodeWeights for exporting them.
let graphml = new
.pretty_print
.export_node_weights_display;
assert_eq!;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.