Comparing version 0.3.6 to 0.3.7
@@ -0,1 +1,6 @@ | ||
v0.3.7 | ||
====== | ||
* Add bounding box information to output graph | ||
v0.3.6 | ||
@@ -2,0 +7,0 @@ ====== |
@@ -227,2 +227,17 @@ var util = require('./util'), | ||
}); | ||
// Attach bounding box information | ||
var maxX = 0, maxY = 0; | ||
g.eachNode(function(u, value) { | ||
maxX = Math.max(maxX, value.x + value.width / 2); | ||
maxY = Math.max(maxY, value.y + value.height / 2); | ||
}); | ||
g.eachEdge(function(e, u, v, value) { | ||
var maxXPoints = Math.max.apply(Math, value.points.map(function(p) { return p.x; })); | ||
var maxYPoints = Math.max.apply(Math, value.points.map(function(p) { return p.y; })); | ||
maxX = Math.max(maxX, maxXPoints + value.width / 2); | ||
maxY = Math.max(maxY, maxYPoints + value.height / 2); | ||
}); | ||
out.graph().bbox = { width: maxX, height: maxY }; | ||
return out; | ||
@@ -229,0 +244,0 @@ } |
@@ -1,1 +0,1 @@ | ||
module.exports = '0.3.6'; | ||
module.exports = '0.3.7'; |
{ | ||
"name": "dagre", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "Graph layout for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71913
1736