0.1.8 • Published 3 years ago

meta-struct-js v0.1.8

Weekly downloads
349
License
MIT
Repository
github
Last release
3 years ago

MetaStruct.Graph

MetaStruct.Graph - directed acyclic graph.


Graph Invariants:

  • has only one root node;
  • has no non-connected nodes;
  • has no cycles;
  • has exit (at least one);

Graph Creation

  • create node Graph.Node:
import Graph from 'MetaStruct'

Graph.Node.create(
  _your_uuid_, // autogenerated uuid by default
  _your_labels_, // [] by default
  _your_properties_ // {} by default
)
  • create edge Graph.Edge:
Graph.Edge.create(
  _your_left_node_, // an instance of Graph.Node
  _your_right_node_, // an instance of Graph.Node
  _your_labels_, // [] by default
  _your_properties_, // {} by default
  _your_weight_ // 0 by default
)
  • build graph Graph:
    • fails on duplicated nodes (nodes with duplicated uuids);
    • fails on duplicated edges (duplicated edge objects wich have identical left and right nodes);
    • fails on situation, when node has no edge entity (presented in edge list);
    • fails on situation, when edge has node which is not presented in node list;
Graph.create(
  _your_array_of_nodes_, // [] by default
  _your_array_of_edges // [] by default
)

Build and Development

  • code style checking:
npm run lint
  • development mode:
npm run start
  • run tests:
npm run test // -- with using сoverage statement

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago