diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-20 16:55:36 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-20 16:55:36 +0200 |
| commit | e4c7bafd276049c805039b240e0a83346c31f41b (patch) | |
| tree | 4c8788909ed67710a1628b9e4ae51c1a45b3b3ce /doc/README.md | |
Initial release
Diffstat (limited to 'doc/README.md')
| -rw-r--r-- | doc/README.md | 85 |
1 files changed, 85 insertions, 0 deletions
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 + +<dl> +<dt><a href="#Grafn">Grafn</a></dt> +<dd></dd> +</dl> + +## Typedefs + +<dl> +<dt><a href="#tVertex">tVertex</a> : <code>object</code></dt> +<dd><p>The definition of a vertex that can be executed in the graph.</p> +</dd> +</dl> + +<a name="Grafn"></a> + +## Grafn +**Kind**: global class + +* [Grafn](#Grafn) + * [new Grafn()](#new_Grafn_new) + * [.run(vertexName)](#Grafn+run) + * [.vertex(vertex)](#Grafn+vertex) + * [.toString()](#Grafn+toString) ⇒ <code>string</code> + +<a name="new_Grafn_new"></a> + +### 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. + +<a name="Grafn+run"></a> + +### grafn.run(vertexName) +Executes the named vertex and all its dependents + +**Kind**: instance method of [<code>Grafn</code>](#Grafn) +**Throws**: + +- Will throw an error if a requested vertex does not exist + + +| Param | Type | Description | +| --- | --- | --- | +| vertexName | <code>string</code> | the name of the vertex to run | + +<a name="Grafn+vertex"></a> + +### grafn.vertex(vertex) +Adds a vertex to the graph. + +**Kind**: instance method of [<code>Grafn</code>](#Grafn) + +| Param | Type | Description | +| --- | --- | --- | +| vertex | [<code>tVertex</code>](#tVertex) | the definition of the vertex to add | + +<a name="Grafn+toString"></a> + +### grafn.toString() ⇒ <code>string</code> +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 [<code>Grafn</code>](#Grafn) +**Returns**: <code>string</code> - The graphviz digraph representation +<a name="tVertex"></a> + +## tVertex : <code>object</code> +The definition of a vertex that can be executed in the graph. + +**Kind**: global typedef +**Properties** + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| name | <code>string</code> | | The name of the vertex | +| [dependencies] | <code>Array.<string></code> | <code>[]</code> | The names of vertices that need to run before this one | +| action | <code>function</code> | | The action to execute | + |