# Alignment and reording

**URL:** <https://forum.bpmn.io/t/alignment-and-reording/11110>\
**Category:** Developers\
**Created:** [May 30, 2024, 5:57pm UTC](https://forum.bpmn.io/t/alignment-and-reording/11110 "2024-05-30T17:57:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessia\_Volpi](https://forum.bpmn.io/user_avatar/forum.bpmn.io/alessia_volpi/32/5289_2.png) [@Alessia\_Volpi](https://forum.bpmn.io/u/Alessia_Volpi)\
**Post date:** [May 30, 2024, 5:57pm UTC](https://forum.bpmn.io/t/alignment-and-reording/11110/1 "2024-05-30T17:57:14Z")

</div>

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 task to the process and in the end the entire diagram is a mess. So… exists some function that can help me or do i need to implement it by myself.  
Thank in advance for the answer.

In order that this is the before:

 ![Screenshot 2024-04-23 alle 10.49.28](https://forum.bpmn.io/uploads/default/original/2X/b/b6c69bf7975c15c9dc48cd124b7ee0e6bb4b5c62.png)

And this the result of the call of the function  
 ![Screenshot 2024-04-23 alle 10.49.38](https://forum.bpmn.io/uploads/default/original/2X/b/bfb786ab6221bd5216340b92ac2fd57a7652a48b.png)

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [May 31, 2024, 7:25am UTC](https://forum.bpmn.io/t/alignment-and-reording/11110/2 "2024-05-31T07:25:15Z")

</div>

![Recording 2024-05-31 at 09.24.57](https://forum.bpmn.io/uploads/default/original/2X/2/258c8567a8ddf41422489f3cb672e5a037708742.gif)

---

<div class="post-metadata">

**Author:** ![Alessia\_Volpi](https://forum.bpmn.io/user_avatar/forum.bpmn.io/alessia_volpi/32/5289_2.png) [@Alessia\_Volpi](https://forum.bpmn.io/u/Alessia_Volpi)\
**Post date:** [May 31, 2024, 10:13am UTC](https://forum.bpmn.io/t/alignment-and-reording/11110/3 "2024-05-31T10:13:29Z")

</div>

so exist a function that i can call? In which way i can call it from bpmnjs?

---

<div class="post-metadata">

**Author:** ![Martin](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@Martin](https://forum.bpmn.io/u/Martin)\
**Post date:** [May 31, 2024, 10:16am UTC](https://forum.bpmn.io/t/alignment-and-reording/11110/4 "2024-05-31T10:16:34Z")

</div>

You can use the alignElements service

> <https://github.com/bpmn-io/diagram-js/blob/develop/lib/features/align-elements/AlignElements.js>

---

<div class="post-metadata">

**Author:** ![system](https://forum.bpmn.io/uploads/default/original/2X/b/b534893973385c2d302b38572464112e4adae002.png) [@system](https://forum.bpmn.io/u/system)\
**Post date:** [June 7, 2024, 10:17am UTC](https://forum.bpmn.io/t/alignment-and-reording/11110/5 "2024-06-07T10:17:22Z")

</div>

Closed on June 7, 2024, 10:17am UTC

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