Is it required to store the Gojs Geometric values to redraw the same diagram?

We are building the application to draw flow chart and extract the user input to store them in DB. When we need to redisplay the same, do we need to have all the Geometric values to get the same diagram?

Do you have any API which helps to calculate the points and displays the diagram?


  1. Flow chart starts from top to bottom, if it has decision box(Rhombus symbol) the left and right branches.
  2. User cannot drag the node and place them in different place.

The answers to your questions are “no”, you don’t have to have saved node locations in your database, and “yes”, you can use GoJS Layouts to automatically position nodes and route links.

I guess you are starting with the FlowChart sample,, which uses saved node locations and no Diagram.layout.

Perhaps you have not seen the Flowgrammer sample, That uses LayeredDigraphLayout as the Diagram.layout. However that layout does not have the two links coming out from a conditional/“if” node from the left and right sides. We should improve that sample.

But you can get some of the same effects by setting the Diagram.layout of the FlowChart sample:

          layout: $(go.LayeredDigraphLayout,
                    { direction: 90, setsPortSpots: false, isOngoing: false }),

You can add an HTML Button or other command that calls Diagram.layoutDiagram() when the user wants to perform a layout after adding or removing any nodes or links.

If you do not want users to move nodes, set Diagram.allowMove to false. See for more information, including other permissions that you might want to disable for your users.