Package Exports
- dagjs
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 (dagjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dag.js

Simple DAG (Directed Acyclic Graph) module with edge tagging.
Install
$ npm install dagjsUsage
let Dag = require('dagjs');
let dag = new Dag();
// ...Examples
Adding edges:
let dag = new Dag();
// add(from, to, tags, weight)
dag.add('Mike', 'Josh', 'follows', 3);
dag.add('Mary', 'Josh', ['follows', 'likes'], 50);
dag.add('Josh', 'John', ['follows', 'admires']);
dag.add('Mike', 'Mary', 'likes', 100);
// It results in a DAG:
// follows admires
// Mike ----3---> Josh --------> John
// | ^
// | |
// | 50 follows and likes
// | likes |
// -----100---> MaryFiltering by tag:
let likeDag = dag.filterByTag('likes');
// likeDag =
// likes follows and likes
// Mike --100--> Mary ---------50--------> JoshNeighbouring:
let edgesToJosh = dag.edgesTo('Josh');
// edgesToJosh =
// [
// {from:'Mike', to:'Josh', tags:['follows'], weight:3},
// {from: 'Mary', to:'Josh', tags:['follows', 'likes'], weight: 50}
// ]
let edgesFromMary = dag.edgesFrom('Mary');
// edgesFromMary =
// [
// {from: 'Mary', to:'Josh', tags:['follows', 'likes'], weight: 50}
// ]
let neighbourhoodOfJosh = dag.neighbourhood('Josh');
// neighbourhoodOfJosh =
// follows admires
// Mike ----3---> Josh --------> John
// ^
// |
// 50 follows and likes
// |
// MaryClones:
// shallow-clone
let shallowDag = dag.clone();
// deep-clone
let deepDag = dag.deepClone();