@@ -13,8 +13,10 @@ import DialogTitle from '@material-ui/core/DialogTitle';
1313
1414import { NetPyNESelectField , NetPyNEField , NetPyNECoordsRange } from 'netpyne/components' ;
1515import Utils from '../../../Utils' ;
16+ import ExpansionPanel from '../../general/ExpansionPanel'
17+ import { withStyles } from "@material-ui/core/styles"
1618
17- export default class NetPyNECellRule extends React . Component {
19+ class NetPyNECellRule extends React . Component {
1820
1921 constructor ( props ) {
2022 super ( props ) ;
@@ -68,7 +70,7 @@ export default class NetPyNECellRule extends React.Component {
6870 }
6971
7072 render ( ) {
71-
73+ const { classes } = this . props
7274 var dialogPop = ( this . state . errorMessage != undefined ? (
7375 < Dialog
7476 open = { true }
@@ -92,85 +94,95 @@ export default class NetPyNECellRule extends React.Component {
9294 )
9395 return (
9496 < div >
95- < div >
97+ < div className = { classes . root } >
9698
9799 < TextField
98100 onChange = { this . handleRenameChange }
99101 value = { this . state . currentName }
100102 disabled = { this . renaming }
101- label = "The name of the cell rule "
103+ label = "The name of the cell type "
102104 className = { "netpyneField" }
103105 id = { "cellRuleName" }
104106 style = { { marginTop : 8 } }
105107 />
106108
107- < div style = { { float : 'left' , marginTop : '20px' } } >
108- < b > Conditions:</ b >
109- </ div >
110-
111- < NetPyNEField id = { "netParams.cellParams.conds.cellType" } >
112- < NetPyNESelectField
113- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellType']" }
114- method = { "netpyne_geppetto.getAvailableCellTypes" }
115- postProcessItems = { this . postProcessMenuItems }
116- multiple = { true }
117- />
118- </ NetPyNEField >
119109
120- < NetPyNEField id = { "netParams.cellParams.conds.cellModel" } >
121- < NetPyNESelectField
122- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellModel']" }
123- method = { "netpyne_geppetto.getAvailableCellModels" }
124- postProcessItems = { this . postProcessMenuItems }
125- multiple = { true }
110+ < ExpansionPanel className = { classes . expandable } elevation = { 0 } >
111+ < div >
112+ < b > Conditions (optional):</ b >
113+ </ div >
114+
115+ < NetPyNEField id = { "netParams.cellParams.conds.cellModel" } >
116+ < NetPyNESelectField
117+ model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellModel']" }
118+ method = { "netpyne_geppetto.getAvailableCellModels" }
119+ postProcessItems = { this . postProcessMenuItems }
120+ multiple = { true }
121+ />
122+ </ NetPyNEField >
123+
124+ < NetPyNEField id = { "netParams.cellParams.conds.pop" } >
125+ < NetPyNESelectField
126+ model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['pop']" }
127+ method = { "netpyne_geppetto.getAvailablePops" }
128+ postProcessItems = { this . postProcessMenuItems }
129+ multiple = { true }
130+ />
131+ </ NetPyNEField >
132+
133+ < NetPyNECoordsRange
134+ id = "xRangeCellParams"
135+ name = { this . state . currentName }
136+ model = { 'netParams.cellParams' }
137+ conds = { 'conds' }
138+ items = { [
139+ { value : 'x' , label : 'Absolute' } ,
140+ { value : 'xnorm' , label : 'Normalized' }
141+ ] }
126142 />
127- </ NetPyNEField >
128-
129- < NetPyNEField id = { "netParams.cellParams.conds.pop" } >
130- < NetPyNESelectField
131- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['pop']" }
132- method = { "netpyne_geppetto.getAvailablePops" }
133- postProcessItems = { this . postProcessMenuItems }
134- multiple = { true }
135- />
136- </ NetPyNEField >
137-
138- < NetPyNECoordsRange
139- id = "xRangeCellParams"
140- name = { this . state . currentName }
141- model = { 'netParams.cellParams' }
142- conds = { 'conds' }
143- items = { [
144- { value : 'x' , label : 'Absolute' } ,
145- { value : 'xnorm' , label : 'Normalized' }
146- ] }
147- />
148143
149- < NetPyNECoordsRange
150- id = "yRangeCellParams"
151- name = { this . state . currentName }
152- model = { 'netParams.cellParams' }
153- conds = { 'conds' }
154- items = { [
155- { value : 'y' , label : 'Absolute' } ,
156- { value : 'ynorm' , label : 'Normalized' }
157- ] }
158- />
159-
160- < NetPyNECoordsRange
161- id = "zRangeCellParams"
162- name = { this . state . currentName }
163- model = { 'netParams.cellParams' }
164- conds = { 'conds' }
165- items = { [
166- { value : 'z' , label : 'Absolute' } ,
167- { value : 'znorm' , label : 'Normalized' }
168- ] }
169- />
144+ < NetPyNECoordsRange
145+ id = "yRangeCellParams"
146+ name = { this . state . currentName }
147+ model = { 'netParams.cellParams' }
148+ conds = { 'conds' }
149+ items = { [
150+ { value : 'y' , label : 'Absolute' } ,
151+ { value : 'ynorm' , label : 'Normalized' }
152+ ] }
153+ />
170154
155+ < NetPyNECoordsRange
156+ id = "zRangeCellParams"
157+ name = { this . state . currentName }
158+ model = { 'netParams.cellParams' }
159+ conds = { 'conds' }
160+ items = { [
161+ { value : 'z' , label : 'Absolute' } ,
162+ { value : 'znorm' , label : 'Normalized' }
163+ ] }
164+ />
165+
166+ </ ExpansionPanel >
171167 </ div >
172168 { dialogPop }
173169 </ div >
174170 ) ;
175171 }
176172}
173+
174+
175+ const styles = ( { shape, spacing } ) => ( {
176+ expandable : {
177+ borderRadius : shape . borderRadius ,
178+ backgroundColor : 'inherit' ,
179+ paddingTop : spacing ( 2 ) ,
180+ "&::before" : { content : 'unset' }
181+ } ,
182+ root : {
183+ display : 'flex' ,
184+ flexDirection : 'column'
185+ }
186+ } )
187+
188+ export default withStyles ( styles ) ( NetPyNECellRule )
0 commit comments