@thi.ng/dot 2.1.122 → 2.1.124
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/README.md +1 -1
- package/package.json +4 -4
- package/serialize.js +5 -5
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 212 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dot",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.124",
|
|
4
4
|
"description": "Graphviz document abstraction & serialization to DOT format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/checks": "^3.
|
|
42
|
+
"@thi.ng/api": "^8.12.11",
|
|
43
|
+
"@thi.ng/checks": "^3.8.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"esbuild": "^0.27.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"tag": "graphviz",
|
|
88
88
|
"year": 2018
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "e7a21b9d2a188fa04d4c893d8531c40fbc0f4c06\n"
|
|
91
91
|
}
|
package/serialize.js
CHANGED
|
@@ -4,7 +4,7 @@ const __nextSubgraphID = () => "cluster" + __nextID++;
|
|
|
4
4
|
const __wrapQ = (x) => `"${x}"`;
|
|
5
5
|
const __escape = (x) => String(x).replace(/"/g, `\\"`).replace(/\n/g, "\\n");
|
|
6
6
|
const __formatGraphAttribs = (attribs, acc) => {
|
|
7
|
-
for (
|
|
7
|
+
for (const a in attribs) {
|
|
8
8
|
let v = attribs[a];
|
|
9
9
|
switch (a) {
|
|
10
10
|
case "bgcolor":
|
|
@@ -59,7 +59,7 @@ const __formatAttribs = (attribs) => {
|
|
|
59
59
|
};
|
|
60
60
|
const __formatPorts = (ports) => {
|
|
61
61
|
const acc = [];
|
|
62
|
-
for (
|
|
62
|
+
for (const i in ports) {
|
|
63
63
|
acc.push(`<${i}> ${__escape(ports[i])}`);
|
|
64
64
|
}
|
|
65
65
|
return `{ ${acc.join(" | ")} }`;
|
|
@@ -95,14 +95,14 @@ const serializeGraph = (graph, isSub = false) => {
|
|
|
95
95
|
if (graph.attribs) {
|
|
96
96
|
__formatGraphAttribs(graph.attribs, acc);
|
|
97
97
|
}
|
|
98
|
-
for (
|
|
98
|
+
for (const id in graph.nodes) {
|
|
99
99
|
acc.push(serializeNode(id, graph.nodes[id]));
|
|
100
100
|
}
|
|
101
|
-
for (
|
|
101
|
+
for (const e of graph.edges) {
|
|
102
102
|
acc.push(serializeEdge(e, directed));
|
|
103
103
|
}
|
|
104
104
|
if (graph.sub) {
|
|
105
|
-
for (
|
|
105
|
+
for (const sub of graph.sub) {
|
|
106
106
|
acc.push(serializeGraph(sub, true));
|
|
107
107
|
}
|
|
108
108
|
}
|