Interface TwolayerOpt

a Twolayer for optimal decrossing of a single target layer

The opt order operator orders the relevant layer to minimize the number of crossings. This is expensive, but not nearly as expensive as optimizing all crossings initially.

Create with twolayerOpt.

interface TwolayerOpt {
    check(val: OptChecking): TwolayerOpt;
    check(): OptChecking;
    dist(val: boolean): TwolayerOpt;
    dist(): boolean;
    (
        topLayer: SugiNode<unknown, unknown>[],
        bottomLayer: SugiNode<unknown, unknown>[],
        topDown: boolean,
    ): void;
}

Hierarchy (View Summary)

  • rearrange one layer conditioned on another

    Parameters

    • topLayer: SugiNode<unknown, unknown>[]

      the top layer

    • bottomLayer: SugiNode<unknown, unknown>[]

      the bottom layer

    • topDown: boolean

      if true rearrange bottomLayer, else rearrange topLayer

    Returns void

Methods

Methods

  • set whether to also minimize distance between nodes with common ancestors

    This adds more variables and constraints so will take longer, but will likely produce a better layout. It is the same as DecrossOpt#dist.

    (default: false)

    Parameters

    • val: boolean

    Returns TwolayerOpt

  • get whether the current layout minimizes distance

    Returns boolean