UNPKG

ancient-graph-spreading

Version:

Automatic maintenance spreading of graph according other graphs.

1,958 lines (555 loc) 28.5 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>QueueSpreading - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="GraphSpreading.html">GraphSpreading</a><ul class='methods'><li data-type='method'><a href="GraphSpreading.html#_getFromFields">_getFromFields</a></li><li data-type='method'><a href="GraphSpreading.html#_getToFields">_getToFields</a></li><li data-type='method'><a href="GraphSpreading.html#_spreadByPathLink">_spreadByPathLink</a></li><li data-type='method'><a href="GraphSpreading.html#_spreadFromSpreadLinkByPathGraph">_spreadFromSpreadLinkByPathGraph</a></li><li data-type='method'><a href="GraphSpreading.html#_spreadFromSpreadLinkByPathLink">_spreadFromSpreadLinkByPathLink</a></li><li data-type='method'><a href="GraphSpreading.html#_wrapPathQuery">_wrapPathQuery</a></li><li data-type='method'><a href="GraphSpreading.html#_wrapSpreadQuery">_wrapSpreadQuery</a></li><li data-type='method'><a href="GraphSpreading.html#addPathGraph">addPathGraph</a></li><li data-type='method'><a href="GraphSpreading.html#each">each</a></li><li data-type='method'><a href="GraphSpreading.html#spreadByPathLink">spreadByPathLink</a></li><li data-type='method'><a href="GraphSpreading.html#spreadFromSpreadLink">spreadFromSpreadLink</a></li><li data-type='method'><a href="GraphSpreading.html#spreadFromSpreadLinkByPathGraph">spreadFromSpreadLinkByPathGraph</a></li><li data-type='method'><a href="GraphSpreading.html#spreadFromSpreadLinkByPathLink">spreadFromSpreadLinkByPathLink</a></li><li data-type='method'><a href="GraphSpreading.html#spreadNewSpreadLink">spreadNewSpreadLink</a></li><li data-type='method'><a href="GraphSpreading.html#spreadTo">spreadTo</a></li><li data-type='method'><a href="GraphSpreading.html#unspread">unspread</a></li><li data-type='method'><a href="GraphSpreading.html#unspreadByPathId">unspreadByPathId</a></li><li data-type='method'><a href="GraphSpreading.html#unspreadFromRemovedSpreadLinkByPrevId">unspreadFromRemovedSpreadLinkByPrevId</a></li></ul></li><li><a href="PathGraph.html">PathGraph</a></li><li><a href="QueueSpreading.html">QueueSpreading</a><ul class='methods'><li data-type='method'><a href="QueueSpreading.html#_getGraph">_getGraph</a></li><li data-type='method'><a href="QueueSpreading.html#removeFromLaunched">removeFromLaunched</a></li><li data-type='method'><a href="QueueSpreading.html#spreadByPath">spreadByPath</a></li><li data-type='method'><a href="QueueSpreading.html#spreadBySpread">spreadBySpread</a></li><li data-type='method'><a href="QueueSpreading.html#spreadBySpreader">spreadBySpreader</a></li><li data-type='method'><a href="QueueSpreading.html#unspreadByPath">unspreadByPath</a></li><li data-type='method'><a href="QueueSpreading.html#unspreadBySpread">unspreadBySpread</a></li><li data-type='method'><a href="QueueSpreading.html#unspreadBySpreader">unspreadBySpreader</a></li></ul></li><li><a href="SpreaderGraph.html">SpreaderGraph</a></li><li><a href="SpreadGraph.html">SpreadGraph</a><ul class='methods'><li data-type='method'><a href="SpreadGraph.html#_spreadingHandler">_spreadingHandler</a></li><li data-type='method'><a href="SpreadGraph.html#_unspreadingHandler">_unspreadingHandler</a></li><li data-type='method'><a href="SpreadGraph.html#insert">insert</a></li><li data-type='method'><a href="SpreadGraph.html#remove">remove</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#factoryLaunchedGraph">factoryLaunchedGraph</a></li><li><a href="global.html#factoryPathGraph">factoryPathGraph</a></li><li><a href="global.html#factoryRespreadGraph">factoryRespreadGraph</a></li><li><a href="global.html#factorySpreaderGraph">factorySpreaderGraph</a></li><li><a href="global.html#factorySpreadGraph">factorySpreadGraph</a></li></ul> </nav> <div id="main"> <h1 class="page-title">QueueSpreading</h1> <section> <header> <h2> QueueSpreading </h2> <div class="class-description"><p>Class with methods for easy subscription to spreading on graph events.</p></div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="QueueSpreading"><span class="type-signature"></span>new QueueSpreading<span class="signature">(graphSpreading)</span><span class="type-signature"></span></h4> <div class="description"> <p><code>import { QueueSpreading } from 'ancient-graph-spreading';</code></p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>graphSpreading</code></td> <td class="type"> <span class="param-type"><a href="GraphSpreading.html">GraphSpreading</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line7">line 7</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="_getGraph"><span class="type-signature"></span>_getGraph<span class="signature">(linkId)</span><span class="type-signature"> &rarr; {Graph}</span></h4> <div class="description"> <p>Should return graph instance by link id from process field.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>linkId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line26">line 26</a> </li></ul></dd> </dl> <h5>Throws:</h5> <dl> <dt> <div class="param-desc"> <p>If graph is not founded</p> </div> </dt> <dd></dd> <dt> <dl> <dt> Type </dt> <dd> <span class="param-type">Error</span> </dd> </dl> </dt> <dd></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>graph</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Graph</span> </dd> </dl> <h4 class="name" id="removeFromLaunched"><span class="type-signature"></span>removeFromLaunched<span class="signature">(launchedGraph, launchedLinkId, launchedToRemove)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to end of method triggered from launched or process link. If there are no other processes spreading links performed for the start, remove launched token.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>launchedGraph</code></td> <td class="type"> <span class="param-type">ExistedGraph</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>launchedLinkId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>launchedToRemove</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line35">line 35</a> </li></ul></dd> </dl> <h4 class="name" id="spreadByPath"><span class="type-signature"></span>spreadByPath<span class="signature">(pathGraph, pathLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to insert a new path and reacts to update launched remove unspread, but spread still exists. This method triggers the first step of the second spread queue. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pathGraph</code></td> <td class="type"> <span class="param-type"><a href="PathGraph.html">PathGraph</a></span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>pathLink</code></td> <td class="type"> <span class="param-type">PathLink</span> </td> <td class="attributes"> </td> <td class="description last"> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>launched</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last"><p>['spread']</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line62">line 62</a> </li></ul></dd> </dl> <h4 class="name" id="spreadBySpread"><span class="type-signature"></span>spreadBySpread<span class="signature">(spreadLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to insert new spread link. Link can be inserted with field process as step in queue or with field launched as start of queue. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>spreadLink</code></td> <td class="type"> <span class="param-type">SpreadLink</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line92">line 92</a> </li></ul></dd> </dl> <h4 class="name" id="spreadBySpreader"><span class="type-signature"></span>spreadBySpreader<span class="signature">(spreaderGraph, spreaderLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to insert a new spreader and reacts to update launched remove unspread, but spread still exists. This method triggers the first step of the second spread queue. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>spreaderGraph</code></td> <td class="type"> <span class="param-type"><a href="SpreaderGraph.html">SpreaderGraph</a></span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>spreaderLink</code></td> <td class="type"> <span class="param-type">SpreaderLink</span> </td> <td class="attributes"> </td> <td class="description last"> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>launched</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last"><p>['spread']</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line156">line 156</a> </li></ul></dd> </dl> <h4 class="name" id="unspreadByPath"><span class="type-signature"></span>unspreadByPath<span class="signature">(pathGraph, pathLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to remove path and reacts to update source or target in path. Then it launched two queues, unspread and spread. This method triggers the first step of the first unspread queue. After removal of unspread from launched from path, you need to start the second queue with method spreadByPath. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pathGraph</code></td> <td class="type"> <span class="param-type"><a href="PathGraph.html">PathGraph</a></span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>pathLink</code></td> <td class="type"> <span class="param-type">PathLink</span> </td> <td class="attributes"> </td> <td class="description last"> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>launched</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last"><p>['unspread', 'spread']</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line78">line 78</a> </li></ul></dd> </dl> <h4 class="name" id="unspreadBySpread"><span class="type-signature"></span>unspreadBySpread<span class="signature">(spreadLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to remove spread link. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>spreadLink</code></td> <td class="type"> <span class="param-type">SpreadLink</span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line122">line 122</a> </li></ul></dd> </dl> <h4 class="name" id="unspreadBySpreader"><span class="type-signature"></span>unspreadBySpreader<span class="signature">(spreaderGraph, spreaderLink, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Reacts to remove spreader link and reacts to update source or target in spreader. Then it launched two queues, unspread and spread. This method triggers the first step of the first unspread queue. After removal of unspread from launched from spreader, you need to start the second queue with method spreadBySpreader. If passed callback, then not be called removeFromLaunched.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>spreaderGraph</code></td> <td class="type"> <span class="param-type"><a href="SpreaderGraph.html">SpreaderGraph</a></span> </td> <td class="attributes"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>spreaderLink</code></td> <td class="type"> <span class="param-type">SpreaderLink</span> </td> <td class="attributes"> </td> <td class="description last"> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>launched</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last"><p>['unspread', 'spread']</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line176">line 176</a> </li></ul></dd> </dl> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Dec 04 2016 20:09:10 GMT+0000 (UTC) using the Minami theme. </footer> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> </body> </html>