-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathComponentsInitialization.js
65 lines (56 loc) · 2.76 KB
/
ComponentsInitialization.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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={"http://" + window.location.hostname + ":" + window.location.port + "/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) => {
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");
})
});
};
});