Skip to content

Commit 22ab314

Browse files
committed
v1.21.7
1 parent 081148b commit 22ab314

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nshiab/journalism",
3-
"version": "1.21.6",
3+
"version": "1.21.7",
44
"exports": {
55
".": "./src/index.ts",
66
"./web": "./src/web.ts"

src/dataviz/saveChart.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { chromium } from "playwright-chromium";
22
import type { Data } from "@observablehq/plot";
33
import { readFileSync, writeFileSync } from "node:fs";
4-
import { fileURLToPath } from "node:url";
5-
import { dirname, resolve } from "node:path";
4+
import { resolve } from "node:path";
65

76
/**
87
* Saves an [Observable Plot](https://github.com/observablehq/plot) chart as an image file (`.png` or `.jpeg`). You can also save a SVG file (`.svg`), but only the main SVG element will be saved, not the other HTML elements (legend, title, etc.).
@@ -46,15 +45,8 @@ export default async function saveChart(
4645
});
4746
const page = await context.newPage();
4847

49-
console.log(JSON.stringify(import.meta));
50-
51-
const __filename = fileURLToPath(import.meta.url);
52-
const __dirname = dirname(__filename);
53-
54-
console.log({ __filename, __dirname });
55-
56-
const d3Path = resolve(__dirname, "./imports/[email protected]");
57-
const plotPath = resolve(__dirname, "./imports/[email protected]");
48+
const d3Path = resolve("./src/dataviz/imports/[email protected]");
49+
const plotPath = resolve("./src/dataviz/imports/[email protected]");
5850

5951
console.log({ d3Path, plotPath });
6052

0 commit comments

Comments
 (0)