All Projects → jriecken → Dependency Graph

jriecken / Dependency Graph

Licence: mit
A simple dependency graph for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dependency Graph

Dotnet Assembly Grapher
Reverse engineering and software quality assurance tool for .NET assemblies
Stars: ✭ 21 (-90.41%)
Mutual labels:  dependency-graph, graph
Git Deps
git commit dependency analysis tool
Stars: ✭ 232 (+5.94%)
Mutual labels:  dependency-graph, graph
Protodot
transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
Stars: ✭ 107 (-51.14%)
Mutual labels:  dependency-graph, graph
Ngd
View the dependencies tree of you Angular application
Stars: ✭ 570 (+160.27%)
Mutual labels:  dependency-graph, graph
Objc Dependency Visualizer
Objective-C and Swift dependency visualizer. It's tool that helps to visualize current state of your project. It's really easy to see how tight your classes are coupled.
Stars: ✭ 1,738 (+693.61%)
Mutual labels:  dependency-graph, graph
Star History
The missing star history graph of GitHub repos - https://star-history.com
Stars: ✭ 2,534 (+1057.08%)
Mutual labels:  graph
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (-6.39%)
Mutual labels:  graph
Graph Notebook
Library extending Jupyter notebooks to integrate with Apache TinkerPop and RDF SPARQL.
Stars: ✭ 199 (-9.13%)
Mutual labels:  graph
Gradoop
Distributed Graph Analytics with Apache Flink
Stars: ✭ 197 (-10.05%)
Mutual labels:  graph
Ehtrace
ATrace is a tool for tracing execution of binaries on Windows.
Stars: ✭ 218 (-0.46%)
Mutual labels:  graph
Gitgraph.js
👋 [Looking for maintainers] - A JavaScript library to draw pretty git graphs in the browser
Stars: ✭ 2,553 (+1065.75%)
Mutual labels:  graph
Litegraph.js
A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
Stars: ✭ 2,735 (+1148.86%)
Mutual labels:  graph
Phpflo
Flow-based programming for PHP
Stars: ✭ 199 (-9.13%)
Mutual labels:  graph
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-6.85%)
Mutual labels:  graph
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+966.67%)
Mutual labels:  graph
Hyperformula
A complete, open-source Excel-like calculation engine written in TypeScript. Includes 380+ built-in functions. Maintained by the Handsontable team⚡
Stars: ✭ 210 (-4.11%)
Mutual labels:  graph
Quark
Quark is a data visualization framework.
Stars: ✭ 198 (-9.59%)
Mutual labels:  graph
Yfiles For Html Demos
Contains demo sources for the JavaScript diagramming library yFiles for HTML
Stars: ✭ 202 (-7.76%)
Mutual labels:  graph
Graph Cnn In 3d Point Cloud Classification
Code for A GRAPH-CNN FOR 3D POINT CLOUD CLASSIFICATION (ICASSP 2018)
Stars: ✭ 206 (-5.94%)
Mutual labels:  graph
Vue Blocks
Vue2 dataflow graph editor
Stars: ✭ 201 (-8.22%)
Mutual labels:  graph

Dependency Graph

Simple dependency graph

Overview

This is a simple dependency graph useful for determining the order to do a list of things that depend on certain items being done before they are.

To use, npm install dependency-graph and then require('dependency-graph').DepGraph

API

DepGraph

Nodes in the graph are just simple strings with optional data associated with them.

  • addNode(name, data) - add a node in the graph with optional data. If data is not given, name will be used as data
  • removeNode(name) - remove a node from the graph
  • hasNode(name) - check if a node exists in the graph
  • size() - return the number of nodes in the graph
  • getNodeData(name) - get the data associated with a node (will throw an Error if the node does not exist)
  • setNodeData(name, data) - set the data for an existing node (will throw an Error if the node does not exist)
  • addDependency(from, to) - add a dependency between two nodes (will throw an Error if one of the nodes does not exist)
  • removeDependency(from, to) - remove a dependency between two nodes
  • clone() - return a clone of the graph. Any data attached to the nodes will only be shallow-copied
  • dependenciesOf(name, leavesOnly) - get an array containing the nodes that the specified node depends on (transitively). If leavesOnly is true, only nodes that do not depend on any other nodes will be returned in the array.
  • dependantsOf(name, leavesOnly) (aliased as dependentsOf) - get an array containing the nodes that depend on the specified node (transitively). If leavesOnly is true, only nodes that do not have any dependants will be returned in the array.
  • directDependenciesOf(name) - get an array containing the direct dependencies of the specified node
  • directDependantsOf(name) (aliased as directDependentsOf) - get an array containing the nodes that directly depend on the specified node
  • overallOrder(leavesOnly) - construct the overall processing order for the dependency graph. If leavesOnly is true, only nodes that do not depend on any other nodes will be returned.
  • entryNodes() - array of nodes that have no dependants (i.e. nothing depends on them).

Dependency Cycles are detected when running dependenciesOf, dependantsOf, and overallOrder and if one is found, a DepGraphCycleError will be thrown that includes what the cycle was in the message as well as the cyclePath property: e.g. Dependency Cycle Found: a -> b -> c -> a. If you wish to silence this error, pass circular: true when instantiating DepGraph (more below).

Examples

var DepGraph = require('dependency-graph').DepGraph;

var graph = new DepGraph();
graph.addNode('a');
graph.addNode('b');
graph.addNode('c');

graph.size() // 3

graph.addDependency('a', 'b');
graph.addDependency('b', 'c');

graph.dependenciesOf('a'); // ['c', 'b']
graph.dependenciesOf('b'); // ['c']
graph.dependantsOf('c'); // ['a', 'b']

graph.overallOrder(); // ['c', 'b', 'a']
graph.overallOrder(true); // ['c']
graph.entryNodes(); // ['a']

graph.addNode('d', 'data');

graph.getNodeData('d'); // 'data'

graph.setNodeData('d', 'newData');

graph.getNodeData('d'); // 'newData'

var circularGraph = new DepGraph({ circular: true });

circularGraph.addNode('a');
circularGraph.addNode('b');
circularGraph.addNode('c');
circularGraph.addNode('d');

circularGraph.addDependency('a', 'b');
circularGraph.addDependency('b', 'c'); // b depends on c
circularGraph.addDependency('c', 'a'); // c depends on a, which depends on b
circularGraph.addDependency('d', 'a');

circularGraph.dependenciesOf('b'); // ['a', 'c']
circularGraph.overallOrder(); // ['c', 'b', 'a', 'd']
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].