Timo Hocker e8382f8117
Some checks failed
continuous-integration/drone/push Build is failing
update-scanner: automatic update
ava: 3.11.1 ==> 3.12.1 minor
2020-08-30 15:59:46 +02:00
2020-07-17 13:29:03 +02:00
2020-08-07 08:12:45 +02:00
2020-04-24 12:22:57 +02:00
2020-05-17 17:17:39 +02:00
2020-04-17 15:43:34 +02:00
2020-05-17 17:17:39 +02:00
2020-07-17 13:29:03 +02:00
2020-05-17 17:17:39 +02:00
2020-08-21 13:17:17 +02:00
2020-07-17 13:29:03 +02:00
2020-04-24 12:36:04 +02:00
2020-08-30 15:59:46 +02:00

@sapphirecode/graphviz-builder

version: 1.3.x

constructing graphviz files using an easy typescript interface

Installation

npm:

npm i --save @sapphirecode/graphviz-builder

yarn:

yarn add @sapphirecode/graphviz-builder

Usage

Object structure

import {Graph,Color} from '@sapphirecode/graphviz-builder';

// create a new graph
const g = new Graph('foo');

// add a node to the graph
// this function returns the full name of the node that's later used for creating edges
const bar = g.add_node('bar');

// if you want to specify attributes
const baz = g.add_node(n => {
  n.name = 'baz';
  n.label = 'node baz';
  n.color = Color.red;
});

// connect nodes
g.add_edge(bar, baz);

// add a subgraph
g.add_graph(sg=>{
  sg.name = 'subgraph';

  sg.add_node('foo');
})

// get info about current stream state
g.node_count // count of nodes written
g.path // get current path (parent graph names separated by underscores)

License

MIT © Timo Hocker timo@scode.ovh

Description
No description provided
Readme 441 KiB
Languages
TypeScript 100%