Interface TwolayerAgg<Agg>

a Twolayer that orders nodes based off aggregated ancestor indices

This is much faster than twolayerOpt, and often produces comparable or better layouts. Nodes without ancestors will be placed first to minimize the distance between nodes with common ancestors, and then to minimize rank inversions with respect to the initial ordering.

Create with twolayerAgg.

Type Parameters

Hierarchy

  • 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 the Aggregator for this operator

    The aggregator is used to combine the indices of ancestors to provide a suitable rank for ordering. There are three built-in variants:

    • aggMean - The simple mean of indices. This is very fast and memory efficient, but is often worse than the other two.
    • aggMedian - Takes the median of the indices. This is often better for minimizing edge crossings than mean.
    • aggWeightedMedian - This slightly skews the results for nodes with an even number of ancestors, that tends to be a little better than aggMedian but runs a little slower.

    (default: aggWeightedMedian)

    Type Parameters

    Parameters

    • val: NewAgg

    Returns TwolayerAgg<NewAgg>

    Example

    const twolayer = twolayerAgg().aggregator(aggMedian);
    
  • get the current aggregator

    Returns Agg

Generated using TypeDoc