reverse square images to circles

This commit is contained in:
Ruben van de Ven 2018-09-22 19:22:49 +02:00
parent b21c467c54
commit 14bae34193

View file

@ -650,7 +650,10 @@ node.append('circle')
.attr("r", nodeSize) .attr("r", nodeSize)
.attr("class", "nodeBg") .attr("class", "nodeBg")
; ;
node.append('circle')
.attr("r", nodeSize * 1.08) // nodeSize + margin
.attr("class", "highlightCircle")
;
node.append('text') node.append('text')
.append("textPath") .append("textPath")
@ -658,28 +661,17 @@ node.append('text')
.text(getNodeTitle); .text(getNodeTitle);
node.each(function(d) { node.each(function(d) {
let n = d3.select(this);
if(!d.contentUrl) { if(!d.contentUrl) {
n.append('circle') return;
.attr("r", nodeSize * 1.08) // nodeSize + margin }
.attr("class", "highlightCircle") d3.select(this).append('svg:image')
;
} else {
n.append('svg:image')
.attr("xlink:href", d.contentUrl) .attr("xlink:href", d.contentUrl)
.attr("width", nodeSize*2) .attr("width", nodeSize*2)
.attr("height", nodeSize*2) .attr("height", nodeSize*2)
.attr("transform","translate(-"+nodeSize+" -"+nodeSize+")") .attr("transform","translate(-"+nodeSize+" -"+nodeSize+")")
// .attr("clip-path","url(#clipNodeImage)") .attr("clip-path","url(#clipNodeImage)")
.attr("preserveAspectRatio","xMidYMid slice") .attr("preserveAspectRatio","xMidYMid slice")
; ;
n.append('rect')
.attr("width", nodeSize * 1.08 * 2) // nodeSize + margin
.attr("height", nodeSize * 1.08 * 2) // nodeSize + margin
.attr("transform","translate(-"+nodeSize * 1.08 +" -"+nodeSize * 1.08 +")")
.attr("class", "highlightCircle")
;
}
}); });
// node.append("title") // node.append("title")