From 31942f688b524bef5c9fcd57f0c0d646e22339c0 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 3 Apr 2026 23:41:06 +0100 Subject: [PATCH 1/3] feat: add `graphviz` to preferred manifest --- docs/modules/README.md | 1 + docs/modules/graphviz.md | 56 ++++++++++++++++++++++++++++++++++++++++ manifests/preferred.json | 12 +++++++++ 3 files changed, 69 insertions(+) create mode 100644 docs/modules/graphviz.md diff --git a/docs/modules/README.md b/docs/modules/README.md index a09649d9..cc17fa8b 100644 --- a/docs/modules/README.md +++ b/docs/modules/README.md @@ -61,6 +61,7 @@ ESLint plugin. - [`glob`](./glob.md) - [`globby`](./globby.md) - [`graphemer`](./graphemer.md) +- [`graphviz`](./graphviz.md) - [`gzip-size`](./gzip-size.md) - [`inherits`](./inherits.md) - [`invariant`](./invariant.md) diff --git a/docs/modules/graphviz.md b/docs/modules/graphviz.md new file mode 100644 index 00000000..39491c4e --- /dev/null +++ b/docs/modules/graphviz.md @@ -0,0 +1,56 @@ +--- +description: Modern alternatives to the graphviz package +--- + +# Replacements for `graphviz` + +`graphviz` did not receive a new update for more than 6 years and requires GraphViz to be installed + +## `ts-graphviz` + +[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) graphviz implementation in pure TypeScript. + +Example: + +```ts +import { + attribute as _, + Digraph, + Subgraph, + Node, + Edge, + toDot +} from 'ts-graphviz' + +const G = new Digraph() +const A = new Subgraph('A') +const node1 = new Node('node1', { + [_.color]: 'red' +}) +const node2 = new Node('node2', { + [_.color]: 'blue' +}) +const edge = new Edge([node1, node2], { + [_.label]: 'Edge Label', + [_.color]: 'pink' +}) +G.addSubgraph(A) +A.addNode(node1) +A.addNode(node2) +A.addEdge(edge) +const dot = toDot(G) +// digraph { +// subgraph "A" { +// "node1" [ +// color = "red", +// ] +// "node2" [ +// color = "blue", +// ] +// "node1" -> "node2" [ +// label = "Edge Label", +// color = "pink", +// ] +// } +// } +``` diff --git a/manifests/preferred.json b/manifests/preferred.json index f78b0c18..100ee4ee 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -366,6 +366,12 @@ "replacements": ["Intl.Segmenter", "unicode-segmenter"], "url": {"type": "e18e", "id": "graphemer"} }, + "graphviz": { + "type": "module", + "moduleName": "graphviz", + "replacements": ["ts-graphviz"], + "url": {"type": "e18e", "id": "graphviz"} + }, "gzip-size": { "type": "module", "moduleName": "gzip-size", @@ -3383,6 +3389,12 @@ "url": {"type": "e18e", "id": "express"}, "replacementModule": "@tinyhttp/app" }, + "ts-graphviz": { + "id": "ts-graphviz", + "type": "documented", + "url": {"type": "e18e", "id": "graphviz"}, + "replacementModule": "ts-graphviz" + }, "unicode-segmenter": { "id": "unicode-segmenter", "type": "documented", From 74874e5a2e556c4c00f604db42867c70b7db83cd Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 6 Apr 2026 22:14:05 +0100 Subject: [PATCH 2/3] update doc --- docs/modules/graphviz.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/modules/graphviz.md b/docs/modules/graphviz.md index 39491c4e..2c86aaf6 100644 --- a/docs/modules/graphviz.md +++ b/docs/modules/graphviz.md @@ -4,11 +4,9 @@ description: Modern alternatives to the graphviz package # Replacements for `graphviz` -`graphviz` did not receive a new update for more than 6 years and requires GraphViz to be installed - ## `ts-graphviz` -[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) graphviz implementation in pure TypeScript. +[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) is a well-maintained graphviz implementation in pure TypeScript. Example: From 807e9d4cb23c2fb8d48ef5799bc2aad9471b625f Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:14:35 +0100 Subject: [PATCH 3/3] Apply suggestion from @43081j --- docs/modules/graphviz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/graphviz.md b/docs/modules/graphviz.md index 2c86aaf6..14a9742b 100644 --- a/docs/modules/graphviz.md +++ b/docs/modules/graphviz.md @@ -6,7 +6,7 @@ description: Modern alternatives to the graphviz package ## `ts-graphviz` -[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) is a well-maintained graphviz implementation in pure TypeScript. +[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) is an actively maintained graphviz implementation in pure TypeScript. Example: