use graphviz::{Graph, Context};
use graphviz::layout::{apply_layout, Engine};
use graphviz::render::{render_to_file, Format};
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let context = Context::new_with_plugins(true, true)?;
let mut graph = Graph::new("plugin_example", true)?;
let node1 = graph.add_node("Node1")?;
let node2 = graph.add_node("Node2")?;
graph.add_edge(&node1, &node2, None)?;
apply_layout(&context, &mut graph, Engine::Neato)?;
render_to_file(&context, &graph, Format::Png, "plugin_example.png")?;
Ok(())
}