@observablehq/notebook-kit 2.5.8 → 2.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +2 -2
- package/dist/src/runtime/stdlib/dot.js +9 -16
- package/package.json +2 -2
package/dist/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/observablehq/notebook-kit.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.5.
|
|
8
|
+
"version": "2.5.9",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "TZ=America/Los_Angeles vitest",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@lezer/python": "^1.1.18",
|
|
55
55
|
"@observablehq/inspector": "^5.0.1",
|
|
56
56
|
"@observablehq/parser": "^6.1.0",
|
|
57
|
-
"@observablehq/runtime": "^6.0.
|
|
57
|
+
"@observablehq/runtime": "^6.0.1",
|
|
58
58
|
"@sindresorhus/slugify": "^2.2.1",
|
|
59
59
|
"@sveltejs/acorn-typescript": "^1.0.11",
|
|
60
60
|
"acorn": "^8.16.0",
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { instance } from "https://cdn.jsdelivr.net/npm/@viz-js/viz/+esm";
|
|
2
2
|
const viz = await instance();
|
|
3
|
+
const theme = {
|
|
4
|
+
color: "#00000101",
|
|
5
|
+
fontcolor: "#00000101",
|
|
6
|
+
fontname: "var(--sans-serif)",
|
|
7
|
+
fontsize: "12"
|
|
8
|
+
};
|
|
3
9
|
export const dot = (template, ...values) => {
|
|
4
10
|
const source = String.raw.call(String, template, ...values);
|
|
5
11
|
const svg = viz.renderSVGElement(source, {
|
|
6
|
-
graphAttributes: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
fontcolor: "#00000101",
|
|
10
|
-
fontname: "var(--sans-serif)",
|
|
11
|
-
fontsize: "12"
|
|
12
|
-
},
|
|
13
|
-
nodeAttributes: {
|
|
14
|
-
color: "#00000101",
|
|
15
|
-
fontcolor: "#00000101",
|
|
16
|
-
fontname: "var(--sans-serif)",
|
|
17
|
-
fontsize: "12"
|
|
18
|
-
},
|
|
19
|
-
edgeAttributes: {
|
|
20
|
-
color: "#00000101"
|
|
21
|
-
}
|
|
12
|
+
graphAttributes: { bgcolor: "none", ...theme },
|
|
13
|
+
nodeAttributes: theme,
|
|
14
|
+
edgeAttributes: theme
|
|
22
15
|
});
|
|
23
16
|
for (const e of svg.querySelectorAll("[stroke='#000001'][stroke-opacity='0.003922']")) {
|
|
24
17
|
e.setAttribute("stroke", "currentColor");
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/observablehq/notebook-kit.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.5.
|
|
8
|
+
"version": "2.5.9",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "TZ=America/Los_Angeles vitest",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@lezer/python": "^1.1.18",
|
|
55
55
|
"@observablehq/inspector": "^5.0.1",
|
|
56
56
|
"@observablehq/parser": "^6.1.0",
|
|
57
|
-
"@observablehq/runtime": "^6.0.
|
|
57
|
+
"@observablehq/runtime": "^6.0.1",
|
|
58
58
|
"@sindresorhus/slugify": "^2.2.1",
|
|
59
59
|
"@sveltejs/acorn-typescript": "^1.0.11",
|
|
60
60
|
"acorn": "^8.16.0",
|