Skip to content

Commit 8ac85fe

Browse files
committed
#483 start network item list styling
1 parent 18c9ea9 commit 8ac85fe

File tree

3 files changed

+58
-7
lines changed

3 files changed

+58
-7
lines changed

webapp/components/general/ControlPanelTreeItem.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ import {
1515
bgLight,
1616
radius,
1717
} from '../../theme';
18-
import { RandomColorLensIcon, ColorLensIcon, TriangleIcon } from './NetPyNEIcons';
18+
import {
19+
RandomColorLensIcon,
20+
ColorLensIcon,
21+
TriangleIcon,
22+
TreeItemCurveIcon,
23+
TreeItemLineWithRadiusIcon,
24+
} from './NetPyNEIcons';
1925
import { changeInstanceColor } from '../../redux/actions/general';
2026

2127
const useStyles = makeStyles((theme) => ({
2228
networkItem: {
23-
paddingTop: '2px',
24-
paddingBottom: '2px',
29+
paddingTop: '0px',
30+
paddingBottom: '0px',
2531
paddingLeft: '8px',
2632
paddingRight: '8px',
2733
borderRadius: radius,
@@ -41,8 +47,9 @@ const useStyles = makeStyles((theme) => ({
4147
},
4248
colorPickerBox: {
4349
position: 'absolute',
44-
top: '1.25rem',
50+
top: '1.2rem',
4551
right: '2.5rem',
52+
height: '3rem',
4653
},
4754
triangleIcon: {
4855
marginBottom: '-7px',
@@ -74,6 +81,15 @@ const useStyles = makeStyles((theme) => ({
7481
fill: '#ffffff',
7582
},
7683
},
84+
treeItemCurveIcon: {
85+
position: 'relative',
86+
},
87+
treeItemLineWithRadiusIcon: {
88+
position: 'relative',
89+
right: '1.85rem',
90+
bottom: '1rem',
91+
height: '35%',
92+
},
7793
}));
7894

7995
const ControlPanelTreeItem = (props) => {
@@ -183,7 +199,16 @@ const ControlPanelTreeItem = (props) => {
183199
flexDirection="row"
184200
justifyContent="space-between"
185201
>
186-
<Grid item xs={4}><Typography onClick={() => onNodeSelect(nodeId)}>{label}</Typography></Grid>
202+
203+
<Grid item xs={4}>
204+
<Typography onClick={() => onNodeSelect(nodeId)}>
205+
<span>
206+
<TreeItemCurveIcon className={classes.treeItemCurveIcon} />
207+
<TreeItemLineWithRadiusIcon className={classes.treeItemLineWithRadiusIcon} />
208+
</span>
209+
{label}
210+
</Typography>
211+
</Grid>
187212
<Grid item xs={4} justifyContent="center"><Typography>{type}</Typography></Grid>
188213
<Grid item xs={4} justifyContent="flex-end" className={classes.controls}>
189214
{isHoveredOver
@@ -219,7 +244,7 @@ const ControlPanelTreeItem = (props) => {
219244
: null}
220245
</Grid>
221246
</Grid>
222-
)}
247+
)}
223248
>
224249
{children}
225250
</TreeItem>

webapp/components/general/ExperimentControlPanel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
1010
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
1111
import ControlPanelTreeItem from './ControlPanelTreeItem';
1212
import { experimentLabelColor } from '../../theme';
13+
import { TreeItemExpandIcon } from './NetPyNEIcons';
1314

1415
import { MODEL_STATE } from '../../constants';
1516

@@ -110,7 +111,7 @@ const ExperimentControlPanel = (props) => {
110111
defaultCollapseIcon={<ExpandMoreIcon />}
111112
defaultExpandIcon={<ChevronRightIcon />}
112113
>
113-
<TreeItem nodeId="network" label="network_netpyne">
114+
<TreeItem nodeId="network" label="network_netpyne" expandIcon={<TreeItemExpandIcon />}>
114115
{filter === ''
115116
? getTreeItemsFromData(window.Instances.network.getChildren())
116117
: getFlatFilteredList(window.Instances.network.getChildren())}

webapp/components/general/NetPyNEIcons.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,28 @@ export function TriangleIcon (props) {
5858
</SvgIcon>
5959
);
6060
}
61+
62+
export function TreeItemExpandIcon (props) {
63+
return (
64+
<SvgIcon viewBox="0 0 4 8" {...props}>
65+
<path d="M0.666504 7.33332L3.99984 3.99999L0.666504 0.666656V7.33332Z" fill="#989898" />
66+
</SvgIcon>
67+
);
68+
}
69+
70+
export function TreeItemCurveIcon (props) {
71+
return (
72+
<SvgIcon viewBox="0 0 12 6" {...props}>
73+
<path d="M6 6C2.68629 6 0 3.31371 0 0H1C1 2.80391 3.19609 5 6 5V6Z" fill="#ffffff" />
74+
<path d="M6 5H11.5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H6V5Z" fill="#ffffff" />
75+
</SvgIcon>
76+
);
77+
}
78+
79+
export function TreeItemLineWithRadiusIcon (props) {
80+
return (
81+
<SvgIcon viewBox="0 0 6 6" {...props}>
82+
<path d="M0 0H1V8H0V0Z" fill="#ffffff" />
83+
</SvgIcon>
84+
);
85+
}

0 commit comments

Comments
 (0)