mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
fixes in performance
This commit is contained in:
212
doc/classes/ContextMenu.html
Normal file
212
doc/classes/ContextMenu.html
Normal file
@@ -0,0 +1,212 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ContextMenu</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="icon" href="../assets/favicon.ico">
|
||||
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
<h1><img src="../assets/css/logo.png" title="" width="117" height="52"></h1>
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: </em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<li><a href="../classes/LiteGraph.html">LiteGraph</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1>ContextMenu Class</h1>
|
||||
<div class="box meta">
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l5814"><code>../src/litegraph.js:5814</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box intro">
|
||||
<p>ContextMenu from LiteGUI</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="constructor">
|
||||
<h2>Constructor</h2>
|
||||
<div id="method_ContextMenu" class="method item">
|
||||
<h3 class="name"><code>ContextMenu</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>values</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>options</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5814"><code>../src/litegraph.js:5814</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">values</code>
|
||||
<span class="type">Array</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>(allows object { title: "Nice text", callback: function ... })</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">options</code>
|
||||
<span class="type">Object</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>[optional] Some options:\</p>
|
||||
<ul>
|
||||
<li>title: title to show on top of the menu</li>
|
||||
<li>callback: function to call when an option is clicked, it receives the item information</li>
|
||||
<li>ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback</li>
|
||||
<li>event: you can pass a MouseEvent, this way the ContextMenu appears in that position</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="classdocs" class="tabview">
|
||||
<ul class="api-class-tabs">
|
||||
<li class="api-class-tab index"><a href="#index">Index</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div id="index" class="api-class-tabpanel index">
|
||||
<h2 class="off-left">Item Index</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l304"><code>../src/litegraph.js:304</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l328"><code>../src/litegraph.js:328</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l304"><code>../src/litegraph.js:304</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l328"><code>../src/litegraph.js:328</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l724"><code>../src/litegraph.js:724</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l748"><code>../src/litegraph.js:748</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l377"><code>../src/litegraph.js:377</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l401"><code>../src/litegraph.js:401</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l328"><code>../src/litegraph.js:328</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l352"><code>../src/litegraph.js:352</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1218"><code>../src/litegraph.js:1218</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1247"><code>../src/litegraph.js:1247</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l396"><code>../src/litegraph.js:396</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l420"><code>../src/litegraph.js:420</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l857"><code>../src/litegraph.js:857</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l886"><code>../src/litegraph.js:886</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -583,7 +583,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l890"><code>../src/litegraph.js:890</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l919"><code>../src/litegraph.js:919</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -649,7 +649,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l873"><code>../src/litegraph.js:873</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l902"><code>../src/litegraph.js:902</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -709,7 +709,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l669"><code>../src/litegraph.js:669</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l693"><code>../src/litegraph.js:693</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#l658"><code>../src/litegraph.js:658</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l682"><code>../src/litegraph.js:682</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#l844"><code>../src/litegraph.js:844</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l873"><code>../src/litegraph.js:873</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#l906"><code>../src/litegraph.js:906</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l935"><code>../src/litegraph.js:935</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#l647"><code>../src/litegraph.js:647</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l671"><code>../src/litegraph.js:671</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#l1148"><code>../src/litegraph.js:1148</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1177"><code>../src/litegraph.js:1177</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#l775"><code>../src/litegraph.js:775</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l804"><code>../src/litegraph.js:804</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#l464"><code>../src/litegraph.js:464</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l488"><code>../src/litegraph.js:488</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#l681"><code>../src/litegraph.js:681</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l705"><code>../src/litegraph.js:705</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#l1185"><code>../src/litegraph.js:1185</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1214"><code>../src/litegraph.js:1214</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#l1093"><code>../src/litegraph.js:1093</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1122"><code>../src/litegraph.js:1122</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#l1108"><code>../src/litegraph.js:1108</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1137"><code>../src/litegraph.js:1137</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#l414"><code>../src/litegraph.js:414</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l438"><code>../src/litegraph.js:438</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#l442"><code>../src/litegraph.js:442</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l466"><code>../src/litegraph.js:466</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#l543"><code>../src/litegraph.js:543</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l567"><code>../src/litegraph.js:567</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l3043"><code>../src/litegraph.js:3043</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l3074"><code>../src/litegraph.js:3074</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3043"><code>../src/litegraph.js:3043</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3074"><code>../src/litegraph.js:3074</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2703"><code>../src/litegraph.js:2703</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2733"><code>../src/litegraph.js:2733</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2796"><code>../src/litegraph.js:2796</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2826"><code>../src/litegraph.js:2826</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3059"><code>../src/litegraph.js:3059</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3090"><code>../src/litegraph.js:3090</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2769"><code>../src/litegraph.js:2769</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2799"><code>../src/litegraph.js:2799</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2811"><code>../src/litegraph.js:2811</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2842"><code>../src/litegraph.js:2842</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2738"><code>../src/litegraph.js:2738</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2768"><code>../src/litegraph.js:2768</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3073"><code>../src/litegraph.js:3073</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3104"><code>../src/litegraph.js:3104</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3097"><code>../src/litegraph.js:3097</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3128"><code>../src/litegraph.js:3128</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l1349"><code>../src/litegraph.js:1349</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l1379"><code>../src/litegraph.js:1379</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2021"><code>../src/litegraph.js:2021</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2051"><code>../src/litegraph.js:2051</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1958"><code>../src/litegraph.js:1958</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1988"><code>../src/litegraph.js:1988</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1982"><code>../src/litegraph.js:1982</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2012"><code>../src/litegraph.js:2012</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1896"><code>../src/litegraph.js:1896</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1926"><code>../src/litegraph.js:1926</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1919"><code>../src/litegraph.js:1919</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1949"><code>../src/litegraph.js:1949</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1870"><code>../src/litegraph.js:1870</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1900"><code>../src/litegraph.js:1900</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2600"><code>../src/litegraph.js:2600</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2630"><code>../src/litegraph.js:2630</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -777,7 +777,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2042"><code>../src/litegraph.js:2042</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2072"><code>../src/litegraph.js:2072</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -833,7 +833,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1402"><code>../src/litegraph.js:1402</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1432"><code>../src/litegraph.js:1432</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -879,7 +879,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2189"><code>../src/litegraph.js:2189</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2219"><code>../src/litegraph.js:2219</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -967,7 +967,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2397"><code>../src/litegraph.js:2397</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2427"><code>../src/litegraph.js:2427</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1036,7 +1036,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2307"><code>../src/litegraph.js:2307</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2337"><code>../src/litegraph.js:2337</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1113,7 +1113,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2158"><code>../src/litegraph.js:2158</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2188"><code>../src/litegraph.js:2188</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1179,7 +1179,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2174"><code>../src/litegraph.js:2174</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2204"><code>../src/litegraph.js:2204</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1239,7 +1239,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2093"><code>../src/litegraph.js:2093</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2123"><code>../src/litegraph.js:2123</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1291,7 +1291,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2466"><code>../src/litegraph.js:2466</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2496"><code>../src/litegraph.js:2496</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1371,7 +1371,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1635"><code>../src/litegraph.js:1635</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1665"><code>../src/litegraph.js:1665</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1447,7 +1447,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1684"><code>../src/litegraph.js:1684</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1714"><code>../src/litegraph.js:1714</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1512,7 +1512,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1699"><code>../src/litegraph.js:1699</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1729"><code>../src/litegraph.js:1729</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1577,7 +1577,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1720"><code>../src/litegraph.js:1720</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1750"><code>../src/litegraph.js:1750</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1642,7 +1642,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1738"><code>../src/litegraph.js:1738</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1768"><code>../src/litegraph.js:1768</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1707,7 +1707,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1767"><code>../src/litegraph.js:1767</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1797"><code>../src/litegraph.js:1797</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1773,7 +1773,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2127"><code>../src/litegraph.js:2127</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2157"><code>../src/litegraph.js:2157</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1839,7 +1839,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1586"><code>../src/litegraph.js:1586</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1616"><code>../src/litegraph.js:1616</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1879,7 +1879,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1671"><code>../src/litegraph.js:1671</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1701"><code>../src/litegraph.js:1701</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1942,7 +1942,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1754"><code>../src/litegraph.js:1754</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1784"><code>../src/litegraph.js:1784</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2008,7 +2008,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2103"><code>../src/litegraph.js:2103</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2133"><code>../src/litegraph.js:2133</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2072,7 +2072,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2613"><code>../src/litegraph.js:2613</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2643"><code>../src/litegraph.js:2643</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2109,7 +2109,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2007"><code>../src/litegraph.js:2007</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2037"><code>../src/litegraph.js:2037</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2162,7 +2162,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1944"><code>../src/litegraph.js:1944</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1974"><code>../src/litegraph.js:1974</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2209,7 +2209,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1498"><code>../src/litegraph.js:1498</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1528"><code>../src/litegraph.js:1528</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2249,7 +2249,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1599"><code>../src/litegraph.js:1599</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1629"><code>../src/litegraph.js:1629</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2306,7 +2306,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1574"><code>../src/litegraph.js:1574</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1604"><code>../src/litegraph.js:1604</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2346,7 +2346,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1800"><code>../src/litegraph.js:1800</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1830"><code>../src/litegraph.js:1830</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2413,7 +2413,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1823"><code>../src/litegraph.js:1823</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1853"><code>../src/litegraph.js:1853</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l111"><code>../src/litegraph.js:111</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l135"><code>../src/litegraph.js:135</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l129"><code>../src/litegraph.js:129</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l153"><code>../src/litegraph.js:153</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l172"><code>../src/litegraph.js:172</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l196"><code>../src/litegraph.js:196</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l185"><code>../src/litegraph.js:185</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l209"><code>../src/litegraph.js:209</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l207"><code>../src/litegraph.js:207</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l231"><code>../src/litegraph.js:231</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -515,7 +515,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l64"><code>../src/litegraph.js:64</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l70"><code>../src/litegraph.js:70</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
152
doc/data.json
152
doc/data.json
@@ -39,7 +39,7 @@
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 304,
|
||||
"line": 328,
|
||||
"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": 1349,
|
||||
"line": 1379,
|
||||
"description": "Base Class for all the node type classes",
|
||||
"params": [
|
||||
{
|
||||
@@ -71,7 +71,7 @@
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 3043,
|
||||
"line": 3074,
|
||||
"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": 5676,
|
||||
"line": 5814,
|
||||
"description": "ContextMenu from LiteGUI",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
@@ -123,7 +123,7 @@
|
||||
"classitems": [
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 64,
|
||||
"line": 70,
|
||||
"description": "Register a node class so it can be listed when the user wants to create a new one",
|
||||
"itemtype": "method",
|
||||
"name": "registerNodeType",
|
||||
@@ -143,7 +143,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 111,
|
||||
"line": 135,
|
||||
"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 +158,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 129,
|
||||
"line": 153,
|
||||
"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 +183,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 172,
|
||||
"line": 196,
|
||||
"description": "Returns a registered node type with a given name",
|
||||
"itemtype": "method",
|
||||
"name": "getNodeType",
|
||||
@@ -202,7 +202,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 185,
|
||||
"line": 209,
|
||||
"description": "Returns a list of node types matching one category",
|
||||
"itemtype": "method",
|
||||
"name": "getNodeType",
|
||||
@@ -221,7 +221,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 207,
|
||||
"line": 231,
|
||||
"description": "Returns a list with all the node type categories",
|
||||
"itemtype": "method",
|
||||
"name": "getNodeTypesCategories",
|
||||
@@ -233,7 +233,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 328,
|
||||
"line": 352,
|
||||
"description": "Removes all nodes from this graph",
|
||||
"itemtype": "method",
|
||||
"name": "clear",
|
||||
@@ -241,7 +241,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 377,
|
||||
"line": 401,
|
||||
"description": "Attach Canvas to this graph",
|
||||
"itemtype": "method",
|
||||
"name": "attachCanvas",
|
||||
@@ -256,7 +256,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 396,
|
||||
"line": 420,
|
||||
"description": "Detach Canvas from this graph",
|
||||
"itemtype": "method",
|
||||
"name": "detachCanvas",
|
||||
@@ -271,7 +271,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 414,
|
||||
"line": 438,
|
||||
"description": "Starts running this graph every interval milliseconds.",
|
||||
"itemtype": "method",
|
||||
"name": "start",
|
||||
@@ -286,7 +286,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 442,
|
||||
"line": 466,
|
||||
"description": "Stops the execution loop of the graph",
|
||||
"itemtype": "method",
|
||||
"name": "stop execution",
|
||||
@@ -294,7 +294,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 464,
|
||||
"line": 488,
|
||||
"description": "Run N steps (cycles) of the graph",
|
||||
"itemtype": "method",
|
||||
"name": "runStep",
|
||||
@@ -309,7 +309,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 543,
|
||||
"line": 567,
|
||||
"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 +317,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 647,
|
||||
"line": 671,
|
||||
"description": "Returns the amount of time the graph has been running in milliseconds",
|
||||
"itemtype": "method",
|
||||
"name": "getTime",
|
||||
@@ -329,7 +329,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 658,
|
||||
"line": 682,
|
||||
"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 +341,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 669,
|
||||
"line": 693,
|
||||
"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 +353,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 681,
|
||||
"line": 705,
|
||||
"description": "Sends an event to all the nodes, useful to trigger stuff",
|
||||
"itemtype": "method",
|
||||
"name": "sendEventToAllNodes",
|
||||
@@ -373,7 +373,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 724,
|
||||
"line": 748,
|
||||
"description": "Adds a new node instasnce to this graph",
|
||||
"itemtype": "method",
|
||||
"name": "add",
|
||||
@@ -388,7 +388,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 775,
|
||||
"line": 804,
|
||||
"description": "Removes a node from the graph",
|
||||
"itemtype": "method",
|
||||
"name": "remove",
|
||||
@@ -403,7 +403,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 844,
|
||||
"line": 873,
|
||||
"description": "Returns a node by its id.",
|
||||
"itemtype": "method",
|
||||
"name": "getNodeById",
|
||||
@@ -418,7 +418,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 857,
|
||||
"line": 886,
|
||||
"description": "Returns a list of nodes that matches a class",
|
||||
"itemtype": "method",
|
||||
"name": "findNodesByClass",
|
||||
@@ -437,7 +437,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 873,
|
||||
"line": 902,
|
||||
"description": "Returns a list of nodes that matches a type",
|
||||
"itemtype": "method",
|
||||
"name": "findNodesByType",
|
||||
@@ -456,7 +456,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 890,
|
||||
"line": 919,
|
||||
"description": "Returns a list of nodes that matches a name",
|
||||
"itemtype": "method",
|
||||
"name": "findNodesByName",
|
||||
@@ -475,7 +475,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 906,
|
||||
"line": 935,
|
||||
"description": "Returns the top-most node in this position of the canvas",
|
||||
"itemtype": "method",
|
||||
"name": "getNodeOnPos",
|
||||
@@ -504,7 +504,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1093,
|
||||
"line": 1122,
|
||||
"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 +524,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1108,
|
||||
"line": 1137,
|
||||
"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 +543,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1148,
|
||||
"line": 1177,
|
||||
"description": "returns if the graph is in live mode",
|
||||
"itemtype": "method",
|
||||
"name": "isLive",
|
||||
@@ -551,7 +551,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1185,
|
||||
"line": 1214,
|
||||
"description": "Creates a Object containing all the info about this graph, it can be serialized",
|
||||
"itemtype": "method",
|
||||
"name": "serialize",
|
||||
@@ -563,7 +563,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1218,
|
||||
"line": 1247,
|
||||
"description": "Configure a graph from a JSON string",
|
||||
"itemtype": "method",
|
||||
"name": "configure",
|
||||
@@ -578,7 +578,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1402,
|
||||
"line": 1432,
|
||||
"description": "configure a node from an object containing the serialized info",
|
||||
"itemtype": "method",
|
||||
"name": "configure",
|
||||
@@ -586,7 +586,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1498,
|
||||
"line": 1528,
|
||||
"description": "serialize the content",
|
||||
"itemtype": "method",
|
||||
"name": "serialize",
|
||||
@@ -594,7 +594,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1574,
|
||||
"line": 1604,
|
||||
"description": "serialize and stringify",
|
||||
"itemtype": "method",
|
||||
"name": "toString",
|
||||
@@ -602,7 +602,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1586,
|
||||
"line": 1616,
|
||||
"description": "get the title string",
|
||||
"itemtype": "method",
|
||||
"name": "getTitle",
|
||||
@@ -610,7 +610,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1599,
|
||||
"line": 1629,
|
||||
"description": "sets the output data",
|
||||
"itemtype": "method",
|
||||
"name": "setOutputData",
|
||||
@@ -630,7 +630,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1635,
|
||||
"line": 1665,
|
||||
"description": "retrieves the input data (data traveling through the connection) from one slot",
|
||||
"itemtype": "method",
|
||||
"name": "getInputData",
|
||||
@@ -654,7 +654,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1671,
|
||||
"line": 1701,
|
||||
"description": "tells you if there is a connection in one input slot",
|
||||
"itemtype": "method",
|
||||
"name": "isInputConnected",
|
||||
@@ -673,7 +673,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1684,
|
||||
"line": 1714,
|
||||
"description": "tells you info about an input connection (which node, type, etc)",
|
||||
"itemtype": "method",
|
||||
"name": "getInputInfo",
|
||||
@@ -692,7 +692,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1699,
|
||||
"line": 1729,
|
||||
"description": "returns the node connected in the input slot",
|
||||
"itemtype": "method",
|
||||
"name": "getInputNode",
|
||||
@@ -711,7 +711,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1720,
|
||||
"line": 1750,
|
||||
"description": "tells you the last output data that went in that slot",
|
||||
"itemtype": "method",
|
||||
"name": "getOutputData",
|
||||
@@ -730,7 +730,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1738,
|
||||
"line": 1768,
|
||||
"description": "tells you info about an output connection (which node, type, etc)",
|
||||
"itemtype": "method",
|
||||
"name": "getOutputInfo",
|
||||
@@ -749,7 +749,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1754,
|
||||
"line": 1784,
|
||||
"description": "tells you if there is a connection in one output slot",
|
||||
"itemtype": "method",
|
||||
"name": "isOutputConnected",
|
||||
@@ -768,7 +768,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1767,
|
||||
"line": 1797,
|
||||
"description": "retrieves all the nodes connected to this output slot",
|
||||
"itemtype": "method",
|
||||
"name": "getOutputNodes",
|
||||
@@ -787,7 +787,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1800,
|
||||
"line": 1830,
|
||||
"description": "Triggers an event in this node, this will trigger any output with the same name",
|
||||
"itemtype": "method",
|
||||
"name": "trigger",
|
||||
@@ -807,7 +807,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1823,
|
||||
"line": 1853,
|
||||
"description": "Triggers an slot event in this node",
|
||||
"itemtype": "method",
|
||||
"name": "triggerSlot",
|
||||
@@ -827,7 +827,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1870,
|
||||
"line": 1900,
|
||||
"description": "add a new property to this node",
|
||||
"itemtype": "method",
|
||||
"name": "addProperty",
|
||||
@@ -857,7 +857,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1896,
|
||||
"line": 1926,
|
||||
"description": "add a new output slot to use in this node",
|
||||
"itemtype": "method",
|
||||
"name": "addOutput",
|
||||
@@ -882,7 +882,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1919,
|
||||
"line": 1949,
|
||||
"description": "add a new output slot to use in this node",
|
||||
"itemtype": "method",
|
||||
"name": "addOutputs",
|
||||
@@ -897,7 +897,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1944,
|
||||
"line": 1974,
|
||||
"description": "remove an existing output slot",
|
||||
"itemtype": "method",
|
||||
"name": "removeOutput",
|
||||
@@ -912,7 +912,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1958,
|
||||
"line": 1988,
|
||||
"description": "add a new input slot to use in this node",
|
||||
"itemtype": "method",
|
||||
"name": "addInput",
|
||||
@@ -937,7 +937,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 1982,
|
||||
"line": 2012,
|
||||
"description": "add several new input slots in this node",
|
||||
"itemtype": "method",
|
||||
"name": "addInputs",
|
||||
@@ -952,7 +952,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2007,
|
||||
"line": 2037,
|
||||
"description": "remove an existing input slot",
|
||||
"itemtype": "method",
|
||||
"name": "removeInput",
|
||||
@@ -967,7 +967,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2021,
|
||||
"line": 2051,
|
||||
"description": "add an special connection to this node (used for special kinds of graphs)",
|
||||
"itemtype": "method",
|
||||
"name": "addConnection",
|
||||
@@ -997,7 +997,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2042,
|
||||
"line": 2072,
|
||||
"description": "computes the size of a node according to its inputs and output slots",
|
||||
"itemtype": "method",
|
||||
"name": "computeSize",
|
||||
@@ -1016,7 +1016,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2093,
|
||||
"line": 2123,
|
||||
"description": "returns the bounding of the object, used for rendering purposes",
|
||||
"itemtype": "method",
|
||||
"name": "getBounding",
|
||||
@@ -1028,7 +1028,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2103,
|
||||
"line": 2133,
|
||||
"description": "checks if a point is inside the shape of a node",
|
||||
"itemtype": "method",
|
||||
"name": "isPointInsideNode",
|
||||
@@ -1052,7 +1052,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2127,
|
||||
"line": 2157,
|
||||
"description": "checks if a point is inside a node slot, and returns info about which slot",
|
||||
"itemtype": "method",
|
||||
"name": "getSlotInPosition",
|
||||
@@ -1076,7 +1076,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2158,
|
||||
"line": 2188,
|
||||
"description": "returns the input slot with a given name (used for dynamic slots), -1 if not found",
|
||||
"itemtype": "method",
|
||||
"name": "findInputSlot",
|
||||
@@ -1095,7 +1095,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2174,
|
||||
"line": 2204,
|
||||
"description": "returns the output slot with a given name (used for dynamic slots), -1 if not found",
|
||||
"itemtype": "method",
|
||||
"name": "findOutputSlot",
|
||||
@@ -1114,7 +1114,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2189,
|
||||
"line": 2219,
|
||||
"description": "connect this node output to the input of another node",
|
||||
"itemtype": "method",
|
||||
"name": "connect",
|
||||
@@ -1143,7 +1143,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2307,
|
||||
"line": 2337,
|
||||
"description": "disconnect one output to an specific node",
|
||||
"itemtype": "method",
|
||||
"name": "disconnectOutput",
|
||||
@@ -1167,7 +1167,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2397,
|
||||
"line": 2427,
|
||||
"description": "disconnect one input",
|
||||
"itemtype": "method",
|
||||
"name": "disconnectInput",
|
||||
@@ -1186,7 +1186,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2466,
|
||||
"line": 2496,
|
||||
"description": "returns the center of a connection point in canvas coords",
|
||||
"itemtype": "method",
|
||||
"name": "getConnectionPos",
|
||||
@@ -1210,7 +1210,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2600,
|
||||
"line": 2630,
|
||||
"description": "Collapse the node to make it smaller on the canvas",
|
||||
"itemtype": "method",
|
||||
"name": "collapse",
|
||||
@@ -1218,7 +1218,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2613,
|
||||
"line": 2643,
|
||||
"description": "Forces the node to do not move or realign on Z",
|
||||
"itemtype": "method",
|
||||
"name": "pin",
|
||||
@@ -1226,7 +1226,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2703,
|
||||
"line": 2733,
|
||||
"description": "clears all the data inside",
|
||||
"itemtype": "method",
|
||||
"name": "clear",
|
||||
@@ -1234,7 +1234,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2738,
|
||||
"line": 2768,
|
||||
"description": "assigns a graph, you can reasign graphs to the same canvas",
|
||||
"itemtype": "method",
|
||||
"name": "setGraph",
|
||||
@@ -1249,7 +1249,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2769,
|
||||
"line": 2799,
|
||||
"description": "opens a graph contained inside a node in the current graph",
|
||||
"itemtype": "method",
|
||||
"name": "openSubgraph",
|
||||
@@ -1264,7 +1264,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2796,
|
||||
"line": 2826,
|
||||
"description": "closes a subgraph contained inside a node",
|
||||
"itemtype": "method",
|
||||
"name": "closeSubgraph",
|
||||
@@ -1279,7 +1279,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 2811,
|
||||
"line": 2842,
|
||||
"description": "assigns a canvas",
|
||||
"itemtype": "method",
|
||||
"name": "setCanvas",
|
||||
@@ -1294,7 +1294,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 3059,
|
||||
"line": 3090,
|
||||
"description": "Used to attach the canvas in a popup",
|
||||
"itemtype": "method",
|
||||
"name": "getCanvasWindow",
|
||||
@@ -1306,7 +1306,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 3073,
|
||||
"line": 3104,
|
||||
"description": "starts rendering the content of the canvas when needed",
|
||||
"itemtype": "method",
|
||||
"name": "startRendering",
|
||||
@@ -1314,7 +1314,7 @@
|
||||
},
|
||||
{
|
||||
"file": "../src/litegraph.js",
|
||||
"line": 3097,
|
||||
"line": 3128,
|
||||
"description": "stops rendering the content of the canvas (to save resources)",
|
||||
"itemtype": "method",
|
||||
"name": "stopRendering",
|
||||
|
||||
@@ -126,6 +126,12 @@ var LiteGraph = global.LiteGraph = {
|
||||
DEFAULT_POSITION: [100,100],//default node position
|
||||
node_images_path: "",
|
||||
|
||||
VALID_SHAPES: ["box","round","circle"],
|
||||
|
||||
BOX_SHAPE: 1,
|
||||
ROUND_SHAPE: 2,
|
||||
CIRCLE_SHAPE: 3,
|
||||
|
||||
//enums
|
||||
INPUT: 1,
|
||||
OUTPUT: 2,
|
||||
@@ -135,8 +141,8 @@ var LiteGraph = global.LiteGraph = {
|
||||
|
||||
ALWAYS: 0,
|
||||
ON_EVENT: 1,
|
||||
ON_TRIGGER: 1, //the same
|
||||
NEVER: 2,
|
||||
ON_TRIGGER: 3,
|
||||
|
||||
proxy: null, //used to redirect calls
|
||||
|
||||
@@ -178,6 +184,24 @@ var LiteGraph = global.LiteGraph = {
|
||||
for(var i in LGraphNode.prototype)
|
||||
if(!base_class.prototype[i])
|
||||
base_class.prototype[i] = LGraphNode.prototype[i];
|
||||
|
||||
Object.defineProperty( base_class.prototype, "shape",{
|
||||
set: function(v) {
|
||||
switch(v)
|
||||
{
|
||||
case "box": this._shape = LiteGraph.BOX_SHAPE; break;
|
||||
case "round": this._shape = LiteGraph.ROUND_SHAPE; break;
|
||||
case "circle": this._shape = LiteGraph.CIRCLE_SHAPE; break;
|
||||
default:
|
||||
this._shape = v;
|
||||
}
|
||||
},
|
||||
get: function(v)
|
||||
{
|
||||
return this._shape;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
this.registered_node_types[ type ] = base_class;
|
||||
if(base_class.constructor.name)
|
||||
@@ -815,8 +839,13 @@ LGraph.prototype.sendActionToCanvas = function(action, params)
|
||||
|
||||
LGraph.prototype.add = function(node, skip_compute_order)
|
||||
{
|
||||
if(!node || (node.id != -1 && this._nodes_by_id[node.id] != null))
|
||||
return; //already added
|
||||
if(!node)
|
||||
return;
|
||||
if(node.id != -1 && this._nodes_by_id[node.id] != null)
|
||||
{
|
||||
console.warn("LiteGraph: there is already a node with this ID, changing it");
|
||||
node.id = ++this.last_node_id;
|
||||
}
|
||||
|
||||
if(this._nodes.length >= LiteGraph.MAX_NUMBER_OF_NODES)
|
||||
throw("LiteGraph: max number of nodes in a graph reached");
|
||||
@@ -1405,6 +1434,7 @@ LGraph.prototype.onNodeTrace = function(node, msg, color)
|
||||
+ skip_title_render
|
||||
+ clip_area
|
||||
+ unsafe_execution: not allowed for safe execution
|
||||
+ skip_repeated_outputs: when adding new outputs, it wont show if there is one already connected
|
||||
|
||||
supported callbacks:
|
||||
+ onAdded: when added to graph
|
||||
@@ -1899,10 +1929,10 @@ LGraphNode.prototype.trigger = function( action, param )
|
||||
|
||||
for(var i = 0; i < this.outputs.length; ++i)
|
||||
{
|
||||
var output = this.outputs[ slot ];
|
||||
var output = this.outputs[ i ];
|
||||
if(!output || output.type !== LiteGraph.EVENT || (action && output.name != action) )
|
||||
continue;
|
||||
this.triggerSlot( slot, param );
|
||||
this.triggerSlot( i, param );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2890,6 +2920,7 @@ LGraphCanvas.prototype.closeSubgraph = function()
|
||||
if(!this._graph_stack || this._graph_stack.length == 0)
|
||||
return;
|
||||
var graph = this._graph_stack.pop();
|
||||
this.selected_nodes = {};
|
||||
graph.attachCanvas(this);
|
||||
this.setDirty(true,true);
|
||||
}
|
||||
@@ -3708,8 +3739,12 @@ LGraphCanvas.prototype.processKey = function(e)
|
||||
|
||||
var block_default = false;
|
||||
|
||||
if(e.target.localName == "input")
|
||||
return;
|
||||
|
||||
if(e.type == "keydown")
|
||||
{
|
||||
console.log(e);
|
||||
//select all Control A
|
||||
if(e.keyCode == 65 && e.ctrlKey)
|
||||
{
|
||||
@@ -3717,6 +3752,40 @@ LGraphCanvas.prototype.processKey = function(e)
|
||||
block_default = true;
|
||||
}
|
||||
|
||||
if(e.code == "KeyC" && (e.metaKey || e.ctrlKey) && !e.shiftKey ) //copy
|
||||
{
|
||||
if(this.selected_nodes)
|
||||
{
|
||||
var nodes_data = [];
|
||||
for(var i in this.selected_nodes)
|
||||
nodes_data.push( this.selected_nodes[i].serialize() );
|
||||
localStorage.setItem( "litegrapheditor_clipboard", JSON.stringify(nodes_data) );
|
||||
block_default = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(e.code == "KeyV" && (e.metaKey || e.ctrlKey) && !e.shiftKey ) //paste
|
||||
{
|
||||
var data = localStorage.getItem( "litegrapheditor_clipboard" );
|
||||
if(data)
|
||||
{
|
||||
var nodes_data = JSON.parse(data);
|
||||
for(var i = 0; i < nodes_data.length; ++i)
|
||||
{
|
||||
var node_data = nodes_data[i];
|
||||
var node = LiteGraph.createNode( node_data.type );
|
||||
if(node)
|
||||
{
|
||||
node.configure(node_data);
|
||||
node.pos[0] += 5;
|
||||
node.pos[1] += 5;
|
||||
this.graph.add( node );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//delete or backspace
|
||||
if(e.keyCode == 46 || e.keyCode == 8)
|
||||
{
|
||||
@@ -4231,6 +4300,14 @@ LGraphCanvas.prototype.drawBackCanvas = function()
|
||||
if(this.clear_background)
|
||||
ctx.clearRect(0,0,canvas.width, canvas.height);
|
||||
|
||||
if(this._graph_stack && this._graph_stack.length)
|
||||
{
|
||||
ctx.strokeStyle = this._graph_stack[ this._graph_stack.length - 1].bgcolor;
|
||||
ctx.lineWidth = 10;
|
||||
ctx.strokeRect(1,1,canvas.width-2,canvas.height-2);
|
||||
ctx.lineWidth = 1;
|
||||
}
|
||||
|
||||
//reset in case of error
|
||||
ctx.restore();
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
@@ -4316,6 +4393,8 @@ LGraphCanvas.prototype.drawBackCanvas = function()
|
||||
this.dirty_canvas = true; //to force to repaint the front canvas with the bgcanvas
|
||||
}
|
||||
|
||||
var temp_vec2 = new Float32Array(2);
|
||||
|
||||
/* Renders the LGraphNode on the canvas */
|
||||
LGraphCanvas.prototype.drawNode = function(node, ctx )
|
||||
{
|
||||
@@ -4381,8 +4460,9 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
||||
ctx.globalAlpha = editor_alpha;
|
||||
|
||||
//clip if required (mask)
|
||||
var shape = node.shape || "box";
|
||||
var size = new Float32Array(node.size);
|
||||
var shape = node._shape || LiteGraph.BOX_SHAPE;
|
||||
var size = temp_vec2;
|
||||
temp_vec2.set( node.size );
|
||||
if(node.flags.collapsed)
|
||||
{
|
||||
size[0] = LiteGraph.NODE_COLLAPSED_WIDTH;
|
||||
@@ -4393,16 +4473,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
||||
if(node.flags.clip_area)
|
||||
{
|
||||
ctx.save();
|
||||
if(shape == "box")
|
||||
if(shape == LiteGraph.BOX_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.rect(0,0,size[0], size[1]);
|
||||
}
|
||||
else if (shape == "round")
|
||||
else if (shape == LiteGraph.ROUND_SHAPE)
|
||||
{
|
||||
ctx.roundRect(0,0,size[0], size[1],10);
|
||||
}
|
||||
else if (shape == "circle")
|
||||
else if (shape == LiteGraph.CIRCLE_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc(size[0] * 0.5, size[1] * 0.5, size[0] * 0.5, 0, Math.PI*2);
|
||||
@@ -4540,8 +4620,8 @@ LGraphCanvas.prototype.drawNodeShape = function(node, ctx, size, fgcolor, bgcolo
|
||||
var title_height = LiteGraph.NODE_TITLE_HEIGHT;
|
||||
|
||||
//render depending on shape
|
||||
var shape = node.shape || "box";
|
||||
if(shape == "box")
|
||||
var shape = node._shape || LiteGraph.BOX_SHAPE;
|
||||
if(shape == LiteGraph.BOX_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.rect(0,no_title ? 0 : -title_height, size[0]+1, no_title ? size[1] : size[1] + title_height);
|
||||
@@ -4555,12 +4635,12 @@ LGraphCanvas.prototype.drawNodeShape = function(node, ctx, size, fgcolor, bgcolo
|
||||
ctx.strokeStyle = fgcolor;
|
||||
}
|
||||
}
|
||||
else if (node.shape == "round")
|
||||
else if (shape == LiteGraph.ROUND_SHAPE)
|
||||
{
|
||||
ctx.roundRect(0,no_title ? 0 : -title_height,size[0], no_title ? size[1] : size[1] + title_height, 10);
|
||||
ctx.fill();
|
||||
}
|
||||
else if (node.shape == "circle")
|
||||
else if (shape == LiteGraph.CIRCLE_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc(size[0] * 0.5, size[1] * 0.5, size[0] * 0.5, 0, Math.PI*2);
|
||||
@@ -4587,25 +4667,33 @@ LGraphCanvas.prototype.drawNodeShape = function(node, ctx, size, fgcolor, bgcolo
|
||||
ctx.fillStyle = fgcolor || LiteGraph.NODE_DEFAULT_COLOR;
|
||||
var old_alpha = ctx.globalAlpha;
|
||||
ctx.globalAlpha = 0.5 * old_alpha;
|
||||
if(shape == "box")
|
||||
if(shape == LiteGraph.BOX_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, -title_height, size[0]+1, title_height);
|
||||
ctx.fill()
|
||||
//ctx.stroke();
|
||||
}
|
||||
else if (shape == "round")
|
||||
else if (shape == LiteGraph.ROUND_SHAPE)
|
||||
{
|
||||
ctx.roundRect(0,-title_height,size[0], title_height,10,0);
|
||||
//ctx.fillRect(0,8,size[0],NODE_TITLE_HEIGHT - 12);
|
||||
ctx.fill();
|
||||
//ctx.stroke();
|
||||
}
|
||||
/*
|
||||
else if (shape == LiteGraph.CIRCLE_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc(title_height *0.5, title_height * -0.5, (title_height - 6) *0.5,0,Math.PI*2);
|
||||
ctx.fill();
|
||||
}
|
||||
*/
|
||||
|
||||
//title box
|
||||
ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;
|
||||
ctx.beginPath();
|
||||
if (shape == "round")
|
||||
if (shape == LiteGraph.ROUND_SHAPE || shape == LiteGraph.CIRCLE_SHAPE)
|
||||
ctx.arc(title_height *0.5, title_height * -0.5, (title_height - 6) *0.5,0,Math.PI*2);
|
||||
else
|
||||
ctx.rect(3,-title_height + 3,title_height - 6,title_height - 6);
|
||||
@@ -4633,8 +4721,8 @@ LGraphCanvas.prototype.drawNodeCollapsed = function(node, ctx, fgcolor, bgcolor)
|
||||
var collapsed_radius = LiteGraph.NODE_COLLAPSED_RADIUS;
|
||||
|
||||
//circle shape
|
||||
var shape = node.shape || "box";
|
||||
if(shape == "circle")
|
||||
var shape = node._shape || LiteGraph.BOX_SHAPE;
|
||||
if(shape == LiteGraph.CIRCLE_SHAPE)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc(node.size[0] * 0.5, node.size[1] * 0.5, collapsed_radius,0,Math.PI * 2);
|
||||
@@ -4647,7 +4735,7 @@ LGraphCanvas.prototype.drawNodeCollapsed = function(node, ctx, fgcolor, bgcolor)
|
||||
ctx.arc(node.size[0] * 0.5, node.size[1] * 0.5, collapsed_radius * 0.5,0,Math.PI * 2);
|
||||
ctx.fill();
|
||||
}
|
||||
else if(shape == "round") //rounded box
|
||||
else if(shape == LiteGraph.ROUND_SHAPE) //rounded box
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.roundRect(node.size[0] * 0.5 - collapsed_radius, node.size[1] * 0.5 - collapsed_radius, 2*collapsed_radius,2*collapsed_radius,5);
|
||||
@@ -5027,7 +5115,10 @@ LGraphCanvas.showMenuNodeOptionalInputs = function( v, options, e, prev_menu, no
|
||||
var label = entry[0];
|
||||
if(entry[2] && entry[2].label)
|
||||
label = entry[2].label;
|
||||
entries.push({content: label, value: entry});
|
||||
var data = {content: label, value: entry};
|
||||
if(entry[1] == LiteGraph.ACTION)
|
||||
data.className = "event";
|
||||
entries.push(data);
|
||||
}
|
||||
|
||||
if(this.onMenuNodeInputs)
|
||||
@@ -5047,7 +5138,10 @@ LGraphCanvas.showMenuNodeOptionalInputs = function( v, options, e, prev_menu, no
|
||||
v.callback.call( that, node, v, e, prev );
|
||||
|
||||
if(v.value)
|
||||
{
|
||||
node.addInput(v.value[0],v.value[1], v.value[2]);
|
||||
node.setDirtyCanvas(true,true);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -5077,7 +5171,7 @@ LGraphCanvas.showMenuNodeOptionalOutputs = function( v, options, e, prev_menu, n
|
||||
continue;
|
||||
}
|
||||
|
||||
if(node.findOutputSlot(entry[0]) != -1)
|
||||
if(node.flags && node.flags.skip_repeated_outputs && node.findOutputSlot(entry[0]) != -1)
|
||||
continue; //skip the ones already on
|
||||
var label = entry[0];
|
||||
if(entry[2] && entry[2].label)
|
||||
@@ -5118,7 +5212,11 @@ LGraphCanvas.showMenuNodeOptionalOutputs = function( v, options, e, prev_menu, n
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
node.addOutput( v.value[0], v.value[1], v.value[2]);
|
||||
node.setDirtyCanvas(true,true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -5283,10 +5381,7 @@ LGraphCanvas.prototype.showEditPropertyValue = function( node, property, options
|
||||
input_html = "<input autofocus type='checkbox' class='value' "+(node.properties[property] ? "checked" : "")+"/>";
|
||||
}
|
||||
|
||||
|
||||
var dialog = document.createElement("div");
|
||||
dialog.className = "graphdialog";
|
||||
dialog.innerHTML = "<span class='name'>" + property + "</span>"+input_html+"<button>OK</button>";
|
||||
var dialog = this.createDialog( "<span class='name'>" + property + "</span>"+input_html+"<button>OK</button>" , options );
|
||||
|
||||
if(type == "enum" && info.values)
|
||||
{
|
||||
@@ -5323,6 +5418,35 @@ LGraphCanvas.prototype.showEditPropertyValue = function( node, property, options
|
||||
}
|
||||
}
|
||||
|
||||
var button = dialog.querySelector("button");
|
||||
button.addEventListener("click", inner );
|
||||
|
||||
function inner()
|
||||
{
|
||||
setValue( input.value );
|
||||
}
|
||||
|
||||
function setValue(value)
|
||||
{
|
||||
if(typeof( node.properties[ property ] ) == "number")
|
||||
value = Number(value);
|
||||
node.properties[ property ] = value;
|
||||
|
||||
if(node.onPropertyChanged)
|
||||
node.onPropertyChanged( property, value );
|
||||
dialog.close();
|
||||
node.setDirtyCanvas(true,true);
|
||||
}
|
||||
}
|
||||
|
||||
LGraphCanvas.prototype.createDialog = function( html, options )
|
||||
{
|
||||
options = options || {};
|
||||
|
||||
var dialog = document.createElement("div");
|
||||
dialog.className = "graphdialog";
|
||||
dialog.innerHTML = html;
|
||||
|
||||
var rect = this.canvas.getClientRects()[0];
|
||||
var offsetx = -20;
|
||||
var offsety = -20;
|
||||
@@ -5351,28 +5475,15 @@ LGraphCanvas.prototype.showEditPropertyValue = function( node, property, options
|
||||
dialog.style.left = offsetx + "px";
|
||||
dialog.style.top = offsety + "px";
|
||||
|
||||
var button = dialog.querySelector("button");
|
||||
button.addEventListener("click", inner );
|
||||
|
||||
this.canvas.parentNode.appendChild( dialog );
|
||||
|
||||
|
||||
function inner()
|
||||
dialog.close = function()
|
||||
{
|
||||
setValue( input.value );
|
||||
if(this.parentNode)
|
||||
this.parentNode.removeChild( this );
|
||||
}
|
||||
|
||||
function setValue(value)
|
||||
{
|
||||
if(typeof( node.properties[ property ] ) == "number")
|
||||
value = Number(value);
|
||||
node.properties[ property ] = value;
|
||||
|
||||
if(node.onPropertyChanged)
|
||||
node.onPropertyChanged( property, value );
|
||||
dialog.parentNode.removeChild( dialog );
|
||||
node.setDirtyCanvas(true,true);
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
LGraphCanvas.onMenuNodeCollapse = function( value, options, e, menu, node )
|
||||
@@ -5388,7 +5499,7 @@ LGraphCanvas.onMenuNodePin = function( value, options, e, menu, node )
|
||||
|
||||
LGraphCanvas.onMenuNodeMode = function( value, options, e, menu, node )
|
||||
{
|
||||
new LiteGraph.ContextMenu(["Always","On Event","Never"], {event: e, callback: inner_clicked, parentMenu: prev_menu, node: node });
|
||||
new LiteGraph.ContextMenu(["Always","On Event","On Trigger","Never"], {event: e, callback: inner_clicked, parentMenu: menu, node: node });
|
||||
|
||||
function inner_clicked(v)
|
||||
{
|
||||
@@ -5397,6 +5508,7 @@ LGraphCanvas.onMenuNodeMode = function( value, options, e, menu, node )
|
||||
switch(v)
|
||||
{
|
||||
case "On Event": node.mode = LiteGraph.ON_EVENT; break;
|
||||
case "On Trigger": node.mode = LiteGraph.ON_TRIGGER; break;
|
||||
case "Never": node.mode = LiteGraph.NEVER; break;
|
||||
case "Always":
|
||||
default:
|
||||
@@ -5443,7 +5555,7 @@ LGraphCanvas.onMenuNodeShapes = function( value, options, e, menu, node )
|
||||
if(!node)
|
||||
throw("no node passed");
|
||||
|
||||
new LiteGraph.ContextMenu(["box","round"], { event: e, callback: inner_clicked, parentMenu: menu, node: node });
|
||||
new LiteGraph.ContextMenu( LiteGraph.VALID_SHAPES, { event: e, callback: inner_clicked, parentMenu: menu, node: node });
|
||||
|
||||
function inner_clicked(v)
|
||||
{
|
||||
@@ -5478,9 +5590,13 @@ LGraphCanvas.onMenuNodeClone = function( value, options, e, menu, node )
|
||||
}
|
||||
|
||||
LGraphCanvas.node_colors = {
|
||||
"red": { color:"#FAA", bgcolor:"#A44" },
|
||||
"green": { color:"#AFA", bgcolor:"#4A4" },
|
||||
"blue": { color:"#AAF", bgcolor:"#44A" },
|
||||
"red": { color:"#FAA", bgcolor:"#944" },
|
||||
"green": { color:"#AFA", bgcolor:"#494" },
|
||||
"blue": { color:"#AAF", bgcolor:"#449" },
|
||||
"cyan": { color:"#AFF", bgcolor:"#499" },
|
||||
"purple": { color:"#FAF", bgcolor:"#949" },
|
||||
"yellow": { color:"#FFA", bgcolor:"#994" },
|
||||
"black": { color:"#777", bgcolor:"#000" },
|
||||
"white": { color:"#FFF", bgcolor:"#AAA" }
|
||||
};
|
||||
|
||||
@@ -5588,10 +5704,15 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
|
||||
|
||||
if(slot)
|
||||
{
|
||||
menu_info = slot.locked ? [ "Cannot remove" ] : { "Remove Slot": slot };
|
||||
options.title = slot.input ? slot.input.type : slot.output.type;
|
||||
if(slot.input && slot.input.type == LiteGraph.EVENT)
|
||||
menu_info = [];
|
||||
menu_info.push( slot.locked ? "Cannot remove" : { content: "Remove Slot", slot: slot } );
|
||||
menu_info.push( { content: "Rename Slot", slot: slot } );
|
||||
options.title = (slot.input ? slot.input.type : slot.output.type) || "*";
|
||||
if(slot.input && slot.input.type == LiteGraph.ACTION)
|
||||
options.title = "Action";
|
||||
if(slot.output && slot.output.type == LiteGraph.EVENT)
|
||||
options.title = "Event";
|
||||
|
||||
}
|
||||
else
|
||||
menu_info = node ? this.getNodeMenuOptions(node) : this.getCanvasMenuOptions();
|
||||
@@ -5607,14 +5728,31 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
|
||||
if(!v)
|
||||
return;
|
||||
|
||||
if(v == slot)
|
||||
if(v.content == "Remove Slot")
|
||||
{
|
||||
if(v.input)
|
||||
node.removeInput( slot.slot );
|
||||
else if(v.output)
|
||||
node.removeOutput( slot.slot );
|
||||
var info = v.slot;
|
||||
if(info.input)
|
||||
node.removeInput( info.slot );
|
||||
else if(info.output)
|
||||
node.removeOutput( info.slot );
|
||||
return;
|
||||
}
|
||||
else if( v.content == "Rename Slot")
|
||||
{
|
||||
var info = v.slot;
|
||||
var dialog = that.createDialog( "<span class='name'>Name</span><input type='text'/><button>OK</button>" , options );
|
||||
var input = dialog.querySelector("input");
|
||||
dialog.querySelector("button").addEventListener("click",function(e){
|
||||
if(input.value)
|
||||
{
|
||||
var slot_info = info.input ? node.getInputInfo( info.slot ) : node.getOutputInfo( info.slot );
|
||||
if( slot_info )
|
||||
slot_info.label = input.value;
|
||||
that.setDirty(true);
|
||||
}
|
||||
dialog.close();
|
||||
});
|
||||
}
|
||||
|
||||
//if(v.callback)
|
||||
// return v.callback.call(that, node, options, e, menu, that, event );
|
||||
@@ -5933,6 +6071,9 @@ ContextMenu.prototype.addItem = function( name, value, options )
|
||||
}
|
||||
else
|
||||
element.dataset["value"] = value;
|
||||
|
||||
if(value.className)
|
||||
element.className += " " + value.className;
|
||||
}
|
||||
|
||||
this.root.appendChild(element);
|
||||
|
||||
Reference in New Issue
Block a user