Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
56 changes: 56 additions & 0 deletions docs/modules/graphviz.md
Original file line number Diff line number Diff line change
@@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just mention it has more modern and lighter alternatives rather than focusing on how long it has been since it was updated.

Either we should be certain it is unmaintained or not mention it I think.


## `ts-graphviz`

[`ts-graphviz`](https://github.com/ts-graphviz/ts-graphviz) graphviz implementation in pure TypeScript.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`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 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",
// ]
// }
// }
```
12 changes: 12 additions & 0 deletions manifests/preferred.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down