added method to create nodes from functions, wrapFunctionAsNode

This commit is contained in:
tamat
2018-03-28 16:35:52 +02:00
parent e54e2409d1
commit 7485fc68aa
11 changed files with 822 additions and 498 deletions

View File

@@ -85,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l5814"><code>..&#x2F;src&#x2F;litegraph.js:5814</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l5876"><code>..&#x2F;src&#x2F;litegraph.js:5876</code></a>
</div>
@@ -123,7 +123,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l5814"><code>..&#x2F;src&#x2F;litegraph.js:5814</code></a>
<a href="../files/.._src_litegraph.js.html#l5876"><code>..&#x2F;src&#x2F;litegraph.js:5876</code></a>
</p>

View File

@@ -85,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l328"><code>..&#x2F;src&#x2F;litegraph.js:328</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l377"><code>..&#x2F;src&#x2F;litegraph.js:377</code></a>
</div>
@@ -114,7 +114,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l328"><code>..&#x2F;src&#x2F;litegraph.js:328</code></a>
<a href="../files/.._src_litegraph.js.html#l377"><code>..&#x2F;src&#x2F;litegraph.js:377</code></a>
</p>
@@ -269,7 +269,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l748"><code>..&#x2F;src&#x2F;litegraph.js:748</code></a>
<a href="../files/.._src_litegraph.js.html#l799"><code>..&#x2F;src&#x2F;litegraph.js:799</code></a>
</p>
@@ -323,7 +323,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l401"><code>..&#x2F;src&#x2F;litegraph.js:401</code></a>
<a href="../files/.._src_litegraph.js.html#l452"><code>..&#x2F;src&#x2F;litegraph.js:452</code></a>
</p>
@@ -370,7 +370,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l352"><code>..&#x2F;src&#x2F;litegraph.js:352</code></a>
<a href="../files/.._src_litegraph.js.html#l403"><code>..&#x2F;src&#x2F;litegraph.js:403</code></a>
</p>
@@ -407,7 +407,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1247"><code>..&#x2F;src&#x2F;litegraph.js:1247</code></a>
<a href="../files/.._src_litegraph.js.html#l1298"><code>..&#x2F;src&#x2F;litegraph.js:1298</code></a>
</p>
@@ -461,7 +461,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l420"><code>..&#x2F;src&#x2F;litegraph.js:420</code></a>
<a href="../files/.._src_litegraph.js.html#l471"><code>..&#x2F;src&#x2F;litegraph.js:471</code></a>
</p>
@@ -517,7 +517,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l886"><code>..&#x2F;src&#x2F;litegraph.js:886</code></a>
<a href="../files/.._src_litegraph.js.html#l937"><code>..&#x2F;src&#x2F;litegraph.js:937</code></a>
</p>
@@ -583,7 +583,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l919"><code>..&#x2F;src&#x2F;litegraph.js:919</code></a>
<a href="../files/.._src_litegraph.js.html#l970"><code>..&#x2F;src&#x2F;litegraph.js:970</code></a>
</p>
@@ -649,7 +649,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l902"><code>..&#x2F;src&#x2F;litegraph.js:902</code></a>
<a href="../files/.._src_litegraph.js.html#l953"><code>..&#x2F;src&#x2F;litegraph.js:953</code></a>
</p>
@@ -709,7 +709,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l693"><code>..&#x2F;src&#x2F;litegraph.js:693</code></a>
<a href="../files/.._src_litegraph.js.html#l744"><code>..&#x2F;src&#x2F;litegraph.js:744</code></a>
</p>
@@ -753,7 +753,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l682"><code>..&#x2F;src&#x2F;litegraph.js:682</code></a>
<a href="../files/.._src_litegraph.js.html#l733"><code>..&#x2F;src&#x2F;litegraph.js:733</code></a>
</p>
@@ -799,7 +799,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l873"><code>..&#x2F;src&#x2F;litegraph.js:873</code></a>
<a href="../files/.._src_litegraph.js.html#l924"><code>..&#x2F;src&#x2F;litegraph.js:924</code></a>
</p>
@@ -861,7 +861,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l935"><code>..&#x2F;src&#x2F;litegraph.js:935</code></a>
<a href="../files/.._src_litegraph.js.html#l986"><code>..&#x2F;src&#x2F;litegraph.js:986</code></a>
</p>
@@ -943,7 +943,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l671"><code>..&#x2F;src&#x2F;litegraph.js:671</code></a>
<a href="../files/.._src_litegraph.js.html#l722"><code>..&#x2F;src&#x2F;litegraph.js:722</code></a>
</p>
@@ -983,7 +983,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1177"><code>..&#x2F;src&#x2F;litegraph.js:1177</code></a>
<a href="../files/.._src_litegraph.js.html#l1228"><code>..&#x2F;src&#x2F;litegraph.js:1228</code></a>
</p>
@@ -1020,7 +1020,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l804"><code>..&#x2F;src&#x2F;litegraph.js:804</code></a>
<a href="../files/.._src_litegraph.js.html#l855"><code>..&#x2F;src&#x2F;litegraph.js:855</code></a>
</p>
@@ -1074,7 +1074,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l488"><code>..&#x2F;src&#x2F;litegraph.js:488</code></a>
<a href="../files/.._src_litegraph.js.html#l539"><code>..&#x2F;src&#x2F;litegraph.js:539</code></a>
</p>
@@ -1131,7 +1131,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l705"><code>..&#x2F;src&#x2F;litegraph.js:705</code></a>
<a href="../files/.._src_litegraph.js.html#l756"><code>..&#x2F;src&#x2F;litegraph.js:756</code></a>
</p>
@@ -1193,7 +1193,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1214"><code>..&#x2F;src&#x2F;litegraph.js:1214</code></a>
<a href="../files/.._src_litegraph.js.html#l1265"><code>..&#x2F;src&#x2F;litegraph.js:1265</code></a>
</p>
@@ -1242,7 +1242,7 @@ if the nodes are using graphical actions</p>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1122"><code>..&#x2F;src&#x2F;litegraph.js:1122</code></a>
<a href="../files/.._src_litegraph.js.html#l1173"><code>..&#x2F;src&#x2F;litegraph.js:1173</code></a>
</p>
@@ -1311,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#l1137"><code>..&#x2F;src&#x2F;litegraph.js:1137</code></a>
<a href="../files/.._src_litegraph.js.html#l1188"><code>..&#x2F;src&#x2F;litegraph.js:1188</code></a>
</p>
@@ -1374,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#l438"><code>..&#x2F;src&#x2F;litegraph.js:438</code></a>
<a href="../files/.._src_litegraph.js.html#l489"><code>..&#x2F;src&#x2F;litegraph.js:489</code></a>
</p>
@@ -1422,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#l466"><code>..&#x2F;src&#x2F;litegraph.js:466</code></a>
<a href="../files/.._src_litegraph.js.html#l517"><code>..&#x2F;src&#x2F;litegraph.js:517</code></a>
</p>
@@ -1453,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#l567"><code>..&#x2F;src&#x2F;litegraph.js:567</code></a>
<a href="../files/.._src_litegraph.js.html#l618"><code>..&#x2F;src&#x2F;litegraph.js:618</code></a>
</p>

View File

@@ -85,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l3074"><code>..&#x2F;src&#x2F;litegraph.js:3074</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l3134"><code>..&#x2F;src&#x2F;litegraph.js:3134</code></a>
</div>
@@ -126,7 +126,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l3074"><code>..&#x2F;src&#x2F;litegraph.js:3074</code></a>
<a href="../files/.._src_litegraph.js.html#l3134"><code>..&#x2F;src&#x2F;litegraph.js:3134</code></a>
</p>
@@ -254,7 +254,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2733"><code>..&#x2F;src&#x2F;litegraph.js:2733</code></a>
<a href="../files/.._src_litegraph.js.html#l2793"><code>..&#x2F;src&#x2F;litegraph.js:2793</code></a>
</p>
@@ -291,7 +291,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2826"><code>..&#x2F;src&#x2F;litegraph.js:2826</code></a>
<a href="../files/.._src_litegraph.js.html#l2886"><code>..&#x2F;src&#x2F;litegraph.js:2886</code></a>
</p>
@@ -342,7 +342,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l3090"><code>..&#x2F;src&#x2F;litegraph.js:3090</code></a>
<a href="../files/.._src_litegraph.js.html#l3150"><code>..&#x2F;src&#x2F;litegraph.js:3150</code></a>
</p>
@@ -388,7 +388,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2799"><code>..&#x2F;src&#x2F;litegraph.js:2799</code></a>
<a href="../files/.._src_litegraph.js.html#l2859"><code>..&#x2F;src&#x2F;litegraph.js:2859</code></a>
</p>
@@ -441,7 +441,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2842"><code>..&#x2F;src&#x2F;litegraph.js:2842</code></a>
<a href="../files/.._src_litegraph.js.html#l2902"><code>..&#x2F;src&#x2F;litegraph.js:2902</code></a>
</p>
@@ -495,7 +495,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2768"><code>..&#x2F;src&#x2F;litegraph.js:2768</code></a>
<a href="../files/.._src_litegraph.js.html#l2828"><code>..&#x2F;src&#x2F;litegraph.js:2828</code></a>
</p>
@@ -542,7 +542,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l3104"><code>..&#x2F;src&#x2F;litegraph.js:3104</code></a>
<a href="../files/.._src_litegraph.js.html#l3164"><code>..&#x2F;src&#x2F;litegraph.js:3164</code></a>
</p>
@@ -573,7 +573,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l3128"><code>..&#x2F;src&#x2F;litegraph.js:3128</code></a>
<a href="../files/.._src_litegraph.js.html#l3188"><code>..&#x2F;src&#x2F;litegraph.js:3188</code></a>
</p>

View File

@@ -85,7 +85,7 @@
<div class="foundat">
Defined in: <a href="../files/.._src_litegraph.js.html#l1379"><code>..&#x2F;src&#x2F;litegraph.js:1379</code></a>
Defined in: <a href="../files/.._src_litegraph.js.html#l1430"><code>..&#x2F;src&#x2F;litegraph.js:1430</code></a>
</div>
@@ -293,7 +293,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2051"><code>..&#x2F;src&#x2F;litegraph.js:2051</code></a>
<a href="../files/.._src_litegraph.js.html#l2104"><code>..&#x2F;src&#x2F;litegraph.js:2104</code></a>
</p>
@@ -385,7 +385,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1988"><code>..&#x2F;src&#x2F;litegraph.js:1988</code></a>
<a href="../files/.._src_litegraph.js.html#l2041"><code>..&#x2F;src&#x2F;litegraph.js:2041</code></a>
</p>
@@ -460,7 +460,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2012"><code>..&#x2F;src&#x2F;litegraph.js:2012</code></a>
<a href="../files/.._src_litegraph.js.html#l2065"><code>..&#x2F;src&#x2F;litegraph.js:2065</code></a>
</p>
@@ -520,7 +520,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1926"><code>..&#x2F;src&#x2F;litegraph.js:1926</code></a>
<a href="../files/.._src_litegraph.js.html#l1979"><code>..&#x2F;src&#x2F;litegraph.js:1979</code></a>
</p>
@@ -595,7 +595,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1949"><code>..&#x2F;src&#x2F;litegraph.js:1949</code></a>
<a href="../files/.._src_litegraph.js.html#l2002"><code>..&#x2F;src&#x2F;litegraph.js:2002</code></a>
</p>
@@ -658,7 +658,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1900"><code>..&#x2F;src&#x2F;litegraph.js:1900</code></a>
<a href="../files/.._src_litegraph.js.html#l1953"><code>..&#x2F;src&#x2F;litegraph.js:1953</code></a>
</p>
@@ -737,7 +737,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2630"><code>..&#x2F;src&#x2F;litegraph.js:2630</code></a>
<a href="../files/.._src_litegraph.js.html#l2688"><code>..&#x2F;src&#x2F;litegraph.js:2688</code></a>
</p>
@@ -777,7 +777,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2072"><code>..&#x2F;src&#x2F;litegraph.js:2072</code></a>
<a href="../files/.._src_litegraph.js.html#l2125"><code>..&#x2F;src&#x2F;litegraph.js:2125</code></a>
</p>
@@ -833,7 +833,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1432"><code>..&#x2F;src&#x2F;litegraph.js:1432</code></a>
<a href="../files/.._src_litegraph.js.html#l1485"><code>..&#x2F;src&#x2F;litegraph.js:1485</code></a>
</p>
@@ -879,7 +879,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2219"><code>..&#x2F;src&#x2F;litegraph.js:2219</code></a>
<a href="../files/.._src_litegraph.js.html#l2277"><code>..&#x2F;src&#x2F;litegraph.js:2277</code></a>
</p>
@@ -967,7 +967,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2427"><code>..&#x2F;src&#x2F;litegraph.js:2427</code></a>
<a href="../files/.._src_litegraph.js.html#l2485"><code>..&#x2F;src&#x2F;litegraph.js:2485</code></a>
</p>
@@ -1036,7 +1036,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2337"><code>..&#x2F;src&#x2F;litegraph.js:2337</code></a>
<a href="../files/.._src_litegraph.js.html#l2395"><code>..&#x2F;src&#x2F;litegraph.js:2395</code></a>
</p>
@@ -1113,7 +1113,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2188"><code>..&#x2F;src&#x2F;litegraph.js:2188</code></a>
<a href="../files/.._src_litegraph.js.html#l2246"><code>..&#x2F;src&#x2F;litegraph.js:2246</code></a>
</p>
@@ -1179,7 +1179,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2204"><code>..&#x2F;src&#x2F;litegraph.js:2204</code></a>
<a href="../files/.._src_litegraph.js.html#l2262"><code>..&#x2F;src&#x2F;litegraph.js:2262</code></a>
</p>
@@ -1239,7 +1239,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2123"><code>..&#x2F;src&#x2F;litegraph.js:2123</code></a>
<a href="../files/.._src_litegraph.js.html#l2176"><code>..&#x2F;src&#x2F;litegraph.js:2176</code></a>
</p>
@@ -1291,7 +1291,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2496"><code>..&#x2F;src&#x2F;litegraph.js:2496</code></a>
<a href="../files/.._src_litegraph.js.html#l2554"><code>..&#x2F;src&#x2F;litegraph.js:2554</code></a>
</p>
@@ -1371,7 +1371,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1665"><code>..&#x2F;src&#x2F;litegraph.js:1665</code></a>
<a href="../files/.._src_litegraph.js.html#l1718"><code>..&#x2F;src&#x2F;litegraph.js:1718</code></a>
</p>
@@ -1447,7 +1447,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1714"><code>..&#x2F;src&#x2F;litegraph.js:1714</code></a>
<a href="../files/.._src_litegraph.js.html#l1767"><code>..&#x2F;src&#x2F;litegraph.js:1767</code></a>
</p>
@@ -1512,7 +1512,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1729"><code>..&#x2F;src&#x2F;litegraph.js:1729</code></a>
<a href="../files/.._src_litegraph.js.html#l1782"><code>..&#x2F;src&#x2F;litegraph.js:1782</code></a>
</p>
@@ -1577,7 +1577,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1750"><code>..&#x2F;src&#x2F;litegraph.js:1750</code></a>
<a href="../files/.._src_litegraph.js.html#l1803"><code>..&#x2F;src&#x2F;litegraph.js:1803</code></a>
</p>
@@ -1642,7 +1642,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1768"><code>..&#x2F;src&#x2F;litegraph.js:1768</code></a>
<a href="../files/.._src_litegraph.js.html#l1821"><code>..&#x2F;src&#x2F;litegraph.js:1821</code></a>
</p>
@@ -1707,7 +1707,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#l1850"><code>..&#x2F;src&#x2F;litegraph.js:1850</code></a>
</p>
@@ -1773,7 +1773,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2157"><code>..&#x2F;src&#x2F;litegraph.js:2157</code></a>
<a href="../files/.._src_litegraph.js.html#l2215"><code>..&#x2F;src&#x2F;litegraph.js:2215</code></a>
</p>
@@ -1839,7 +1839,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1616"><code>..&#x2F;src&#x2F;litegraph.js:1616</code></a>
<a href="../files/.._src_litegraph.js.html#l1669"><code>..&#x2F;src&#x2F;litegraph.js:1669</code></a>
</p>
@@ -1879,7 +1879,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1701"><code>..&#x2F;src&#x2F;litegraph.js:1701</code></a>
<a href="../files/.._src_litegraph.js.html#l1754"><code>..&#x2F;src&#x2F;litegraph.js:1754</code></a>
</p>
@@ -1942,7 +1942,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1784"><code>..&#x2F;src&#x2F;litegraph.js:1784</code></a>
<a href="../files/.._src_litegraph.js.html#l1837"><code>..&#x2F;src&#x2F;litegraph.js:1837</code></a>
</p>
@@ -2008,7 +2008,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2133"><code>..&#x2F;src&#x2F;litegraph.js:2133</code></a>
<a href="../files/.._src_litegraph.js.html#l2191"><code>..&#x2F;src&#x2F;litegraph.js:2191</code></a>
</p>
@@ -2072,7 +2072,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2643"><code>..&#x2F;src&#x2F;litegraph.js:2643</code></a>
<a href="../files/.._src_litegraph.js.html#l2701"><code>..&#x2F;src&#x2F;litegraph.js:2701</code></a>
</p>
@@ -2109,7 +2109,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l2037"><code>..&#x2F;src&#x2F;litegraph.js:2037</code></a>
<a href="../files/.._src_litegraph.js.html#l2090"><code>..&#x2F;src&#x2F;litegraph.js:2090</code></a>
</p>
@@ -2162,7 +2162,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1974"><code>..&#x2F;src&#x2F;litegraph.js:1974</code></a>
<a href="../files/.._src_litegraph.js.html#l2027"><code>..&#x2F;src&#x2F;litegraph.js:2027</code></a>
</p>
@@ -2209,7 +2209,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1528"><code>..&#x2F;src&#x2F;litegraph.js:1528</code></a>
<a href="../files/.._src_litegraph.js.html#l1581"><code>..&#x2F;src&#x2F;litegraph.js:1581</code></a>
</p>
@@ -2249,7 +2249,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1629"><code>..&#x2F;src&#x2F;litegraph.js:1629</code></a>
<a href="../files/.._src_litegraph.js.html#l1682"><code>..&#x2F;src&#x2F;litegraph.js:1682</code></a>
</p>
@@ -2306,7 +2306,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1604"><code>..&#x2F;src&#x2F;litegraph.js:1604</code></a>
<a href="../files/.._src_litegraph.js.html#l1657"><code>..&#x2F;src&#x2F;litegraph.js:1657</code></a>
</p>
@@ -2346,7 +2346,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1830"><code>..&#x2F;src&#x2F;litegraph.js:1830</code></a>
<a href="../files/.._src_litegraph.js.html#l1883"><code>..&#x2F;src&#x2F;litegraph.js:1883</code></a>
</p>
@@ -2413,7 +2413,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l1853"><code>..&#x2F;src&#x2F;litegraph.js:1853</code></a>
<a href="../files/.._src_litegraph.js.html#l1906"><code>..&#x2F;src&#x2F;litegraph.js:1906</code></a>
</p>

View File

@@ -170,6 +170,10 @@
<a href="#method_registerNodeType">registerNodeType</a>
</li>
<li class="index-item method">
<a href="#method_wrapFunctionAsNode">wrapFunctionAsNode</a>
</li>
</ul>
</div>
@@ -201,7 +205,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l135"><code>..&#x2F;src&#x2F;litegraph.js:135</code></a>
<a href="../files/.._src_litegraph.js.html#l164"><code>..&#x2F;src&#x2F;litegraph.js:164</code></a>
</p>
@@ -261,7 +265,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l153"><code>..&#x2F;src&#x2F;litegraph.js:153</code></a>
<a href="../files/.._src_litegraph.js.html#l182"><code>..&#x2F;src&#x2F;litegraph.js:182</code></a>
</p>
@@ -340,7 +344,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l196"><code>..&#x2F;src&#x2F;litegraph.js:196</code></a>
<a href="../files/.._src_litegraph.js.html#l225"><code>..&#x2F;src&#x2F;litegraph.js:225</code></a>
</p>
@@ -406,7 +410,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l209"><code>..&#x2F;src&#x2F;litegraph.js:209</code></a>
<a href="../files/.._src_litegraph.js.html#l238"><code>..&#x2F;src&#x2F;litegraph.js:238</code></a>
</p>
@@ -466,7 +470,7 @@
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l231"><code>..&#x2F;src&#x2F;litegraph.js:231</code></a>
<a href="../files/.._src_litegraph.js.html#l260"><code>..&#x2F;src&#x2F;litegraph.js:260</code></a>
</p>
@@ -558,6 +562,101 @@
</div>
<div id="method_wrapFunctionAsNode" class="method item">
<h3 class="name"><code>wrapFunctionAsNode</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>name</code>
</li>
<li class="arg">
<code>func</code>
</li>
<li class="arg">
<code>param_types</code>
</li>
<li class="arg">
<code>return_type</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="../files/.._src_litegraph.js.html#l135"><code>..&#x2F;src&#x2F;litegraph.js:135</code></a>
</p>
</div>
<div class="description">
<p>create a new node type by passing a function, it wraps it with a propper class</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">name</code>
<span class="type">String</span>
<div class="param-description">
<p>node name with namespace (p.e.: 'math/sum')</p>
</div>
</li>
<li class="param">
<code class="param-name">func</code>
<span class="type">Function</span>
<div class="param-description">
</div>
</li>
<li class="param">
<code class="param-name">param_types</code>
<span class="type">Array</span>
<div class="param-description">
<p>[optional] an array containing the type of every parameter, otherwise parameters will accept any type</p>
</div>
</li>
<li class="param">
<code class="param-name">return_type</code>
<span class="type">String</span>
<div class="param-description">
<p>[optional] string with the return type, otherwise it will be generic</p>
</div>
</li>
</ul>
</div>
</div>
</div>

View File

@@ -39,7 +39,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 328,
"line": 377,
"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
},
@@ -52,7 +52,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 1379,
"line": 1430,
"description": "Base Class for all the node type classes",
"params": [
{
@@ -71,7 +71,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 3074,
"line": 3134,
"description": "marks as dirty the canvas, this way it will be rendered again",
"is_constructor": 1,
"params": [
@@ -102,7 +102,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 5814,
"line": 5876,
"description": "ContextMenu from LiteGUI",
"is_constructor": 1,
"params": [
@@ -144,6 +144,36 @@
{
"file": "../src/litegraph.js",
"line": 135,
"description": "create a new node type by passing a function, it wraps it with a propper class",
"itemtype": "method",
"name": "wrapFunctionAsNode",
"params": [
{
"name": "name",
"description": "node name with namespace (p.e.: 'math/sum')",
"type": "String"
},
{
"name": "func",
"description": "",
"type": "Function"
},
{
"name": "param_types",
"description": "[optional] an array containing the type of every parameter, otherwise parameters will accept any type",
"type": "Array"
},
{
"name": "return_type",
"description": "[optional] string with the return type, otherwise it will be generic",
"type": "String"
}
],
"class": "LiteGraph"
},
{
"file": "../src/litegraph.js",
"line": 164,
"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",
@@ -158,7 +188,7 @@
},
{
"file": "../src/litegraph.js",
"line": 153,
"line": 182,
"description": "Create a node of a given type with a name. The node is not attached to any graph yet.",
"itemtype": "method",
"name": "createNode",
@@ -183,7 +213,7 @@
},
{
"file": "../src/litegraph.js",
"line": 196,
"line": 225,
"description": "Returns a registered node type with a given name",
"itemtype": "method",
"name": "getNodeType",
@@ -202,7 +232,7 @@
},
{
"file": "../src/litegraph.js",
"line": 209,
"line": 238,
"description": "Returns a list of node types matching one category",
"itemtype": "method",
"name": "getNodeType",
@@ -221,7 +251,7 @@
},
{
"file": "../src/litegraph.js",
"line": 231,
"line": 260,
"description": "Returns a list with all the node type categories",
"itemtype": "method",
"name": "getNodeTypesCategories",
@@ -233,7 +263,7 @@
},
{
"file": "../src/litegraph.js",
"line": 352,
"line": 403,
"description": "Removes all nodes from this graph",
"itemtype": "method",
"name": "clear",
@@ -241,7 +271,7 @@
},
{
"file": "../src/litegraph.js",
"line": 401,
"line": 452,
"description": "Attach Canvas to this graph",
"itemtype": "method",
"name": "attachCanvas",
@@ -256,7 +286,7 @@
},
{
"file": "../src/litegraph.js",
"line": 420,
"line": 471,
"description": "Detach Canvas from this graph",
"itemtype": "method",
"name": "detachCanvas",
@@ -271,7 +301,7 @@
},
{
"file": "../src/litegraph.js",
"line": 438,
"line": 489,
"description": "Starts running this graph every interval milliseconds.",
"itemtype": "method",
"name": "start",
@@ -286,7 +316,7 @@
},
{
"file": "../src/litegraph.js",
"line": 466,
"line": 517,
"description": "Stops the execution loop of the graph",
"itemtype": "method",
"name": "stop execution",
@@ -294,7 +324,7 @@
},
{
"file": "../src/litegraph.js",
"line": 488,
"line": 539,
"description": "Run N steps (cycles) of the graph",
"itemtype": "method",
"name": "runStep",
@@ -309,7 +339,7 @@
},
{
"file": "../src/litegraph.js",
"line": 567,
"line": 618,
"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",
@@ -317,7 +347,7 @@
},
{
"file": "../src/litegraph.js",
"line": 671,
"line": 722,
"description": "Returns the amount of time the graph has been running in milliseconds",
"itemtype": "method",
"name": "getTime",
@@ -329,7 +359,7 @@
},
{
"file": "../src/litegraph.js",
"line": 682,
"line": 733,
"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",
@@ -341,7 +371,7 @@
},
{
"file": "../src/litegraph.js",
"line": 693,
"line": 744,
"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",
@@ -353,7 +383,7 @@
},
{
"file": "../src/litegraph.js",
"line": 705,
"line": 756,
"description": "Sends an event to all the nodes, useful to trigger stuff",
"itemtype": "method",
"name": "sendEventToAllNodes",
@@ -373,7 +403,7 @@
},
{
"file": "../src/litegraph.js",
"line": 748,
"line": 799,
"description": "Adds a new node instasnce to this graph",
"itemtype": "method",
"name": "add",
@@ -388,7 +418,7 @@
},
{
"file": "../src/litegraph.js",
"line": 804,
"line": 855,
"description": "Removes a node from the graph",
"itemtype": "method",
"name": "remove",
@@ -403,7 +433,7 @@
},
{
"file": "../src/litegraph.js",
"line": 873,
"line": 924,
"description": "Returns a node by its id.",
"itemtype": "method",
"name": "getNodeById",
@@ -418,7 +448,7 @@
},
{
"file": "../src/litegraph.js",
"line": 886,
"line": 937,
"description": "Returns a list of nodes that matches a class",
"itemtype": "method",
"name": "findNodesByClass",
@@ -437,7 +467,7 @@
},
{
"file": "../src/litegraph.js",
"line": 902,
"line": 953,
"description": "Returns a list of nodes that matches a type",
"itemtype": "method",
"name": "findNodesByType",
@@ -456,7 +486,7 @@
},
{
"file": "../src/litegraph.js",
"line": 919,
"line": 970,
"description": "Returns a list of nodes that matches a name",
"itemtype": "method",
"name": "findNodesByName",
@@ -475,7 +505,7 @@
},
{
"file": "../src/litegraph.js",
"line": 935,
"line": 986,
"description": "Returns the top-most node in this position of the canvas",
"itemtype": "method",
"name": "getNodeOnPos",
@@ -504,7 +534,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1122,
"line": 1173,
"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",
@@ -524,7 +554,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1137,
"line": 1188,
"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",
@@ -543,7 +573,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1177,
"line": 1228,
"description": "returns if the graph is in live mode",
"itemtype": "method",
"name": "isLive",
@@ -551,7 +581,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1214,
"line": 1265,
"description": "Creates a Object containing all the info about this graph, it can be serialized",
"itemtype": "method",
"name": "serialize",
@@ -563,7 +593,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1247,
"line": 1298,
"description": "Configure a graph from a JSON string",
"itemtype": "method",
"name": "configure",
@@ -578,7 +608,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1432,
"line": 1485,
"description": "configure a node from an object containing the serialized info",
"itemtype": "method",
"name": "configure",
@@ -586,7 +616,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1528,
"line": 1581,
"description": "serialize the content",
"itemtype": "method",
"name": "serialize",
@@ -594,7 +624,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1604,
"line": 1657,
"description": "serialize and stringify",
"itemtype": "method",
"name": "toString",
@@ -602,7 +632,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1616,
"line": 1669,
"description": "get the title string",
"itemtype": "method",
"name": "getTitle",
@@ -610,7 +640,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1629,
"line": 1682,
"description": "sets the output data",
"itemtype": "method",
"name": "setOutputData",
@@ -630,7 +660,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1665,
"line": 1718,
"description": "retrieves the input data (data traveling through the connection) from one slot",
"itemtype": "method",
"name": "getInputData",
@@ -654,7 +684,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1701,
"line": 1754,
"description": "tells you if there is a connection in one input slot",
"itemtype": "method",
"name": "isInputConnected",
@@ -673,7 +703,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1714,
"line": 1767,
"description": "tells you info about an input connection (which node, type, etc)",
"itemtype": "method",
"name": "getInputInfo",
@@ -692,7 +722,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1729,
"line": 1782,
"description": "returns the node connected in the input slot",
"itemtype": "method",
"name": "getInputNode",
@@ -711,7 +741,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1750,
"line": 1803,
"description": "tells you the last output data that went in that slot",
"itemtype": "method",
"name": "getOutputData",
@@ -730,7 +760,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1768,
"line": 1821,
"description": "tells you info about an output connection (which node, type, etc)",
"itemtype": "method",
"name": "getOutputInfo",
@@ -749,7 +779,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1784,
"line": 1837,
"description": "tells you if there is a connection in one output slot",
"itemtype": "method",
"name": "isOutputConnected",
@@ -768,7 +798,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1797,
"line": 1850,
"description": "retrieves all the nodes connected to this output slot",
"itemtype": "method",
"name": "getOutputNodes",
@@ -787,7 +817,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1830,
"line": 1883,
"description": "Triggers an event in this node, this will trigger any output with the same name",
"itemtype": "method",
"name": "trigger",
@@ -807,7 +837,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1853,
"line": 1906,
"description": "Triggers an slot event in this node",
"itemtype": "method",
"name": "triggerSlot",
@@ -827,7 +857,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1900,
"line": 1953,
"description": "add a new property to this node",
"itemtype": "method",
"name": "addProperty",
@@ -857,7 +887,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1926,
"line": 1979,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutput",
@@ -882,7 +912,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1949,
"line": 2002,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutputs",
@@ -897,7 +927,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1974,
"line": 2027,
"description": "remove an existing output slot",
"itemtype": "method",
"name": "removeOutput",
@@ -912,7 +942,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1988,
"line": 2041,
"description": "add a new input slot to use in this node",
"itemtype": "method",
"name": "addInput",
@@ -937,7 +967,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2012,
"line": 2065,
"description": "add several new input slots in this node",
"itemtype": "method",
"name": "addInputs",
@@ -952,7 +982,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2037,
"line": 2090,
"description": "remove an existing input slot",
"itemtype": "method",
"name": "removeInput",
@@ -967,7 +997,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2051,
"line": 2104,
"description": "add an special connection to this node (used for special kinds of graphs)",
"itemtype": "method",
"name": "addConnection",
@@ -997,7 +1027,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2072,
"line": 2125,
"description": "computes the size of a node according to its inputs and output slots",
"itemtype": "method",
"name": "computeSize",
@@ -1016,7 +1046,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2123,
"line": 2176,
"description": "returns the bounding of the object, used for rendering purposes",
"itemtype": "method",
"name": "getBounding",
@@ -1028,7 +1058,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2133,
"line": 2191,
"description": "checks if a point is inside the shape of a node",
"itemtype": "method",
"name": "isPointInsideNode",
@@ -1052,7 +1082,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2157,
"line": 2215,
"description": "checks if a point is inside a node slot, and returns info about which slot",
"itemtype": "method",
"name": "getSlotInPosition",
@@ -1076,7 +1106,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2188,
"line": 2246,
"description": "returns the input slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findInputSlot",
@@ -1095,7 +1125,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2204,
"line": 2262,
"description": "returns the output slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findOutputSlot",
@@ -1114,7 +1144,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2219,
"line": 2277,
"description": "connect this node output to the input of another node",
"itemtype": "method",
"name": "connect",
@@ -1143,7 +1173,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2337,
"line": 2395,
"description": "disconnect one output to an specific node",
"itemtype": "method",
"name": "disconnectOutput",
@@ -1167,7 +1197,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2427,
"line": 2485,
"description": "disconnect one input",
"itemtype": "method",
"name": "disconnectInput",
@@ -1186,7 +1216,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2496,
"line": 2554,
"description": "returns the center of a connection point in canvas coords",
"itemtype": "method",
"name": "getConnectionPos",
@@ -1210,7 +1240,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2630,
"line": 2688,
"description": "Collapse the node to make it smaller on the canvas",
"itemtype": "method",
"name": "collapse",
@@ -1218,7 +1248,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2643,
"line": 2701,
"description": "Forces the node to do not move or realign on Z",
"itemtype": "method",
"name": "pin",
@@ -1226,7 +1256,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2733,
"line": 2793,
"description": "clears all the data inside",
"itemtype": "method",
"name": "clear",
@@ -1234,7 +1264,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2768,
"line": 2828,
"description": "assigns a graph, you can reasign graphs to the same canvas",
"itemtype": "method",
"name": "setGraph",
@@ -1249,7 +1279,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2799,
"line": 2859,
"description": "opens a graph contained inside a node in the current graph",
"itemtype": "method",
"name": "openSubgraph",
@@ -1264,7 +1294,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2826,
"line": 2886,
"description": "closes a subgraph contained inside a node",
"itemtype": "method",
"name": "closeSubgraph",
@@ -1279,7 +1309,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2842,
"line": 2902,
"description": "assigns a canvas",
"itemtype": "method",
"name": "setCanvas",
@@ -1294,7 +1324,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3090,
"line": 3150,
"description": "Used to attach the canvas in a popup",
"itemtype": "method",
"name": "getCanvasWindow",
@@ -1306,7 +1336,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3104,
"line": 3164,
"description": "starts rendering the content of the canvas when needed",
"itemtype": "method",
"name": "startRendering",
@@ -1314,7 +1344,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3128,
"line": 3188,
"description": "stops rendering the content of the canvas (to save resources)",
"itemtype": "method",
"name": "stopRendering",

View File

@@ -126,7 +126,7 @@ var LiteGraph = global.LiteGraph = {
DEFAULT_POSITION: [100,100],//default node position
node_images_path: &quot;&quot;,
VALID_SHAPES: [&quot;box&quot;,&quot;round&quot;,&quot;circle&quot;],
VALID_SHAPES: [&quot;box&quot;,&quot;round&quot;], //,&quot;circle&quot;
BOX_SHAPE: 1,
ROUND_SHAPE: 2,
@@ -218,6 +218,35 @@ var LiteGraph = global.LiteGraph = {
}
},
/**
* create a new node type by passing a function, it wraps it with a propper class
* @method wrapFunctionAsNode
* @param {String} name node name with namespace (p.e.: &#x27;math/sum&#x27;)
* @param {Function} func
* @param {Array} param_types [optional] an array containing the type of every parameter, otherwise parameters will accept any type
* @param {String} return_type [optional] string with the return type, otherwise it will be generic
*/
wrapFunctionAsNode: function( name, func, param_types, return_type )
{
var params = Array(func.length);
var code = &quot;&quot;;
var names = LiteGraph.getParameterNames( func );
for(var i = 0; i &lt; names.length; ++i)
code += &quot;this.addInput(&#x27;&quot;+names[i]+&quot;&#x27;,&quot;+(param_types &amp;&amp; param_types[i] ? &quot;&#x27;&quot; + param_types[i] + &quot;&#x27;&quot; : &quot;0&quot;) + &quot;);\n&quot;;
code += &quot;this.addOutput(&#x27;out&#x27;,&quot;+( return_type ? &quot;&#x27;&quot; + return_type + &quot;&#x27;&quot; : 0 )+&quot;);\n&quot;;
var classobj = Function(code);
classobj.title = name.split(&quot;/&quot;).pop();
classobj.desc = &quot;Generated from &quot; + func.name;
classobj.prototype.onExecute = function onExecute()
{
for(var i = 0; i &lt; params.length; ++i)
params[i] = this.getInputData(i);
var r = func.apply( this, params );
this.setOutputData(0,r);
}
this.registerNodeType( name, classobj );
},
/**
* Adds this method to all nodetypes, existing and to be created
* (You can add it to LGraphNode.prototype but then existing node types wont have it)
@@ -258,7 +287,7 @@ var LiteGraph = global.LiteGraph = {
title = title || base_class.title || type;
var node = new base_class( name );
var node = new base_class( title );
node.type = type;
if(!node.title) node.title = title;
@@ -391,16 +420,36 @@ var LiteGraph = global.LiteGraph = {
if( !type_a || //generic output
!type_b || //generic input
type_a == type_b || //same type (is valid for triggers)
(type_a !== LiteGraph.EVENT &amp;&amp; type_b !== LiteGraph.EVENT &amp;&amp; type_a.toLowerCase() == type_b.toLowerCase()) ) //same type
return true;
type_a == LiteGraph.EVENT &amp;&amp; type_b == LiteGraph.ACTION )
return true;
type_a = type_a.toLowerCase();
type_b = type_b.toLowerCase();
if( type_a.indexOf(&quot;,&quot;) == -1 &amp;&amp; type_b.indexOf(&quot;,&quot;) == -1 )
return type_a == type_b;
var supported_types_a = type_a.split(&quot;,&quot;);
var supported_types_b = type_b.split(&quot;,&quot;);
for(var i = 0; i &lt; supported_types_a.length; ++i)
for(var j = 0; j &lt; supported_types_b.length; ++j)
if( supported_types_a[i] == supported_types_b[i] )
return true;
return false;
}
};
//timer that works everywhere
if(typeof(performance) != &quot;undefined&quot;)
LiteGraph.getTime = function getTime() { return performance.now(); }
LiteGraph.getTime = performance.now.bind(performance);
else if(typeof(Date) != &quot;undefined&quot; &amp;&amp; Date.now)
LiteGraph.getTime = Date.now.bind(Date);
else if(typeof(process) != &quot;undefined&quot;)
LiteGraph.getTime = function(){
var t = process.hrtime();
return t[0]*0.001 + t[1]*(1e-6);
}
else
LiteGraph.getTime = function getTime() { return Date.now(); }
LiteGraph.getTime = function getTime() { return (new Date).getTime(); }
@@ -418,7 +467,7 @@ else
* @constructor
*/
global.LGraph = LiteGraph.LGraph = function LGraph()
function LGraph()
{
if (LiteGraph.debug)
console.log(&quot;Graph created&quot;);
@@ -426,6 +475,8 @@ global.LGraph = LiteGraph.LGraph = function LGraph()
this.clear();
}
global.LGraph = LiteGraph.LGraph = LGraph;
//default supported types
LGraph.supported_types = [&quot;number&quot;,&quot;string&quot;,&quot;boolean&quot;];
@@ -1468,11 +1519,13 @@ LGraph.prototype.onNodeTrace = function(node, msg, color)
* @param {String} name a name for the node
*/
global.LGraphNode = LiteGraph.LGraphNode = function LGraphNode(title)
function LGraphNode(title)
{
this._ctor();
}
global.LGraphNode = LiteGraph.LGraphNode = LGraphNode;
LGraphNode.prototype._ctor = function( title )
{
this.title = title || &quot;Unnamed&quot;;
@@ -2211,9 +2264,14 @@ LGraphNode.prototype.computeSize = function( minHeight, out )
* @method getBounding
* @return {Float32Array[4]} the total size
*/
LGraphNode.prototype.getBounding = function()
LGraphNode.prototype.getBounding = function( out )
{
return new Float32Array([this.pos[0] - 4, this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT, this.pos[0] + this.size[0] + 4, this.pos[1] + this.size[1] + LGraph.NODE_TITLE_HEIGHT]);
out = out || new Float32Array(4);
out[0] = this.pos[0] - 4;
out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT;
out[2] = this.pos[0] + this.size[0] + 4;
out[3] = this.pos[1] + this.size[1] + LGraph.NODE_TITLE_HEIGHT;
return out;
}
/**
@@ -2761,7 +2819,7 @@ LGraphNode.prototype.localToScreen = function(x,y, graphcanvas)
* @param {LGraph} graph [optional]
* @param {Object} options [optional] { skip_rendering, autoresize }
*/
global.LGraphCanvas = LiteGraph.LGraphCanvas = function LGraphCanvas( canvas, graph, options )
function LGraphCanvas( canvas, graph, options )
{
options = options || {};
@@ -2813,6 +2871,8 @@ global.LGraphCanvas = LiteGraph.LGraphCanvas = function LGraphCanvas( canvas, gr
this.autoresize = options.autoresize;
}
global.LGraphCanvas = LiteGraph.LGraphCanvas = LGraphCanvas;
LGraphCanvas.link_type_colors = {&quot;-1&quot;:&quot;#F85&quot;,&#x27;number&#x27;:&quot;#AAC&quot;,&quot;node&quot;:&quot;#DCA&quot;};
@@ -3610,8 +3670,8 @@ LGraphCanvas.prototype.processMouseUp = function(e)
if(this.connecting_output.type == LiteGraph.EVENT)
this.connecting_node.connect( this.connecting_slot, node, LiteGraph.EVENT );
else
if(input &amp;&amp; !input.link &amp;&amp; input.type == this.connecting_output.type) //toLowerCase missing
this.connecting_node.connect(this.connecting_slot, node, 0);
if(input &amp;&amp; !input.link &amp;&amp; LiteGraph.isValidConnection( input.type &amp;&amp; this.connecting_output.type ) )
this.connecting_node.connect( this.connecting_slot, node, 0 );
}
}
}
@@ -3744,7 +3804,8 @@ LGraphCanvas.prototype.processKey = function(e)
if(e.type == &quot;keydown&quot;)
{
console.log(e);
//console.log(e); //debug
//select all Control A
if(e.keyCode == 65 &amp;&amp; e.ctrlKey)
{
@@ -4092,6 +4153,7 @@ LGraphCanvas.prototype.sendToBack = function(n)
LGraphCanvas.prototype.computeVisibleNodes = function()
{
var temp = new Float32Array(4);
var visible_nodes = [];
for(var i = 0, l = this.graph._nodes.length; i &lt; l; ++i)
{
@@ -4101,7 +4163,7 @@ LGraphCanvas.prototype.computeVisibleNodes = function()
if(this.live_mode &amp;&amp; !n.onDrawBackground &amp;&amp; !n.onDrawForeground)
continue;
if(!overlapBounding(this.visible_area, n.getBounding() ))
if(!overlapBounding( this.visible_area, n.getBounding( temp ) ))
continue; //out of the visible area
visible_nodes.push(n);
@@ -6256,15 +6318,17 @@ LiteGraph.extendClass = function ( target, origin )
}
}
/*
LiteGraph.createNodetypeWrapper = function( class_object )
{
//create Nodetype object
}
//LiteGraph.registerNodeType(&quot;scene/global&quot;, LGraphGlobal );
*/
LiteGraph.getParameterNames = function(func) {
return (func + &#x27;&#x27;)
.replace(/[/][/].*$/mg,&#x27;&#x27;) // strip single-line comments
.replace(/\s+/g, &#x27;&#x27;) // strip white space
.replace(/[/][*][^/*]*[*][/]/g, &#x27;&#x27;) // strip multi-line comments /**/
.split(&#x27;){&#x27;, 1)[0].replace(/^[^(]*[(]/, &#x27;&#x27;) // extract the parameters
.replace(/=[^,]+/g, &#x27;&#x27;) // strip any ES6 defaults
.split(&#x27;,&#x27;).filter(Boolean); // split &amp; filter [&quot;&quot;]
}
if(typeof(window) !== undefined &amp;&amp; !window[&quot;requestAnimationFrame&quot;] )
if( typeof(window) != &quot;undefined&quot; &amp;&amp; !window[&quot;requestAnimationFrame&quot;] )
{
window.requestAnimationFrame = window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
@@ -6274,6 +6338,9 @@ if(typeof(window) !== undefined &amp;&amp; !window[&quot;requestAnimationFrame&q
}
})(this);
if(typeof(exports) != &quot;undefined&quot;)
exports.LiteGraph = this.LiteGraph;
</pre>
</div>