This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
circle = g.merge(circle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const count_text = g | |
.append("svg:text") | |
.attr("class", "countText") | |
.attr("r", 10) | |
.attr("dx", function(d) { | |
let X = outerNodebbox.x; | |
let WIDTH = outerNodebbox.width; | |
return X + (2.5 * WIDTH) / 3; | |
}) | |
.attr("dy", function(d) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const count_circle = g | |
.append("svg:circle") | |
.attr("class", "countCircle") | |
.style("visibility", "unset") | |
.attr("r", 10) | |
.attr("cx", function(d) { | |
let X = outerNodebbox.x; | |
let WIDTH = outerNodebbox.width; | |
return X + (2.5 * WIDTH) / 3; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const description = g | |
.append("svg:text") | |
.attr("class", "description") | |
.attr("dx", function(d) { | |
return outerNodebbox.width / 3; | |
}) | |
.attr("dy", function(d) { | |
return (2 * outerNodebbox.height) / 3; | |
}) | |
.attr("dominant-baseline", "central") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const label = g | |
.append("svg:text") | |
.attr("class", "name") | |
.attr("dx", function(d) { | |
return outerNodebbox.width / 3; | |
}) | |
.attr("dy", function(d) { | |
return outerNodebbox.height / 3; | |
}) | |
.attr("dominant-baseline", "central") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const images = g | |
.append("svg:image") | |
.attr( | |
"xlink:href", | |
"https://img.icons8.com/ios-glyphs/30/000000/superman.png" | |
) | |
.attr("x", function(d) { | |
let X = outerNodebbox.x; | |
return X + 10; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var outerNodebbox = rectangularNode.node().getBBox(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rectangularNode = g | |
.append("svg:rect") | |
.attr("class", "node") | |
.attr("x", d => { | |
return 0; | |
}) | |
.attr("y", d => { | |
return 0; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let circle = svg | |
.append("svg:g") | |
.selectAll("g") | |
.data(nodes, d => d.id); | |
const g = circle.enter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var width = 500, height = 400; | |
const nodes = [ | |
{ | |
id: 0, | |
name: "ServiceGroup", | |
description: "Port : 80", | |
connection_count: 3 | |
} | |
]; |
NewerOlder