diff --git a/client/app/scripts/charts/node-shape-circle.js b/client/app/scripts/charts/node-shape-circle.js index 8587f720e..dcf2327eb 100644 --- a/client/app/scripts/charts/node-shape-circle.js +++ b/client/app/scripts/charts/node-shape-circle.js @@ -4,11 +4,11 @@ import {getMetricValue, getMetricColor, getClipPathDefinition} from '../utils/me import {CANVAS_METRIC_FONT_SIZE} from '../constants/styles.js'; -export default function NodeShapeCircle({id, highlighted, size, color, metric, wireframe}) { +export default function NodeShapeCircle({id, highlighted, size, color, metric}) { const clipId = `mask-${id}`; const {height, hasMetric, formattedValue} = getMetricValue(metric, size); const metricStyle = { fill: getMetricColor(metric) }; - const className = classNames('shape', { metrics: hasMetric, wireframe }); + const className = classNames('shape', { metrics: hasMetric }); const fontSize = size * CANVAS_METRIC_FONT_SIZE; return ( @@ -21,7 +21,7 @@ export default function NodeShapeCircle({id, highlighted, size, color, metric, w clipPath={`url(#${clipId})`} />} {highlighted && hasMetric ? {formattedValue} : - } + } ); } diff --git a/client/app/scripts/charts/node-shape-hex.js b/client/app/scripts/charts/node-shape-hex.js index 2e1a8c917..d7045c9ab 100644 --- a/client/app/scripts/charts/node-shape-hex.js +++ b/client/app/scripts/charts/node-shape-hex.js @@ -30,7 +30,7 @@ function getPoints(h) { } -export default function NodeShapeHex({id, highlighted, size, color, metric, wireframe}) { +export default function NodeShapeHex({id, highlighted, size, color, metric}) { const pathProps = v => ({ d: getPoints(size * v * 2), transform: `rotate(90) translate(-${size * getWidth(v)}, -${size * v})` @@ -42,7 +42,7 @@ export default function NodeShapeHex({id, highlighted, size, color, metric, wire const clipId = `mask-${id}`; const {height, hasMetric, formattedValue} = getMetricValue(metric, size); const metricStyle = { fill: getMetricColor(metric) }; - const className = classNames('shape', { metrics: hasMetric, wireframe }); + const className = classNames('shape', { metrics: hasMetric }); const fontSize = size * CANVAS_METRIC_FONT_SIZE; return ( @@ -58,7 +58,7 @@ export default function NodeShapeHex({id, highlighted, size, color, metric, wire {formattedValue} : - } + } ); } diff --git a/client/app/scripts/charts/node-shape-square.js b/client/app/scripts/charts/node-shape-square.js index 345877bfd..d4cd116bc 100644 --- a/client/app/scripts/charts/node-shape-square.js +++ b/client/app/scripts/charts/node-shape-square.js @@ -5,7 +5,7 @@ import {CANVAS_METRIC_FONT_SIZE} from '../constants/styles.js'; export default function NodeShapeSquare({ - id, highlighted, size, color, rx = 0, ry = 0, metric, wireframe + id, highlighted, size, color, rx = 0, ry = 0, metric }) { const rectProps = (scale, radiusScale) => ({ width: scale * size * 2, @@ -19,7 +19,7 @@ export default function NodeShapeSquare({ const clipId = `mask-${id}`; const {height, hasMetric, formattedValue} = getMetricValue(metric, size); const metricStyle = { fill: getMetricColor(metric) }; - const className = classNames('shape', { metrics: hasMetric, wireframe }); + const className = classNames('shape', { metrics: hasMetric }); const fontSize = size * CANVAS_METRIC_FONT_SIZE; return ( @@ -34,7 +34,7 @@ export default function NodeShapeSquare({ {formattedValue} : - } + } ); } diff --git a/client/app/scripts/charts/node-shape-stack.js b/client/app/scripts/charts/node-shape-stack.js index e566460d3..3d691888c 100644 --- a/client/app/scripts/charts/node-shape-stack.js +++ b/client/app/scripts/charts/node-shape-stack.js @@ -14,13 +14,15 @@ export default function NodeShapeStack(props) { - + - + + + + - ); } diff --git a/client/app/scripts/charts/node.js b/client/app/scripts/charts/node.js index bf354d1d0..63511fdfa 100644 --- a/client/app/scripts/charts/node.js +++ b/client/app/scripts/charts/node.js @@ -36,7 +36,7 @@ const nodeShapes = { cloud: NodeShapeCloud }; -export function getNodeShape({ shape, stack }) { +function getNodeShape({ shape, stack }) { const nodeShape = nodeShapes[shape]; if (!nodeShape) { throw new Error(`Unknown shape: ${shape}!`); @@ -142,7 +142,7 @@ class Node extends React.Component { } - +
+ {showSwitchTopology && }
@@ -149,60 +138,30 @@ export class NodeDetails extends React.Component { const { details, nodeControlStatus, nodeMatches = makeMap() } = this.props; const showControls = details.controls && details.controls.length > 0; const nodeColor = getNodeColorDark(details.rank, details.label, details.pseudo); - const controlsColor = brightenColor(nodeColor); const {error, pending} = nodeControlStatus ? nodeControlStatus.toJS() : {}; const tools = this.renderTools(); const styles = { controls: { - backgroundColor: controlsColor, + backgroundColor: brightenColor(nodeColor) }, header: { backgroundColor: nodeColor } }; - const NodeShapeType = getNodeShape(details); - const shapeMarginTop = details.stack ? -20 : -27; - const topologyTitle = `View ${this.props.label} in ${this.props.topologyId}`; - const showSwitchTopology = this.props.nodeId !== this.props.selectedNodeId; - const highlighted = this.state.highlighted; - - const commonProps = { - onClick: this.handleShowTopologyForNode, - onMouseEnter: showSwitchTopology && this.handleNodeMouseEnter, - onMouseLeave: showSwitchTopology && this.handleNodeMouseLeave, - style: { - cursor: showSwitchTopology && 'pointer', - }, - }; - const headerClassName = classnames('node-details-header', { - 'show-switch-topology': showSwitchTopology, - }); return (
{tools} -
+
- - - {showSwitchTopology && {topologyTitle}} - - - -

+

- {details.parents && } +
+ {details.parents && } +
diff --git a/client/app/styles/main.less b/client/app/styles/main.less index f14911ea2..ba220398e 100644 --- a/client/app/styles/main.less +++ b/client/app/styles/main.less @@ -482,105 +482,77 @@ h2 { } } } -} -// -// stacks and shapes!!! -// - -.stack .shape .highlighted { - display: none; -} - -.stack .onlyHighlight .shape { - .border { display: none; } - .shadow { display: none; } - .node { display: none; } - .highlighted { display: inline; } -} - -.stack .shape .metric-fill { - display: none; -} - -.shape { - transform: scale(1); - - /* cloud paths have stroke-width set dynamically */ - &:not(.shape-cloud) .border { - stroke-width: @node-border-stroke-width; - fill: @background-color; - transition: stroke-opacity 0.333s @base-ease, fill 0.333s @base-ease; - stroke-opacity: 1; + .stack .shape .highlighted { + display: none; } - &.metrics .border { - fill: @background-lighter-color; - stroke-opacity: 0.3; + .stack .onlyHighlight .shape { + .border { display: none; } + .shadow { display: none; } + .node { display: none; } + .highlighted { display: inline; } } - .metric-fill { - stroke: none; - fill: #A0BE7E; - fill-opacity: 0.7; + .stack .shape .metric-fill { + display: none; } - .shadow { - stroke: none; - fill: @background-lighter-color; + .shape { + transform: scale(1); + cursor: pointer; + + /* cloud paths have stroke-width set dynamically */ + &:not(.shape-cloud) .border { + stroke-width: @node-border-stroke-width; + fill: @background-color; + transition: stroke-opacity 0.333s @base-ease, fill 0.333s @base-ease; + stroke-opacity: 1; + } + + &.metrics .border { + fill: @background-lighter-color; + stroke-opacity: 0.3; + } + + .metric-fill { + stroke: none; + fill: #A0BE7E; + fill-opacity: 0.7; + } + + .shadow { + stroke: none; + fill: @background-lighter-color; + } + + .node { + fill: @text-color; + stroke: @background-lighter-color; + stroke-width: 2px; + } + + text { + font-size: 12px; + dominant-baseline: middle; + text-anchor: middle; + } + + .highlighted { + fill: @weave-blue; + fill-opacity: @node-highlight-fill-opacity; + stroke: @weave-blue; + stroke-width: @node-highlight-stroke-width; + stroke-opacity: @node-highlight-stroke-opacity; + } } - text { - font-size: 12px; - dominant-baseline: middle; - text-anchor: middle; + .stack .shape .border { + stroke-width: @node-border-stroke-width - 0.5; } - .highlighted { - fill: @weave-blue; - fill-opacity: @node-highlight-fill-opacity; - stroke: @weave-blue; - stroke-width: @node-highlight-stroke-width; - stroke-opacity: @node-highlight-stroke-opacity; - } } -.shape.wireframe { - .shadow, .border { - fill-opacity: 0; - } - - .border { - stroke: white; - } - - .node { - fill: white; - stroke: white; - // fill-opacity: 0.9; - // stroke-opacity: 0.9; - } -} - -.noNode .wireframe .node { - display: none; -} - -.stack .shape .border { - stroke-width: @node-border-stroke-width - 0.5; -} - -.shape:not(.wireframe) .node { - fill: @text-color; - stroke: @background-lighter-color; - stroke-width: 2px; -} - - -// ---- - - - .matched-results { text-align: center; @@ -671,28 +643,17 @@ h2 { &-header { .colorable; - &.show-switch-topology &-label { - .btn-opacity; - opacity: 0.8; - &:hover { - opacity: 1; - } - } - &-wrapper { - padding: 36px 36px 8px 24px; + padding: 36px 36px 8px 36px; } &-label { color: white; - margin: 0 0 0 64px; + margin: 0; + width: 348px; padding-top: 0; } - svg { - float: left; - } - .details-tools { position: absolute; top: 16px; @@ -706,7 +667,6 @@ h2 { } &-relatives { - margin-left: 64px; margin-top: 4px; font-size: 120%; color: @white;