I just remembered this and wanted to record it before I forgot. The JS API method that creates links uses the getSourcePort and getTargetPort methods on the react-diagrams link model to get the node IDs for the edge creation endpoint. But these correspond to the port where the user started dragging and the port where they stopped, respectively, rather than the out- and in-ports. Meaning if someone drew a link backwards, the DiGraph edge would be backwards. We need to add a step to the JS API method that determines which of the two ports is of type out, and sets that as the first parameter in the API call.
I just remembered this and wanted to record it before I forgot. The JS API method that creates links uses the
getSourcePort
andgetTargetPort
methods on the react-diagrams link model to get the node IDs for the edge creation endpoint. But these correspond to the port where the user started dragging and the port where they stopped, respectively, rather than the out- and in-ports. Meaning if someone drew a link backwards, the DiGraph edge would be backwards. We need to add a step to the JS API method that determines which of the two ports is of typeout
, and sets that as the first parameter in the API call.