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

Function node_path

external/.d3.js:13088–13102  ·  view source on GitHub ↗
(end)

Source from the content-addressed store, hash-verified

13086}
13087
13088function node_path(end) {
13089 var start = this,
13090 ancestor = leastCommonAncestor(start, end),
13091 nodes = [start];
13092 while (start !== ancestor) {
13093 start = start.parent;
13094 nodes.push(start);
13095 }
13096 var k = nodes.length;
13097 while (end !== ancestor) {
13098 nodes.splice(k, 0, end);
13099 end = end.parent;
13100 }
13101 return nodes;
13102}
13103
13104function leastCommonAncestor(a, b) {
13105 if (a === b) return a;

Callers

nothing calls this directly

Calls 1

leastCommonAncestorFunction · 0.85

Tested by

no test coverage detected