Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dagre-d3

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dagre-d3 - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

6

CHANGELOG.md

@@ -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 @@ ======

22

lib/Renderer.js

@@ -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 @@

2

lib/version.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc