diff --git a/src/js/portfolio.js b/src/js/portfolio.js index 163c2a9..79221c2 100644 --- a/src/js/portfolio.js +++ b/src/js/portfolio.js @@ -312,7 +312,16 @@ var linkText = link .selectAll(".node") .data(graph.nodes) .enter().append("g") - .attr("class", function(d) { return 'node ' + d['@type']; }) + .attr("class", function(d) { + let baseClasses = 'node ' + d['@type']; + if(d['@type']) { + let slashpos = d['@type'].lastIndexOf('/'); + if(slashpos > -1) { + baseClasses += ' ' + d['@type'].substr(slashpos + 1); + } + } + return baseClasses; + }) ; var getViewbox = function() { return svg.attr("viewBox").split(" ").map(parseFloat); @@ -949,7 +958,7 @@ nodeTitle // scale according to text length: if(textLength > nodeSize * 2) { - self.attr('transform', `scale(${(nodeSize * 2) / textLength})`); + self.attr('transform', `scale(${(nodeSize * 2) / textLength / 1.05})`); } }) ; diff --git a/src/scss/portfolio.scss b/src/scss/portfolio.scss index b655842..14cbef9 100644 --- a/src/scss/portfolio.scss +++ b/src/scss/portfolio.scss @@ -122,15 +122,15 @@ g.node{ // font-family: "CMU Bright", sans-serif; font-size: 10pt; - // TODO: make this valid - // g[class*="ImageObject"] & { - // display: none; - // } - tspan{ text-anchor:middle; } } + &.ImageObject{ + text.nodeTitle { + display: none; + } + } } .relationship{