documentationfor yFiles for HTML 2.6

LayoutExecutorAsync

Executes an algorithm or ILayoutAlgorithm on a graph asynchronously and optionally animates the transition to the new layout, afterwards.

Inheritance Hierarchy
LayoutExecutorAsync

Remarks

In contrast to LayoutExecutor, this class serves as one half of the pair of two classes that perform the calculation in separate contexts, asynchronously to the main thread that starts the layout. This allows the main thread to continue and the UI to stay responsive when longer layout calculations need to be performed, or multiple layout calculations should be carried out in parallel.

Instances of this class will serialize all the information that is required to execute the algorithm and send that information to a separate context, which processes the data with the help of the LayoutExecutorAsyncWorker class. The context that worker executes in often is a Web Worker, but it could also be running on a different machine or a server.

The actual transmission of the serialized data to the other context is not part of this implementation. Rather, it can be added by means of passing a function callback to the constructor. That function will be given an opaque blob that can be serialized and sent to the second context where it will be processed by a call to process. Once the the response is received from the other context, the function callback resolves the Promise and the results are applied to the graph.

Related Reading in the Developer's Guide

The ability to execute layouts asynchronously via web workers is presented in detail in the section Asynchronous Layout Calculation.

Type Details

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

See Also

Constructors

Properties

Methods