drawio-desktop icon indicating copy to clipboard operation
drawio-desktop copied to clipboard

Script to align the segments of multiple edges neatly

Open raindropsfromsky opened this issue 1 month ago • 0 comments

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe. It is very tedious to arrange the segments of multiple edges to create a neat appearance. Every segment has to be dragged manually.

Further, when multiple orthogonal/horizontal/vertical edges are converging on a common point on a node, it is virtually impossible to snap them into one line. In such case, the segments have a slight lateral offset, which looks ugly.

In the following illustration, I have deliberately not used the snap points of nodes (shapes). As a result-

  1. The horizontal segments of the blue and red edges do not align with each other.
  2. The vertical segments of the blue and red edges do not align perfectly. Image

A similar difficulty arises when we want to lay out multiple edges with parallel and equidistant segments (drawn like an electrical bus bar).

Describe the solution you'd like I asked ChatGPT, which generated a JavaScript to achieve these alignments (see attached file). segment-layout-plugin.js

But I am unable to run the script. It would be great if this functionality is provided by default.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

raindropsfromsky avatar Oct 17 '25 09:10 raindropsfromsky