Skip to content

Commit ba18380

Browse files
author
Alex
committed
MUI update
1 parent 46912b7 commit ba18380

File tree

15 files changed

+4368
-5574
lines changed

15 files changed

+4368
-5574
lines changed

backend/translate/translate.py

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

backend/translate/translate_keras.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ def translate_keras(filename):
1717
Returns:
1818
object -- the result of this translation, can be an error
1919
"""
20-
epicbox.configure(profiles=[
21-
epicbox.Profile('python', 'tf_plus_keras:latest')])
22-
general_reader = open('translate/keras_loader.txt', 'rb')
23-
general_code = general_reader.read()
2420
if keras_ext in filename:
2521
try:
2622
return graph_from_model_file(filename)
2723
except Exception as err:
2824
return {'error_class': '', 'line_number': 1,
2925
'detail': "Model could not be loaded correctly. Error: " + str(err)}
3026
else:
27+
epicbox.configure(profiles=[
28+
epicbox.Profile('python', 'tf_plus_keras:latest')])
29+
general_reader = open('translate/keras_loader.txt', 'rb')
30+
general_code = general_reader.read()
3131
with open(filename, 'rb') as myfile:
3232
keras_code = myfile.read()
3333
try:

net2vis/package-lock.json

Lines changed: 4036 additions & 5302 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

net2vis/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@material-ui/core": "^4.12.3",
7-
"@material-ui/icons": "^4.11.2",
6+
"@emotion/react": "^11.4.1",
7+
"@emotion/styled": "^11.3.0",
8+
"@mui/icons-material": "^5.0.1",
9+
"@mui/material": "^5.0.2",
810
"ace-builds": "^1.4.12",
911
"dagre": "^0.8.5",
1012
"file-saver": "^2.0.5",

net2vis/src/App.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import thunk from "redux-thunk";
66
import AppRouter from "./AppRouter";
77
import Controls from "./components/controls/ControlsComponent";
88
import combinedReducers from "./reducers";
9-
import CssBaseline from "@material-ui/core/CssBaseline";
109

11-
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
12-
import { blue, red } from "@material-ui/core/colors";
10+
import { CssBaseline, createTheme, ThemeProvider } from "@mui/material";
11+
import { blue, red } from "@mui/material/colors";
1312

1413
// Create the Store using all the Reducers and applying the Middleware
1514
const store = createStore(combinedReducers, applyMiddleware(thunk));
1615

17-
const theme = createMuiTheme({
16+
const theme = createTheme({
1817
palette: {
1918
primary: blue,
2019
secondary: red,
@@ -28,7 +27,7 @@ const theme = createMuiTheme({
2827
// The App provides the Store to the following components.
2928
// Controls as well as Routed Content are rendered.
3029
const App = () => (
31-
<MuiThemeProvider theme={theme}>
30+
<ThemeProvider theme={theme}>
3231
<Provider store={store}>
3332
<div className="full">
3433
<CssBaseline />
@@ -38,7 +37,7 @@ const App = () => (
3837
<AppRouter />
3938
</div>
4039
</Provider>
41-
</MuiThemeProvider>
40+
</ThemeProvider>
4241
);
4342

4443
export default App;

net2vis/src/components/AlertSnack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { bindActionCreators } from "redux";
55

66
import * as actions from "../actions";
77

8-
import CloseIcon from "@material-ui/icons/Close";
9-
import { IconButton, Snackbar } from "@material-ui/core";
8+
import { Close } from "@mui/icons-material";
9+
import { IconButton, Snackbar } from "@mui/material";
1010

1111
class AlertSnack extends React.Component {
1212
handleClose = (event, reason) => {
@@ -34,7 +34,7 @@ class AlertSnack extends React.Component {
3434
color="inherit"
3535
onClick={this.handleClose}
3636
>
37-
<CloseIcon />
37+
<Close />
3838
</IconButton>,
3939
]}
4040
/>

net2vis/src/components/MainComponent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import PropTypes from "prop-types";
44
import { connect } from "react-redux";
55
import { bindActionCreators } from "redux";
66

7+
import { Grid, Paper } from "@mui/material";
8+
79
import * as actions from "../actions";
810
import Network from "./network/NetworkComponent";
911
import Legend from "./legend/LegendComponent";
1012
import Preferences from "./preferences/PreferencesComponent";
1113
import Code from "./code/CodeComponent";
12-
import { Grid, Paper } from "@material-ui/core";
1314
import Patterns from "./patterns/PatternComponent";
1415
import AlertSnack from "./AlertSnack";
1516

net2vis/src/components/code/CodeComponent.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import { connect } from "react-redux";
33
import PropTypes from "prop-types";
44
import { bindActionCreators } from "redux";
55
import AceEditor from "react-ace";
6-
import InputField from "../input/InputField";
7-
import Dialog from "@material-ui/core/Dialog";
8-
import DialogActions from "@material-ui/core/DialogActions";
9-
import DialogContent from "@material-ui/core/DialogContent";
10-
import DialogTitle from "@material-ui/core/DialogTitle";
11-
import Button from "@material-ui/core/Button";
126
import Dropzone from "react-dropzone";
7+
8+
import {
9+
Dialog,
10+
DialogActions,
11+
DialogContent,
12+
DialogTitle,
13+
Button,
14+
} from "@mui/material";
15+
16+
import InputField from "../input/InputField";
1317
import "ace-builds/src-noconflict/mode-python";
1418
import "ace-builds/src-noconflict/snippets/python";
1519
import "ace-builds/src-min-noconflict/ext-language_tools";

net2vis/src/components/controls/ControlsComponent.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ import { connect } from "react-redux";
33
import { bindActionCreators } from "redux";
44
import PropTypes from "prop-types";
55

6-
import AppBar from "@material-ui/core/AppBar";
7-
import Toolbar from "@material-ui/core/Toolbar";
8-
import Typography from "@material-ui/core/Typography";
9-
import IconButton from "@material-ui/core/IconButton";
10-
import GetApp from "@material-ui/icons/GetApp";
11-
import BugReport from "@material-ui/icons/BugReport";
12-
import Button from "@material-ui/core/Button";
13-
import Dialog from "@material-ui/core/Dialog";
14-
import DialogActions from "@material-ui/core/DialogActions";
15-
import DialogContent from "@material-ui/core/DialogContent";
16-
import DialogContentText from "@material-ui/core/DialogContentText";
17-
import DialogTitle from "@material-ui/core/DialogTitle";
6+
import {
7+
AppBar,
8+
Toolbar,
9+
Typography,
10+
IconButton,
11+
Button,
12+
Dialog,
13+
DialogContent,
14+
DialogActions,
15+
DialogContentText,
16+
DialogTitle,
17+
} from "@mui/material";
18+
import { GetApp, BugReport } from "@mui/icons-material";
1819

1920
import ToggleButton from "./ToggleButton";
2021
import * as actions from "../../actions";

net2vis/src/components/input/InputField.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
Select,
1414
MenuItem,
1515
InputLabel,
16-
} from "@material-ui/core";
16+
Box,
17+
} from "@mui/material";
1718

1819
// ToggleButton Control Element appearance dependant on State of the Button. Action that is provided gets called on click.
1920
const InputField = ({
@@ -89,6 +90,20 @@ const InputField = ({
8990
</Button>
9091
</div>
9192
);
93+
case "paddedButton":
94+
return (
95+
<div className="paddedButton">
96+
<Button
97+
onClick={(e) => action(e)}
98+
variant="contained"
99+
color={options === "secondary" ? "secondary" : "primary"}
100+
className="inputElement"
101+
disabled={!active}
102+
>
103+
{description}
104+
</Button>
105+
</div>
106+
);
92107
case "codeButton":
93108
return (
94109
<div className="codeItem">
@@ -121,10 +136,15 @@ const InputField = ({
121136
);
122137
case "select":
123138
return (
124-
<div className="preferenceItem">
139+
<div className="preferenceItem formselect">
125140
<FormControl className="inputElement">
126-
<InputLabel shrink>{description}</InputLabel>
127-
<Select onChange={(e) => action(e)} value={value}>
141+
<InputLabel id="select-label">{description}</InputLabel>
142+
<Select
143+
onChange={(e) => action(e)}
144+
value={value}
145+
labelId="select-label"
146+
label={description}
147+
>
128148
{options.map((option, index) => (
129149
<MenuItem value={option} key={index}>
130150
{option}
@@ -134,6 +154,22 @@ const InputField = ({
134154
</FormControl>
135155
</div>
136156
);
157+
case "barselect":
158+
return (
159+
<div className="menuselect">
160+
<Box>
161+
<FormControl className="inputElement">
162+
<Select onChange={(e) => action(e)} value={value}>
163+
{options.map((option, index) => (
164+
<MenuItem value={option} key={index}>
165+
{option}
166+
</MenuItem>
167+
))}
168+
</Select>
169+
</FormControl>
170+
</Box>
171+
</div>
172+
);
137173
default:
138174
return <div></div>;
139175
}

0 commit comments

Comments
 (0)