From 09383a6eb373e8f0ac85c35363bf999accca4536 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Thu, 11 Feb 2016 21:46:09 +0700 Subject: [PATCH] Gentle perspective in the nodestacks. They get a little bit smaller as they go down. --- client/app/scripts/charts/node-shape-hex.js | 15 +++++++++++--- .../app/scripts/charts/node-shape-square.js | 16 +++++++++++---- client/app/scripts/charts/node-shape-stack.js | 20 ++++++++++++++----- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/client/app/scripts/charts/node-shape-hex.js b/client/app/scripts/charts/node-shape-hex.js index 5878544ed5..71b351b109 100644 --- a/client/app/scripts/charts/node-shape-hex.js +++ b/client/app/scripts/charts/node-shape-hex.js @@ -24,7 +24,7 @@ function getPoints(h) { } -export default function NodeShapeHex({highlighted, size, color}) { +export default function NodeShapeHex({onlyHighlight, highlighted, size, color}) { const pathProps = (v) => { return { d: getPoints(size * v * 2), @@ -32,10 +32,19 @@ export default function NodeShapeHex({highlighted, size, color}) { }; }; + const hightlightNode = ; + + if (onlyHighlight) { + return ( + + {highlighted && hightlightNode} + + ); + } + return ( - {highlighted && - } + {highlighted && hightlightNode} diff --git a/client/app/scripts/charts/node-shape-square.js b/client/app/scripts/charts/node-shape-square.js index 286fa176dc..ea1c1507e8 100644 --- a/client/app/scripts/charts/node-shape-square.js +++ b/client/app/scripts/charts/node-shape-square.js @@ -1,6 +1,6 @@ import React from 'react'; -export default function NodeShapeSquare({highlighted, size, color, rx = 0, ry = 0}) { +export default function NodeShapeSquare({onlyHighlight, highlighted, size, color, rx = 0, ry = 0}) { const rectProps = (v) => { return { width: v * size * 2, @@ -11,11 +11,19 @@ export default function NodeShapeSquare({highlighted, size, color, rx = 0, ry = }; }; + const hightlightNode = ; + + if (onlyHighlight) { + return ( + + {highlighted && hightlightNode} + + ); + } + return ( - {highlighted && - } - + {highlighted && hightlightNode} diff --git a/client/app/scripts/charts/node-shape-stack.js b/client/app/scripts/charts/node-shape-stack.js index 031fa50cb8..92df910316 100644 --- a/client/app/scripts/charts/node-shape-stack.js +++ b/client/app/scripts/charts/node-shape-stack.js @@ -1,19 +1,29 @@ import React from 'react'; import _ from 'lodash'; -export default function NodeShapeCircleStack(props) { +export default function NodeShapeStack(props) { const propsNoHighlight = _.clone(props); const Shape = props.shape; delete propsNoHighlight.highlighted; + const propsOnlyHighlight = Object.assign({}, props, {onlyHighlight: true}); + const [dx, dy] = [0, 6]; + const ds = 0.075; + const dsx = (props.size * 2 + dx) / (props.size * 2); + const dsy = (props.size * 2 + dy) / (props.size * 2); + const hls = [dsx, dsy]; + return ( - - + + - - + + + + + ); }