Functionality in Org Chart to shift a node to left

OK, if you have the two nodes that you want to exchange, you just need to do something like:

var right = myDiagram.selection.first(); // the selected Node
var left = …; // the node to the left of the selected Node, if any
if (!left) return;
myDiagram.startTransaction(“shift left”);
// swap “sequence” values
var r = right.data.sequence;
myDiagram.model.setDataProperty(right.data, “sequence”, left.data.sequence);
myDiagram.model.setDataProperty(left.data, “sequence”, r);
// call this because the layout doesn’t know it depends on state that has changed:
myDiagram.layout.invalidateLayout();
myDiagram.commitTransaction(“shift left”);