Skip to content

Commit cd42eaa

Browse files
authored
Merge pull request #580 from MetaCell/feature/571
Feature/571
2 parents 4fa3b71 + 5386f31 commit cd42eaa

6 files changed

Lines changed: 233 additions & 1 deletion

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,8 @@ def getAvailablePlots(self):
882882
"iplotConn",
883883
"granger",
884884
"plotDipole",
885-
"plotEEG"
885+
"plotEEG",
886+
"plotRateSpectrogram"
886887
]
887888

888889
return [plot for plot in plots if plot not in list(self.simConfig.analysis.keys())]

webapp/components/definition/plots/NetPyNENewPlot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ export default class NetPyNENewPlot extends React.Component {
101101
>
102102
Granger Causality Plot
103103
</MenuItem>
104+
<MenuItem
105+
key="plotRateSpectrogram"
106+
value="plotRateSpectrogram"
107+
onClick={() => this.handleClick('plotRateSpectrogram')}
108+
>
109+
Rate Spectrogram Plot
110+
</MenuItem>
104111
</Menu>
105112
</div>
106113
);

webapp/components/definition/plots/NetPyNEPlots.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import PlotRaster from './plotTypes/PlotRaster';
1010
import PlotTraces from './plotTypes/PlotTraces';
1111
import PlotGranger from './plotTypes/PlotGranger';
1212
import PlotRatePSD from './plotTypes/PlotRatePSD';
13+
import PlotRateSpectrogram from './plotTypes/PlotRateSpectrogram'
1314
import PlotSpikeHist from './plotTypes/PlotSpikeHist';
1415
import PlotSpikeStats from './plotTypes/PlotSpikeStats';
1516
import NetPyNENewPlot from './NetPyNENewPlot';
@@ -123,6 +124,9 @@ export default class NetPyNEPlots extends React.Component {
123124
case 'granger':
124125
selectedPlot = <PlotGranger />;
125126
break;
127+
case 'plotRateSpectrogram':
128+
selectedPlot = <PlotRateSpectrogram />;
129+
break;
126130
}
127131

128132
return (
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import React, { Component } from 'react';
2+
import Box from '@material-ui/core/Box';
3+
import {
4+
NetPyNEInclude,
5+
NetPyNEField,
6+
SelectField,
7+
NetPyNECheckbox,
8+
NetPyNETextField,
9+
} from 'netpyne/components';
10+
import TimeRange from '../TimeRange';
11+
12+
export default class PlotRateSpectrogram extends React.Component {
13+
constructor (props) {
14+
super(props);
15+
this.state = { checked: false };
16+
this.handleCheckChange = this.handleCheckChange.bind(this);
17+
}
18+
19+
handleCheckChange = (event, isCheck) => {
20+
this.setState({ Checked: isCheck });
21+
};
22+
23+
render () {
24+
const tag = 'simConfig.analysis[\'plotRateSpectrogram\']';
25+
return (
26+
<Box className="scrollbar scrollchild" mt={1}>
27+
<NetPyNEInclude
28+
id="simConfig.analysis.plotRateSpectrogram.include"
29+
model={`${tag}['include']`}
30+
defaultOptions={['all', 'allCells', 'allNetStims']}
31+
initialValue="all"
32+
/>
33+
34+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.timeRange">
35+
<TimeRange model={`${tag}['timeRange']`} />
36+
</NetPyNEField>
37+
38+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.binSize">
39+
<NetPyNETextField
40+
fullWidth
41+
variant="filled"
42+
model={`${tag}['binSize']`}
43+
/>
44+
</NetPyNEField>
45+
46+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.minFreq">
47+
<NetPyNETextField
48+
fullWidth
49+
variant="filled"
50+
model={`${tag}['minFreq']`}
51+
/>
52+
</NetPyNEField>
53+
54+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.maxFreq">
55+
<NetPyNETextField
56+
fullWidth
57+
variant="filled"
58+
model={`${tag}['maxFreq']`}
59+
/>
60+
</NetPyNEField>
61+
62+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.stepFreq">
63+
<NetPyNETextField
64+
fullWidth
65+
variant="filled"
66+
model={`${tag}['stepFreq']`}
67+
/>
68+
</NetPyNEField>
69+
70+
<NetPyNEField
71+
id="simConfig.analysis.plotRateSpectrogram.transformMethod"
72+
className="listStyle"
73+
>
74+
<SelectField model={`${tag}['transformMethod']`} />
75+
</NetPyNEField>
76+
77+
{/* <NetPyNEField id="simConfig.analysis.plotRateSpectrogram.fontSize">
78+
<NetPyNETextField
79+
fullWidth
80+
variant="filled"
81+
model={`${tag}['fontSize']`}
82+
/>
83+
</NetPyNEField>
84+
85+
<NetPyNEField id="simConfig.analysis.plotRateSpectrogram.figSize">
86+
<NetPyNETextField
87+
fullWidth
88+
variant="filled"
89+
model={`${tag}['figSize']`}
90+
/>
91+
</NetPyNEField>
92+
93+
<NetPyNEField
94+
id="simConfig.analysis.plotRateSpectrogram.saveData"
95+
className="netpyneCheckbox"
96+
>
97+
<NetPyNECheckbox model={`${tag}['saveData']`} />
98+
</NetPyNEField>
99+
100+
<NetPyNEField
101+
id="simConfig.analysis.plotRateSpectrogram.saveFig"
102+
className="netpyneCheckbox"
103+
>
104+
<NetPyNECheckbox model={`${tag}['saveFig']`} />
105+
</NetPyNEField>
106+
107+
<NetPyNEField
108+
id="simConfig.analysis.plotRateSpectrogram.showFig"
109+
className="netpyneCheckbox"
110+
>
111+
<NetPyNECheckbox model={`${tag}['showFig']`} />
112+
</NetPyNEField> */}
113+
</Box>
114+
);
115+
}
116+
}

webapp/constants.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,33 @@ export const PLOT_WIDGETS = {
444444
},
445445
},
446446
},
447+
plotRateSpectrogram: {
448+
id: 'plotRateSpectrogram',
449+
name: 'Rate Spectrogram Plot',
450+
status: WidgetStatus.MINIMIZED,
451+
component: 'Plot',
452+
hideOnClose: true,
453+
panelName: MINIMIZED_PANEL,
454+
defaultPanel: 'plotPanel',
455+
enableRename: false,
456+
initialized: false,
457+
disabled: true,
458+
method: {
459+
plotKey: 'plotRateSpectrogram',
460+
plotMethod: 'plotRateSpectrogram',
461+
plotType: false,
462+
},
463+
pos: 15,
464+
config: {
465+
id: 'plotRateSpectrogram',
466+
name: 'Rate Spectrogram Plot',
467+
method: {
468+
plotKey: 'plotRateSpectrogram',
469+
plotMethod: 'plotRateSpectrogram',
470+
plotType: false,
471+
},
472+
},
473+
},
447474
};
448475

449476
export const DEFAULT_NETWORK_WIDGETS = {
Lines changed: 77 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)