https://github.com/statusfailed/gla-layout
A layout algorithm for drawing simple string diagrams a la https://graphicallinearalgebra.net/
https://github.com/statusfailed/gla-layout
Last synced: 6 months ago
JSON representation
A layout algorithm for drawing simple string diagrams a la https://graphicallinearalgebra.net/
- Host: GitHub
- URL: https://github.com/statusfailed/gla-layout
- Owner: statusfailed
- Created: 2018-03-11T20:57:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T21:50:33.000Z (about 8 years ago)
- Last Synced: 2025-03-26T06:43:54.748Z (12 months ago)
- Language: Haskell
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Graphical Linear Algebra Layout
An algorithm and demo for laying out
[graphical linear algebra](https://graphicallinearalgebra.net/)
string diagrams in the browser using the
[miso framework](https://github.com/dmjio/miso).
# Example Images
Right-hand side of [rule "B1"](https://graphicallinearalgebra.net/2015/05/16/natural-numbers-diagrammatically/)

Left-hand-side of [rule "Assoc"](https://graphicallinearalgebra.net/2015/05/16/natural-numbers-diagrammatically/)

Natural number "3" as a diagram

# Building & running the demo
Build with [nix](https://nixos.org/nix/):
nix-build
View the demo by serving it. For example with warp:
warp -d result/bin/gla-layout.jsexe
# TODO
- [ ] Basic layout
- [x] Static image
- [x] One stack of diagrams
- [x] List of stacks
- [x] Connections between stacks
- [ ] Interactivity
- [ ] Specify diagrams as JSON
- [ ] Add/Remove generators from a diagram
- [ ] More complex diagrams
- [ ] Syntactic sugars
# Code Cleanup
- [ ] stop using gross string concatenation in drawConnector. Nasty!
- [ ] Replace Coords with a 2D vector library?