diff --git a/client/app/scripts/charts/node.js b/client/app/scripts/charts/node.js index 58a3ecd31..6fd29dfca 100644 --- a/client/app/scripts/charts/node.js +++ b/client/app/scripts/charts/node.js @@ -18,8 +18,8 @@ const Node = React.createClass({ } else if (props.blurred) { scaleFactor = 0.75; } - const textOffsetX = 0; - const textOffsetY = scale(0.5 * scaleFactor) + 18; + const labelOffsetY = 18; + const subLabelOffsetY = labelOffsetY + 17; const isPseudo = !!this.props.pseudo; const color = isPseudo ? '' : this.getNodeColor(this.props.rank); const onClick = this.props.onClick; @@ -42,20 +42,24 @@ const Node = React.createClass({ const classes = classNames.join(' '); return ( - + {function(interpolated) { const transform = `translate(${interpolated.x.val},${interpolated.y.val})`; return ( - {props.highlighted && } - - - - + {props.highlighted && } + + + + {label} - + {subLabel} @@ -69,10 +73,8 @@ const Node = React.createClass({ const averageCharLength = fontSize / 1.5; const allowedChars = maxWidth / averageCharLength; let truncatedText = text; - let trimmedText = text; - while (text && trimmedText.length > 1 && trimmedText.length > allowedChars) { - trimmedText = trimmedText.slice(0, -1); - truncatedText = trimmedText + '...'; + if (text && text.length > allowedChars) { + truncatedText = text.slice(0, allowedChars) + '...'; } return truncatedText; },