@thi.ng/dgraph-dot 2.1.82 → 2.1.83
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/CHANGELOG.md +1 -1
- package/index.js +24 -27
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const spec = opts.spec;
|
|
15
|
-
for (let n of src.nodes()) {
|
|
16
|
-
const id = opts.id(n);
|
|
17
|
-
nodes[id] = spec ? spec(n) : { label: label(n) };
|
|
18
|
-
for (let d of src.immediateDependencies(n)) {
|
|
19
|
-
edges.push({ src: id, dest: opts.id(d) });
|
|
20
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
serializeGraph
|
|
3
|
+
} from "@thi.ng/dot";
|
|
4
|
+
const toDot = (src, opts) => {
|
|
5
|
+
const nodes = {};
|
|
6
|
+
const edges = [];
|
|
7
|
+
const label = opts.label || opts.id;
|
|
8
|
+
const spec = opts.spec;
|
|
9
|
+
for (let n of src.nodes()) {
|
|
10
|
+
const id = opts.id(n);
|
|
11
|
+
nodes[id] = spec ? spec(n) : { label: label(n) };
|
|
12
|
+
for (let d of src.immediateDependencies(n)) {
|
|
13
|
+
edges.push({ src: id, dest: opts.id(d) });
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
}
|
|
16
|
+
const graph = {
|
|
17
|
+
attribs: opts.attribs,
|
|
18
|
+
directed: true,
|
|
19
|
+
edges,
|
|
20
|
+
nodes
|
|
21
|
+
};
|
|
22
|
+
return serializeGraph(graph);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
toDot
|
|
29
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dgraph-dot",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.83",
|
|
4
4
|
"description": "Customizable Graphviz DOT serialization for @thi.ng/dgraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "yarn
|
|
27
|
+
"build": "yarn build:esbuild && yarn build:decl",
|
|
28
|
+
"build:decl": "tsc --declaration --emitDeclarationOnly",
|
|
29
|
+
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
28
30
|
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
|
|
29
31
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
@@ -33,12 +35,13 @@
|
|
|
33
35
|
"test": "bun test"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@thi.ng/api": "^8.9.
|
|
37
|
-
"@thi.ng/dgraph": "^2.1.
|
|
38
|
-
"@thi.ng/dot": "^2.1.
|
|
38
|
+
"@thi.ng/api": "^8.9.12",
|
|
39
|
+
"@thi.ng/dgraph": "^2.1.82",
|
|
40
|
+
"@thi.ng/dot": "^2.1.50"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
43
|
"@microsoft/api-extractor": "^7.38.3",
|
|
44
|
+
"esbuild": "^0.19.8",
|
|
42
45
|
"rimraf": "^5.0.5",
|
|
43
46
|
"tools": "^0.0.1",
|
|
44
47
|
"typedoc": "^0.25.4",
|
|
@@ -73,5 +76,5 @@
|
|
|
73
76
|
"parent": "@thi.ng/dgraph",
|
|
74
77
|
"year": 2020
|
|
75
78
|
},
|
|
76
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "5e7bafedfc3d53bc131469a28de31dd8e5b4a3ff\n"
|
|
77
80
|
}
|