From e4c7bafd276049c805039b240e0a83346c31f41b Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 20 Sep 2020 16:55:36 +0200 Subject: Initial release --- doc/README.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doc/README.md (limited to 'doc/README.md') diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000..44ae3f8 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,85 @@ +## Classes + +
+
Grafn
+
+
+ +## Typedefs + +
+
tVertex : object
+

The definition of a vertex that can be executed in the graph.

+
+
+ + + +## Grafn +**Kind**: global class + +* [Grafn](#Grafn) + * [new Grafn()](#new_Grafn_new) + * [.run(vertexName)](#Grafn+run) + * [.vertex(vertex)](#Grafn+vertex) + * [.toString()](#Grafn+toString) ⇒ string + + + +### new Grafn() +Represents a graph of functions. You can call run on any specific vertex, +which will trigger execution of it and its dependencies. + +It guarantees that each vertex will only run once. + +It can be represented in graphviz format, highlighting fulfilled and +rejected vertices. + + + +### grafn.run(vertexName) +Executes the named vertex and all its dependents + +**Kind**: instance method of [Grafn](#Grafn) +**Throws**: + +- Will throw an error if a requested vertex does not exist + + +| Param | Type | Description | +| --- | --- | --- | +| vertexName | string | the name of the vertex to run | + + + +### grafn.vertex(vertex) +Adds a vertex to the graph. + +**Kind**: instance method of [Grafn](#Grafn) + +| Param | Type | Description | +| --- | --- | --- | +| vertex | [tVertex](#tVertex) | the definition of the vertex to add | + + + +### grafn.toString() ⇒ string +Converts the graph to a graphviz digraph. If vertices have been executed, +they will be highlighted depending on whether they fulfilled or rejected. + +**Kind**: instance method of [Grafn](#Grafn) +**Returns**: string - The graphviz digraph representation + + +## tVertex : object +The definition of a vertex that can be executed in the graph. + +**Kind**: global typedef +**Properties** + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| name | string | | The name of the vertex | +| [dependencies] | Array.<string> | [] | The names of vertices that need to run before this one | +| action | function | | The action to execute | + -- cgit