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";
"#;
let builder = DiagramBuilder::default();
let diagram = builder.parse(source)?;
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.