reverse square images to circles
This commit is contained in:
parent
b21c467c54
commit
14bae34193
1 changed files with 13 additions and 21 deletions
|
@ -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')
|
||||
.attr("xlink:href", d.contentUrl)
|
||||
.attr("width", nodeSize*2)
|
||||
.attr("height", nodeSize*2)
|
||||
.attr("transform","translate(-"+nodeSize+" -"+nodeSize+")")
|
||||
// .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")
|
||||
;
|
||||
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("preserveAspectRatio","xMidYMid slice")
|
||||
;
|
||||
});
|
||||
|
||||
// node.append("title")
|
||||
|
|
Loading…
Reference in a new issue