MCPcopy Create free account
hub / github.com/breck7/scroll / firstWalk

Function firstWalk

external/.d3.js:13963–13980  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

13961 // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the
13962 // node v is placed to the midpoint of its outermost children.
13963 function firstWalk(v) {
13964 var children = v.children,
13965 siblings = v.parent.children,
13966 w = v.i ? siblings[v.i - 1] : null;
13967 if (children) {
13968 executeShifts(v);
13969 var midpoint = (children[0].z + children[children.length - 1].z) / 2;
13970 if (w) {
13971 v.z = w.z + separation(v._, w._);
13972 v.m = v.z - midpoint;
13973 } else {
13974 v.z = midpoint;
13975 }
13976 } else if (w) {
13977 v.z = w.z + separation(v._, w._);
13978 }
13979 v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
13980 }
13981
13982 // Computes all real x-coordinates by summing up the modifiers recursively.
13983 function secondWalk(v) {

Callers

nothing calls this directly

Calls 2

executeShiftsFunction · 0.85
apportionFunction · 0.85

Tested by

no test coverage detected