pub fn render_svg<N, E, Ix>(
graph: &Graph<N, E, Ix>,
layout: &GraphLayout<N>,
config: &SvgConfig,
) -> StringExpand description
Render a graph to SVG using the provided layout and configuration
§Arguments
graph- The graph to renderlayout- Pre-computed node positionsconfig- Visual styling configuration
§Returns
A String containing valid SVG markup
§Example
use scirs2_graph::visualization::{compute_layout, LayoutAlgorithm, SvgConfig, render_svg};
use scirs2_graph::Graph;
let mut g: Graph<&str, f64> = Graph::new();
g.add_node("A");
g.add_node("B");
let _ = g.add_edge("A", "B", 1.0);
let layout = compute_layout(&g, &LayoutAlgorithm::Circular { radius: 100.0 }, 400.0, 300.0).unwrap();
let svg = render_svg(&g, &layout, &SvgConfig::default());
assert!(svg.contains("<svg"));