mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 03:01:11 +00:00
Dont trunctate node labels on hover
* makes it easier to read long node labels on demand
This commit is contained in:
@@ -27,7 +27,7 @@ const nodeShapes = {
|
||||
cloud: NodeShapeCloud
|
||||
};
|
||||
|
||||
function getNodeShape({shape, stack}) {
|
||||
function getNodeShape({ shape, stack }) {
|
||||
const nodeShape = nodeShapes[shape];
|
||||
if (!nodeShape) {
|
||||
throw new Error(`Unknown shape: ${shape}!`);
|
||||
@@ -59,8 +59,9 @@ export default class Node extends React.Component {
|
||||
subLabel, scaleFactor, transform, zoomScale } = this.props;
|
||||
|
||||
const color = getNodeColor(rank, label, pseudo);
|
||||
const labelText = ellipsis(label, 14, nodeScale(4 * scaleFactor));
|
||||
const subLabelText = ellipsis(subLabel, 12, nodeScale(4 * scaleFactor));
|
||||
const truncate = !focused && !highlighted;
|
||||
const labelText = truncate ? ellipsis(label, 14, nodeScale(4 * scaleFactor)) : label;
|
||||
const subLabelText = truncate ? ellipsis(subLabel, 12, nodeScale(4 * scaleFactor)) : subLabel;
|
||||
|
||||
let labelOffsetY = 18;
|
||||
let subLabelOffsetY = 35;
|
||||
|
||||
Reference in New Issue
Block a user