Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjquines/sdsvg
render square dance formations as SVGs
https://github.com/cjquines/sdsvg
Last synced: 3 months ago
JSON representation
render square dance formations as SVGs
- Host: GitHub
- URL: https://github.com/cjquines/sdsvg
- Owner: cjquines
- License: mit
- Created: 2023-12-05T07:02:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-01T16:50:57.000Z (7 months ago)
- Last Synced: 2024-10-07T17:49:00.679Z (3 months ago)
- Language: TypeScript
- Size: 224 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# sdsvg
render square dance formations as SVGs
- **note:** "hexagon" geometry setting is a lie right now :(
```ts
import { formationToSvg, Formation } from "sdsvg";formationToSvg("1> 2> . . / . . 6< 5<");
const formation = new Formation("e.e/nsns/w.w", {
body: { fillOpacity: 0.2 },
nose: { size: `*2` },
});
formation.toElement(document.getElementById("#svg"));formationToSvg(
[
{ x: 0, y: 0, direction: "north", label: "A", color: "blue" },
{ x: 1, y: 0, direction: ["north", "south"], label: "B", phantom: true },
],
{ layout: { geometry: "hexagon", origin: { x: 0.5, y: 1.5 } } },
);
```![](https://raw.githubusercontent.com/cjquines/sdsvg/main/src/__image_snapshots__/sample1.png)
![](https://raw.githubusercontent.com/cjquines/sdsvg/main/src/__image_snapshots__/sample2.png)
![](https://raw.githubusercontent.com/cjquines/sdsvg/main/src/__image_snapshots__/sample3.png)
## inspiration
- [tex-squares.sty](https://www.mit.edu/~tech-squares/resources/tex/)
- [FormationBot](https://gitlab.com/tech-squares/formationbot)