Basic download SVG

pull/17/head
Mike Lynch 2025-01-11 15:32:18 +11:00
parent 4224cb1b3b
commit 0a53220ecb
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# CHANGELOG.md # CHANGELOG.md
## v1.1.0
Added SVG and PNG downloads
## v1.0.2 ## v1.0.2
* Fixed bug which was stopping slanted grids * Fixed bug which was stopping slanted grids

View File

@ -4,7 +4,7 @@ toc: false
<h1>poptimal</h1> <h1>poptimal</h1>
<p>v1.0.2 | by <a href="https://mikelynch.org">mike lynch</a> | <a href="https://aus.social/@mikelynch">@mikelynch@aus.social</a> | <a href="https://git.tilde.town/bombinans/poptimal">source</a></p> <p>v1.1.0 | by <a href="https://mikelynch.org">mike lynch</a> | <a href="https://aus.social/@mikelynch">@mikelynch@aus.social</a> | <a href="https://git.tilde.town/bombinans/poptimal">source</a></p>
<div class="grid grid-cols-2"> <div class="grid grid-cols-2">
@ -14,6 +14,7 @@ toc: false
import {RADIUS_OPTS, DotMaker} from './components/dots.js'; import {RADIUS_OPTS, DotMaker} from './components/dots.js';
import {PALETTES, DotControls} from './components/controls.js'; import {PALETTES, DotControls} from './components/controls.js';
import {download, serialize_svg} from './components/download.js';
import random from "npm:random"; import random from "npm:random";
const CELL = 10; const CELL = 10;
@ -149,10 +150,19 @@ dots_g2.selectAll("circle")
display(svg.node()); display(svg.node());
```
```js
display(download(() => serialize_svg(svg.node()), "poptimal.svg", "Save as SVG"));
``` ```
</p>
</div> </div>
</div> </div>
<style> <style>