Skip to content

Commit 64abee8

Browse files
committed
Add toroidal grid builder
1 parent b1d96fd commit 64abee8

File tree

3 files changed

+1017
-0
lines changed

3 files changed

+1017
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- `yog/properties/*``yog/property/*`
1414
- `yog/generators/*``yog/generator/*`
1515

16+
- **Typed Rendering Configuration**:
17+
- `yog/io/dot`: `DotOptions` now uses robust Algebraic Data Types (ADTs) like `Layout`, `RankDir`, `NodeShape`, and `Style` instead of strings. Numeric values now use `Float` for precision (e.g., `nodesep`, `penwidth`).
18+
- `yog/io/mermaid`: `MermaidOptions` now uses `Direction`, `NodeShape`, and `CssLength` ADTs, providing a type-safe way to configure diagram appearance.
19+
1620
- **Edge Addition API Changes**: `add_edge()` and `add_edge_with_combine()` now return `Result(Graph, String)` instead of `Graph` to prevent "ghost nodes":
1721
- `add_edge(graph, from: 1, to: 2, with: 10)` now returns `Error("Node 1 does not exist")` if nodes don't exist
1822
- `add_edge_with_combine(graph, from: 1, to: 2, with: 5, using: int.add)` also returns `Result`
@@ -31,6 +35,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3135
- `add_unweighted_edges(graph, edges: List(#(NodeId, NodeId)))` - Add multiple edges with weight Nil
3236
- These functions fail fast on the first missing node, reducing Result-handling boilerplate compared to chaining individual `add_edge` calls
3337

38+
- **Toroidal Grid Builder** (`yog/builder/toroidal`): Support for graphs with wrapping (torus) topology. Includes specialized toroidal distance heuristics: `toroidal_manhattan_distance`, `toroidal_chebyshev_distance`, and `toroidal_octile_distance`.
39+
40+
- **ASCII Art Rendering** (`yog/io/ascii`): New module for rendering grids and mazes as ASCII text, ideal for terminal output and debugging.
41+
42+
- **Grid Distance Heuristics**: Added `chebyshev_distance` (for 8-way movement) and `octile_distance` (for realistic diagonal costs) to `yog/builder/grid`.
43+
3444
- **F# Comparison**: Added `GLEAM_FSHARP_COMPARISON.md` documenting feature parity, API differences, and migration guidance between the Gleam and F# implementations of Yog.
3545

3646
### Changed

0 commit comments

Comments
 (0)