Package Exports
- simian-simple-graph
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simian-simple-graph) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Simian Simple Graph
This is a pretty basic DAG structure I cooked up for a particular project.
Installation
npm i --save simian-simple-graph
Usage
import {
Edge,
Graph,
toDot,
getSubTree
} from 'simian-simple-graph';
const g0 = new Graph([
new Edge('a', 'b'), // a -> b
new Edge('a', 'c'), // a -> c
new Edge('a', 'd'), // a -> d
new Edge('d', 'e'), // d -> e
new Edge('d', 'f'), // d -> f
]);
const g1 = getSubTree(g0, 'd'); // d -> e, d -> f
const dotOutput = toDot(g0); // produces string in DOT syntax