@thi.ng/dgraph-dot 2.1.81 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/index.js +24 -27
  3. package/package.json +9 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-12-03T12:13:31Z
3
+ - **Last updated**: 2023-12-11T10:07:09Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/index.js CHANGED
@@ -1,29 +1,26 @@
1
- import { serializeGraph, } from "@thi.ng/dot";
2
- /**
3
- * Takes a [`DGraph`](https://docs.thi.ng/umbrella/dgraph/classes/DGraph.html)
4
- * and object of visualization & serialization options. Returns Graphviz DOT
5
- * format serialization of given graph.
6
- *
7
- * @param src -
8
- * @param opts -
9
- */
10
- export const toDot = (src, opts) => {
11
- const nodes = {};
12
- const edges = [];
13
- const label = opts.label || opts.id;
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
- const graph = {
23
- attribs: opts.attribs,
24
- directed: true,
25
- edges,
26
- nodes,
27
- };
28
- return serializeGraph(graph);
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.81",
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 clean && tsc --declaration",
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,13 +35,13 @@
33
35
  "test": "bun test"
34
36
  },
35
37
  "dependencies": {
36
- "@thi.ng/api": "^8.9.10",
37
- "@thi.ng/dgraph": "^2.1.80",
38
- "@thi.ng/dot": "^2.1.48"
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",
42
- "@thi.ng/testament": "^0.4.3",
44
+ "esbuild": "^0.19.8",
43
45
  "rimraf": "^5.0.5",
44
46
  "tools": "^0.0.1",
45
47
  "typedoc": "^0.25.4",
@@ -74,5 +76,5 @@
74
76
  "parent": "@thi.ng/dgraph",
75
77
  "year": 2020
76
78
  },
77
- "gitHead": "04d1de79f256d7a53c6b5fd157b37f49bc88e11d\n"
79
+ "gitHead": "5e7bafedfc3d53bc131469a28de31dd8e5b4a3ff\n"
78
80
  }