diff --git a/client/app/scripts/charts/node-shape-circle.js b/client/app/scripts/charts/node-shape-circle.js index 176af9d59..227ea41f3 100644 --- a/client/app/scripts/charts/node-shape-circle.js +++ b/client/app/scripts/charts/node-shape-circle.js @@ -1,4 +1,5 @@ import React from 'react'; +import classNames from 'classnames'; import {getMetricValue} from '../utils/data-utils.js'; export default function NodeShapeCircle({highlighted, size, color, metric}) { @@ -6,8 +7,12 @@ export default function NodeShapeCircle({highlighted, size, color, metric}) { const clipId = `mask-${Math.random()}`; const {height, value, formattedValue} = getMetricValue(metric, size); + const className = classNames('shape', { + 'metrics': value !== null + }); + return ( - + + + ({ + const rectProps = (v, vr) => ({ width: v * size * 2, height: v * size * 2, - rx: v * size * rx, - ry: v * size * ry, + rx: (vr || v) * size * rx, + ry: (vr || v) * size * ry, x: -size * v, y: -size * v }); const clipId = `mask-${Math.random()}`; const {height, value, formattedValue} = getMetricValue(metric, size); + const className = classNames('shape', { + 'metrics': value !== null + }); return ( - + {highlighted && } - - - + + + {highlighted && value !== null ? {formattedValue} : } diff --git a/client/app/scripts/components/metric-selector.js b/client/app/scripts/components/metric-selector.js index cb5d4255f..16b4ce825 100644 --- a/client/app/scripts/components/metric-selector.js +++ b/client/app/scripts/components/metric-selector.js @@ -2,13 +2,10 @@ import React from 'react'; import { selectMetric, lockMetric, unlockMetric } from '../actions/app-actions'; import classNames from 'classnames'; -const CROSS = '\u274C'; +// const CROSS = '\u274C'; // const MINUS = '\u2212'; // const DOT = '\u2022'; -// docker_cpu_total_usage -// docker_memory_usage - function onMouseOver(k) { selectMetric(k); } @@ -30,6 +27,9 @@ export default function MetricSelector({availableCanvasMetrics, selectedMetric,
onMouseOut(lockedMetric)}> +
+ METRICS +
{availableCanvasMetrics.map(({id, label}) => { const isLocked = (id === lockedMetric); const isSelected = (id === selectedMetric); @@ -46,9 +46,7 @@ export default function MetricSelector({availableCanvasMetrics, selectedMetric, onClick={() => onMouseClick(id, lockedMetric)}> {label} {isLocked && - - {CROSS} - + }
); diff --git a/client/app/styles/main.less b/client/app/styles/main.less index 8e1a0cf36..3a0f32078 100644 --- a/client/app/styles/main.less +++ b/client/app/styles/main.less @@ -407,9 +407,13 @@ h2 { fill: @background-color; } + &.metrics .border { + fill: @background-lighter-color; + } + .metric-fill { stroke: none; - fill: @background-darker-color; + fill: #A0BE7E; } .shadow {