Skip to content

Commit 31c23d9

Browse files
committed
#483 style color picker and network tree items in control panel
1 parent 8f56598 commit 31c23d9

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

webapp/components/general/ControlPanelTreeItem.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,40 @@ const useStyles = makeStyles((theme) => ({
7070
padding: '0.2rem',
7171
'& label': {
7272
color: '#ffffff !important',
73+
fontFamily: 'Roboto, arial',
74+
fontSize: '11px',
75+
fontWeight: 400,
7376
},
7477
'& input': {
7578
backgroundColor: `${bgLight} !important`,
7679
color: '#ffffff !important',
7780
boxShadow: 'none !important',
81+
fontFamily: 'Roboto, arial',
82+
fontSize: '11px',
83+
fontWeight: 400,
7884
},
7985
'& svg': {
8086
fill: '#ffffff !important',
8187
},
8288
'& svg:hover': {
8389
background: 'transparent !important',
8490
},
91+
'& .hue-horizontal': {
92+
borderRadius: '10px',
93+
},
94+
'& :nth-child(2)': {
95+
'& :nth-child(1)': {
96+
'& :nth-child(2)': {
97+
'& :nth-child(2)': {
98+
'& :nth-child(1)': {
99+
'& :nth-child(2)': {
100+
borderRadius: '10px',
101+
},
102+
},
103+
},
104+
},
105+
},
106+
},
85107
},
86108
activeColorPicker: {
87109
'& path': {

webapp/components/general/ExperimentControlPanel.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import Box from '@material-ui/core/Box';
66
import Typography from '@material-ui/core/Typography';
77
import TextField from '@material-ui/core/TextField';
88
import TreeView from '@material-ui/lab/TreeView';
9-
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
10-
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
119
import ControlPanelTreeItem from './ControlPanelTreeItem';
1210
import { experimentLabelColor } from '../../theme';
1311
import { MODEL_STATE } from '../../constants';
1412
import { selectInstances } from '../../redux/actions/general';
13+
import { TreeItemArrowRightIcon, TreeItemArrowDownIcon } from './NetPyNEIcons';
1514

1615
const useStyles = makeStyles(() => ({
1716
root: {
@@ -25,7 +24,7 @@ const useStyles = makeStyles(() => ({
2524
left: '-0.65rem',
2625
borderRadius: '3.125rem',
2726
top: '0rem',
28-
backgroundImage: 'url("data:image/svg+xml,%3Csvg width=\'1\' height=\'8\' viewBox=\'0 0 1 8\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M0 0H1V8H0V0Z\' fill=\'%23ffffff\'/%3E%3C/svg%3E")',
27+
backgroundImage: 'url("data:image/svg+xml,%3Csvg width=\'1\' height=\'8\' viewBox=\'0 0 1 8\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M0 0H1V8H0V0Z\' fill=\'%23989898\'/%3E%3C/svg%3E")',
2928
backgroundRepeat: 'repeat',
3029
},
3130
'& .MuiTreeItem-root': {
@@ -34,7 +33,7 @@ const useStyles = makeStyles(() => ({
3433
content: '""',
3534
height: '0.875rem',
3635
width: '1.4375rem',
37-
backgroundImage: 'url("data:image/svg+xml,%3Csvg width=\'12\' height=\'6\' viewBox=\'0 0 12 6\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M6 6C2.68629 6 0 3.31371 0 0H1C1 2.80391 3.19609 5 6 5V6Z\' fill=\'%23ffffff\'/%3E%3Cpath d=\'M6 5H11.5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H6V5Z\' fill=\'%23ffffff\'/%3E%3C/svg%3E")',
36+
backgroundImage: 'url("data:image/svg+xml,%3Csvg width=\'12\' height=\'6\' viewBox=\'0 0 12 6\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cpath d=\'M6 6C2.68629 6 0 3.31371 0 0H1C1 2.80391 3.19609 5 6 5V6Z\' fill=\'%23989898\'/%3E%3Cpath d=\'M6 5H11.5C11.7761 5 12 5.22386 12 5.5C12 5.77614 11.7761 6 11.5 6H6V5Z\' fill=\'%23989898\'/%3E%3C/svg%3E")',
3837
position: 'absolute',
3938
top: '0.5rem',
4039
backgroundRepeat: 'no-repeat',
@@ -66,6 +65,11 @@ const useStyles = makeStyles(() => ({
6665
fontWeight: 'bold',
6766
},
6867
},
68+
svgContainer: {
69+
fontSize: '12px',
70+
width: '10px',
71+
height: '10px',
72+
},
6973
}));
7074

7175
const ExperimentControlPanel = (props) => {
@@ -157,8 +161,8 @@ const ExperimentControlPanel = (props) => {
157161
className={classes.root}
158162
aria-label="Network data navigator"
159163
defaultExpanded={['network']}
160-
defaultCollapseIcon={<ExpandMoreIcon />}
161-
defaultExpandIcon={<ChevronRightIcon />}
164+
defaultCollapseIcon={<TreeItemArrowDownIcon className={classes.svgContainer} />}
165+
defaultExpandIcon={<TreeItemArrowRightIcon className={classes.svgContainer} />}
162166
>
163167
{filter === ''
164168
? getTreeItemsFromData([window.Instances.getInstance('network')])

webapp/components/general/NetPyNEIcons.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,22 @@ export function TriangleIcon (props) {
5959
);
6060
}
6161

62-
export function TreeItemExpandIcon (props) {
62+
export function TreeItemArrowRightIcon (props) {
6363
return (
6464
<SvgIcon viewBox="0 0 4 8" {...props}>
6565
<path d="M0.666504 7.33332L3.99984 3.99999L0.666504 0.666656V7.33332Z" fill="#989898" />
6666
</SvgIcon>
6767
);
6868
}
6969

70+
export function TreeItemArrowDownIcon (props) {
71+
return (
72+
<SvgIcon viewBox="0 0 8 4" {...props}>
73+
<path d="M0.65625 0.65625H7.34375L4 4L0.65625 0.65625Z" fill="#989898" />
74+
</SvgIcon>
75+
);
76+
}
77+
7078
export function TreeItemCurveIcon (props) {
7179
return (
7280
<SvgIcon viewBox="0 0 12 6" {...props}>

webapp/components/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,15 @@ export const LaunchDialog = connect(
137137
},
138138
)(_LaunchDialog);
139139

140+
export const ExperimentControlPanel = connect(
141+
(state) => ({
142+
modelState: state.general.modelState,
143+
}),
144+
null,
145+
)(_ExperimentControlPanel);
146+
140147
export const ExperimentEdit = _ExperimentEdit;
141148
export const ExperimentManager = _ExperimentManager;
142-
export const ExperimentControlPanel = _ExperimentControlPanel;
143149

144150
// ---------------------------------------------------------------------------------------- //
145151

0 commit comments

Comments
 (0)