tentone hace 5 años
padre
commit
33c83bc891
Se han modificado 1 ficheros con 17 adiciones y 1 borrados
  1. 17 1
      README.md

+ 17 - 1
README.md

@@ -115,7 +115,23 @@ event.create();
 ### Node Graph
 ### Node Graph
 
 
 - Node graph can be used to create node diagrams, node have inputs and outputs sockets that can be connected using node connectors.
 - Node graph can be used to create node diagrams, node have inputs and outputs sockets that can be connected using node connectors.
-- Data flows between the nodes, each node class has to implement how its data is processed using the `getValue()` method of its sockets.
+- Data flows between the nodes, each node class has to implement how its data is processed using the `getValue()` method of its sockets. This method is called across the nodes connected together to retrieve the result at any point.
+
+```javascript
+registerSockets()
+{
+	this.a = this.addInput("number", "a");
+	this.b = this.addInput("number", "b");
+    
+	this.r = this.addOutput("number", "r");
+	this.r.getValue = () =>
+	{
+        // Add input A and input B
+		return this.a.getValue() + this.b.getValue();
+	};
+}
+```
+
 - The node value propagates trough the node connections from outputs to inputs.
 - The node value propagates trough the node connections from outputs to inputs.
 - Its possible to integrate user input elements using the DOM wrapper object.
 - Its possible to integrate user input elements using the DOM wrapper object.