PHP 7.4.33
Preview: link.js Size: 1.79 KB
/var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/d3-shape/src/link.js
import {slice} from "./array.js";
import constant from "./constant.js";
import {bumpX, bumpY, bumpRadial} from "./curve/bump.js";
import {withPath} from "./path.js";
import {x as pointX, y as pointY} from "./point.js";

function linkSource(d) {
  return d.source;
}

function linkTarget(d) {
  return d.target;
}

export function link(curve) {
  let source = linkSource,
      target = linkTarget,
      x = pointX,
      y = pointY,
      context = null,
      output = null,
      path = withPath(link);

  function link() {
    let buffer;
    const argv = slice.call(arguments);
    const s = source.apply(this, argv);
    const t = target.apply(this, argv);
    if (context == null) output = curve(buffer = path());
    output.lineStart();
    argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));
    argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));
    output.lineEnd();
    if (buffer) return output = null, buffer + "" || null;
  }

  link.source = function(_) {
    return arguments.length ? (source = _, link) : source;
  };

  link.target = function(_) {
    return arguments.length ? (target = _, link) : target;
  };

  link.x = function(_) {
    return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), link) : x;
  };

  link.y = function(_) {
    return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), link) : y;
  };

  link.context = function(_) {
    return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;
  };

  return link;
}

export function linkHorizontal() {
  return link(bumpX);
}

export function linkVertical() {
  return link(bumpY);
}

export function linkRadial() {
  const l = link(bumpRadial);
  l.angle = l.x, delete l.x;
  l.radius = l.y, delete l.y;
  return l;
}

Directory Contents

Dirs: 4 × Files: 19
Name Size Perms Modified Actions
curve DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
offset DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
order DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
symbol DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
8.64 KB lrw-r--r-- 2026-04-28 09:11:39
Edit Download
3.14 KB lrw-r--r-- 2026-04-28 09:11:39
Edit Download
944 B lrw-r--r-- 2026-04-28 09:11:39
Edit Download
242 B lrw-r--r-- 2026-04-28 09:11:39
Edit Download
81 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
86 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
43 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
3.28 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.69 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
402 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.79 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
492 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
29 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
393 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
2.34 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
81 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
101 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.39 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.80 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).