1.2.4 • Published 12 months ago

dot-generator v1.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

DOT Generator

Generator for Graphviz's DOT language written in Typescript.

Usage

Basic graph

import { generate, graph, edge, node } from 'dot-generator'

const a = node('A')
const b = node('B', { bgcolor: 'red', })
const c = node('C', { shape: 'rectangle' })

const g = graph([
    edge(a, b),
    edge(a, c),
])

console.log(generate(g))

Directed graph

// same as previously...

const g = digraph([
    edge(a, b),
    edge(a, c),
])

console.log(generate(g))

Subgraph / Cluster

import { generate, graph, edge, node, subgraph, cluster } from 'dot-generator'

const a = node('A')
const b = node('B', { bgcolor: 'red', })
const c = node('C', { shape: 'rectangle' })
const d = node('D')

const g = graph([
    edge(a, b),
    subgraph([
        edge(b, c)
    ]),
    cluster([
        edge(c, d)
    ])
])

console.log(generate(g))
1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.2.0

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago