diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -19,6 +19,7 @@ pub use configuration::{ pub use stage_type::StageType; use thiserror::Error; +use cairo::ImageSurface; /// Error types for rendering #[derive(Debug, Error)] @@ -86,6 +87,25 @@ pub fn render_to_svg( renderer::render_to_svg(map, stage_type, config) } +/// Renders a Wardley map to a cairo context. +/// +/// # Arguments +/// +/// * `map` - The parsed Wardley map +/// * `stage_type` - The stage type to use for axis labels +/// * `config` - Configuration options +/// +/// # Returns +/// +/// A string containing the SVG data +pub fn render_to_surface( + map: &Map, + stage_type: StageType, + config: &Configuration, +) -> Result<ImageSurface, RenderError> { + renderer::render_to_surface(map, stage_type, config) +} + #[cfg(test)] mod tests { use super::*; |