I've been asked to build a petri net engine to use as a basis for internal workflows at work.
So far I've been able to generate all the logic and behaviours (I have created a "Service Desk" type of workflow to test rules and conditions) and it all works OK.
Something that's proving to be a bit of a pain, though, is visualizing the Petri net and automating this visualization.
I've been taking a look at SVG-Drawing diagram routines like: http://flowchart.js.org (flowcharts) https://bramp.github.io/js-sequence-diagrams/ (Sequence Diagrams)
And I'd love to either modify one of these or find a similar one to use as a basis, but I'm facing an unexpected problem: I'm absolutely unfamiliar with complex drawing routines and theory that handles automatic placement of multiple concurrent connections and branches.
The two examples above are simple enough but in a Petri net you may have a single place spawning multiple transitions and even short/simple nets can easily become unwieldy diagrams if not handled properly.
What would be the best way to approach this problem?
EDIT: I ended up using MermaidJS, which has basic workflow diagramming and is easy to adapt. While it's not designed for Petri Net diagrams natively it does allow for enough styling and flexibility in workflows to accurately reflect the net.