aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b56c670..de4146d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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::*;