orrery 0.1.1

A diagram language for creating component and sequence diagrams
Documentation

Orrery Library

A Rust library for parsing, layouting, and rendering diagram descriptions written in the Orrery DSL.

Installation

Add to your Cargo.toml:

[dependencies]
orrery = "0.1.0"

Quick Start

use orrery::DiagramBuilder;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let source = r#"
        diagram component;
        
        frontend: Rectangle [fill_color="lightblue"];
        backend: Rectangle [fill_color="lightgreen"];
        database: Rectangle;
        
        frontend -> backend: "API";
        backend -> database: "SQL";
    "#;

    // Create a builder with default configuration
    let builder = DiagramBuilder::default();

    // Parse the source code into a semantic diagram
    let diagram = builder.parse(source)?;

    // Render the semantic diagram to SVG
    let svg = builder.render_svg(&diagram)?;

    std::fs::write("output.svg", &svg)?;
    Ok(())
}

Custom Configuration

use orrery::{DiagramBuilder, config::AppConfig};

let config = AppConfig::default();
let builder = DiagramBuilder::new(config);

Examples

See the examples directory for more diagram samples.

Documentation

License

Licensed under either of Apache License 2.0 or MIT license at your option.