Link<T> constructor

Link<T>(
  1. CurveFactory curve,
  2. T source(
    1. Link<T>, [
    2. List<Object?>?
    ]),
  3. T target(
    1. Link<T>, [
    2. List<Object?>?
    ]),
  4. num x(
    1. T, [
    2. List<Object?>?
    ]),
  5. num y(
    1. T, [
    2. List<Object?>?
    ]),
)

Constructs a new link generator using the specified curve and the given source, target, x and y accessors.

For example, to visualize links in a tree diagram rooted on the top edge of the display, you might say:

final link = Link(
  curveBumpY,
  (thisArg, [args]) => args[0]["source"],
  (thisArg, [args]) => args[0]["target"],
  (d, [args]) => d["x"],
  (d, [args]) => d["y"],
);

Implementation

Link(
    CurveFactory curve,
    T Function(Link<T>, [List<Object?>?]) source,
    T Function(Link<T>, [List<Object?>?]) target,
    num Function(T, [List<Object?>?]) x,
    num Function(T, [List<Object?>?]) y)
    : super(curve, source, target, x, y);