diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 52 |
1 files changed, 27 insertions, 25 deletions
@@ -1,22 +1,20 @@ -# Wardley Map Renderer (Rust) +# wmap-renderer -A high-performance Wardley map renderer written in Rust, providing complete feature parity with the JavaScript/Canvas implementation. +A rust renderer for `wmap` formatted wardley maps parsed with [`wmap-parser`][wmap-parser-rust]. ## Features -- ✅ **Multiple Output Formats**: PNG and SVG support via cairo-rs -- ✅ **All Rendering Features**: - - Axes with customizable stage labels - - Components with 4 shape types (circle, square, triangle, x) - - Dependencies with optional arrowheads - - Evolution arrows with bidirectional support - - Inertia indicators - - Notes with multiline text support - - Groups with concave hull rendering - - Background evolution stage patterns -- ✅ **21 Stage Types**: Activities, Behavior, Certainty, Comparison, Cynefin, Data, Decision Drivers, Efficiency, Failure, Focus of Value, Knowledge, Knowledge Management, Market, Market Action, Market Perception, Perception in Industry, Practice, Publication Types, Ubiquity, Understanding, User Perception, Evolution Stage -- ✅ **Complete Configuration**: Colors, sizes, fonts, line heights, and opacity all configurable -- ✅ **Visual Parity**: Matches JavaScript implementation output exactly +- Can render to PNG or SVG. +- Rendering logic attempts to replicate [map][map]'s output. + +## Installation + +Add it to your project with cargo add + +```bash +cargo add wmap-renderer +``` + ## Usage @@ -77,11 +75,18 @@ All 22 tests should pass (17 unit tests + 5 integration tests). ## Performance -The Rust implementation is significantly faster than the JavaScript version: -- Example map (~4 components): < 5ms -- Large maps (100+ components): ~10-20ms -- No garbage collection pauses -- Efficient memory usage +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: + +```bash +make benchmark +``` ## Dependencies @@ -104,11 +109,8 @@ The Rust implementation is significantly faster than the JavaScript version: - ✅ Comprehensive test suite - ✅ Example programs -### Future Optimizations (Optional) -- ⏱ Smart label positioning algorithm (currently uses simple right-side positioning) -- ⏱ Parallel rendering for large maps -- ⏱ PDF output support - ## License See LICENSE file. +[wmap-parser-rust]: https://crates.io/crates/wmap-parser +[map]: https://map.tranquil.systems |