I have defined a node with multiple outputs similar to this sample code :
https://codepen.io/hatead1/pen/GaZYaq
But the output connections to other nodes were not created when editing and retrieving the file through editor.fromJson . To solve this problem, I tried to manually connect the corresponding outputs to the adjacent nodes. In order to connect after creating the node and creating the corresponding control, first I created a list of non-exist connections including input_node_id, input_node_port, output_node_id and output_node_port in the json format with the name of Connection and then created the connection manually through the following code.
Connections are created, but when in line editor.view.updateConnections , I get the following error message.
Uncaught Error: Connection view not found
Also, when changing the position of the connection node, it does not move along with the input and output sockets and leaves a fixed view.
When usingthis.trigger('connectioncreated', connection) by changing the location of the node, the connections are created in the new position, but the previous connections remain in place, and a crowded view of nodes and connections is created.
This problem only occurs for nodes created with this property, that is, multi-output nodes with a changeable number of outputs, and there is no problem when editing through the main editor environment. The problem only occurs when creating a connection manually.
What should I do to create connections and change and move when moving and changing the size of the nodes connected to it?
I have defined a node with multiple outputs similar to this sample code : https://codepen.io/hatead1/pen/GaZYaq But the output connections to other nodes were not created when editing and retrieving the file through editor.fromJson . To solve this problem, I tried to manually connect the corresponding outputs to the adjacent nodes. In order to connect after creating the node and creating the corresponding control, first I created a list of non-exist connections including input_node_id, input_node_port, output_node_id and output_node_port in the json format with the name of Connection and then created the connection manually through the following code.
Connections are created, but when in line editor.view.updateConnections , I get the following error message.
Uncaught Error: Connection view not found
Also, when changing the position of the connection node, it does not move along with the input and output sockets and leaves a fixed view.When using
this.trigger('connectioncreated', connection)
by changing the location of the node, the connections are created in the new position, but the previous connections remain in place, and a crowded view of nodes and connections is created.This problem only occurs for nodes created with this property, that is, multi-output nodes with a changeable number of outputs, and there is no problem when editing through the main editor environment. The problem only occurs when creating a connection manually. What should I do to create connections and change and move when moving and changing the size of the nodes connected to it?