From 715a3d0f4d2857e4a4e6ab93016467c63367c7bd Mon Sep 17 00:00:00 2001 From: Alexander Kimmig Date: Tue, 3 Jun 2025 00:02:39 +0200 Subject: [PATCH] =?UTF-8?q?plot.ts=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plot.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plot.ts diff --git a/plot.ts b/plot.ts new file mode 100644 index 0000000..dd4430c --- /dev/null +++ b/plot.ts @@ -0,0 +1,9 @@ +import * as Plot from "npm:@observablehq/plot"; +import { DOMParser, SVGElement } from "npm:linkedom"; +export const document = new DOMParser().parseFromString( + ``, +); + +export const plot = (data) => { + return Plot.line(data, {x: "x", y: "y"}).plot({y: {grid: true}, document}) +} \ No newline at end of file