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