How to re-allign a gojs flow chart?

Is there a way to align the roughly created flowchart by user ?

Attached here is a sample rough flowchart–>>

and its desired output should be like this–>>

You could try setting Diagram.layout to a LayeredDigraphLayout. That’s what the Flowgrammer sample does, http://gojs.net/latest/samples/flowgrammer.html.

Walter,

This is not what i am looking for.

I want my GoJS original flowchart to be aligned (as shown in picture), upon some button click, after the user has created the flowchart.

I tried setting the layout as LayeredDigraphLayout, but that didn’t work for me.

The Page Flow sample, http://gojs.net/latest/samples/pageFlow.html, demonstrates what I think you are looking for. Basically you want to set Layout.isOngoing to false and you want your button to call Diagram.layoutDiagram. If you are keeping node locations in your model, you probably also want to set Layout.isInitial to false as well.

The Fishbone sample, http://gojs.net/latest/extensions/Fishbone.html, demonstrates another way for a button to cause a (different) layout to occur.

Hey Walter,
That worked, it allowed me to align the diagram upon button click.
Thanks.

However, the diagram is aligned horizontally like this–>>

I want the diagram to be aligned vertically like this -->>

Is there another property or setting that needs to be set to achieve this ?

LayeredDigraphLayout.direction. Please read the documentation, http://gojs.net/latest/api/symbols/LayeredDigraphLayout.html, and play interactively with the properties at http://gojs.net/latest/samples/ldLayout.html.

Thanks Walter,
Got the feature i was looking for.