Reorder and align the elements and the diagram

Hi, I would like to ask if you know about some function that can be invoked and that re allign or reorder the entire diagram in bpmnjs.
I recursively add other element to the diagram and in the end the entire diagram is a mess.
So… exists some function that can help me?
Thank in advance for the answer.

Please share a running / prototypical example that clearly shows what you’re trying to achieve, what is working and what is not.

Use our existing starter projects to quickly hack it or share your existing, partial solution on GitHub or via a CodeSandbox. Provide the necessary pointers that allow us to quickly understand where you got stuck.

This way we may be able to help you in a constructive manner.

Thanks :heart:

Some libraries have built-in functions for re-aligning or reordering elements. Have you checked if bpmn-js has a layout or auto layout function?

You can either use Modeling#alignElements or Modeling#distributeElements or lay out the diagram from scratch using GitHub - bpmn-io/bpmn-auto-layout: Layout BPMN diagrams, generating missing DI information.. These are the options we offer. Anything else you’d have to build yourself.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.