| Crates.io | wmap-renderer |
| lib.rs | wmap-renderer |
| version | 1.1.0 |
| created_at | 2025-12-16 17:19:57.903298+00 |
| updated_at | 2026-01-16 10:53:55.798487+00 |
| description | A parser for wmap formatted Wardley Map files. |
| homepage | https://git.sr.ht/~rbdr/wmap-renderer-rust |
| repository | |
| max_upload_size | |
| id | 1988288 |
| size | 312,380 |
A rust renderer for wmap formatted wardley maps parsed with [wmap-parser][wmap-parser-rust].
Add it to your project with cargo add
cargo add wmap-renderer
use wmap_renderer::{render_to_png, render_to_svg, Configuration, StageType};
let map_source = r#"
Computer (90, 20)
Silicon Ore (80, 90)
Computer -> Silicon Ore
"#;
let map = wmap_parser::parse(map_source);
let config = Configuration::default();
// Render to PNG
let png_data = render_to_png(&map, StageType::Activities, &config)?;
std::fs::write("map.png", png_data)?;
// Render to SVG
let svg_data = render_to_svg(&map, StageType::Activities, &config)?;
std::fs::write("map.svg", svg_data)?;
The renderer lets you configure sizes, colors, and font.
let mut config = Configuration::default();
config.theme.colors.vertex = "#FF0000".to_string();
config.theme.sizes.vertex_size = 30.0;
config.options.show_background = false;
make examples
make test
The drawing is not optimized for live-editing. It's relatively quick to generate a single image. On an M1 Pro mac, our xample map renders in about ~2ms, while a larger map with slightly under 2000 entities does so in ~140ms.
Turning off smart labels doesn't have a big effect on medium to small maps, but in our large map test it renders in ~97ms instead.
You can run the benchmarks by using:
make benchmark