-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gentle perspective in the nodestacks.
They get a little bit smaller as they go down.
- Loading branch information
Showing
3 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<g className="stack"> | ||
<g transform="translate(0, 4)"> | ||
<g transform={`translate(${dx * -1}, ${dy * -1})`} className="stack"> | ||
<g transform={`translate(${dx * 2}, ${dy * 2}) scale(${1 - (2 * ds)}, ${1 - (2 * ds)})`}> | ||
<Shape {...propsNoHighlight} /> | ||
</g> | ||
<Shape {...props} /> | ||
<g transform="translate(0, -4)"> | ||
<g transform={`translate(${dx * 1}, ${dy * 1}) scale(${1 - (1 * ds)}, ${1 - (1 * ds)})`}> | ||
<Shape {...propsNoHighlight} /> | ||
</g> | ||
<g transform={`translate(${dx * 0.5}, ${dy * 0.5}) scale(${hls})`} className="stack"> | ||
<Shape {...propsOnlyHighlight} /> | ||
</g> | ||
<Shape {...propsNoHighlight} /> | ||
</g> | ||
); | ||
} |