Regarding changing the layout: Take a look at the implementation of this sample: Fishbone Layout. Look at what each of the buttons does to replace the diagram’s current layout.
But you will need to remove many (or all?) of the links, and then add new ones to form the long chain of nodes. To do that, after you start the transaction and before you replace the Diagram.layout, you can replace the GraphLinksModel.linkDataArray.