Skip to content

Commit 42df22c

Browse files
authored
Merge pull request #288 from MetaCell/feature/279_ui_improvements
Feature/279 UI improvements
2 parents 479f374 + 507c418 commit 42df22c

7 files changed

Lines changed: 46 additions & 95 deletions

File tree

webapp/components/definition/configuration/NetPyNESimConfig.js

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NetPyNESimConfig extends React.Component {
3131
});
3232

3333
render () {
34-
var contentLeft = <div className="layoutVerticalFitInner" />;
34+
let contentLeft = <div className="layoutVerticalFitInner" />;
3535
let contentRight = <div className="layoutVerticalFitInner" />;
3636
const { classes } = this.props;
3737
if (this.state.sectionId == 'General') {
@@ -174,7 +174,7 @@ class NetPyNESimConfig extends React.Component {
174174
);
175175
} else if (this.state.sectionId == 'SaveConfiguration') {
176176
contentLeft = (
177-
<div>
177+
<div className="scrollbar scrollchild">
178178
<NetPyNEField id="simConfig.simLabel">
179179
<NetPyNETextField
180180
fullWidth
@@ -215,7 +215,7 @@ class NetPyNESimConfig extends React.Component {
215215
</div>
216216
);
217217
contentRight = (
218-
<div>
218+
<div className="scrollbar scrollchild">
219219
<NetPyNEField id="simConfig.saveJson" className="netpyneCheckbox">
220220
<NetPyNECheckbox model="simConfig.saveJson" />
221221
</NetPyNEField>
@@ -248,23 +248,6 @@ class NetPyNESimConfig extends React.Component {
248248
>
249249
<NetPyNECheckbox model="simConfig.timestampFilename" />
250250
</NetPyNEField>
251-
{/*
252-
// TODO: can this be removed?
253-
<NetPyNEField id="simConfig.saveHDF5" className={"netpyneCheckbox"} >
254-
<NetPyNECheckbox model={"simConfig.saveHDF5"} />
255-
</NetPyNEField>
256-
257-
<NetPyNEField id="simConfig.saveDpk" className={"netpyneCheckbox"} >
258-
<NetPyNECheckbox model={"simConfig.saveDpk"} />
259-
</NetPyNEField>
260-
261-
<NetPyNEField id="simConfig.saveDat" className={"netpyneCheckbox"} >
262-
<NetPyNECheckbox model={"simConfig.saveDat"} />
263-
</NetPyNEField>
264-
265-
<NetPyNEField id="simConfig.saveCSV" className={"netpyneCheckbox"} >
266-
<NetPyNECheckbox model={"simConfig.saveCSV"} />
267-
</NetPyNEField> */}
268251

269252
<NetPyNEField id="simConfig.saveTiming" className="netpyneCheckbox">
270253
<NetPyNECheckbox model="simConfig.saveTiming" />
@@ -273,7 +256,7 @@ class NetPyNESimConfig extends React.Component {
273256
);
274257
} else if (this.state.sectionId == 'Record') {
275258
contentLeft = (
276-
<div>
259+
<div className="scrollbar scrollchild">
277260
<NetPyNEField id="simConfig.recordCells" className="listStyle">
278261
<ListComponent model="simConfig.recordCells" />
279262
</NetPyNEField>
@@ -296,7 +279,7 @@ class NetPyNESimConfig extends React.Component {
296279
</div>
297280
);
298281
contentRight = (
299-
<div>
282+
<div className="scrollbar scrollchild">
300283
<NetPyNEField
301284
id="simConfig.saveLFPCells"
302285
className="netpyneCheckbox"
@@ -315,8 +298,8 @@ class NetPyNESimConfig extends React.Component {
315298
</div>
316299
);
317300
} else if (this.state.sectionId == 'netParams') {
318-
var contentLeft = (
319-
<div>
301+
contentLeft = (
302+
<div className="scrollbar scrollchild">
320303
<NetPyNEField id="netParams.scale">
321304
<NetPyNETextField
322305
fullWidth
@@ -366,7 +349,7 @@ class NetPyNESimConfig extends React.Component {
366349
</div>
367350
);
368351
contentRight = (
369-
<div>
352+
<div className="scrollbar scrollchild">
370353
<NetPyNEField id="netParams.sizeX">
371354
<NetPyNETextField
372355
fullWidth

webapp/components/definition/connectivity/NetPyNEConnectivityRule.js

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ export default class NetPyNEConnectivityRule extends React.Component {
144144
/>
145145
</Box>
146146

147-
<NetPyNEField id="netParams.connParams.sec" className="listStyle">
148-
<ListComponent
149-
model={`netParams.connParams['${this.props.name}']['sec']`}
150-
/>
151-
</NetPyNEField>
152-
153147
<NetPyNEField id="netParams.connParams.weight">
154148
<NetPyNETextField
155149
fullWidth
@@ -213,6 +207,12 @@ export default class NetPyNEConnectivityRule extends React.Component {
213207
/>
214208
</NetPyNEField>
215209

210+
<NetPyNEField id="netParams.connParams.sec" className="listStyle">
211+
<ListComponent
212+
model={`netParams.connParams['${this.props.name}']['sec']`}
213+
/>
214+
</NetPyNEField>
215+
216216
<NetPyNEField id="netParams.connParams.loc" className="listStyle">
217217
<ListComponent
218218
model={`netParams.connParams['${this.props.name}']['loc']`}
@@ -256,19 +256,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
256256
multiple
257257
/>
258258
</NetPyNEField>
259-
<NetPyNEField id="netParams.connParams.preConds.cellModel">
260-
<NetPyNESelectField
261-
model={
262-
`netParams.connParams['${
263-
this.props.name
264-
}']['preConds']['cellModel']`
265-
}
266-
fullWidth
267-
method="netpyne_geppetto.getAvailableCellModels"
268-
postProcessItems={this.postProcessMenuItems}
269-
multiple
270-
/>
271-
</NetPyNEField>
259+
272260
<NetPyNEField id="netParams.connParams.preConds.cellType">
273261
<NetPyNESelectField
274262
fullWidth
@@ -351,19 +339,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
351339
multiple
352340
/>
353341
</NetPyNEField>
354-
<NetPyNEField id="netParams.connParams.postConds.cellModel">
355-
<NetPyNESelectField
356-
model={
357-
`netParams.connParams['${
358-
this.props.name
359-
}']['postConds']['cellModel']`
360-
}
361-
method="netpyne_geppetto.getAvailableCellModels"
362-
postProcessItems={this.postProcessMenuItems}
363-
multiple
364-
fullWidth
365-
/>
366-
</NetPyNEField>
342+
367343
<NetPyNEField id="netParams.connParams.postConds.cellType">
368344
<NetPyNESelectField
369345
model={

webapp/components/definition/stimulationSources/NetPyNEStimulationSource.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,18 @@ class NetPyNEStimulationSource extends React.Component {
3232
super(props);
3333
this.state = {
3434
currentName: props.name,
35-
sourceType: 'IClamp',
35+
sourceType: 'NetStim',
3636
errorMessage: undefined,
3737
errorDetails: undefined,
3838
};
3939
this.stimSourceTypeOptions = [
40+
{ type: 'NetStim' },
4041
{ type: 'IClamp' },
4142
{ type: 'VClamp' },
4243
{ type: 'SEClamp' },
43-
{ type: 'NetStim' },
4444
{ type: 'AlphaSynapse' },
4545
];
46-
this.handleStimSourceTypeChange = this.handleStimSourceTypeChange.bind(
47-
this,
48-
);
46+
this.handleStimSourceTypeChange = this.handleStimSourceTypeChange.bind(this);
4947
}
5048

5149
UNSAFE_componentWillReceiveProps (nextProps) {
@@ -177,7 +175,7 @@ class NetPyNEStimulationSource extends React.Component {
177175

178176
if (this.state.sourceType == 'IClamp') {
179177
var variableContent = (
180-
<div>
178+
<div className="scrollbar scrollchild">
181179
<NetPyNEField id="netParams.stimSourceParams.del">
182180
<NetPyNETextField
183181
variant="filled"
@@ -211,7 +209,7 @@ class NetPyNEStimulationSource extends React.Component {
211209
);
212210
} else if (this.state.sourceType == 'VClamp') {
213211
var variableContent = (
214-
<div>
212+
<div className="scrollbar scrollchild">
215213
<NetPyNEField id="netParams.stimSourceParams.tau1">
216214
<NetPyNETextField
217215
variant="filled"
@@ -277,7 +275,7 @@ class NetPyNEStimulationSource extends React.Component {
277275
);
278276
} else if (this.state.sourceType == 'AlphaSynapse') {
279277
var variableContent = (
280-
<div>
278+
<div className="scrollbar scrollchild">
281279
<NetPyNEField id="netParams.stimSourceParams.onset">
282280
<NetPyNETextField
283281
variant="filled"
@@ -321,7 +319,7 @@ class NetPyNEStimulationSource extends React.Component {
321319
);
322320
} else if (this.state.sourceType == 'NetStim') {
323321
var variableContent = (
324-
<div>
322+
<div className="scrollbar scrollchild">
325323
<NetPyNEField id="netParams.stimSourceParams.rate">
326324
<NetPyNETextField
327325
variant="filled"
@@ -379,7 +377,7 @@ class NetPyNEStimulationSource extends React.Component {
379377
);
380378
} else if (this.state.sourceType == 'SEClamp') {
381379
var variableContent = (
382-
<div>
380+
<div className="scrollbar scrollchild">
383381
<NetPyNEField
384382
id="netParams.stimSourceParams.vClampDur"
385383
className="listStyle"

webapp/components/definition/stimulationSources/NetPyNEStimulationSources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class NetPyNEStimulationSources extends Component {
4242
}
4343

4444
handleNewStimulationSource () {
45-
const defaultStimulationSources = { stim_source: { type: 'IClamp' } };
45+
const defaultStimulationSources = { stim_source: { type: 'NetStim' } };
4646
const key = Object.keys(defaultStimulationSources)[0];
4747
const value = defaultStimulationSources[key];
4848
const model = { ...this.state.value };

webapp/components/definition/synapses/NetPyNESynapse.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React from 'react';
22
import TextField from '@material-ui/core/TextField';
33
import Box from '@material-ui/core/Box';
44
import Dialog from '@material-ui/core/Dialog/Dialog';
@@ -140,9 +140,7 @@ class NetPyNESynapse extends React.Component {
140140
</Button>
141141
</DialogActions>
142142
</Dialog>
143-
) : (
144-
undefined
145-
);
143+
) : undefined;
146144

147145
if (this.state.synMechMod == '' || this.state.synMechMod == undefined) {
148146
var content = <div />;

webapp/components/topbar/menuConfiguration.js

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import {
1717
showNetwork,
1818
setTheme,
1919
} from '../../redux/actions/general';
20-
import { TOPBAR_CONSTANTS, MODEL_STATE, THEMES } from '../../constants';
20+
import {
21+
TOPBAR_CONSTANTS, MODEL_STATE, THEMES, TUTORIALS_LIST,
22+
} from '../../constants';
2123

2224
const checkedIcon = 'fa fa-check secondary';
2325

@@ -69,15 +71,6 @@ const firstItemStyle = {
6971
hover: { ...topLevelMenuItemStyle.hover, ...firstItemCustom },
7072
};
7173

72-
const tutorialsList = {
73-
tut1: 'Tut 1: Simple cell network',
74-
tut2: 'Tut 2: Detailed cell network',
75-
tut3: 'Tut 3a: Multiscale network (low IP3)',
76-
tut3_ip3high: 'Tut 3b: Multiscale network (high IP3)',
77-
tut3_norxd: 'Tut 3c: Multiscale network (no RxD) (edited)',
78-
tut_osc: 'Tut 4: Simple oscillatory network',
79-
};
80-
8174
export const getTutorials = () => {
8275
const { tuts } = window;
8376
if (!tuts) {
@@ -88,7 +81,7 @@ export const getTutorials = () => {
8881
const tutName = tutFile.replace('.py', '')
8982
.replace('gui', '')
9083
.replace('_', '');
91-
const tutLabel = tutorialsList[tutName] !== undefined ? tutorialsList[tutName] : tutName;
84+
const tutLabel = TUTORIALS_LIST[tutName] !== undefined ? TUTORIALS_LIST[tutName] : tutName;
9285
return {
9386
label: tutLabel,
9487
icon: '',
@@ -162,16 +155,10 @@ export default {
162155
{
163156
label: 'New',
164157
icon: '',
165-
list: [
166-
{
167-
label: 'Blank',
168-
icon: '',
169-
action: {
170-
handlerAction: 'redux',
171-
parameters: [openTopbarDialog, TOPBAR_CONSTANTS.NEW_MODEL],
172-
},
173-
},
174-
],
158+
action: {
159+
handlerAction: 'redux',
160+
parameters: [openTopbarDialog, TOPBAR_CONSTANTS.NEW_MODEL],
161+
},
175162
},
176163
{
177164
label: 'Open...',
@@ -296,7 +283,8 @@ export const getViewMenu = (props) => {
296283
const networkAction = () => {
297284
if (instantiate && props.automaticSimulation) {
298285
return createAndSimulateNetwork;
299-
} if (instantiate) {
286+
}
287+
if (instantiate) {
300288
return createNetwork;
301289
}
302290
return showNetwork;

webapp/constants.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const MODEL_STATE = {
1414
NOT_INSTANTIATED: 'NOT_INSTANTIATED',
1515
INSTANTIATED: 'INSTANTIATED',
1616
SIMULATED: 'SIMULATED',
17-
1817
};
1918

2019
export const NETPYNE_COMMANDS = {
@@ -389,3 +388,12 @@ export const EDIT_WIDGETS = {
389388
pos: 7,
390389
},
391390
};
391+
392+
export const TUTORIALS_LIST = {
393+
tut1: 'Tut 1: Simple cell network',
394+
tut2: 'Tut 2: Detailed cell network',
395+
tut3: 'Tut 3a: Multiscale network (low IP3)',
396+
tut3_ip3high: 'Tut 3b: Multiscale network (high IP3)',
397+
tut3_norxd: 'Tut 3c: Multiscale network (no RxD)',
398+
tut_osc: 'Tut 4: Simple oscillatory network',
399+
};

0 commit comments

Comments
 (0)