This commit is contained in:
tamat
2018-03-01 20:08:42 +01:00
parent 2e16b6560a
commit 440eef2cba
15 changed files with 4255 additions and 9308 deletions

File diff suppressed because it is too large Load Diff

6949
build/litegraph.min.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
YUI.add("yuidoc-meta", function(Y) {
Y.YUIDoc = { meta: {
"classes": [
"ContextMenu",
"LGraph",
"LGraphCanvas",
"LGraphNode",

View File

@@ -38,6 +38,7 @@
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/ContextMenu.html">ContextMenu</a></li>
<li><a href="../classes/LGraph.html">LGraph</a></li>
<li><a href="../classes/LGraphCanvas.html">LGraphCanvas</a></li>
<li><a href="../classes/LGraphNode.html">LGraphNode</a></li>
@@ -84,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l274"><code>..&#x2F;src&#x2F;litegraph.js:274</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l304"><code>..&#x2F;src&#x2F;litegraph.js:304</code></a>
</div>
@@ -113,7 +114,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l274"><code>..&#x2F;src&#x2F;litegraph.js:274</code></a>
<a href="../files/.._src_litegraph.js.html#l304"><code>..&#x2F;src&#x2F;litegraph.js:304</code></a>
</p>
@@ -268,7 +269,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l660"><code>..&#x2F;src&#x2F;litegraph.js:660</code></a>
<a href="../files/.._src_litegraph.js.html#l724"><code>..&#x2F;src&#x2F;litegraph.js:724</code></a>
</p>
@@ -322,7 +323,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l343"><code>..&#x2F;src&#x2F;litegraph.js:343</code></a>
<a href="../files/.._src_litegraph.js.html#l377"><code>..&#x2F;src&#x2F;litegraph.js:377</code></a>
</p>
@@ -369,7 +370,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l298"><code>..&#x2F;src&#x2F;litegraph.js:298</code></a>
<a href="../files/.._src_litegraph.js.html#l328"><code>..&#x2F;src&#x2F;litegraph.js:328</code></a>
</p>
@@ -406,7 +407,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1154"><code>..&#x2F;src&#x2F;litegraph.js:1154</code></a>
<a href="../files/.._src_litegraph.js.html#l1218"><code>..&#x2F;src&#x2F;litegraph.js:1218</code></a>
</p>
@@ -460,7 +461,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l362"><code>..&#x2F;src&#x2F;litegraph.js:362</code></a>
<a href="../files/.._src_litegraph.js.html#l396"><code>..&#x2F;src&#x2F;litegraph.js:396</code></a>
</p>
@@ -516,7 +517,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l790"><code>..&#x2F;src&#x2F;litegraph.js:790</code></a>
<a href="../files/.._src_litegraph.js.html#l857"><code>..&#x2F;src&#x2F;litegraph.js:857</code></a>
</p>
@@ -582,7 +583,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l823"><code>..&#x2F;src&#x2F;litegraph.js:823</code></a>
<a href="../files/.._src_litegraph.js.html#l890"><code>..&#x2F;src&#x2F;litegraph.js:890</code></a>
</p>
@@ -648,7 +649,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l806"><code>..&#x2F;src&#x2F;litegraph.js:806</code></a>
<a href="../files/.._src_litegraph.js.html#l873"><code>..&#x2F;src&#x2F;litegraph.js:873</code></a>
</p>
@@ -708,7 +709,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l605"><code>..&#x2F;src&#x2F;litegraph.js:605</code></a>
<a href="../files/.._src_litegraph.js.html#l669"><code>..&#x2F;src&#x2F;litegraph.js:669</code></a>
</p>
@@ -752,7 +753,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l594"><code>..&#x2F;src&#x2F;litegraph.js:594</code></a>
<a href="../files/.._src_litegraph.js.html#l658"><code>..&#x2F;src&#x2F;litegraph.js:658</code></a>
</p>
@@ -798,7 +799,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l778"><code>..&#x2F;src&#x2F;litegraph.js:778</code></a>
<a href="../files/.._src_litegraph.js.html#l844"><code>..&#x2F;src&#x2F;litegraph.js:844</code></a>
</p>
@@ -816,7 +817,7 @@ if the nodes are using graphical actions</p>
<ul class="params-list">
<li class="param">
<code class="param-name">id</code>
<span class="type">String</span>
<span class="type">Number</span>
<div class="param-description">
@@ -860,7 +861,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l839"><code>..&#x2F;src&#x2F;litegraph.js:839</code></a>
<a href="../files/.._src_litegraph.js.html#l906"><code>..&#x2F;src&#x2F;litegraph.js:906</code></a>
</p>
@@ -942,7 +943,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l583"><code>..&#x2F;src&#x2F;litegraph.js:583</code></a>
<a href="../files/.._src_litegraph.js.html#l647"><code>..&#x2F;src&#x2F;litegraph.js:647</code></a>
</p>
@@ -982,7 +983,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1081"><code>..&#x2F;src&#x2F;litegraph.js:1081</code></a>
<a href="../files/.._src_litegraph.js.html#l1148"><code>..&#x2F;src&#x2F;litegraph.js:1148</code></a>
</p>
@@ -1019,7 +1020,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l709"><code>..&#x2F;src&#x2F;litegraph.js:709</code></a>
<a href="../files/.._src_litegraph.js.html#l775"><code>..&#x2F;src&#x2F;litegraph.js:775</code></a>
</p>
@@ -1073,7 +1074,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l429"><code>..&#x2F;src&#x2F;litegraph.js:429</code></a>
<a href="../files/.._src_litegraph.js.html#l464"><code>..&#x2F;src&#x2F;litegraph.js:464</code></a>
</p>
@@ -1130,7 +1131,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l617"><code>..&#x2F;src&#x2F;litegraph.js:617</code></a>
<a href="../files/.._src_litegraph.js.html#l681"><code>..&#x2F;src&#x2F;litegraph.js:681</code></a>
</p>
@@ -1192,7 +1193,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1118"><code>..&#x2F;src&#x2F;litegraph.js:1118</code></a>
<a href="../files/.._src_litegraph.js.html#l1185"><code>..&#x2F;src&#x2F;litegraph.js:1185</code></a>
</p>
@@ -1241,7 +1242,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1026"><code>..&#x2F;src&#x2F;litegraph.js:1026</code></a>
<a href="../files/.._src_litegraph.js.html#l1093"><code>..&#x2F;src&#x2F;litegraph.js:1093</code></a>
</p>
@@ -1310,7 +1311,7 @@ can be easily accesed from the outside of the graph</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1041"><code>..&#x2F;src&#x2F;litegraph.js:1041</code></a>
<a href="../files/.._src_litegraph.js.html#l1108"><code>..&#x2F;src&#x2F;litegraph.js:1108</code></a>
</p>
@@ -1373,7 +1374,7 @@ can be easily accesed from the outside of the graph</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l380"><code>..&#x2F;src&#x2F;litegraph.js:380</code></a>
<a href="../files/.._src_litegraph.js.html#l414"><code>..&#x2F;src&#x2F;litegraph.js:414</code></a>
</p>
@@ -1421,7 +1422,7 @@ can be easily accesed from the outside of the graph</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l407"><code>..&#x2F;src&#x2F;litegraph.js:407</code></a>
<a href="../files/.._src_litegraph.js.html#l442"><code>..&#x2F;src&#x2F;litegraph.js:442</code></a>
</p>
@@ -1452,7 +1453,7 @@ can be easily accesed from the outside of the graph</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l485"><code>..&#x2F;src&#x2F;litegraph.js:485</code></a>
<a href="../files/.._src_litegraph.js.html#l543"><code>..&#x2F;src&#x2F;litegraph.js:543</code></a>
</p>

View File

@@ -38,6 +38,7 @@
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/ContextMenu.html">ContextMenu</a></li>
<li><a href="../classes/LGraph.html">LGraph</a></li>
<li><a href="../classes/LGraphCanvas.html">LGraphCanvas</a></li>
<li><a href="../classes/LGraphNode.html">LGraphNode</a></li>
@@ -84,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l2819"><code>..&#x2F;src&#x2F;litegraph.js:2819</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l3043"><code>..&#x2F;src&#x2F;litegraph.js:3043</code></a>
</div>
@@ -125,7 +126,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2819"><code>..&#x2F;src&#x2F;litegraph.js:2819</code></a>
<a href="../files/.._src_litegraph.js.html#l3043"><code>..&#x2F;src&#x2F;litegraph.js:3043</code></a>
</p>
@@ -146,7 +147,7 @@
<div class="param-description">
<p>the canvas where you want to render (it accepts a selector in string format or the canvas itself)</p>
<p>the canvas where you want to render (it accepts a selector in string format or the canvas element itself)</p>
</div>
@@ -253,7 +254,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2481"><code>..&#x2F;src&#x2F;litegraph.js:2481</code></a>
<a href="../files/.._src_litegraph.js.html#l2703"><code>..&#x2F;src&#x2F;litegraph.js:2703</code></a>
</p>
@@ -290,7 +291,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2574"><code>..&#x2F;src&#x2F;litegraph.js:2574</code></a>
<a href="../files/.._src_litegraph.js.html#l2796"><code>..&#x2F;src&#x2F;litegraph.js:2796</code></a>
</p>
@@ -341,7 +342,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2835"><code>..&#x2F;src&#x2F;litegraph.js:2835</code></a>
<a href="../files/.._src_litegraph.js.html#l3059"><code>..&#x2F;src&#x2F;litegraph.js:3059</code></a>
</p>
@@ -387,7 +388,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2547"><code>..&#x2F;src&#x2F;litegraph.js:2547</code></a>
<a href="../files/.._src_litegraph.js.html#l2769"><code>..&#x2F;src&#x2F;litegraph.js:2769</code></a>
</p>
@@ -440,7 +441,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2589"><code>..&#x2F;src&#x2F;litegraph.js:2589</code></a>
<a href="../files/.._src_litegraph.js.html#l2811"><code>..&#x2F;src&#x2F;litegraph.js:2811</code></a>
</p>
@@ -462,7 +463,7 @@
<div class="param-description">
<p>a canvas</p>
<p>a canvas (also accepts the ID of the element (not a selector)</p>
</div>
@@ -494,7 +495,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2516"><code>..&#x2F;src&#x2F;litegraph.js:2516</code></a>
<a href="../files/.._src_litegraph.js.html#l2738"><code>..&#x2F;src&#x2F;litegraph.js:2738</code></a>
</p>
@@ -541,7 +542,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2849"><code>..&#x2F;src&#x2F;litegraph.js:2849</code></a>
<a href="../files/.._src_litegraph.js.html#l3073"><code>..&#x2F;src&#x2F;litegraph.js:3073</code></a>
</p>
@@ -572,7 +573,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2872"><code>..&#x2F;src&#x2F;litegraph.js:2872</code></a>
<a href="../files/.._src_litegraph.js.html#l3097"><code>..&#x2F;src&#x2F;litegraph.js:3097</code></a>
</p>

View File

@@ -38,6 +38,7 @@
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/ContextMenu.html">ContextMenu</a></li>
<li><a href="../classes/LGraph.html">LGraph</a></li>
<li><a href="../classes/LGraphCanvas.html">LGraphCanvas</a></li>
<li><a href="../classes/LGraphNode.html">LGraphNode</a></li>
@@ -84,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l1244"><code>..&#x2F;src&#x2F;litegraph.js:1244</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l1349"><code>..&#x2F;src&#x2F;litegraph.js:1349</code></a>
</div>
@@ -187,6 +188,10 @@
<li class="index-item method">
<a href="#method_getInputNode">getInputNode</a>
</li>
<li class="index-item method">
<a href="#method_getOutputData">getOutputData</a>
</li>
<li class="index-item method">
<a href="#method_getOutputInfo">getOutputInfo</a>
@@ -244,6 +249,10 @@
<a href="#method_trigger">trigger</a>
</li>
<li class="index-item method">
<a href="#method_triggerSlot">triggerSlot</a>
</li>
</ul>
</div>
@@ -284,7 +293,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1811"><code>..&#x2F;src&#x2F;litegraph.js:1811</code></a>
<a href="../files/.._src_litegraph.js.html#l2021"><code>..&#x2F;src&#x2F;litegraph.js:2021</code></a>
</p>
@@ -376,7 +385,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1748"><code>..&#x2F;src&#x2F;litegraph.js:1748</code></a>
<a href="../files/.._src_litegraph.js.html#l1958"><code>..&#x2F;src&#x2F;litegraph.js:1958</code></a>
</p>
@@ -451,7 +460,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1772"><code>..&#x2F;src&#x2F;litegraph.js:1772</code></a>
<a href="../files/.._src_litegraph.js.html#l1982"><code>..&#x2F;src&#x2F;litegraph.js:1982</code></a>
</p>
@@ -511,7 +520,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1686"><code>..&#x2F;src&#x2F;litegraph.js:1686</code></a>
<a href="../files/.._src_litegraph.js.html#l1896"><code>..&#x2F;src&#x2F;litegraph.js:1896</code></a>
</p>
@@ -586,7 +595,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1709"><code>..&#x2F;src&#x2F;litegraph.js:1709</code></a>
<a href="../files/.._src_litegraph.js.html#l1919"><code>..&#x2F;src&#x2F;litegraph.js:1919</code></a>
</p>
@@ -649,7 +658,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1660"><code>..&#x2F;src&#x2F;litegraph.js:1660</code></a>
<a href="../files/.._src_litegraph.js.html#l1870"><code>..&#x2F;src&#x2F;litegraph.js:1870</code></a>
</p>
@@ -728,7 +737,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2380"><code>..&#x2F;src&#x2F;litegraph.js:2380</code></a>
<a href="../files/.._src_litegraph.js.html#l2600"><code>..&#x2F;src&#x2F;litegraph.js:2600</code></a>
</p>
@@ -768,7 +777,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1832"><code>..&#x2F;src&#x2F;litegraph.js:1832</code></a>
<a href="../files/.._src_litegraph.js.html#l2042"><code>..&#x2F;src&#x2F;litegraph.js:2042</code></a>
</p>
@@ -824,7 +833,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1297"><code>..&#x2F;src&#x2F;litegraph.js:1297</code></a>
<a href="../files/.._src_litegraph.js.html#l1402"><code>..&#x2F;src&#x2F;litegraph.js:1402</code></a>
</p>
@@ -870,7 +879,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1978"><code>..&#x2F;src&#x2F;litegraph.js:1978</code></a>
<a href="../files/.._src_litegraph.js.html#l2189"><code>..&#x2F;src&#x2F;litegraph.js:2189</code></a>
</p>
@@ -958,7 +967,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2178"><code>..&#x2F;src&#x2F;litegraph.js:2178</code></a>
<a href="../files/.._src_litegraph.js.html#l2397"><code>..&#x2F;src&#x2F;litegraph.js:2397</code></a>
</p>
@@ -1027,7 +1036,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2095"><code>..&#x2F;src&#x2F;litegraph.js:2095</code></a>
<a href="../files/.._src_litegraph.js.html#l2307"><code>..&#x2F;src&#x2F;litegraph.js:2307</code></a>
</p>
@@ -1104,7 +1113,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1948"><code>..&#x2F;src&#x2F;litegraph.js:1948</code></a>
<a href="../files/.._src_litegraph.js.html#l2158"><code>..&#x2F;src&#x2F;litegraph.js:2158</code></a>
</p>
@@ -1170,7 +1179,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1963"><code>..&#x2F;src&#x2F;litegraph.js:1963</code></a>
<a href="../files/.._src_litegraph.js.html#l2174"><code>..&#x2F;src&#x2F;litegraph.js:2174</code></a>
</p>
@@ -1230,7 +1239,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1883"><code>..&#x2F;src&#x2F;litegraph.js:1883</code></a>
<a href="../files/.._src_litegraph.js.html#l2093"><code>..&#x2F;src&#x2F;litegraph.js:2093</code></a>
</p>
@@ -1282,7 +1291,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2246"><code>..&#x2F;src&#x2F;litegraph.js:2246</code></a>
<a href="../files/.._src_litegraph.js.html#l2466"><code>..&#x2F;src&#x2F;litegraph.js:2466</code></a>
</p>
@@ -1343,6 +1352,9 @@
<li class="arg">
<code>slot</code>
</li>
<li class="arg">
<code>force_update</code>
</li>
</ul><span class="paren">)</span>
</div>
@@ -1359,7 +1371,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1482"><code>..&#x2F;src&#x2F;litegraph.js:1482</code></a>
<a href="../files/.._src_litegraph.js.html#l1635"><code>..&#x2F;src&#x2F;litegraph.js:1635</code></a>
</p>
@@ -1385,6 +1397,17 @@
</div>
</li>
<li class="param">
<code class="param-name">force_update</code>
<span class="type">Boolean</span>
<div class="param-description">
<p>if set to true it will force the connected node of this slot to output data into this link</p>
</div>
</li>
</ul>
</div>
@@ -1424,7 +1447,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1527"><code>..&#x2F;src&#x2F;litegraph.js:1527</code></a>
<a href="../files/.._src_litegraph.js.html#l1684"><code>..&#x2F;src&#x2F;litegraph.js:1684</code></a>
</p>
@@ -1458,7 +1481,7 @@
<div class="returns-description">
<span class="type">Object</span>:
<p>object or null</p>
<p>object or null { link: id, name: string, type: string or 0 }</p>
</div>
</div>
@@ -1489,7 +1512,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1542"><code>..&#x2F;src&#x2F;litegraph.js:1542</code></a>
<a href="../files/.._src_litegraph.js.html#l1699"><code>..&#x2F;src&#x2F;litegraph.js:1699</code></a>
</p>
@@ -1529,6 +1552,71 @@
</div>
</div>
<div id="method_getOutputData" class="method item">
<h3 class="name"><code>getOutputData</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>slot</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="returns-inline">
<span class="type">Object</span>
</span>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1720"><code>..&#x2F;src&#x2F;litegraph.js:1720</code></a>
</p>
</div>
<div class="description">
<p>tells you the last output data that went in that slot</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">slot</code>
<span class="type">Number</span>
<div class="param-description">
</div>
</li>
</ul>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
<span class="type">Object</span>:
<p>object or null</p>
</div>
</div>
</div>
<div id="method_getOutputInfo" class="method item">
<h3 class="name"><code>getOutputInfo</code></h3>
@@ -1554,7 +1642,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1561"><code>..&#x2F;src&#x2F;litegraph.js:1561</code></a>
<a href="../files/.._src_litegraph.js.html#l1738"><code>..&#x2F;src&#x2F;litegraph.js:1738</code></a>
</p>
@@ -1588,7 +1676,7 @@
<div class="returns-description">
<span class="type">Object</span>:
<p>object or null</p>
<p>object or null { name: string, type: string, links: [ ids of links in number ] }</p>
</div>
</div>
@@ -1619,7 +1707,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1590"><code>..&#x2F;src&#x2F;litegraph.js:1590</code></a>
<a href="../files/.._src_litegraph.js.html#l1767"><code>..&#x2F;src&#x2F;litegraph.js:1767</code></a>
</p>
@@ -1685,7 +1773,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1917"><code>..&#x2F;src&#x2F;litegraph.js:1917</code></a>
<a href="../files/.._src_litegraph.js.html#l2127"><code>..&#x2F;src&#x2F;litegraph.js:2127</code></a>
</p>
@@ -1751,7 +1839,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1448"><code>..&#x2F;src&#x2F;litegraph.js:1448</code></a>
<a href="../files/.._src_litegraph.js.html#l1586"><code>..&#x2F;src&#x2F;litegraph.js:1586</code></a>
</p>
@@ -1791,7 +1879,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1514"><code>..&#x2F;src&#x2F;litegraph.js:1514</code></a>
<a href="../files/.._src_litegraph.js.html#l1671"><code>..&#x2F;src&#x2F;litegraph.js:1671</code></a>
</p>
@@ -1854,7 +1942,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1577"><code>..&#x2F;src&#x2F;litegraph.js:1577</code></a>
<a href="../files/.._src_litegraph.js.html#l1754"><code>..&#x2F;src&#x2F;litegraph.js:1754</code></a>
</p>
@@ -1920,7 +2008,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1893"><code>..&#x2F;src&#x2F;litegraph.js:1893</code></a>
<a href="../files/.._src_litegraph.js.html#l2103"><code>..&#x2F;src&#x2F;litegraph.js:2103</code></a>
</p>
@@ -1984,7 +2072,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2393"><code>..&#x2F;src&#x2F;litegraph.js:2393</code></a>
<a href="../files/.._src_litegraph.js.html#l2613"><code>..&#x2F;src&#x2F;litegraph.js:2613</code></a>
</p>
@@ -2021,7 +2109,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1797"><code>..&#x2F;src&#x2F;litegraph.js:1797</code></a>
<a href="../files/.._src_litegraph.js.html#l2007"><code>..&#x2F;src&#x2F;litegraph.js:2007</code></a>
</p>
@@ -2074,7 +2162,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1734"><code>..&#x2F;src&#x2F;litegraph.js:1734</code></a>
<a href="../files/.._src_litegraph.js.html#l1944"><code>..&#x2F;src&#x2F;litegraph.js:1944</code></a>
</p>
@@ -2121,7 +2209,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1366"><code>..&#x2F;src&#x2F;litegraph.js:1366</code></a>
<a href="../files/.._src_litegraph.js.html#l1498"><code>..&#x2F;src&#x2F;litegraph.js:1498</code></a>
</p>
@@ -2161,7 +2249,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1461"><code>..&#x2F;src&#x2F;litegraph.js:1461</code></a>
<a href="../files/.._src_litegraph.js.html#l1599"><code>..&#x2F;src&#x2F;litegraph.js:1599</code></a>
</p>
@@ -2218,7 +2306,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1436"><code>..&#x2F;src&#x2F;litegraph.js:1436</code></a>
<a href="../files/.._src_litegraph.js.html#l1574"><code>..&#x2F;src&#x2F;litegraph.js:1574</code></a>
</p>
@@ -2258,7 +2346,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1610"><code>..&#x2F;src&#x2F;litegraph.js:1610</code></a>
<a href="../files/.._src_litegraph.js.html#l1800"><code>..&#x2F;src&#x2F;litegraph.js:1800</code></a>
</p>
@@ -2300,6 +2388,73 @@
</div>
<div id="method_triggerSlot" class="method item">
<h3 class="name"><code>triggerSlot</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>slot</code>
</li>
<li class="arg">
<code>param</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1823"><code>..&#x2F;src&#x2F;litegraph.js:1823</code></a>
</p>
</div>
<div class="description">
<p>Triggers an slot event in this node</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">slot</code>
<span class="type">Number</span>
<div class="param-description">
<p>the index of the output slot</p>
</div>
</li>
<li class="param">
<code class="param-name">param</code>
<span class="type"></span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
</div>

View File

@@ -38,6 +38,7 @@
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/ContextMenu.html">ContextMenu</a></li>
<li><a href="../classes/LGraph.html">LGraph</a></li>
<li><a href="../classes/LGraphCanvas.html">LGraphCanvas</a></li>
<li><a href="../classes/LGraphNode.html">LGraphNode</a></li>
@@ -84,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l6"><code>..&#x2F;src&#x2F;litegraph.js:6</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l18"><code>..&#x2F;src&#x2F;litegraph.js:18</code></a>
</div>
@@ -113,7 +114,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l6"><code>..&#x2F;src&#x2F;litegraph.js:6</code></a>
<a href="../files/.._src_litegraph.js.html#l18"><code>..&#x2F;src&#x2F;litegraph.js:18</code></a>
</p>
@@ -200,7 +201,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l86"><code>..&#x2F;src&#x2F;litegraph.js:86</code></a>
<a href="../files/.._src_litegraph.js.html#l111"><code>..&#x2F;src&#x2F;litegraph.js:111</code></a>
</p>
@@ -260,7 +261,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l99"><code>..&#x2F;src&#x2F;litegraph.js:99</code></a>
<a href="../files/.._src_litegraph.js.html#l129"><code>..&#x2F;src&#x2F;litegraph.js:129</code></a>
</p>
@@ -339,7 +340,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l142"><code>..&#x2F;src&#x2F;litegraph.js:142</code></a>
<a href="../files/.._src_litegraph.js.html#l172"><code>..&#x2F;src&#x2F;litegraph.js:172</code></a>
</p>
@@ -405,7 +406,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l155"><code>..&#x2F;src&#x2F;litegraph.js:155</code></a>
<a href="../files/.._src_litegraph.js.html#l185"><code>..&#x2F;src&#x2F;litegraph.js:185</code></a>
</p>
@@ -465,7 +466,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l177"><code>..&#x2F;src&#x2F;litegraph.js:177</code></a>
<a href="../files/.._src_litegraph.js.html#l207"><code>..&#x2F;src&#x2F;litegraph.js:207</code></a>
</p>
@@ -514,7 +515,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l49"><code>..&#x2F;src&#x2F;litegraph.js:49</code></a>
<a href="../files/.._src_litegraph.js.html#l64"><code>..&#x2F;src&#x2F;litegraph.js:64</code></a>
</p>

View File

@@ -8,7 +8,8 @@
"LiteGraph": 1,
"LGraph": 1,
"LGraphNode": 1,
"LGraphCanvas": 1
"LGraphCanvas": 1,
"ContextMenu": 1
},
"fors": {},
"namespaces": {}
@@ -25,7 +26,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 6,
"line": 18,
"description": "The Global Scope. It contains all the registered node classes.",
"is_constructor": 1
},
@@ -38,7 +39,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 274,
"line": 304,
"description": "LGraph is the class that contain a full graph. We instantiate one and add nodes to it, and then we can run the execution loop.",
"is_constructor": 1
},
@@ -51,7 +52,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 1244,
"line": 1349,
"description": "Base Class for all the node type classes",
"params": [
{
@@ -70,13 +71,13 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 2819,
"line": 3043,
"description": "marks as dirty the canvas, this way it will be rendered again",
"is_constructor": 1,
"params": [
{
"name": "canvas",
"description": "the canvas where you want to render (it accepts a selector in string format or the canvas itself)",
"description": "the canvas where you want to render (it accepts a selector in string format or the canvas element itself)",
"type": "HTMLCanvas"
},
{
@@ -91,13 +92,38 @@
}
],
"itemtype": "method"
},
"ContextMenu": {
"name": "ContextMenu",
"shortname": "ContextMenu",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 5676,
"description": "ContextMenu from LiteGUI",
"is_constructor": 1,
"params": [
{
"name": "values",
"description": "(allows object { title: \"Nice text\", callback: function ... })",
"type": "Array"
},
{
"name": "options",
"description": "[optional] Some options:\\\n- title: title to show on top of the menu\n- callback: function to call when an option is clicked, it receives the item information\n- ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback\n- event: you can pass a MouseEvent, this way the ContextMenu appears in that position",
"type": "Object"
}
]
}
},
"elements": {},
"classitems": [
{
"file": "../src/litegraph.js",
"line": 49,
"line": 64,
"description": "Register a node class so it can be listed when the user wants to create a new one",
"itemtype": "method",
"name": "registerNodeType",
@@ -117,7 +143,7 @@
},
{
"file": "../src/litegraph.js",
"line": 86,
"line": 111,
"description": "Adds this method to all nodetypes, existing and to be created\n(You can add it to LGraphNode.prototype but then existing node types wont have it)",
"itemtype": "method",
"name": "addNodeMethod",
@@ -132,7 +158,7 @@
},
{
"file": "../src/litegraph.js",
"line": 99,
"line": 129,
"description": "Create a node of a given type with a name. The node is not attached to any graph yet.",
"itemtype": "method",
"name": "createNode",
@@ -157,7 +183,7 @@
},
{
"file": "../src/litegraph.js",
"line": 142,
"line": 172,
"description": "Returns a registered node type with a given name",
"itemtype": "method",
"name": "getNodeType",
@@ -176,7 +202,7 @@
},
{
"file": "../src/litegraph.js",
"line": 155,
"line": 185,
"description": "Returns a list of node types matching one category",
"itemtype": "method",
"name": "getNodeType",
@@ -195,7 +221,7 @@
},
{
"file": "../src/litegraph.js",
"line": 177,
"line": 207,
"description": "Returns a list with all the node type categories",
"itemtype": "method",
"name": "getNodeTypesCategories",
@@ -207,7 +233,7 @@
},
{
"file": "../src/litegraph.js",
"line": 298,
"line": 328,
"description": "Removes all nodes from this graph",
"itemtype": "method",
"name": "clear",
@@ -215,7 +241,7 @@
},
{
"file": "../src/litegraph.js",
"line": 343,
"line": 377,
"description": "Attach Canvas to this graph",
"itemtype": "method",
"name": "attachCanvas",
@@ -230,7 +256,7 @@
},
{
"file": "../src/litegraph.js",
"line": 362,
"line": 396,
"description": "Detach Canvas from this graph",
"itemtype": "method",
"name": "detachCanvas",
@@ -245,7 +271,7 @@
},
{
"file": "../src/litegraph.js",
"line": 380,
"line": 414,
"description": "Starts running this graph every interval milliseconds.",
"itemtype": "method",
"name": "start",
@@ -260,7 +286,7 @@
},
{
"file": "../src/litegraph.js",
"line": 407,
"line": 442,
"description": "Stops the execution loop of the graph",
"itemtype": "method",
"name": "stop execution",
@@ -268,7 +294,7 @@
},
{
"file": "../src/litegraph.js",
"line": 429,
"line": 464,
"description": "Run N steps (cycles) of the graph",
"itemtype": "method",
"name": "runStep",
@@ -283,7 +309,7 @@
},
{
"file": "../src/litegraph.js",
"line": 485,
"line": 543,
"description": "Updates the graph execution order according to relevance of the nodes (nodes with only outputs have more relevance than\nnodes with only inputs.",
"itemtype": "method",
"name": "updateExecutionOrder",
@@ -291,7 +317,7 @@
},
{
"file": "../src/litegraph.js",
"line": 583,
"line": 647,
"description": "Returns the amount of time the graph has been running in milliseconds",
"itemtype": "method",
"name": "getTime",
@@ -303,7 +329,7 @@
},
{
"file": "../src/litegraph.js",
"line": 594,
"line": 658,
"description": "Returns the amount of time accumulated using the fixedtime_lapse var. This is used in context where the time increments should be constant",
"itemtype": "method",
"name": "getFixedTime",
@@ -315,7 +341,7 @@
},
{
"file": "../src/litegraph.js",
"line": 605,
"line": 669,
"description": "Returns the amount of time it took to compute the latest iteration. Take into account that this number could be not correct\nif the nodes are using graphical actions",
"itemtype": "method",
"name": "getElapsedTime",
@@ -327,7 +353,7 @@
},
{
"file": "../src/litegraph.js",
"line": 617,
"line": 681,
"description": "Sends an event to all the nodes, useful to trigger stuff",
"itemtype": "method",
"name": "sendEventToAllNodes",
@@ -347,7 +373,7 @@
},
{
"file": "../src/litegraph.js",
"line": 660,
"line": 724,
"description": "Adds a new node instasnce to this graph",
"itemtype": "method",
"name": "add",
@@ -362,7 +388,7 @@
},
{
"file": "../src/litegraph.js",
"line": 709,
"line": 775,
"description": "Removes a node from the graph",
"itemtype": "method",
"name": "remove",
@@ -377,7 +403,7 @@
},
{
"file": "../src/litegraph.js",
"line": 778,
"line": 844,
"description": "Returns a node by its id.",
"itemtype": "method",
"name": "getNodeById",
@@ -385,14 +411,14 @@
{
"name": "id",
"description": "",
"type": "String"
"type": "Number"
}
],
"class": "LGraph"
},
{
"file": "../src/litegraph.js",
"line": 790,
"line": 857,
"description": "Returns a list of nodes that matches a class",
"itemtype": "method",
"name": "findNodesByClass",
@@ -411,7 +437,7 @@
},
{
"file": "../src/litegraph.js",
"line": 806,
"line": 873,
"description": "Returns a list of nodes that matches a type",
"itemtype": "method",
"name": "findNodesByType",
@@ -430,7 +456,7 @@
},
{
"file": "../src/litegraph.js",
"line": 823,
"line": 890,
"description": "Returns a list of nodes that matches a name",
"itemtype": "method",
"name": "findNodesByName",
@@ -449,7 +475,7 @@
},
{
"file": "../src/litegraph.js",
"line": 839,
"line": 906,
"description": "Returns the top-most node in this position of the canvas",
"itemtype": "method",
"name": "getNodeOnPos",
@@ -478,7 +504,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1026,
"line": 1093,
"description": "Assigns a value to all the nodes that matches this name. This is used to create global variables of the node that\ncan be easily accesed from the outside of the graph",
"itemtype": "method",
"name": "setInputData",
@@ -498,7 +524,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1041,
"line": 1108,
"description": "Returns the value of the first node with this name. This is used to access global variables of the graph from the outside",
"itemtype": "method",
"name": "setInputData",
@@ -517,7 +543,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1081,
"line": 1148,
"description": "returns if the graph is in live mode",
"itemtype": "method",
"name": "isLive",
@@ -525,7 +551,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1118,
"line": 1185,
"description": "Creates a Object containing all the info about this graph, it can be serialized",
"itemtype": "method",
"name": "serialize",
@@ -537,7 +563,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1154,
"line": 1218,
"description": "Configure a graph from a JSON string",
"itemtype": "method",
"name": "configure",
@@ -552,7 +578,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1297,
"line": 1402,
"description": "configure a node from an object containing the serialized info",
"itemtype": "method",
"name": "configure",
@@ -560,7 +586,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1366,
"line": 1498,
"description": "serialize the content",
"itemtype": "method",
"name": "serialize",
@@ -568,7 +594,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1436,
"line": 1574,
"description": "serialize and stringify",
"itemtype": "method",
"name": "toString",
@@ -576,7 +602,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1448,
"line": 1586,
"description": "get the title string",
"itemtype": "method",
"name": "getTitle",
@@ -584,7 +610,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1461,
"line": 1599,
"description": "sets the output data",
"itemtype": "method",
"name": "setOutputData",
@@ -604,7 +630,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1482,
"line": 1635,
"description": "retrieves the input data (data traveling through the connection) from one slot",
"itemtype": "method",
"name": "getInputData",
@@ -613,6 +639,11 @@
"name": "slot",
"description": "",
"type": "Number"
},
{
"name": "force_update",
"description": "if set to true it will force the connected node of this slot to output data into this link",
"type": "Boolean"
}
],
"return": {
@@ -623,7 +654,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1514,
"line": 1671,
"description": "tells you if there is a connection in one input slot",
"itemtype": "method",
"name": "isInputConnected",
@@ -642,7 +673,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1527,
"line": 1684,
"description": "tells you info about an input connection (which node, type, etc)",
"itemtype": "method",
"name": "getInputInfo",
@@ -654,14 +685,14 @@
}
],
"return": {
"description": "object or null",
"description": "object or null { link: id, name: string, type: string or 0 }",
"type": "Object"
},
"class": "LGraphNode"
},
{
"file": "../src/litegraph.js",
"line": 1542,
"line": 1699,
"description": "returns the node connected in the input slot",
"itemtype": "method",
"name": "getInputNode",
@@ -680,10 +711,10 @@
},
{
"file": "../src/litegraph.js",
"line": 1561,
"description": "tells you info about an output connection (which node, type, etc)",
"line": 1720,
"description": "tells you the last output data that went in that slot",
"itemtype": "method",
"name": "getOutputInfo",
"name": "getOutputData",
"params": [
{
"name": "slot",
@@ -699,7 +730,26 @@
},
{
"file": "../src/litegraph.js",
"line": 1577,
"line": 1738,
"description": "tells you info about an output connection (which node, type, etc)",
"itemtype": "method",
"name": "getOutputInfo",
"params": [
{
"name": "slot",
"description": "",
"type": "Number"
}
],
"return": {
"description": "object or null { name: string, type: string, links: [ ids of links in number ] }",
"type": "Object"
},
"class": "LGraphNode"
},
{
"file": "../src/litegraph.js",
"line": 1754,
"description": "tells you if there is a connection in one output slot",
"itemtype": "method",
"name": "isOutputConnected",
@@ -718,7 +768,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1590,
"line": 1767,
"description": "retrieves all the nodes connected to this output slot",
"itemtype": "method",
"name": "getOutputNodes",
@@ -737,7 +787,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1610,
"line": 1800,
"description": "Triggers an event in this node, this will trigger any output with the same name",
"itemtype": "method",
"name": "trigger",
@@ -757,7 +807,27 @@
},
{
"file": "../src/litegraph.js",
"line": 1660,
"line": 1823,
"description": "Triggers an slot event in this node",
"itemtype": "method",
"name": "triggerSlot",
"params": [
{
"name": "slot",
"description": "the index of the output slot",
"type": "Number"
},
{
"name": "param",
"description": "",
"type": "*"
}
],
"class": "LGraphNode"
},
{
"file": "../src/litegraph.js",
"line": 1870,
"description": "add a new property to this node",
"itemtype": "method",
"name": "addProperty",
@@ -787,7 +857,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1686,
"line": 1896,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutput",
@@ -812,7 +882,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1709,
"line": 1919,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutputs",
@@ -827,7 +897,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1734,
"line": 1944,
"description": "remove an existing output slot",
"itemtype": "method",
"name": "removeOutput",
@@ -842,7 +912,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1748,
"line": 1958,
"description": "add a new input slot to use in this node",
"itemtype": "method",
"name": "addInput",
@@ -867,7 +937,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1772,
"line": 1982,
"description": "add several new input slots in this node",
"itemtype": "method",
"name": "addInputs",
@@ -882,7 +952,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1797,
"line": 2007,
"description": "remove an existing input slot",
"itemtype": "method",
"name": "removeInput",
@@ -897,7 +967,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1811,
"line": 2021,
"description": "add an special connection to this node (used for special kinds of graphs)",
"itemtype": "method",
"name": "addConnection",
@@ -927,7 +997,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1832,
"line": 2042,
"description": "computes the size of a node according to its inputs and output slots",
"itemtype": "method",
"name": "computeSize",
@@ -946,7 +1016,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1883,
"line": 2093,
"description": "returns the bounding of the object, used for rendering purposes",
"itemtype": "method",
"name": "getBounding",
@@ -958,7 +1028,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1893,
"line": 2103,
"description": "checks if a point is inside the shape of a node",
"itemtype": "method",
"name": "isPointInsideNode",
@@ -982,7 +1052,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1917,
"line": 2127,
"description": "checks if a point is inside a node slot, and returns info about which slot",
"itemtype": "method",
"name": "getSlotInPosition",
@@ -1006,7 +1076,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1948,
"line": 2158,
"description": "returns the input slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findInputSlot",
@@ -1025,7 +1095,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1963,
"line": 2174,
"description": "returns the output slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findOutputSlot",
@@ -1044,7 +1114,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1978,
"line": 2189,
"description": "connect this node output to the input of another node",
"itemtype": "method",
"name": "connect",
@@ -1073,7 +1143,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2095,
"line": 2307,
"description": "disconnect one output to an specific node",
"itemtype": "method",
"name": "disconnectOutput",
@@ -1097,7 +1167,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2178,
"line": 2397,
"description": "disconnect one input",
"itemtype": "method",
"name": "disconnectInput",
@@ -1116,7 +1186,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2246,
"line": 2466,
"description": "returns the center of a connection point in canvas coords",
"itemtype": "method",
"name": "getConnectionPos",
@@ -1140,7 +1210,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2380,
"line": 2600,
"description": "Collapse the node to make it smaller on the canvas",
"itemtype": "method",
"name": "collapse",
@@ -1148,7 +1218,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2393,
"line": 2613,
"description": "Forces the node to do not move or realign on Z",
"itemtype": "method",
"name": "pin",
@@ -1156,7 +1226,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2481,
"line": 2703,
"description": "clears all the data inside",
"itemtype": "method",
"name": "clear",
@@ -1164,7 +1234,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2516,
"line": 2738,
"description": "assigns a graph, you can reasign graphs to the same canvas",
"itemtype": "method",
"name": "setGraph",
@@ -1179,7 +1249,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2547,
"line": 2769,
"description": "opens a graph contained inside a node in the current graph",
"itemtype": "method",
"name": "openSubgraph",
@@ -1194,7 +1264,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2574,
"line": 2796,
"description": "closes a subgraph contained inside a node",
"itemtype": "method",
"name": "closeSubgraph",
@@ -1209,14 +1279,14 @@
},
{
"file": "../src/litegraph.js",
"line": 2589,
"line": 2811,
"description": "assigns a canvas",
"itemtype": "method",
"name": "setCanvas",
"params": [
{
"name": "assigns",
"description": "a canvas",
"description": "a canvas (also accepts the ID of the element (not a selector)",
"type": "Canvas"
}
],
@@ -1224,7 +1294,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2835,
"line": 3059,
"description": "Used to attach the canvas in a popup",
"itemtype": "method",
"name": "getCanvasWindow",
@@ -1236,7 +1306,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2849,
"line": 3073,
"description": "starts rendering the content of the canvas when needed",
"itemtype": "method",
"name": "startRendering",
@@ -1244,7 +1314,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2872,
"line": 3097,
"description": "stops rendering the content of the canvas (to save resources)",
"itemtype": "method",
"name": "stopRendering",

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,7 @@
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="./classes/ContextMenu.html">ContextMenu</a></li>
<li><a href="./classes/LGraph.html">LGraph</a></li>
<li><a href="./classes/LGraphCanvas.html">LGraphCanvas</a></li>
<li><a href="./classes/LGraphNode.html">LGraphNode</a></li>

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "litegraph.js",
"version": "0.3.0-1",
"version": "0.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -49,6 +49,7 @@ var LiteGraph = global.LiteGraph = {
ALWAYS: 0,
ON_EVENT: 1,
ON_TRIGGER: 1, //the same
NEVER: 2,
proxy: null, //used to redirect calls
@@ -279,7 +280,7 @@ var LiteGraph = global.LiteGraph = {
{
if( !type_a || //generic output
!type_b || //generic input
type_a == type_a || //same type (is valid for triggers)
type_a == type_b || //same type (is valid for triggers)
(type_a !== LiteGraph.EVENT && type_b !== LiteGraph.EVENT && type_a.toLowerCase() == type_b.toLowerCase()) ) //same type
return true;
return false;
@@ -1197,7 +1198,7 @@ LGraph.prototype.serialize = function()
for(var i in this.links) //links is an OBJECT
{
var link = this.links[i];
links.push([ link.id, link.origin_id, link.origin_slot, link.target_id, link.target_slot ]);
links.push([ link.id, link.origin_id, link.origin_slot, link.target_id, link.target_slot, link.type ]);
}
var data = {
@@ -1233,7 +1234,7 @@ LGraph.prototype.configure = function(data, keep_old)
for(var i = 0; i < data.links.length; ++i)
{
var link = data.links[i];
links[ link[0] ] = { id: link[0], origin_id: link[1], origin_slot: link[2], target_id: link[3], target_slot: link[4] };
links[ link[0] ] = { id: link[0], origin_id: link[1], origin_slot: link[2], target_id: link[3], target_slot: link[4], type: link[5] };
}
data.links = links;
}
@@ -1606,6 +1607,10 @@ LGraphNode.prototype.setOutputData = function(slot, data)
if(!this.outputs)
return;
//this maybe slow and a niche case
//if(slot && slot.constructor === String)
// slot = this.findOutputSlot(slot);
if(slot == -1 || slot >= this.outputs.length)
return;
@@ -1644,6 +1649,8 @@ LGraphNode.prototype.getInputData = function( slot, force_update )
var link_id = this.inputs[slot].link;
var link = this.graph.links[ link_id ];
if(!link) //bug: weird case but it happens sometimes
return null;
//used to extract data from the incomming connection
if(!force_update)
@@ -1806,36 +1813,56 @@ LGraphNode.prototype.trigger = function( action, param )
for(var i = 0; i < this.outputs.length; ++i)
{
var output = this.outputs[i];
if(output.type !== LiteGraph.EVENT || (action && output.name != action) )
var output = this.outputs[ slot ];
if(!output || output.type !== LiteGraph.EVENT || (action && output.name != action) )
continue;
this.triggerSlot( slot, param );
}
}
/**
* Triggers an slot event in this node
* @method triggerSlot
* @param {Number} slot the index of the output slot
* @param {*} param
*/
LGraphNode.prototype.triggerSlot = function( slot, param )
{
if( !this.outputs )
return;
var output = this.outputs[ slot ];
if( !output )
return;
var links = output.links;
if(!links || !links.length)
return;
if(this.graph)
this.graph._last_trigger_time = LiteGraph.getTime();
//for every link attached here
for(var k = 0; k < links.length; ++k)
{
var link_info = this.graph.links[ links[k] ];
if(!link_info) //not connected
continue;
var node = this.graph.getNodeById( link_info.target_id );
if(!node) //node not found?
continue;
var links = output.links;
if(!links || !links.length)
continue;
//used to mark events in graph
link_info._last_time = LiteGraph.getTime();
//for every link attached here
for(var k = 0; k < links.length; ++k)
var target_connection = node.inputs[ link_info.target_slot ];
if(node.onAction)
node.onAction( target_connection.name, param );
else if(node.mode === LiteGraph.ON_TRIGGER)
{
var link_info = this.graph.links[ links[k] ];
if(!link_info) //not connected
continue;
var node = this.graph.getNodeById( link_info.target_id );
if(!node) //node not found?
continue;
//used to mark events in graph
link_info._last_time = LiteGraph.getTime();
var target_connection = node.inputs[ link_info.target_slot ];
if(node.onAction)
node.onAction( target_connection.name, param );
else if(node.mode === LiteGraph.ON_TRIGGER)
{
if(node.onExecute)
node.onExecute(param);
}
if(node.onExecute)
node.onExecute(param);
}
}
}
@@ -2342,6 +2369,8 @@ LGraphNode.prototype.disconnectOutput = function( slot, target_node )
{
var link_id = output.links[i];
var link_info = this.graph.links[ link_id ];
if(!link_info) //bug: it happens sometimes
continue;
var target_node = this.graph.getNodeById( link_info.target_id );
var input = null;
@@ -2349,10 +2378,10 @@ LGraphNode.prototype.disconnectOutput = function( slot, target_node )
{
input = target_node.inputs[ link_info.target_slot ];
input.link = null; //remove other side link
if(target_node.onConnectionsChange)
target_node.onConnectionsChange( LiteGraph.INPUT, link_info.target_slot, false, link_info, input ); //link_info hasnt been modified so its ok
}
delete this.graph.links[ link_id ]; //remove the link from the links pool
if(target_node.onConnectionsChange)
target_node.onConnectionsChange( LiteGraph.INPUT, link_info.target_slot, false, link_info, input ); //link_info hasnt been modified so its ok
if(this.onConnectionsChange)
this.onConnectionsChange( LiteGraph.OUTPUT, slot, false, link_info, output );
}
@@ -3048,7 +3077,8 @@ LGraphCanvas.prototype.getCanvasWindow = function()
*/
LGraphCanvas.prototype.startRendering = function()
{
if(this.is_rendering) return; //already rendering
if(this.is_rendering)
return; //already rendering
this.is_rendering = true;
renderFrame.call(this);

View File

@@ -1,6 +1,104 @@
//event related nodes
(function(){
//Show value inside the debug console
function LogEvent()
{
this.size = [60,20];
this.addInput("event", LiteGraph.ACTION);
}
LogEvent.title = "Log Event";
LogEvent.desc = "Log event in console";
LogEvent.prototype.onAction = function( action, param )
{
console.log( action, param );
}
LiteGraph.registerNodeType("events/log", LogEvent );
//Filter events
function FilterEvent()
{
this.size = [60,20];
this.addInput("event", LiteGraph.ACTION);
this.addOutput("event", LiteGraph.EVENT);
this.properties = {
equal_to: "",
has_property:"",
property_equal_to: ""
};
}
FilterEvent.title = "Filter Event";
FilterEvent.desc = "Blocks events that do not match the filter";
FilterEvent.prototype.onAction = function( action, param )
{
if( param == null )
return;
if( this.properties.equal_to && this.properties.equal_to != param )
return;
if( this.properties.has_property )
{
var prop = param[ this.properties.has_property ];
if( prop == null )
return;
if( this.properties.property_equal_to && this.properties.property_equal_to != prop )
return;
}
this.triggerSlot(0,param);
}
LiteGraph.registerNodeType("events/filter", FilterEvent );
/*
//Filter events
function SetModeNode()
{
this.size = [60,20];
this.addInput("event", LiteGraph.ACTION);
this.addOutput("event", LiteGraph.EVENT);
this.properties = {
equal_to: "",
has_property:"",
property_equal_to: ""
};
}
SetModeNode.title = "Set Node Mode";
SetModeNode.desc = "Changes a node mode";
SetModeNode.prototype.onAction = function( action, param )
{
if( param == null )
return;
if( this.properties.equal_to && this.properties.equal_to != param )
return;
if( this.properties.has_property )
{
var prop = param[ this.properties.has_property ];
if( prop == null )
return;
if( this.properties.property_equal_to && this.properties.property_equal_to != prop )
return;
}
this.triggerSlot(0,param);
}
LiteGraph.registerNodeType("events/set_mode", SetModeNode );
*/
//Show value inside the debug console
function DelayEvent()
{

View File

@@ -4,36 +4,56 @@ function GamepadInput()
{
this.addOutput("left_x_axis","number");
this.addOutput("left_y_axis","number");
this.properties = {};
this.addOutput( "button_pressed", LiteGraph.EVENT );
this.properties = { gamepad_index: 0, threshold: 0.1 };
this._left_axis = vec2.create();
this._right_axis = vec2.create();
this._triggers = vec2.create();
this._previous_buttons = new Uint8Array(17);
this._current_buttons = new Uint8Array(17);
}
GamepadInput.title = "Gamepad";
GamepadInput.desc = "gets the input of the gamepad";
GamepadInput.zero = new Float32Array(2);
GamepadInput.buttons = ["a","b","x","y","lb","rb","lt","rt","back","start","ls","rs","home"];
GamepadInput.prototype.onExecute = function()
{
//get gamepad
var gamepad = this.getGamepad();
var threshold = this.properties.threshold || 0.0;
this._left_axis[0] = Math.abs( gamepad.xbox.axes["lx"] ) > threshold ? gamepad.xbox.axes["lx"] : 0;
this._left_axis[1] = Math.abs( gamepad.xbox.axes["ly"] ) > threshold ? gamepad.xbox.axes["ly"] : 0;
this._right_axis[0] = Math.abs( gamepad.xbox.axes["rx"] ) > threshold ? gamepad.xbox.axes["rx"] : 0;
this._right_axis[1] = Math.abs( gamepad.xbox.axes["ry"] ) > threshold ? gamepad.xbox.axes["ry"] : 0;
this._triggers[0] = Math.abs( gamepad.xbox.axes["ltrigger"] ) > threshold ? gamepad.xbox.axes["ltrigger"] : 0;
this._triggers[1] = Math.abs( gamepad.xbox.axes["rtrigger"] ) > threshold ? gamepad.xbox.axes["rtrigger"] : 0;
if(this.outputs)
{
for(var i = 0; i < this.outputs.length; i++)
{
var output = this.outputs[i];
if(!output.links || !output.links.length)
continue;
var v = null;
if(gamepad)
{
switch( output.name )
{
case "left_axis": v = [ gamepad.xbox.axes["lx"], gamepad.xbox.axes["ly"]]; break;
case "right_axis": v = [ gamepad.xbox.axes["rx"], gamepad.xbox.axes["ry"]]; break;
case "left_x_axis": v = gamepad.xbox.axes["lx"]; break;
case "left_y_axis": v = gamepad.xbox.axes["ly"]; break;
case "right_x_axis": v = gamepad.xbox.axes["rx"]; break;
case "right_y_axis": v = gamepad.xbox.axes["ry"]; break;
case "trigger_left": v = gamepad.xbox.axes["ltrigger"]; break;
case "trigger_right": v = gamepad.xbox.axes["rtrigger"]; break;
case "left_axis": v = this._left_axis; break;
case "right_axis": v = this._right_axis; break;
case "left_x_axis": v = this._left_axis[0]; break;
case "left_y_axis": v = this._left_axis[1]; break;
case "right_x_axis": v = this._right_axis[0]; break;
case "right_y_axis": v = this._right_axis[1]; break;
case "trigger_left": v = this._triggers[0]; break;
case "trigger_right": v = this._triggers[1]; break;
case "a_button": v = gamepad.xbox.buttons["a"] ? 1 : 0; break;
case "b_button": v = gamepad.xbox.buttons["b"] ? 1 : 0; break;
case "x_button": v = gamepad.xbox.buttons["x"] ? 1 : 0; break;
@@ -44,6 +64,13 @@ GamepadInput.prototype.onExecute = function()
case "rs_button": v = gamepad.xbox.buttons["rs"] ? 1 : 0; break;
case "start_button": v = gamepad.xbox.buttons["start"] ? 1 : 0; break;
case "back_button": v = gamepad.xbox.buttons["back"] ? 1 : 0; break;
case "button_pressed":
for(var j = 0; j < this._current_buttons.length; ++j)
{
if( this._current_buttons[j] && !this._previous_buttons[j] )
this.triggerSlot( i, GamepadInput.buttons[j] );
}
break;
default: break;
}
}
@@ -52,9 +79,10 @@ GamepadInput.prototype.onExecute = function()
//if no gamepad is connected, output 0
switch( output.name )
{
case "button_pressed": break;
case "left_axis":
case "right_axis":
v = [0,0];
v = GamepadInput.zero;
break;
default:
v = 0;
@@ -73,7 +101,10 @@ GamepadInput.prototype.getGamepad = function()
var gamepads = getGamepads.call(navigator);
var gamepad = null;
for(var i = 0; i < 4; i++)
this._previous_buttons.set( this._current_buttons );
//pick the first connected
for(var i = this.properties.gamepad_index; i < 4; i++)
{
if (gamepads[i])
{
@@ -91,28 +122,30 @@ GamepadInput.prototype.getGamepad = function()
xbox.axes["ltrigger"] = gamepad.buttons[6].value;
xbox.axes["rtrigger"] = gamepad.buttons[7].value;
for(var i = 0; i < gamepad.buttons.length; i++)
for(var j = 0; j < gamepad.buttons.length; j++)
{
this._current_buttons[j] = gamepad.buttons[j].pressed;
//mapping of XBOX
switch(i) //I use a switch to ensure that a player with another gamepad could play
switch(j) //I use a switch to ensure that a player with another gamepad could play
{
case 0: xbox.buttons["a"] = gamepad.buttons[i].pressed; break;
case 1: xbox.buttons["b"] = gamepad.buttons[i].pressed; break;
case 2: xbox.buttons["x"] = gamepad.buttons[i].pressed; break;
case 3: xbox.buttons["y"] = gamepad.buttons[i].pressed; break;
case 4: xbox.buttons["lb"] = gamepad.buttons[i].pressed; break;
case 5: xbox.buttons["rb"] = gamepad.buttons[i].pressed; break;
case 6: xbox.buttons["lt"] = gamepad.buttons[i].pressed; break;
case 7: xbox.buttons["rt"] = gamepad.buttons[i].pressed; break;
case 8: xbox.buttons["back"] = gamepad.buttons[i].pressed; break;
case 9: xbox.buttons["start"] = gamepad.buttons[i].pressed; break;
case 10: xbox.buttons["ls"] = gamepad.buttons[i].pressed; break;
case 11: xbox.buttons["rs"] = gamepad.buttons[i].pressed; break;
case 12: if( gamepad.buttons[i].pressed) xbox.hat += "up"; break;
case 13: if( gamepad.buttons[i].pressed) xbox.hat += "down"; break;
case 14: if( gamepad.buttons[i].pressed) xbox.hat += "left"; break;
case 15: if( gamepad.buttons[i].pressed) xbox.hat += "right"; break;
case 16: xbox.buttons["home"] = gamepad.buttons[i].pressed; break;
case 0: xbox.buttons["a"] = gamepad.buttons[j].pressed; break;
case 1: xbox.buttons["b"] = gamepad.buttons[j].pressed; break;
case 2: xbox.buttons["x"] = gamepad.buttons[j].pressed; break;
case 3: xbox.buttons["y"] = gamepad.buttons[j].pressed; break;
case 4: xbox.buttons["lb"] = gamepad.buttons[j].pressed; break;
case 5: xbox.buttons["rb"] = gamepad.buttons[j].pressed; break;
case 6: xbox.buttons["lt"] = gamepad.buttons[j].pressed; break;
case 7: xbox.buttons["rt"] = gamepad.buttons[j].pressed; break;
case 8: xbox.buttons["back"] = gamepad.buttons[j].pressed; break;
case 9: xbox.buttons["start"] = gamepad.buttons[j].pressed; break;
case 10: xbox.buttons["ls"] = gamepad.buttons[j].pressed; break;
case 11: xbox.buttons["rs"] = gamepad.buttons[j].pressed; break;
case 12: if( gamepad.buttons[j].pressed) xbox.hat += "up"; break;
case 13: if( gamepad.buttons[j].pressed) xbox.hat += "down"; break;
case 14: if( gamepad.buttons[j].pressed) xbox.hat += "left"; break;
case 15: if( gamepad.buttons[j].pressed) xbox.hat += "right"; break;
case 16: xbox.buttons["home"] = gamepad.buttons[j].pressed; break;
default:
}
}
@@ -124,7 +157,7 @@ GamepadInput.prototype.getGamepad = function()
GamepadInput.prototype.onDrawBackground = function(ctx)
{
//render
//render gamepad state?
}
GamepadInput.prototype.onGetOutputs = function() {
@@ -146,7 +179,8 @@ GamepadInput.prototype.onGetOutputs = function() {
["ls_button","number"],
["rs_button","number"],
["start","number"],
["back","number"]
["back","number"],
["button_pressed", LiteGraph.EVENT]
];
}

View File

@@ -663,9 +663,7 @@
var v = this.getInputData(0);
if(v != null)
this.properties["value"] = v;
else
this.properties["value"] = "";
this.setDirtyCanvas(true);
//this.setDirtyCanvas(true);
}
WidgetText.prototype.resize = function()