Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare commit #110

Open
wants to merge 1 commit into
base: feature/102
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions ComponentsInitialization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
define(function (require) {
return function (GEPPETTO) {
var ReactDOM = require('react-dom');
var React = require('react');
var getMuiTheme = require('material-ui/styles/getMuiTheme').default;
var MuiThemeProvider = require('material-ui/styles/MuiThemeProvider').default;
var NetPyNE = require('./NetPyNE').default;
var injectTapEventPlugin = require('react-tap-event-plugin');

var Utils = require('./Utils').default;
var Console = require('../../js/components/interface/console/Console');
var TabbedDrawer = require('../../js/components/interface/drawer/TabbedDrawer');
var PythonConsole = require('../../js/components/interface/pythonConsole/PythonConsole');

require('./css/netpyne.less');
require('./css/material.less');
require('./css/traceback.less');

injectTapEventPlugin();

const customTheme = {
palette: {
primary1Color: '#543a73',
primary2Color: '#eb557a',
primary3Color: '#ebd07a'
}
};

const theme = getMuiTheme(customTheme);

function App(data = {}) {
return (
<div>
<MuiThemeProvider muiTheme={theme}>
<NetPyNE {...data}></NetPyNE>
</MuiThemeProvider>

<div id="footer">
<div id="footerHeader">
<TabbedDrawer labels={["Console", "Python"]} iconClass={["fa fa-terminal", "fa fa-flask"]} >
<Console />
<PythonConsole pythonNotebookPath={"notebooks/notebook.ipynb"} />
</TabbedDrawer>
</div>
</div>
</div>
);
}
ReactDOM.render(<App />, document.querySelector('#mainContainer'));

GEPPETTO.G.setIdleTimeOut(-1);
GEPPETTO.G.debug(false); //Change this to true to see messages on the Geppetto console while loading
GEPPETTO.Resources.COLORS.DEFAULT = "#6f54aa";
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, "Initialising NetPyNE");

GEPPETTO.on('jupyter_geppetto_extension_ready', (data) => {
let project = { id: 1, name: 'Project', experiments: [{ "id": 1, "name": 'Experiment', "status": 'DESIGN' }] }
GEPPETTO.Manager.loadProject(project, false);
GEPPETTO.Manager.loadExperiment(1, [], []);
Utils.execPythonMessage('from netpyne_ui.netpyne_geppetto import netpyne_geppetto');
Utils.evalPythonMessage('netpyne_geppetto.getData',[]).then((response) => {
var data = Utils.convertToJSON(response)
ReactDOM.render(<App data={data} />, document.querySelector('#mainContainer'));
GEPPETTO.trigger("spinner:hide");
})
});
};
});
38 changes: 21 additions & 17 deletions GeppettoConfiguration.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"_README" : "http://docs.geppetto.org/en/latest/build.html",
"contextPath": "org.geppetto.frontend",
"useSsl": false,
"embedded": false,
"embedderURL": ["/"],
"rootRedirect":"",
"noTest": false,
"themes": "css/colors",
"properties": {
"title" : "geppetto",
"description": "Geppetto is an open-source platform to build web-based tools to visualize and simulate neuroscience data and models. This is a live deployment to showcase its functionalities.",
"type": "website",
"url": "http://live.geppetto.org",
"icon" :"geppetto/style/favicon.png",
"image": "http://www.geppetto.org/images/logo.png"
}
}
"_README" : "http://docs.geppetto.org/en/latest/build.html",
"contextPath": "org.geppetto.frontend",
"useSsl": false,
"embedded": false,
"embedderURL": ["/"],
"rootRedirect":"",
"noTest": false,
"extensions": {
"geppetto-default/ComponentsInitialization": false,
"geppetto-netpyne/ComponentsInitialization": true
},
"themes": "css/colors",
"properties": {
"title" : "NetPyNE",
"description": "NetPyNE-UI is a user interface for building, visualizing and simulationg neuronal network models using NetPyNE.",
"type": "website",
"url": "https://github.com/MetaCell/NetPyNE-UI",
"icon" :"https://d30y9cdsu7xlg0.cloudfront.net/png/38902-200.png",
"image": "http://www.geppetto.org/images/logo.png"
}
}
30 changes: 0 additions & 30 deletions LICENSE

This file was deleted.

87 changes: 0 additions & 87 deletions Main.js

This file was deleted.

74 changes: 18 additions & 56 deletions NetPyNE.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from 'react';
import Toolbar from '@material-ui/core/Toolbar';
import { ExpansionPanel, ExpansionPanelSummary, ExpansionPanelDetails } from '@material-ui/core';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import Typography from '@material-ui/core/Typography';

import Transition from './components/transition/Transition';
import NetPyNEPopulations from './components/definition/populations/NetPyNEPopulations';
import NetPyNECellRules from './components/definition/cellRules/NetPyNECellRules';
Expand Down Expand Up @@ -46,7 +42,7 @@ export default class NetPyNE extends React.Component {
this.handleTabChangedByToolBar = this.handleTabChangedByToolBar.bind(this)
}

componentWillReceiveProps (nextProps) {
UNSAFE_componentWillReceiveProps (nextProps) {
if (this.props.data != nextProps.data) {
console.log("Initialising NetPyNE Tabs")

Expand Down Expand Up @@ -104,11 +100,11 @@ export default class NetPyNE extends React.Component {
}))
};

handleTransitionOptionsChange = (e, v) => {
handleTransitionOptionsChange = value => {
var state = { fastForwardInstantiation: false, fastForwardSimulation: false }
if (v == 'Create and Simulate Network') {
if (value == 'Create and Simulate Network') {
state = { fastForwardInstantiation: true, fastForwardSimulation: true }
} else if (v == 'Create Network') {
} else if (value == 'Create Network') {
state = { fastForwardInstantiation: true, fastForwardSimulation: false }
}
this.setState(state)
Expand Down Expand Up @@ -144,7 +140,16 @@ export default class NetPyNE extends React.Component {
return <div></div>
} else {
if (this.state.value == 'define'){
var content = this.renderModelConfiguration()
var content = <div>
<PythonControlledNetPyNEPopulations model={"netParams.popParams"} />
<PythonControlledNetPyNECellRules model={"netParams.cellParams"} />
<PythonControlledNetPyNESynapses model={"netParams.synMechParams"} />
<PythonControlledNetPyNEConnectivity model={"netParams.connParams"} />
<PythonControlledNetPyNEStimulationSources model={"netParams.stimSourceParams"} />
<PythonControlledNetPyNEStimulationTargets model={"netParams.stimTargetParams"} />
<NetPyNESimConfig model={this.state.model.simConfig} />
<PythonControlledNetPyNEPlots model={"simConfig.analysis"} />
</div>
} else {
var content = <NetPyNEInstantiated key={this.state.freezeInstance ? "FIXME" : "PLEASE"} ref={"simulate"} model={this.state.model} page={"simulate"} />
}
Expand All @@ -157,7 +162,10 @@ export default class NetPyNE extends React.Component {
<NetPyNEToolBar changeTab={this.handleTabChangedByToolBar} />
</div>
<div style={{ display: 'flex', flexFlow: 'rows', width:'100%', marginRight: -10 }}>
<NetPyNETabs label={this.state.value} handleChange={this.handleChange} handleTransitionOptionsChange={this.handleTransitionOptionsChange}/>
<NetPyNETabs
label={this.state.value}
handleChange={this.handleChange}
handleTransitionOptionsChange={this.handleTransitionOptionsChange}/>
</div>
</Toolbar>
</div>
Expand All @@ -178,50 +186,4 @@ export default class NetPyNE extends React.Component {
)
}
}


renderModelConfiguration () {
const Expandable = ({ title, subtitle, children }) => <ExpansionPanel key={title} style={{ clear: 'both' }}>
<ExpansionPanelSummary
id="CellRules"
expandIcon={<ExpandMoreIcon />}
>
<div>
<Typography variant="h2">{title}</Typography>
<Typography variant="subtitle1">{subtitle}</Typography>
</div>
</ExpansionPanelSummary>
{children}
</ExpansionPanel>;


return <div>
<Expandable title="Populations" subtitle="Define here the populations of your network">
<PythonControlledNetPyNEPopulations model={"netParams.popParams"} />
</Expandable>
<Expandable title="Cell rules" subtitle="Define here the rules to set the biophysics and morphology of the cells in your network">
<PythonControlledNetPyNECellRules model={"netParams.cellParams"} />
</Expandable>
<Expandable title="Synaptic mechanisms" subtitle="Define here the synaptic mechanisms available in your network">
<PythonControlledNetPyNESynapses model={"netParams.synMechParams"} />
</Expandable>
<Expandable title="Connectivity rules" subtitle="Define here the rules to generate the connections in your network">
<PythonControlledNetPyNEConnectivity model={"netParams.connParams"} />
</Expandable>
<Expandable title="Stimulation sources" subtitle="Define here the sources of stimulation in your network">
<PythonControlledNetPyNEStimulationSources model={"netParams.stimSourceParams"} />
</Expandable>
<Expandable title="Stimulation target rules" subtitle="Define here the rules to connect stimulation sources to targets in your network">
<PythonControlledNetPyNEStimulationTargets model={"netParams.stimTargetParams"} />
</Expandable>
<Expandable title="Simulation configuration" subtitle="Define here the configuration options for the simulation">
<NetPyNESimConfig model={this.state.model.simConfig} />
</Expandable>
<Expandable title="Plots configuration" subtitle="Define here the options to customize the plots">
<PythonControlledNetPyNEPlots model={"simConfig.analysis"} />
</Expandable>


</div>;
}
}
2 changes: 0 additions & 2 deletions PULL_REQUEST_TEMPLATE

This file was deleted.

7 changes: 3 additions & 4 deletions Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,18 @@ const Utils = {

getErrorResponse (data){
var parsedData = this.convertToJSON(data)
if (parsedData['type'] == 'ERROR'){
if (parsedData.type && parsedData['type'] == 'ERROR') {
const error = { details: parsedData['details'] }
if (parsedData.message) {
if (Object.prototype.hasOwnProperty.call(parsedData, "message")) {
error["message"] = parsedData['message']
} else if (parsedData.websocket) {
} else if (Object.prototype.hasOwnProperty.call(parsedData, "websocket")) {
error["message"] = parsedData['websocket']
}
return error
}
return null;
},


parsePythonException (exception){
return <pre dangerouslySetInnerHTML={{ __html: IPython.utils.fixConsole(exception) }}></pre>
},
Expand Down
16 changes: 0 additions & 16 deletions WEB-INF/shiro.ini

This file was deleted.

Loading