diff --git a/bower.json b/bower.json index 10716f2f..3a580512 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "dagre", - "version": "0.8.6", + "version": "0.8.61", "main": [ "dist/dagre.core.js" ], diff --git a/dist/dagre.core.js b/dist/dagre.core.js index 62b5b885..693c6b0d 100644 --- a/dist/dagre.core.js +++ b/dist/dagre.core.js @@ -2266,7 +2266,6 @@ function positionY(g) { var labelheight = 0; _.forEach(layer, function(v) { var node = g.node(v); - console.log("nodeY", node); if (node.dummy === "border" && node.whimNode) { borderTopSeen = true; labelheight = node.labelheight; @@ -2979,7 +2978,7 @@ function notime(name, fn) { } },{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){ -module.exports = "0.8.6"; +module.exports = "0.8.61"; },{}]},{},[1])(1) }); diff --git a/dist/dagre.core.min.js b/dist/dagre.core.min.js index e14587a4..903ae5b2 100644 --- a/dist/dagre.core.min.js +++ b/dist/dagre.core.min.js @@ -323,7 +323,7 @@ _.forEach(align,function(v){xs[v]=xs[root[v]]});return xs}function buildBlockGra * the minimum coordinate of the smallest width alignment and right-biased * alignments have their maximum coordinate at the same point as the maximum * coordinate of the smallest width alignment. - */function alignCoordinates(xss,alignTo){var alignToVals=_.values(alignTo),alignToMin=_.min(alignToVals),alignToMax=_.max(alignToVals);_.forEach(["u","d"],function(vert){_.forEach(["l","r"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;var xsVals=_.values(xs);delta=horiz==="l"?alignToMin-_.min(xsVals):alignToMax-_.max(xsVals);if(delta){xss[alignment]=_.mapValues(xs,function(x){return x+delta})}})})}function balance(xss,align){return _.mapValues(xss.ul,function(ignore,v){if(align){return xss[align.toLowerCase()][v]}else{var xs=_.sortBy(_.map(xss,v));return(xs[1]+xs[2])/2}})}function positionX(g){var layering=util.buildLayerMatrix(g);var conflicts=_.merge(findType1Conflicts(g,layering),findType2Conflicts(g,layering));var xss={};var adjustedLayering;_.forEach(["u","d"],function(vert){adjustedLayering=vert==="u"?layering:_.values(layering).reverse();_.forEach(["l","r"],function(horiz){if(horiz==="r"){adjustedLayering=_.map(adjustedLayering,function(inner){return _.values(inner).reverse()})}var neighborFn=(vert==="u"?g.predecessors:g.successors).bind(g);var align=verticalAlignment(g,adjustedLayering,conflicts,neighborFn);var xs=horizontalCompaction(g,adjustedLayering,align.root,align.align,horiz==="r");if(horiz==="r"){xs=_.mapValues(xs,function(x){return-x})}xss[vert+horiz]=xs})});var smallestWidth=findSmallestWidthAlignment(g,xss);alignCoordinates(xss,smallestWidth);return balance(xss,g.graph().align)}function sep(nodeSep,edgeSep,reverseSep){return function(g,v,w){var vLabel=g.node(v);var wLabel=g.node(w);var sum=0;var delta;sum+=vLabel.width/2;if(_.has(vLabel,"labelpos")){switch(vLabel.labelpos.toLowerCase()){case"l":delta=-vLabel.width/2;break;case"r":delta=vLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;sum+=(vLabel.dummy?edgeSep:nodeSep)/2;sum+=(wLabel.dummy?edgeSep:nodeSep)/2;sum+=wLabel.width/2;if(_.has(wLabel,"labelpos")){switch(wLabel.labelpos.toLowerCase()){case"l":delta=wLabel.width/2;break;case"r":delta=-wLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;return sum}}function width(g,v){return g.node(v).width}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(require,module,exports){"use strict";var _=require("../lodash");var util=require("../util");var positionX=require("./bk").positionX;module.exports=position;function position(g){g=util.asNonCompoundGraph(g);positionY(g);_.forEach(positionX(g),function(x,v){g.node(v).x=x})}function positionY(g){var layering=util.buildLayerMatrix(g);var rankSep=g.graph().ranksep;var prevY=0;_.forEach(layering,function(layer){var maxHeight=_.max(_.map(layer,function(v){return g.node(v).height}));var borderTopSeen=false;var labelheight=0;_.forEach(layer,function(v){var node=g.node(v);console.log("nodeY",node);if(node.dummy==="border"&&node.whimNode){borderTopSeen=true;labelheight=node.labelheight}node.y=prevY+maxHeight/2});if(borderTopSeen){prevY+=maxHeight+labelheight+24}else{prevY+=maxHeight+rankSep}})}},{"../lodash":10,"../util":29,"./bk":23}],25:[function(require,module,exports){"use strict";var _=require("../lodash");var Graph=require("../graphlib").Graph;var slack=require("./util").slack;module.exports=feasibleTree; + */function alignCoordinates(xss,alignTo){var alignToVals=_.values(alignTo),alignToMin=_.min(alignToVals),alignToMax=_.max(alignToVals);_.forEach(["u","d"],function(vert){_.forEach(["l","r"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;var xsVals=_.values(xs);delta=horiz==="l"?alignToMin-_.min(xsVals):alignToMax-_.max(xsVals);if(delta){xss[alignment]=_.mapValues(xs,function(x){return x+delta})}})})}function balance(xss,align){return _.mapValues(xss.ul,function(ignore,v){if(align){return xss[align.toLowerCase()][v]}else{var xs=_.sortBy(_.map(xss,v));return(xs[1]+xs[2])/2}})}function positionX(g){var layering=util.buildLayerMatrix(g);var conflicts=_.merge(findType1Conflicts(g,layering),findType2Conflicts(g,layering));var xss={};var adjustedLayering;_.forEach(["u","d"],function(vert){adjustedLayering=vert==="u"?layering:_.values(layering).reverse();_.forEach(["l","r"],function(horiz){if(horiz==="r"){adjustedLayering=_.map(adjustedLayering,function(inner){return _.values(inner).reverse()})}var neighborFn=(vert==="u"?g.predecessors:g.successors).bind(g);var align=verticalAlignment(g,adjustedLayering,conflicts,neighborFn);var xs=horizontalCompaction(g,adjustedLayering,align.root,align.align,horiz==="r");if(horiz==="r"){xs=_.mapValues(xs,function(x){return-x})}xss[vert+horiz]=xs})});var smallestWidth=findSmallestWidthAlignment(g,xss);alignCoordinates(xss,smallestWidth);return balance(xss,g.graph().align)}function sep(nodeSep,edgeSep,reverseSep){return function(g,v,w){var vLabel=g.node(v);var wLabel=g.node(w);var sum=0;var delta;sum+=vLabel.width/2;if(_.has(vLabel,"labelpos")){switch(vLabel.labelpos.toLowerCase()){case"l":delta=-vLabel.width/2;break;case"r":delta=vLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;sum+=(vLabel.dummy?edgeSep:nodeSep)/2;sum+=(wLabel.dummy?edgeSep:nodeSep)/2;sum+=wLabel.width/2;if(_.has(wLabel,"labelpos")){switch(wLabel.labelpos.toLowerCase()){case"l":delta=wLabel.width/2;break;case"r":delta=-wLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;return sum}}function width(g,v){return g.node(v).width}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(require,module,exports){"use strict";var _=require("../lodash");var util=require("../util");var positionX=require("./bk").positionX;module.exports=position;function position(g){g=util.asNonCompoundGraph(g);positionY(g);_.forEach(positionX(g),function(x,v){g.node(v).x=x})}function positionY(g){var layering=util.buildLayerMatrix(g);var rankSep=g.graph().ranksep;var prevY=0;_.forEach(layering,function(layer){var maxHeight=_.max(_.map(layer,function(v){return g.node(v).height}));var borderTopSeen=false;var labelheight=0;_.forEach(layer,function(v){var node=g.node(v);if(node.dummy==="border"&&node.whimNode){borderTopSeen=true;labelheight=node.labelheight}node.y=prevY+maxHeight/2});if(borderTopSeen){prevY+=maxHeight+labelheight+24}else{prevY+=maxHeight+rankSep}})}},{"../lodash":10,"../util":29,"./bk":23}],25:[function(require,module,exports){"use strict";var _=require("../lodash");var Graph=require("../graphlib").Graph;var slack=require("./util").slack;module.exports=feasibleTree; /* * Constructs a spanning tree with tight edges and adjusted the input node's * ranks to achieve this. A tight edge is one that is has a length that matches @@ -513,4 +513,4 @@ function addWhimBorderNode(g,prefix,labelHeight){var node={width:0,height:0,whim /* * Returns a new function that wraps `fn` with a timer. The wrapper logs the * time it takes to execute the function. - */function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){module.exports="0.8.6"},{}]},{},[1])(1)}); + */function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){module.exports="0.8.61"},{}]},{},[1])(1)}); diff --git a/dist/dagre.js b/dist/dagre.js index 8882561f..7b62a383 100644 --- a/dist/dagre.js +++ b/dist/dagre.js @@ -2266,7 +2266,6 @@ function positionY(g) { var labelheight = 0; _.forEach(layer, function(v) { var node = g.node(v); - console.log("nodeY", node); if (node.dummy === "border" && node.whimNode) { borderTopSeen = true; labelheight = node.labelheight; @@ -2979,7 +2978,7 @@ function notime(name, fn) { } },{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){ -module.exports = "0.8.6"; +module.exports = "0.8.61"; },{}],31:[function(require,module,exports){ /** diff --git a/dist/dagre.min.js b/dist/dagre.min.js index c1ed57f0..1bf5f7d6 100644 --- a/dist/dagre.min.js +++ b/dist/dagre.min.js @@ -323,7 +323,7 @@ _.forEach(align,function(v){xs[v]=xs[root[v]]});return xs}function buildBlockGra * the minimum coordinate of the smallest width alignment and right-biased * alignments have their maximum coordinate at the same point as the maximum * coordinate of the smallest width alignment. - */function alignCoordinates(xss,alignTo){var alignToVals=_.values(alignTo),alignToMin=_.min(alignToVals),alignToMax=_.max(alignToVals);_.forEach(["u","d"],function(vert){_.forEach(["l","r"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;var xsVals=_.values(xs);delta=horiz==="l"?alignToMin-_.min(xsVals):alignToMax-_.max(xsVals);if(delta){xss[alignment]=_.mapValues(xs,function(x){return x+delta})}})})}function balance(xss,align){return _.mapValues(xss.ul,function(ignore,v){if(align){return xss[align.toLowerCase()][v]}else{var xs=_.sortBy(_.map(xss,v));return(xs[1]+xs[2])/2}})}function positionX(g){var layering=util.buildLayerMatrix(g);var conflicts=_.merge(findType1Conflicts(g,layering),findType2Conflicts(g,layering));var xss={};var adjustedLayering;_.forEach(["u","d"],function(vert){adjustedLayering=vert==="u"?layering:_.values(layering).reverse();_.forEach(["l","r"],function(horiz){if(horiz==="r"){adjustedLayering=_.map(adjustedLayering,function(inner){return _.values(inner).reverse()})}var neighborFn=(vert==="u"?g.predecessors:g.successors).bind(g);var align=verticalAlignment(g,adjustedLayering,conflicts,neighborFn);var xs=horizontalCompaction(g,adjustedLayering,align.root,align.align,horiz==="r");if(horiz==="r"){xs=_.mapValues(xs,function(x){return-x})}xss[vert+horiz]=xs})});var smallestWidth=findSmallestWidthAlignment(g,xss);alignCoordinates(xss,smallestWidth);return balance(xss,g.graph().align)}function sep(nodeSep,edgeSep,reverseSep){return function(g,v,w){var vLabel=g.node(v);var wLabel=g.node(w);var sum=0;var delta;sum+=vLabel.width/2;if(_.has(vLabel,"labelpos")){switch(vLabel.labelpos.toLowerCase()){case"l":delta=-vLabel.width/2;break;case"r":delta=vLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;sum+=(vLabel.dummy?edgeSep:nodeSep)/2;sum+=(wLabel.dummy?edgeSep:nodeSep)/2;sum+=wLabel.width/2;if(_.has(wLabel,"labelpos")){switch(wLabel.labelpos.toLowerCase()){case"l":delta=wLabel.width/2;break;case"r":delta=-wLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;return sum}}function width(g,v){return g.node(v).width}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(require,module,exports){"use strict";var _=require("../lodash");var util=require("../util");var positionX=require("./bk").positionX;module.exports=position;function position(g){g=util.asNonCompoundGraph(g);positionY(g);_.forEach(positionX(g),function(x,v){g.node(v).x=x})}function positionY(g){var layering=util.buildLayerMatrix(g);var rankSep=g.graph().ranksep;var prevY=0;_.forEach(layering,function(layer){var maxHeight=_.max(_.map(layer,function(v){return g.node(v).height}));var borderTopSeen=false;var labelheight=0;_.forEach(layer,function(v){var node=g.node(v);console.log("nodeY",node);if(node.dummy==="border"&&node.whimNode){borderTopSeen=true;labelheight=node.labelheight}node.y=prevY+maxHeight/2});if(borderTopSeen){prevY+=maxHeight+labelheight+24}else{prevY+=maxHeight+rankSep}})}},{"../lodash":10,"../util":29,"./bk":23}],25:[function(require,module,exports){"use strict";var _=require("../lodash");var Graph=require("../graphlib").Graph;var slack=require("./util").slack;module.exports=feasibleTree; + */function alignCoordinates(xss,alignTo){var alignToVals=_.values(alignTo),alignToMin=_.min(alignToVals),alignToMax=_.max(alignToVals);_.forEach(["u","d"],function(vert){_.forEach(["l","r"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;var xsVals=_.values(xs);delta=horiz==="l"?alignToMin-_.min(xsVals):alignToMax-_.max(xsVals);if(delta){xss[alignment]=_.mapValues(xs,function(x){return x+delta})}})})}function balance(xss,align){return _.mapValues(xss.ul,function(ignore,v){if(align){return xss[align.toLowerCase()][v]}else{var xs=_.sortBy(_.map(xss,v));return(xs[1]+xs[2])/2}})}function positionX(g){var layering=util.buildLayerMatrix(g);var conflicts=_.merge(findType1Conflicts(g,layering),findType2Conflicts(g,layering));var xss={};var adjustedLayering;_.forEach(["u","d"],function(vert){adjustedLayering=vert==="u"?layering:_.values(layering).reverse();_.forEach(["l","r"],function(horiz){if(horiz==="r"){adjustedLayering=_.map(adjustedLayering,function(inner){return _.values(inner).reverse()})}var neighborFn=(vert==="u"?g.predecessors:g.successors).bind(g);var align=verticalAlignment(g,adjustedLayering,conflicts,neighborFn);var xs=horizontalCompaction(g,adjustedLayering,align.root,align.align,horiz==="r");if(horiz==="r"){xs=_.mapValues(xs,function(x){return-x})}xss[vert+horiz]=xs})});var smallestWidth=findSmallestWidthAlignment(g,xss);alignCoordinates(xss,smallestWidth);return balance(xss,g.graph().align)}function sep(nodeSep,edgeSep,reverseSep){return function(g,v,w){var vLabel=g.node(v);var wLabel=g.node(w);var sum=0;var delta;sum+=vLabel.width/2;if(_.has(vLabel,"labelpos")){switch(vLabel.labelpos.toLowerCase()){case"l":delta=-vLabel.width/2;break;case"r":delta=vLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;sum+=(vLabel.dummy?edgeSep:nodeSep)/2;sum+=(wLabel.dummy?edgeSep:nodeSep)/2;sum+=wLabel.width/2;if(_.has(wLabel,"labelpos")){switch(wLabel.labelpos.toLowerCase()){case"l":delta=wLabel.width/2;break;case"r":delta=-wLabel.width/2;break}}if(delta){sum+=reverseSep?delta:-delta}delta=0;return sum}}function width(g,v){return g.node(v).width}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(require,module,exports){"use strict";var _=require("../lodash");var util=require("../util");var positionX=require("./bk").positionX;module.exports=position;function position(g){g=util.asNonCompoundGraph(g);positionY(g);_.forEach(positionX(g),function(x,v){g.node(v).x=x})}function positionY(g){var layering=util.buildLayerMatrix(g);var rankSep=g.graph().ranksep;var prevY=0;_.forEach(layering,function(layer){var maxHeight=_.max(_.map(layer,function(v){return g.node(v).height}));var borderTopSeen=false;var labelheight=0;_.forEach(layer,function(v){var node=g.node(v);if(node.dummy==="border"&&node.whimNode){borderTopSeen=true;labelheight=node.labelheight}node.y=prevY+maxHeight/2});if(borderTopSeen){prevY+=maxHeight+labelheight+24}else{prevY+=maxHeight+rankSep}})}},{"../lodash":10,"../util":29,"./bk":23}],25:[function(require,module,exports){"use strict";var _=require("../lodash");var Graph=require("../graphlib").Graph;var slack=require("./util").slack;module.exports=feasibleTree; /* * Constructs a spanning tree with tight edges and adjusted the input node's * ranks to achieve this. A tight edge is one that is has a length that matches @@ -513,7 +513,7 @@ function addWhimBorderNode(g,prefix,labelHeight){var node={width:0,height:0,whim /* * Returns a new function that wraps `fn` with a timer. The wrapper logs the * time it takes to execute the function. - */function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){module.exports="0.8.6"},{}],31:[function(require,module,exports){ + */function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":7,"./lodash":10}],30:[function(require,module,exports){module.exports="0.8.61"},{}],31:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. diff --git a/lib/position/index.js b/lib/position/index.js index a6081cf6..a54e51da 100644 --- a/lib/position/index.js +++ b/lib/position/index.js @@ -25,7 +25,6 @@ function positionY(g) { var labelheight = 0; _.forEach(layer, function(v) { var node = g.node(v); - console.log("nodeY", node); if (node.dummy === "border" && node.whimNode) { borderTopSeen = true; labelheight = node.labelheight; diff --git a/lib/version.js b/lib/version.js index b8e21fee..c8886d47 100644 --- a/lib/version.js +++ b/lib/version.js @@ -1 +1 @@ -module.exports = "0.8.6"; +module.exports = "0.8.61"; diff --git a/package-lock.json b/package-lock.json index 9711834c..57406b8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@whimsicalcode/dagre", - "version": "0.8.6", + "version": "0.8.61", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@whimsicalcode/dagre", - "version": "0.8.6", + "version": "0.8.61", "license": "MIT", "dependencies": { "graphlib": "^2.1.8", diff --git a/package.json b/package.json index aee20d11..669bffd2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@whimsicalcode/dagre", - "version": "0.8.6", + "version": "0.8.61", "description": "Graph layout for JavaScript", "author": "Chris Pettitt ", "contributors": [