https://github.com/lancelet/techdraw
Technical drawing with SVG in Elm
https://github.com/lancelet/techdraw
elm svg technical-drawing
Last synced: 2 months ago
JSON representation
Technical drawing with SVG in Elm
- Host: GitHub
- URL: https://github.com/lancelet/techdraw
- Owner: lancelet
- Created: 2024-08-13T08:24:35.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-07T10:59:34.000Z (8 months ago)
- Last Synced: 2025-01-22T11:47:25.256Z (4 months ago)
- Topics: elm, svg, technical-drawing
- Language: Elm
- Homepage:
- Size: 234 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Technical Drawing in Elm

This package is built on top of the `typed-svg` package in Elm. It provides its own affine
transformation stack which tracks local-to-world and world-to-local coordinate transformations.
This allows:- Easy transformation of mouse events to local coordinates.
- Geometry expressed in the local coordinate system.
- Consistent global line widths.
- Shortening paths to accommodate arrow heads.This is implemented as a tree of nodes which are interpreted at render time to `svg` nodes.
## Tooling Notes
Use [elm-test](https://package.elm-lang.org/packages/elm-explorations/test/) and
[elm-verity-examples](https://github.com/stoeffel/elm-verify-examples) for testing:```sh
elm-test
elm-verify-examples --run-tests
```For local documentation preview, use [elm-doc-preview](https://github.com/dmy/elm-doc-preview)
```sh
elm-doc-preview
```## TODO
- Capture L2W transformation when events are declared, not when they are
attached to objects.
- Text.
- "Bake" node.
- Refactor to separate out styles and events stuff from the huge main file.
- Use a non-recursive traversal of the graph.
- Need a way to draw items in world coordinates.
- Arrow heads.
- More examples.