Formatting Layout using mouse

Hello, I am creating a Sankey Diagram (Sankey diagrams in JavaScript)

When it displays, I notice I can move the different parts with my mouse. I want the layout to stay after I format it by dragging the parts around with my mouse. On my website each user will see a sankey diagram with their data and I want them to be able to format it by dragging however they want and for the format to be maintained. Any ideas?