Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,7 @@ | ||
v0.2.1 | ||
====== | ||
* Now dagre-d3 will use user-supplied width and height if they are set as | ||
attributes on nodes and edges. | ||
v0.2.0 | ||
@@ -2,0 +8,0 @@ ====== |
@@ -409,6 +409,9 @@ var layout = require('dagre').layout; | ||
var bbox = root.node().getBBox(); | ||
var bbox = root.node().getBBox(), | ||
origBBox = { width: bbox.width, height: bbox.height }; | ||
if ('width' in node) { bbox.width = node.width; } | ||
if ('height' in node) { bbox.height = node.height; } | ||
labelSvg.attr('transform', | ||
'translate(' + (-bbox.width / 2) + ',' + (-bbox.height / 2) + ')'); | ||
'translate(' + (-origBBox.width / 2) + ',' + (-origBBox.height / 2) + ')'); | ||
@@ -421,3 +424,16 @@ rect | ||
.attr('width', bbox.width + 2 * marginX) | ||
.attr('height', bbox.height + 2 * marginY); | ||
.attr('height', bbox.height + 2 * marginY) | ||
.attr('fill', '#fff'); | ||
if (node.fill) { | ||
rect.attr('fill', node.fill); | ||
} | ||
if (node.href) { | ||
root | ||
.attr('class', root.attr('class') + ' clickable') | ||
.on('click', function() { | ||
window.open(node.href); | ||
}); | ||
} | ||
} | ||
@@ -424,0 +440,0 @@ |
@@ -1,1 +0,1 @@ | ||
module.exports = '0.2.0'; | ||
module.exports = '0.2.1'; |
{ | ||
"name": "dagre-d3", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A D3-based renderer for Dagre", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -126,2 +126,7 @@ # dagre-d3 - A D3-based renderer for Dagre | ||
### Embedding HTML in the SVG Graph | ||
If the label starts with an HTML tag, it is interpreted as HTML and is embeded as an foreignobject SVG element. | ||
But note that the IE does not support this SVG element. | ||
### Rendering the Graph | ||
@@ -188,2 +193,9 @@ | ||
Or for example, to disable drag and zoom: | ||
```js | ||
renderer.zoom(false); | ||
renderer.run(g, d3.select("svg g")); | ||
``` | ||
### Configuring the Layout | ||
@@ -190,0 +202,0 @@ |
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
30378
546
231