Skip to content

Commit eef0858

Browse files
author
rodriguez-facundo
committed
#139 Move Plots to drawer, remove plot button from 3D canvas
1 parent 5654680 commit eef0858

11 files changed

Lines changed: 285 additions & 220 deletions

File tree

webapp/components/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,6 @@ export const ActionDialog = connect(
212212
})
213213
)(_ActionDialog)
214214

215-
216-
import _PlotButton from './instantiation/PlotButtons'
217-
export const PlotButtons = connect(
218-
state => ({ ...state.errors, openErrorDialogBox: state.errors.openDialog }),
219-
dispatch => ({
220-
newWidget: conf => dispatch(newWidget(conf)),
221-
closeBackendErrorDialog: () => dispatch(closeBackendErrorDialog),
222-
pythonCallErrorDialogBox: payload => dispatch(openBackendErrorDialog(payload))
223-
})
224-
)(_PlotButton)
225-
226-
227215
import _NetPyNEPythonConsole from './general/NetPyNEPythonConsole'
228216
export const NetPyNEPythonConsole = connect(
229217
null,

webapp/components/instantiation/NetWorkControlButtons.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Tooltip } from 'netpyne/components';
44

55
import { MODEL_STATE } from '../../constants'
66
import { withStyles } from '@material-ui/core/styles';
7-
import { PlotButtons } from 'netpyne/components'
87

98
const styles = ({ spacing }) => ({
109
container: {
@@ -76,9 +75,6 @@ class NetWorkControlButtons extends React.Component {
7675
</div>
7776

7877
</Tooltip>
79-
80-
81-
<PlotButtons/>
8278

8379
</div>
8480
</div>

webapp/components/instantiation/PlotButtons.js

Lines changed: 0 additions & 193 deletions
This file was deleted.

webapp/components/layout/LayoutManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function widget2Node (configuration) {
2626
component,
2727
type: "tab",
2828
enableRename: false,
29-
enableClose: enableClose,
29+
enableClose,
3030
// attr defined inside config, will also be available from within flexlayout nodes. For example: node.getNodeById(id).getConfig()
3131
config: configuration ,
3232
...others

webapp/components/settings/Drawer.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import Typography from '@material-ui/core/Typography';
1717
import AdjustIcon from '@material-ui/icons/Adjust';
1818
import {
1919
HLS_WIDGETS, PYTHON_CONSOLE_WIDGET,
20-
FLEXLAYOUT_DEFAULT_STATE, MORPHOLOGY_WIDGET
20+
FLEXLAYOUT_DEFAULT_STATE, MORPHOLOGY_WIDGET,
21+
PLOTS_WIDGETS
2122
} from '../../redux/reducers/flexlayout'
2223

2324

@@ -48,8 +49,8 @@ const useStyles = makeStyles(({ transitions, palette }) => ({
4849
},
4950
paper: { backgroundColor: palette.grey['900'] },
5051

51-
selected: { height: 60, color: palette.primary.main },
52-
unselected: { height: 60, color: palette.common.white },
52+
selected: { height: 48, color: palette.primary.main },
53+
unselected: { height: 48, color: palette.common.white },
5354
noColor: { color: 'inherit' }
5455
}))
5556

@@ -62,18 +63,30 @@ export default ({ widgets, newWidget, editMode }) => {
6263
if (!widgets[widgetId]) {
6364
let widget = HLS_WIDGETS[widgetId]
6465
if (!editMode) {
65-
widget = MORPHOLOGY_WIDGET
66+
widget = simulateModeWidget(widgetId)
6667
}
6768

6869
newWidget({ path: widget.id, ...widget })
6970
}
7071
}
7172

73+
function simulateModeWidget (widgetId) {
74+
if (widgetId.includes('Plot')) {
75+
return PLOTS_WIDGETS[widgetId]
76+
}
77+
return MORPHOLOGY_WIDGET
78+
}
79+
80+
7281
function getMenu () {
7382
if (editMode) {
7483
return Object.values({ ...HLS_WIDGETS, python: PYTHON_CONSOLE_WIDGET })
7584
} else {
76-
return Object.values({ ...FLEXLAYOUT_DEFAULT_STATE.widgetsBackground, python: PYTHON_CONSOLE_WIDGET })
85+
return Object.values({
86+
...FLEXLAYOUT_DEFAULT_STATE.widgetsBackground,
87+
...PLOTS_WIDGETS,
88+
python: PYTHON_CONSOLE_WIDGET
89+
})
7790
}
7891

7992
}
@@ -87,7 +100,7 @@ export default ({ widgets, newWidget, editMode }) => {
87100
>
88101
<div>
89102
<Toolbar/>
90-
<List>
103+
<List dense>
91104
{getMenu().map(({ name, id }) => (
92105
<ListItem
93106
button

webapp/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const NETPYNE_COMMANDS = {
2626
simulateModel: 'netpyne_geppetto.simulateNetPyNEModelInGeppetto',
2727
importModel: 'netpyne_geppetto.importModel',
2828
exportModel: 'netpyne_geppetto.exportModel',
29-
exportHLS: 'netpyne_geppetto.exportHLS'
29+
exportHLS: 'netpyne_geppetto.exportHLS',
30+
plotFigure: 'netpyne_geppetto.getPlot'
3031
}
3132

webapp/redux/actions/flexlayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const newWidget = ({ path, component, panelName, ...others }) => ({
1616
id: path,
1717
instancePath: path,
1818
component: component,
19-
name: path.slice(FILEVARIABLE_LENGTH),
19+
name: path,
2020
status: WidgetStatus.ACTIVE,
2121
panelName: panelName,
2222
...others

webapp/redux/middleware/middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const createSimulateBackendCall = async (cmd, payload, next, action, consoleMess
8686
}
8787
}
8888

89-
const processError = response => {
89+
export const processError = response => {
9090
var parsedResponse = Utils.getErrorResponse(response);
9191
if (parsedResponse) {
9292
return { errorMessage: parsedResponse['message'], errorDetails: parsedResponse['details'] }

0 commit comments

Comments
 (0)