mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
1ff50b2fc0
commit
24ecb90a51
1 changed files with 9 additions and 2 deletions
|
@ -38,7 +38,8 @@ export class Node extends React.PureComponent<Props, State> {
|
|||
const { nodeType, node, options, squareSize, bounds, formatter, timeRange } = this.props;
|
||||
const { isPopoverOpen } = this.state;
|
||||
const { metric } = node;
|
||||
const valueMode = squareSize > 110;
|
||||
const valueMode = squareSize > 70;
|
||||
const ellipsisMode = squareSize > 30;
|
||||
const rawValue = (metric && metric.value) || 0;
|
||||
const color = colorFromValue(options.legend, rawValue, bounds);
|
||||
const value = formatter(rawValue);
|
||||
|
@ -64,11 +65,17 @@ export class Node extends React.PureComponent<Props, State> {
|
|||
>
|
||||
<SquareOuter color={color}>
|
||||
<SquareInner color={color}>
|
||||
{valueMode && (
|
||||
{valueMode ? (
|
||||
<ValueInner>
|
||||
<Label color={color}>{node.name}</Label>
|
||||
<Value color={color}>{value}</Value>
|
||||
</ValueInner>
|
||||
) : (
|
||||
ellipsisMode && (
|
||||
<ValueInner>
|
||||
<Label color={color}>...</Label>
|
||||
</ValueInner>
|
||||
)
|
||||
)}
|
||||
</SquareInner>
|
||||
</SquareOuter>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue