Small fixes

This commit is contained in:
Ruben van de Ven 2019-02-18 12:04:25 +01:00
parent a4a4a5763e
commit 0737c09e1f
2 changed files with 16 additions and 7 deletions

View File

@ -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})`);
}
})
;

View File

@ -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{