Skip to content

Commit f8564d6

Browse files
committed
Merge branch 'feature/417' of https://github.com/MetaCell/netpyne-ui into feature/417_integrating_geppetto_actions
2 parents d30791a + 28b83eb commit f8564d6

7 files changed

Lines changed: 31 additions & 10 deletions

File tree

webapp/components/definition/cellRules/SelectCellTemplate.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default class NetPyNENewPlot extends React.Component {
5252
style={{
5353
width: 40,
5454
height: 40,
55+
borderRadius: '50%',
5556
}}
5657
color={page == 'main' ? 'primary' : 'secondary'}
5758
onClick={(event) => handleButtonClick(event)}

webapp/components/definition/plots/NetPyNENewPlot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class NetPyNENewPlot extends React.Component {
2828
return (
2929
<div>
3030
<Tooltip title="Add new plot" placement="top">
31-
<Fab size="small" color="primary" onClick={this.handleButtonClick}>
31+
<Fab size="small" color="primary" onClick={this.handleButtonClick} style={{ borderRadius: '50%' }}>
3232
<ContentAdd style={{ color: 'white' }} />
3333
</Fab>
3434
</Tooltip>

webapp/components/definition/stimulationTargets/NetPyNEStimulationTargets.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export default class NetPyNEStimulationTargets extends Component {
276276
overflow: 'visible',
277277
display: 'flex',
278278
justifyContent: 'center',
279+
borderRadius: '50%',
279280
}}
280281
>
281282
Target

webapp/components/general/ControlPanelTreeItem.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as React from 'react';
22
import { makeStyles } from '@material-ui/core/styles';
3-
import Box from '@material-ui/core/Box';
43
import Grid from '@material-ui/core/Grid';
54
import Typography from '@material-ui/core/Typography';
5+
import Box from '@material-ui/core/Box';
66
import IconButton from '@material-ui/core/IconButton';
77
import TreeItem from '@material-ui/lab/TreeItem';
88
import Visibility from '@material-ui/icons/Visibility';
99
import ColorLens from '@material-ui/icons/ColorLens';
10+
import Shuffle from '@material-ui/icons/Shuffle';
1011
import { ChromePicker } from 'react-color';
1112
import { experimentLabelColor } from '../../theme';
1213

@@ -44,6 +45,16 @@ const ControlPanelTreeItem = (props) => {
4445
event.stopPropagation();
4546
};
4647

48+
const generateRandomColor = () => {
49+
const randomColor = {
50+
r: parseFloat((Math.random() * 1.00).toFixed(2)),
51+
g: parseFloat((Math.random() * 1.00).toFixed(2)),
52+
b: parseFloat((Math.random() * 1.00).toFixed(2)),
53+
a: 1,
54+
};
55+
setColor(randomColor);
56+
};
57+
4758
const {
4859
label,
4960
type,
@@ -57,6 +68,7 @@ const ControlPanelTreeItem = (props) => {
5768
return (
5869
<TreeItem
5970
nodeId={nodeId}
71+
onLabelClick={(e) => { e.stopPropagation(); e.preventDefault(); }}
6072
label={(
6173
<Grid
6274
container
@@ -67,23 +79,28 @@ const ControlPanelTreeItem = (props) => {
6779
flexDirection="row"
6880
justifyContent="space-between"
6981
>
70-
<Grid item xs={4}><Typography onClick={(event) => onNodeSelect(event, nodeId)}>{label}</Typography></Grid>
82+
<Grid item xs={4}><Typography onClick={() => onNodeSelect(nodeId)}>{label}</Typography></Grid>
7183
<Grid item xs={4} justifyContent="center"><Typography>{type}</Typography></Grid>
7284
<Grid item xs={4} justifyContent="flex-end" className={classes.controls}>
7385
{isHoveredOver
7486
? (
7587
<>
7688

7789
<IconButton onClick={(event) => onVisibilityClick(event, nodeId)}><Visibility /></IconButton>
78-
<IconButton onClick={() => setShowColorPicker(!showColorPicker)}><ColorLens /></IconButton>
90+
<IconButton onClick={generateRandomColor}><Shuffle /></IconButton>
91+
<IconButton onClick={() => setShowColorPicker(true)}><ColorLens /></IconButton>
7992
{
8093
showColorPicker
8194
? (
82-
<ChromePicker
83-
className={classes.colorPicker}
84-
color={color}
85-
onChangeComplete={(e, color) => handleColorSelection(e, color, nodeId)}
86-
/>
95+
<Box
96+
onMouseLeave={() => setShowColorPicker(false)}
97+
>
98+
<ChromePicker
99+
className={classes.colorPicker}
100+
color={color}
101+
onChangeComplete={(color, event) => handleColorSelection(color, event, nodeId)}
102+
/>
103+
</Box>
87104
) : null
88105
}
89106

webapp/components/general/ExperimentControlPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const useStyles = makeStyles(() => ({
2424
const ExperimentControlPanel = (props) => {
2525
const classes = useStyles();
2626
const [filter, setFilter] = React.useState('');
27-
const onNodeSelect = (event, nodeId) => {
27+
const onNodeSelect = (nodeId) => {
2828
console.log(`Node with id ${nodeId} clicked`);
2929
};
3030

webapp/components/general/NetPyNEAddNew.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class NetPyNEAddNew extends React.Component {
3030
id={this.props.id}
3131
className={classes.root}
3232
onClick={this.handleClick}
33+
style={{ borderRadius: '50%' }}
3334
>
3435
<ContentAdd className={classes.plus} />
3536
</Fab>

webapp/components/general/NetPyNEThumbnail.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ const getFabButton = (label, selected, others) => (
150150
<Fab
151151
className={`actionButton ${selected ? 'selectedActionButton' : ''}`}
152152
{...others}
153+
style={{ borderRadius: '50%' }}
153154
>
154155
{label}
155156
</Fab>

0 commit comments

Comments
 (0)