diff --git a/.gitignore b/.gitignore index a547bf3..772a8bb 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ dist dist-ssr *.local +public/*.wasm + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8874297..ad36df9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.0] - 2022-07-14 + +### Added + +* Added GraphViz dojo (rendered by `dot`) + ## [0.3.0] - 2022-07-14 ### Added diff --git a/README.md b/README.md index 61df564..ac92290 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,14 @@ Once connected, players have access to a basic text chat window and the rest of ## Dojo Types -There are five dojo types currently supported: +The following dojo types are supported: * plain text (koans are displayed as entered) * images (drag and drop square image files) * math (powered by [KaTeX](https://katex.org/), using TeX/LaTeX notation) * 1d pyramids (one-dimensional koans with [Looney pyramids](https://www.looneylabs.com/pyramids-home)) * dot matrix (coloured dots on rectangular grids) +* [GraphViz](https://graphviz.org/) (rendered by [dot](https://graphviz.org/docs/layouts/dot/)) ## Caveats diff --git a/package-lock.json b/package-lock.json index d66a626..fe991d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,17 @@ { "name": "@abstractplay/zendo", - "version": "0.1.0", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@abstractplay/zendo", - "version": "0.1.0", + "version": "0.3.0", "license": "MIT", "dependencies": { "buffer": "^6.0.3", "katex": "^0.16.0", + "node-graphviz": "github:JosephusPaye/node-graphviz", "peerjs": "^1.4.6", "svelte-markdown": "^0.2.2" }, @@ -1384,6 +1385,11 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, + "node_modules/node-graphviz": { + "version": "0.1.0", + "resolved": "git+ssh://git@github.com/JosephusPaye/node-graphviz.git#edf5ce1ffc9e7e4375a76e0f92d93758a2e9534a", + "license": "MIT" + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2919,6 +2925,10 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, + "node-graphviz": { + "version": "git+ssh://git@github.com/JosephusPaye/node-graphviz.git#edf5ce1ffc9e7e4375a76e0f92d93758a2e9534a", + "from": "node-graphviz@JosephusPaye/node-graphviz" + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", diff --git a/package.json b/package.json index 97b7749..35d391f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@abstractplay/zendo", "private": true, - "version": "0.3.0", + "version": "0.4.0", "description": "A peer-to-peer, synchronous client for playing Zendo online", "author": "Aaron Dalton (https://www.perlkonig.com)", "license": "MIT", @@ -34,6 +34,7 @@ "dependencies": { "buffer": "^6.0.3", "katex": "^0.16.0", + "node-graphviz": "github:JosephusPaye/node-graphviz", "peerjs": "^1.4.6", "svelte-markdown": "^0.2.2" } diff --git a/src/lib/Game/ActionBar/AddKoan.svelte b/src/lib/Game/ActionBar/AddKoan.svelte index bd46493..b10e69d 100644 --- a/src/lib/Game/ActionBar/AddKoan.svelte +++ b/src/lib/Game/ActionBar/AddKoan.svelte @@ -16,6 +16,8 @@ placeholder = "Enter a series of pyramid designations separated by whitespace"; } else if ($game.koanType === "dotmatrix") { placeholder = "Enter width, height, and then a string of digits"; + } else if ($game.koanType === "graphviz") { + placeholder = "Type or paste your DOT code" } let files: FileList; @@ -71,6 +73,8 @@ typeDesc = "1D Pyramid"; } else if ($game.koanType === "dotmatrix") { typeDesc = "Dot Matrix"; + } else if ($game.koanType === "graphviz") { + typeDesc = "GraphViz"; } const colours = new Map([ @@ -112,9 +116,15 @@ {/if} + {#if $game.koanType === "graphviz"} +
+ +
+ {:else}
+ {/if} {#if $game.koanType === "math"}

No delimiters are needed. Just enter the formula using supported TeX or LaTeX notation. @@ -134,6 +144,10 @@

The digit 0 is an empty cell, 1 is black, and the digits 2–9 give a sequence of different colours.

+ {:else if $game.koanType === "graphviz"} +

+ DOT language reference +

{/if} {#if $game.koanType === "1dpyramids"} diff --git a/src/lib/Game/ActionBar/Master.svelte b/src/lib/Game/ActionBar/Master.svelte index 6217231..da6712e 100644 --- a/src/lib/Game/ActionBar/Master.svelte +++ b/src/lib/Game/ActionBar/Master.svelte @@ -57,7 +57,7 @@ let koanType = "text"; const chooseType = () => { - if ( (koanType === "text") || (koanType === "image") || (koanType === "math") || (koanType === "1dpyramids") || (koanType === "dotmatrix") ) { + if ( (koanType === "text") || (koanType === "image") || (koanType === "math") || (koanType === "1dpyramids") || (koanType === "dotmatrix") || (koanType === "graphviz") ) { $game.koanType = koanType; $game = $game; pushGame(); @@ -151,6 +151,10 @@ Dot matrix koans
+