From 0a53220ecbf1bd442626849c406809fe1b2b6677 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 11 Jan 2025 15:32:18 +1100 Subject: [PATCH] Basic download SVG --- CHANGELOG.md | 4 ++++ src/index.md | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9705f1a..bf2299a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG.md +## v1.1.0 + +Added SVG and PNG downloads + ## v1.0.2 * Fixed bug which was stopping slanted grids diff --git a/src/index.md b/src/index.md index bf32c35..bec9ffc 100644 --- a/src/index.md +++ b/src/index.md @@ -4,7 +4,7 @@ toc: false

poptimal

-

v1.0.2 | by mike lynch | @mikelynch@aus.social | source

+

v1.1.0 | by mike lynch | @mikelynch@aus.social | source

@@ -14,6 +14,7 @@ toc: false import {RADIUS_OPTS, DotMaker} from './components/dots.js'; import {PALETTES, DotControls} from './components/controls.js'; +import {download, serialize_svg} from './components/download.js'; import random from "npm:random"; const CELL = 10; @@ -149,10 +150,19 @@ dots_g2.selectAll("circle") display(svg.node()); +``` + +```js + +display(download(() => serialize_svg(svg.node()), "poptimal.svg", "Save as SVG")); ``` +

+ + +