elk icon indicating copy to clipboard operation
elk copied to clipboard

Avoid multiple (unnecessary) layout calls

Open uruuru opened this issue 7 years ago • 3 comments

Currently the layout button, and thus the LayoutHandler#execute() method, invokes a layout call every time it is pressed. We could add an option that avoids simultaneous layouts of the same diagram, for instance by scheduling the layout only if no new layout request has been issued for the same diagram.

uruuru avatar Mar 05 '18 11:03 uruuru

We already have some code that checks for multiple operations on the same diagram, see ElkServicePlugin.getRunningOperations(). However, operations are canceled only after a layout has been computed.

spoenemann avatar Mar 07 '18 09:03 spoenemann

Can't this yield lost updates when elements are added to a graph in the meantime? Also, numerous layout runs can start before any of them is canceled.

uruuru avatar Mar 07 '18 12:03 uruuru

Yeah, it makes more sense to cancel old runs as soon as new ones arrive.

spoenemann avatar Mar 07 '18 13:03 spoenemann