diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 57 |
1 files changed, 10 insertions, 47 deletions
@@ -15,16 +15,15 @@ Add it to your project with cargo add cargo add wmap-renderer ``` - ## Usage ```rust use wmap_renderer::{render_to_png, render_to_svg, Configuration, StageType}; let map_source = r#" -Tea (90, 50) -Cup (80, 40) -Tea -> Cup +Computer (90, 20) +Silicon Ore (80, 90) +Computer -> Silicon Ore "#; let map = wmap_parser::parse(map_source); @@ -41,14 +40,7 @@ std::fs::write("map.svg", svg_data)?; ## Configuration -The renderer uses the same default configuration as the JavaScript version: - -- **Map Size**: 1300×1000 pixels (with 42px padding) -- **Colors**: #0F261F for axes/vertices/labels, #FA2B00 for inertia, #4F8FE6 for evolution -- **Fonts**: "Helvetica Neue, Helvetica, Arial, sans-serif" -- **Sizes**: 25×25px vertices, 10px arrowheads, 0.5px line width - -All configuration options can be customized: +The renderer lets you configure sizes, colors, and font. ```rust let mut config = Configuration::default(); @@ -57,22 +49,20 @@ config.theme.sizes.vertex_size = 30.0; config.options.show_background = false; ``` -## Running Examples +## Development + +### Running Examples ```bash -cargo run --example generate_map +make examples ``` -This will generate `example.png`, `example.svg`, and `example_cynefin.png` in the project root. - -## Running Tests +### Running Tests ```bash -cargo test +make test ``` -All 22 tests should pass (17 unit tests + 5 integration tests). - ## Performance The drawing is not optimized for live-editing. It's relatively quick to @@ -87,30 +77,3 @@ You can run the benchmarks by using: ```bash make benchmark ``` - -## Dependencies - -- **cairo-rs**: Vector graphics rendering (PNG, SVG support) -- **geo**: Geometric algorithms (concave hull for groups) -- **wmap-parser**: Wardley map source parser (local dependency) -- **thiserror**: Error handling -- **tempfile**: SVG output (temporary file handling) - -## Implementation Status - -### Completed Features -- ✅ All rendering features (axes, vertices, dependencies, notes, inertias, evolutions, groups) -- ✅ Background evolution stage patterns -- ✅ All 21 stage types -- ✅ All 4 vertex shapes -- ✅ PNG and SVG output -- ✅ Concave hull for groups -- ✅ Configuration system matching JS defaults -- ✅ Comprehensive test suite -- ✅ Example programs - -## License - -See LICENSE file. -[wmap-parser-rust]: https://crates.io/crates/wmap-parser -[map]: https://map.tranquil.systems |