Skip to content

Commit 599d101

Browse files
author
rodriguez-facundo
committed
#136 Moving HLS to flexlaout. Styling
1 parent 4252944 commit 599d101

30 files changed

Lines changed: 562 additions & 208 deletions

webapp/Main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jQuery(function () {
2525
require('./css/netpyne.less');
2626
require('./css/material.less');
2727
require('./css/traceback.less');
28+
require('./css/flexlayout.less');
2829

2930
const store = configureStore();
3031

webapp/Theme.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11

22
import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
33
import purple from '@material-ui/core/colors/purple';
4-
import pink from '@material-ui/core/colors/pink';
4+
import orange from '@material-ui/core/colors/orange';
55

6-
// pink
7-
const secondaryColor = pink['A200']
8-
// purple
9-
const primaryColor = 'rgb(84, 58, 115)'
6+
// orange
7+
const primaryColor = '#f67700'
8+
const secondaryColor = '#f67700'
109

10+
const bgLight = '#616161';
11+
const bgRegular = '#424242';
12+
const bgDark = '#212121';
1113

1214
export default createMuiTheme({
1315
typography: {
@@ -21,17 +23,20 @@ export default createMuiTheme({
2123
}
2224
},
2325
palette: {
26+
type: 'dark',
2427
primary: { main: primaryColor, },
25-
secondary: { main: secondaryColor, }
28+
secondary: { main: bgLight, }
2629
},
2730
overrides: {
2831
MuiInputLabel: { formControl: { top: '-6px' } },
2932
MuiInput: {
3033
input: {
3134
outline: 'none !important',
3235
border: 'none !important',
33-
boxShadow: 'none !important'
36+
boxShadow: 'none !important',
3437
},
38+
root:{ color: 'white' }
39+
3540
},
3641
MuiSelect: {
3742
root: {
@@ -40,6 +45,23 @@ export default createMuiTheme({
4045
boxShadow: 'none !important'
4146
},
4247
select: { "&:focus" :{ background: "none" } },
43-
}
48+
},
49+
MuiCard: { root: { height: '100%', backgroundColor: bgRegular, overflowY: 'auto' } },
50+
MuiBottomNavigation: { root: { backgroundColor: bgRegular } },
51+
MuiPaper: { root: { color: 'inherit' } },
52+
MuiBottomNavigationAction: { root: { color: 'white' } },
53+
MuiFab:{
54+
secondary: { color: 'white' },
55+
primary: { color: 'white' }
56+
},
57+
MuiButton: {
58+
containedSecondary: { color: 'white' },
59+
containedPrimary: { color: 'white' },
60+
},
61+
MuiMenuItem: { root: { color: 'white' } },
62+
63+
MuiListItemText: { root: { color: 'white' } },
64+
MuiDialogTitle: { root: { color: 'white' } }
65+
4466
}
4567
});

webapp/components/NetPyNE.js

Lines changed: 37 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
11
import React from "react";
22
import Toolbar from "@material-ui/core/Toolbar";
3-
import Transition from "./transition/Transition";
3+
44
import {
5-
NetPyNESynapses,
6-
NetPyNEConnectivityRules,
7-
NetPyNECellRules,
8-
NetPyNEStimulationSources,
9-
NetPyNEStimulationTargets,
10-
NetPyNESimConfig,
115
NetPyNEToolBar,
126
NetPyNETabs,
13-
NetPyNEPopulations,
147
LayoutManager,
15-
NetPyNEPlots
168
} from "netpyne/components";
179

18-
export default class NetPyNE extends React.Component {
10+
import { withStyles } from '@material-ui/core/styles'
11+
12+
const styles = ({ zIndex, palette, spacing }) => ({
13+
container: {
14+
height: "100%",
15+
width: "100%",
16+
display: "flex",
17+
flexDirection: "column"
18+
},
19+
toolbar: {
20+
backgroundColor: palette.primary.main,
21+
width: "100%",
22+
boxShadow: "0 0px 4px 0 rgba(0, 0, 0, 0.2), 0 0px 8px 0 rgba(0, 0, 0, 0.19)",
23+
position: "relative",
24+
top: 0,
25+
left: 0,
26+
zIndex: zIndex.appBar
27+
},
28+
views: {
29+
display: "flex",
30+
flexFlow: "rows",
31+
width: "100%",
32+
marginRight: spacing(-1)
33+
},
34+
drawer: { marginLeft: spacing(-1) },
35+
content: { position: "relative", zIndex: zIndex.appBar }
36+
})
37+
class NetPyNE extends React.Component {
1938
constructor (props) {
2039
super(props);
2140
this.widgets = {};
@@ -50,79 +69,29 @@ export default class NetPyNE extends React.Component {
5069
if (!this.props.data) {
5170
return <div></div>;
5271
} else {
72+
const { classes } = this.props
5373
if (this.props.editMode) {
54-
var content = (
55-
<div style={{ marginBottom: "50px" }}>
56-
<NetPyNEPopulations model={"netParams.popParams"} />
57-
<NetPyNECellRules model={"netParams.cellParams"} />
58-
<NetPyNESynapses model={"netParams.synMechParams"} />
59-
<NetPyNEConnectivityRules model={"netParams.connParams"} />
60-
<NetPyNEStimulationSources model={"netParams.stimSourceParams"} />
61-
<NetPyNEStimulationTargets model={"netParams.stimTargetParams"} />
62-
<NetPyNESimConfig model={this.props.data.simConfig} />
63-
<NetPyNEPlots model={"simConfig.analysis"} />
64-
</div>
65-
);
74+
var content = <LayoutManager/>;
6675
} else {
6776
var content = <LayoutManager />;
6877
}
6978

7079
return (
71-
<div
72-
style={{
73-
height: "100%",
74-
width: "100%",
75-
display: "flex",
76-
flexDirection: "column"
77-
}}
78-
>
79-
<div style={{ position: "relative", zIndex: "100" }}>
80-
<Toolbar
81-
id="appBar"
82-
style={{
83-
backgroundColor: "#543a73",
84-
width: "100%",
85-
boxShadow:
86-
"0 0px 4px 0 rgba(0, 0, 0, 0.2), 0 0px 8px 0 rgba(0, 0, 0, 0.19)",
87-
position: "relative",
88-
top: "0px",
89-
left: "0px",
90-
zIndex: 100
91-
}}
92-
>
93-
<div style={{ marginLeft: -12 }}>
80+
<div className={classes.container}>
81+
<div className={classes.content}>
82+
<Toolbar id="appBar" className={classes.toolbar}>
83+
<div className={classes.drawer}>
9484
<NetPyNEToolBar />
9585
</div>
96-
<div
97-
style={{
98-
display: "flex",
99-
flexFlow: "rows",
100-
width: "100%",
101-
marginRight: -10
102-
}}
103-
>
86+
<div className={classes.views}>
10487
<NetPyNETabs />
10588
</div>
10689
</Toolbar>
10790
</div>
108-
109-
{/** TODO Reengineer Transition using the middleware to handle simulation and instantiation. The transition should only show content related to what actually we want to do
110-
<Transition
111-
tab={this.state.value}
112-
clickOnTab={this.state.tabClicked}
113-
handleDeactivateInstanceUpdate={this.handleDeactivateInstanceUpdate}
114-
handleDeactivateSimulationUpdate={
115-
this.handleDeactivateSimulationUpdate
116-
}
117-
freezeInstance={this.state.freezeInstance}
118-
freezeSimulation={this.state.freezeSimulation}
119-
fastForwardInstantiation={this.state.fastForwardInstantiation}
120-
fastForwardSimulation={this.state.fastForwardSimulation}
121-
/> */}
122-
12391
{content}
12492
</div>
12593
);
12694
}
12795
}
12896
}
97+
export default withStyles(styles)(NetPyNE)

webapp/components/definition/cellRules/NetPyNECellRules.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export default class NetPyNECellRules extends React.Component {
463463
return selectedCellRule
464464
}
465465
} else {
466-
return <ContentAdd/>
466+
return <ContentAdd style={{ color: 'white' }}/>
467467
}
468468

469469
case 'sections':
@@ -479,7 +479,7 @@ export default class NetPyNECellRules extends React.Component {
479479
}
480480
} else {
481481
if (page == "sections" ) {
482-
return <ContentAdd style={{ height: '100%' }}/>
482+
return <ContentAdd style={{ height: '100%', color: 'white' }}/>
483483
} else {
484484
if (selectedCellRule) {
485485
if (!!model && !!model[selectedCellRule] && Object.keys(model[selectedCellRule]['secs']).length > 0){
@@ -659,11 +659,6 @@ export default class NetPyNECellRules extends React.Component {
659659

660660
return (
661661
<Card style={{ clear: 'both' }}>
662-
<CardHeader
663-
id="CellRules"
664-
title="Cell rules"
665-
subheader="Define here the rules to set the biophysics and morphology of the cells in your network"
666-
/>
667662
{content}
668663
{dialogPop}
669664
</Card>

webapp/components/definition/cellRules/sections/NetPyNESectionThumbnail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class NetPyNESectionThumbnail extends React.Component {
4646
<Button
4747
variant="contained"
4848
id={name}
49-
color={selected ? 'secondary' : 'primary'}
49+
color={selected ? 'primary' : 'secondary'}
5050
style={ styles.btn }
5151
onMouseEnter={ () => this.setState({ isHovered: true }) }
5252
onMouseLeave={ () => this.setState({ isHovered: false }) }

webapp/components/definition/cellRules/sections/mechanisms/NetPyNEMechanismThumbnail.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import IconButton from '@material-ui/core/IconButton';
33
import FontIcon from '@material-ui/core/Icon';
44
import DeleteDialogBox from '../../../../general/DeleteDialogBox';
55

6-
const hoverColor = '#66d2e2';
7-
const changeColor = 'rgb(0, 188, 212)';
6+
const hoverColor = 'white';
7+
const changeColor = 'white';
88

99
const styles = {
1010
main: { float: 'left', '&:hover': { backgroundColor: 'red' } },
@@ -13,7 +13,6 @@ const styles = {
1313
marginTop:37,
1414
marginLeft:38,
1515
position:"absolute",
16-
backgroundColor:"#f23d7a",
1716
color: 'white'
1817
}
1918
}
@@ -72,7 +71,7 @@ export default class NetPyNEMechanismThumbnail extends React.Component {
7271
>
7372
<div>
7473
{ label }
75-
<FontIcon style={{ color: changeColor, '&:hover': { color: hoverColor } }} className="gpt-fullgear"/>
74+
<FontIcon color="primary" className="gpt-fullgear"/>
7675
</div>
7776
</IconButton>
7877
<DeleteDialogBox

webapp/components/definition/configuration/NetPyNESimConfig.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,6 @@ export default class NetPyNESimConfig extends React.Component {
302302

303303
return (
304304
<Card style={{ clear: 'both' }}>
305-
<CardHeader
306-
title="Simulation configuration"
307-
subheader="Define here the configuration options for the simulation"
308-
id={"Configuration"}
309-
/>
310-
311305
<CardContent className={"tabContainer"}>
312306
<div>
313307
<BottomNavigation value={this.state.selectedIndex}>

webapp/components/definition/connectivity/NetPyNEConnectivityRules.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ export default class NetPyNEConnectivityRules extends Component {
221221

222222
return (
223223
<Card style={{ clear: 'both' }}>
224-
<CardHeader
225-
title="Connectivity rules"
226-
subheader="Define here the rules to generate the connections in your network"
227-
id="Connections"
228-
/>
229224
{content}
230225
</Card>);
231226
}

webapp/components/definition/plots/NetPyNEInclude.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export default class NetPyNEInclude extends Component {
268268
onClose={() => this.closeSecondPopover()}
269269
onMouseLeave={() => this.closeSecondPopover()}
270270
>
271-
<List style={{ width: 200 }}>
271+
<List style={{ width: 200 }} dense>
272272
{menuItems}
273273
</List>
274274
</Popover>

webapp/components/definition/plots/NetPyNENewPlot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default class NetPyNENewPlot extends React.Component {
2727

2828
render () {
2929
return <div>
30-
<Fab size='small' style={{ margin: 10, float: 'left' }} onClick={this.handleButtonClick}>
31-
<ContentAdd />
30+
<Fab size='small' color='primary' style={{ margin: 10, float: 'left' }} onClick={this.handleButtonClick}>
31+
<ContentAdd style={{ color: 'white' }}/>
3232
</Fab>
3333
<Menu
3434
open={Boolean(this.state.anchorEl)}

0 commit comments

Comments
 (0)