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

dagre

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dagre - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# v0.0.3
* Support for HTML node labels. To use an HTML node label, start the label with
the `<` character.
# v0.0.2

@@ -2,0 +7,0 @@

2

package.json
{
"name": "dagre",
"version": "0.0.2",
"version": "0.0.3",
"description": "Directed graph rendering",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -59,9 +59,9 @@ /*

var text = createTextNode(u);
svg.appendChild(text);
var svgNode = createSVGNode(u);
svg.appendChild(svgNode);
var bbox = text.getBBox();
var bbox = svgNode.getBBox();
attrs.width = Math.max(attrs.width, bbox.width);
attrs.height = Math.max(attrs.height, bbox.height);
svg.removeChild(text);
svg.removeChild(svgNode);
});

@@ -68,0 +68,0 @@

@@ -57,4 +57,10 @@ /*

var text = createTextNode(u);
group.appendChild(text);
var svgNode = createSVGNode(u);
if(svgNode.nodeName === "foreignObject") {
svgNode.setAttribute("x", -(u.attrs.width / 2 + u.attrs.strokeWidth / 2));
svgNode.setAttribute("y", -(u.attrs.height / 2 + u.attrs.strokeWidth / 2));
svgNode.setAttribute("width", u.attrs.width);
svgNode.setAttribute("height", u.attrs.height);
}
group.appendChild(svgNode);
});

@@ -61,0 +67,0 @@ }

@@ -11,2 +11,28 @@ dagre.util = {};

*/
function createSVGNode(node, x){
if(node.attrs.label[0] === '<') {
return createHTMLNode(node);
} else {
return createTextNode(node, x);
}
}
function createHTMLNode(node){
var fo = createSVGElement("foreignObject");
var div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
div.innerHTML = node.attrs.label;
div.setAttribute("id", "temporaryDiv");
var body = document.getElementsByTagName('body')[0];
body.appendChild(div);
var td = document.getElementById("temporaryDiv");
td.setAttribute("style", "width:10;float:left;");
fo.setAttribute("width", td.clientWidth);
fo.setAttribute("height", td.clientHeight);
body.removeChild(td);
div.setAttribute("id", "");
fo.appendChild(div);
return fo;
}
function createTextNode(node, x) {

@@ -13,0 +39,0 @@ var fontSize = node.attrs.fontSize;

@@ -1,1 +0,1 @@

dagre.version = "0.0.2";
dagre.version = "0.0.3";

Sorry, the diff of this file is not supported yet

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