JountJS - Creating FSM Dynamically through PHP

400 views Asked by At

I'm using JointJS for creating state diagram. I am creating FSM Dynamically through PHP. is there any way to lay the states automatically apart from each other without specifying vertices.Also the link should be made curvy without specificity x n y.

I'm working on a "Reservation Table Analyzer algorithm" with PHP, bootstrap n jQuery. I need state diagram for this algo output. I've done everything. Its working fine but states are scattered n doesn't look good. even links are not appearing proper.

I need some way to place these states auto arranged without specifying vertices (x, y). As handling their x and y in algorithm iteration is difficult. Please take a look at demo here. http://www.figmentsol.com/rtanalyzer/ Use following data for test Time slices:4 Add 3 resources Resource1 : 1001 Resource2 : 0100 Resource3 : 0010 Click start to see result!

Please help!

1

There are 1 answers

1
dave On BEST ANSWER

You can use the joint.layout.DirectedGraph.js plugin that can be found on the JointJS download page: http://jointjs.com/download (at the bottom).

Then just call joint.layout.DirectedGraph.layout(graph, { setLinkVertices: true }).