documentationfor yFiles for HTML 2.6

LayoutExecutor

Executes a ILayoutAlgorithm and optionally animates the transition to the calculated layout.

Inheritance Hierarchy
LayoutExecutor

Remarks

This class is the preferred way to execute a layout on the current or main thread. The layout animation can be customized in various ways via this class' properties.

If no fine-grained control of the animation is required, the methods applyLayout and morphLayout can be used instead.

For larger graphs and complicated layouts that have a greater execution time, blocking the main JavaScript thread of the browser can result in a poor user experience. In order to reduce the blocking time, a Web Worker or an external layout service process may be used. This can be implemented conveniently with the help of the LayoutExecutorAsync class, which is almost fully API compatible to this class, but requires a two-way communication setup between the main thread and the worker thread. It is thus recommended to start with using this approach and potentially blocking the main thread and only switch to the multi-threaded solution in a second step, if required. The code used for the solution, here, can be reused for the asynchronous solution, too.

Related Reading in the Developer's Guide

Migrating from LayoutExecutor to LayoutExecutorAsync and when this should be done is explained in the section Migrating from Synchronous to Asynchronous Layout Calculation.

Type Details

yfiles module
view-layout-bridge
yfiles-umd modules
view-layout-bridge
Legacy UMD name
yfiles.layout.LayoutExecutor

See Also

Constructors

Properties

Methods