ts-graphviz 1.5.1-dev.43c55b93e → 1.5.2-dev.0834faefe
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 +2 -0
- package/example/runkit.cjs +25 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ $ yarn add ts-graphviz
|
|
|
48
48
|
$ pnpm add ts-graphviz
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
> **Note** Want to try before installing? Check out [Runkit](https://npm.runkit.com/ts-graphviz) to see how it works.
|
|
52
|
+
|
|
51
53
|
### Deno 🦕
|
|
52
54
|
|
|
53
55
|
[Deno v1.28 and above supports npm](https://deno.land/manual/node/npm_specifiers).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { attribute: _, digraph, toDot } = require('ts-graphviz');
|
|
2
|
+
|
|
3
|
+
const G = digraph('G', (g) => {
|
|
4
|
+
const a = g.node('aa');
|
|
5
|
+
const b = g.node('bb');
|
|
6
|
+
const c = g.node('cc');
|
|
7
|
+
g.edge([a, b, c], {
|
|
8
|
+
[_.color]: 'red',
|
|
9
|
+
});
|
|
10
|
+
g.subgraph('A', (A) => {
|
|
11
|
+
const Aa = A.node('Aaa', {
|
|
12
|
+
[_.color]: 'pink',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const Ab = A.node('Abb', {
|
|
16
|
+
[_.color]: 'violet',
|
|
17
|
+
});
|
|
18
|
+
const Ac = A.node('Acc');
|
|
19
|
+
A.edge([Aa.port('a'), Ab, Ac, 'E'], {
|
|
20
|
+
[_.color]: 'red',
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
toDot(G);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-graphviz",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2-dev.0834faefe",
|
|
4
4
|
"author": "kamiazya <yuki@kamiazya.tech>",
|
|
5
5
|
"description": "Graphviz library for TypeScript.",
|
|
6
6
|
"homepage": "https://ts-graphviz.github.io/ts-graphviz/",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=14.16"
|
|
83
83
|
},
|
|
84
|
+
"runkitExampleFilename": "example/runkit.cjs",
|
|
84
85
|
"scripts": {
|
|
85
86
|
"build:peggy": "peggy --plugin ts-pegjs --extra-options-file src/ast/dot-shim/parser/peggy.options.json -o src/ast/dot-shim/parser/_parse.ts src/ast/dot-shim/parser/dot.peggy",
|
|
86
87
|
"prebuild": "yarn build:peggy",
|