Abdul K Shahid
Abdul K Shahid

Reputation: 538

ngx graph - Store the state of the graph after repositioning some nodes

The ngx-graph is used to draw flow diagram in angular. The algorithm automatically aligns the nodes with proper spacing. Also there is a feature to drag the nodes from their initial positions But on page refresh all the changes made by the user are lost as the algorithm rebuilds the graph.

Is it possible to save the state of the graph after the user repositions them?

Upvotes: 1

Views: 1257

Answers (1)

Assaf Shemesh
Assaf Shemesh

Reputation: 11

The answer is yes and no, from the library, you won't get this ability but if you maintain your layout file you can select to calculate the layout or use existing points. Which points to use? the set of points that you already calculate on the first load and saved it on your app. So it requires some work but possible, it's not a feature that is part of the graph but needs to be maintain on the layout level.

Hope I was clear.

Upvotes: 1

Related Questions