You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also grab events from the mouse in case your node has some sort of special interactivity.
157
157
@@ -187,16 +187,16 @@ function MyNodeType()
187
187
```
188
188
189
189
This is the list of supported widgets:
190
-
***"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1} );```
190
+
***"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1, precision: 3 } );```
191
191
***"slider"** to change a number by dragging the mouse, the syntax is the same as number.
192
192
***"combo"** to select between multiple choices, the syntax is:
@@ -205,6 +205,7 @@ The fourth optional parameter could be options for the widget, the parameters ac
205
205
***property**: specifies the name of a property to modify when the widget changes
206
206
***min**: min value
207
207
***max**: max value
208
+
***precision**: set the number of digits after decimal point
208
209
***callback**: function to call when the value changes.
209
210
210
211
Widget's value is not serialized by default when storing the node state, but if you want to store the value of widgets just set serialize_widgets to true:
@@ -223,11 +224,17 @@ Or if you want to associate a widget with a property of the node, then specify i
223
224
functionMyNode()
224
225
{
225
226
this.properties= { surname:"smith" };
226
-
this.addWidget("text","Surname","", { property:"surname"}); //this will modify the node.properties
227
+
this.addWidget("text","Surname","", { property:"surname"}); //this will modify the node.properties
227
228
}
228
229
```
229
230
## LGraphCanvas
230
231
LGraphCanvas is the class in charge of rendering/interaction with the nodes inside the browser.
232
+
233
+
## LGraphCanvas settings
234
+
There are graph canvas settings that could be defined or modified to change behaviour:
235
+
236
+
***allow_interaction**: when set to `false` disable interaction with the canvas (`flags.allow_interaction` on node can be used to override graph canvas setting)
237
+
231
238
### Canvas Shortcuts
232
239
* Space - Holding space key while moving the cursor moves the canvas around. It works when holding the mouse button down so it is easier to connect different nodes when the canvas gets too large.
233
240
* Ctrl/Shift + Click - Add clicked node to selection.
@@ -277,7 +284,7 @@ To define slots for nodes you must use the type LiteGraph.ACTION for inputs, and
0 commit comments