Interface CoordQuad<Ops>

a Coord that places nodes to minimize a quadratic function

This operators generally takes the longest of all built-in operators but produces a pleasing layout.

Create with coordQuad.

Type Parameters

Hierarchy

  • Coord<OpNodeDatum<Ops>, OpLinkDatum<Ops>>
    • CoordQuad
  • assign coordinates to a layered graph

    Type Parameters

    • N extends unknown

    • L extends unknown

    Parameters

    • layers: SugiNode<N, L>[][]

      a layered graph of sugiyama nodes

    • sep: SugiSeparation<N, L>

      how much horizontal separation should exist between nodes

    Returns number

    width - the total width of the layout

Methods

  • set the weight for how close nodes should be to zero.

    This ensures the optimization is sound, and is necessary if there are certain types of disconnected components or zero weights for different curvature constraints. If the graph is connected and the weights are positive this can be set to zero, otherwise it should be positive, but small.

    (default: 1e-6)

    Parameters

    • val: number

    Returns CoordQuad<Ops>

  • get the current compress weight.

    Returns number

  • set the link curve weight accessor

    The link curve weight penalizes links to reduce their curving, in dependent of their verticality. If using strongVert for an edge, it probably won't need a strong link curve weight.

    (default: 1)

    Type Parameters

    Parameters

    • val: NewLinkCurve

    Returns CoordQuad<U<Ops, "linkCurve", NewLinkCurve>>

  • get the current link curve weight accessor

    Returns Ops["linkCurve"]

  • set the node curve weight accessor

    The node curve weight penalizes curves through nodes. If a node only has one incoming and one outgoing edge, it will try to make them match in angle. Note that it does it for all possible "through edges" so multiple incoming and multiple outgoing will get counted several times. It's not clear why this would ever be desirable, but it's possible to specify.

    (default: 0)

    Type Parameters

    Parameters

    • val: NewNodeCurve

    Returns CoordQuad<U<Ops, "nodeCurve", NewNodeCurve>>

  • get the current node curve accessor

    Returns Ops["nodeCurve"]

  • set the strong vertical accessor.

    The strong vertical accessor adds a penalty to make edges vertical. It penealizes any section of an edge that isn't vertical, making longer edges contribute more to the overall impact on the objective.

    (default: 0)

    Type Parameters

    Parameters

    • val: NewVertStrong

    Returns CoordQuad<U<Ops, "vertStrong", NewVertStrong>>

  • get the current vertStrong accessor

    Returns Ops["vertStrong"]

  • set the weak vertical accessor.

    The weak vertical accessor adds a penalty to make edges vertical. It's weak in that it applies to all edges equally regardless of length, and while it penalized non vertical edges, it allows curving in the middle of long edges.

    (default: 1)

    Type Parameters

    Parameters

    • val: NewVertWeak

    Returns CoordQuad<U<Ops, "vertWeak", NewVertWeak>>

  • get the current vertWeak accessor

    Returns Ops["vertWeak"]

Generated using TypeDoc