JSPM

@thi.ng/dgraph

0.2.32
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 438
  • Score
    100M100P100Q106366F
  • License Apache-2.0

Type-agnostic directed acyclic graph (DAG) & graph operations

Package Exports

  • @thi.ng/dgraph

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 (@thi.ng/dgraph) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@thi.ng/dgraph

npm version npm downloads Twitter Follow

About

Type-agnostic directed acyclic graph (DAG), using @thi.ng/associative maps & sets as backend.

Features

  • cycle detection
  • accessors for direct & transitive dependencies / dependents
  • topological sorting
  • iterable

Installation

yarn add @thi.ng/dgraph

Dependencies

Usage examples

import { DGraph } from "@thi.ng/dgraph";

g = new DGraph();
g.addDependency([1, 2], [10, 20]);
g.addDependency([3, 4], [30, 40]);
g.addDependency([1, 2], [3, 4]);

g.sort()
// [[30, 40], [3, 4], [10, 20], [1, 2]]

Authors

  • Karsten Schmidt

License

© 2018 Karsten Schmidt // Apache Software License 2.0