src/alignment.js
function moveTopDown(node, dx, dy) {
        var nodes = node.union(node.descendants());

        nodes.filter(":childless").positions(function (node, i) {
            if(typeof node === "number") {
              node = i;
            }
            var pos = node.position();
            return {
                x: pos.x + dx,
                y: pos.y + dy
            };
        });
    }
function moveTopDown(node, dx, dy) {
        var nodes = node.union(node.descendants());

        nodes.filter(":childless").positions(function (node, i) {
            if(typeof node === "number") {
              node = i;
            }
            var pos = node.position();
            return {
                x: pos.x + dx,
                y: pos.y + dy
            };
        });
    }
function moveTopDown ( node , dx , dy ) { var nodes = node . union ( node . descendants ( ) ) ; nodes . filter ( ":childless" ) . positions ( function ( node , i ) { if ( typeof node === "number" ) { node = i ; } var pos = node . position ( ) ; return { x : pos . x + dx , y : pos . y + dy } ; } ) ; }
Needed because parent nodes cannot be moved in Cytoscape.js < v3.2
Needed because parent nodes cannot be moved in Cytoscape . js < v3 . 2