diff --git a/src/assets/styles/constant.js b/src/assets/styles/constant.js
deleted file mode 100644
index 55e06d90..00000000
--- a/src/assets/styles/constant.js
+++ /dev/null
@@ -1,31 +0,0 @@
-export const colorGreen = {
- backgroundColor: '#D4F4D4',
- textColor: '#669D66',
- borderColor: 'rgba(102, 157, 102, 0.2)',
- boxShadow: '0 0.25rem 0.625rem -0.25rem rgba(102, 157, 102, 0.3)',
- bulletColor: '#669D66',
-};
-
-export const colorOrange = {
- backgroundColor: '#F4E9D4',
- textColor: '#9D8B66',
- borderColor: 'rgba(157, 139, 102, 0.2)',
- boxShadow: '0 0.25rem 0.625rem -0.25rem rgba(157, 139, 102, 0.3)',
- bulletColor: '#9D8B66',
-};
-
-export const colorBlue = {
- backgroundColor: '#D4E6F4',
- textColor: '#66829D',
- borderColor: 'rgba(102, 130, 157, 0.2)',
- boxShadow: '0 0.125rem 0.375rem -0.25rem rgba(102, 130, 157, 0.2)',
- bulletColor: '#66829D',
-};
-
-export const colorGray = {
- backgroundColor: '#E4E4E4',
- textColor: '#818181',
- borderColor: 'rgba(130, 130, 130, 0.2)',
- boxShadow: '0 0.25rem 0.625rem -0.25rem rgba(129, 129, 129, 0.3)',
- bulletColor: '#818181',
-};
\ No newline at end of file
diff --git a/src/assets/styles/variables.js b/src/assets/styles/variables.js
index 4f9386cf..0ea685fb 100644
--- a/src/assets/styles/variables.js
+++ b/src/assets/styles/variables.js
@@ -1,3 +1,24 @@
+const nodeRed = {
+ nodeRedBackgroundColor: '#F4D4D4',
+ nodeRedTextColor: '#9D6666',
+ nodeRedBorderColor: 'rgba(157, 139, 102, 0.2)',
+ nodeRedBoxShadow: '0 0.25rem 0.625rem -0.25rem rgba(157, 139, 102, 0.3)',
+};
+
+const nodeBlue = {
+ nodeBlueBackgroundColor: '#D4E6F4',
+ nodeBlueTextColor: '#66829D',
+ nodeBlueBorderColor: 'rgba(102, 130, 157, 0.2)',
+ nodeBlueBoxShadow: '0 0.125rem 0.375rem -0.25rem rgba(102, 130, 157, 0.2)',
+};
+
+const nodeGray = {
+ nodeGrayBackgroundColor: '#E4E4E4',
+ nodeGrayTextColor: '#818181',
+ nodeGrayBorderColor: 'rgba(130, 130, 130, 0.2)',
+ nodeGrayBoxShadow: '0 0.25rem 0.625rem -0.25rem rgba(129, 129, 129, 0.3)',
+};
+
const vars = {
fontFamily: 'Inter, sans-serif',
primaryBg: '#f1f1f1',
@@ -31,7 +52,10 @@ const vars = {
progressBar: '#017AFF',
progressShadow: 'inset 0 0 0.0625rem #E3E3E3',
- switchShadow: '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)'
+ switchShadow: '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',
+ ...nodeRed,
+ ...nodeBlue,
+ ...nodeGray,
};
export default vars;
\ No newline at end of file
diff --git a/src/assets/svg/mechanismgreen.svg b/src/assets/svg/mechanismgreen.svg
deleted file mode 100644
index a5266f58..00000000
--- a/src/assets/svg/mechanismgreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/svg/mechanismicon.svg b/src/assets/svg/mechanismicon.svg
deleted file mode 100644
index 7faf7808..00000000
--- a/src/assets/svg/mechanismicon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/svg/mechanismyellow.svg b/src/assets/svg/mechanismyellow.svg
deleted file mode 100644
index 75f3326f..00000000
--- a/src/assets/svg/mechanismyellow.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/svg/node/blue.png b/src/assets/svg/node/blue.png
new file mode 100644
index 00000000..8adb4d9e
Binary files /dev/null and b/src/assets/svg/node/blue.png differ
diff --git a/src/assets/svg/node/gray.png b/src/assets/svg/node/gray.png
new file mode 100644
index 00000000..e8543f96
Binary files /dev/null and b/src/assets/svg/node/gray.png differ
diff --git a/src/assets/svg/node/red.png b/src/assets/svg/node/red.png
new file mode 100644
index 00000000..c85ed626
Binary files /dev/null and b/src/assets/svg/node/red.png differ
diff --git a/src/components/Main.js b/src/components/Main.js
index 64caff7a..8660e559 100644
--- a/src/components/Main.js
+++ b/src/components/Main.js
@@ -12,20 +12,12 @@ const mockModel = require('../resources/model').mockModel;
const styles = () => ({
root: {
- position: 'absolute',
- top: '3.5rem',
- left: 0,
- height: 'calc(100% - 3.5rem)',
+ height: 'calc(100vh - 3.5rem)',
width: '100%',
- backgroundRepeat: 'repeat',
- backgroundColor: '#fff',
- backgroundImage: `url(${BG})`
- },
-
- diagramContainer: {
- width: '100%',
- height: '100%',
},
+ canvasBG: {
+ backgroundImage: `url(${BG})`
+ }
});
class Main extends React.Component {
@@ -47,7 +39,12 @@ class Main extends React.Component {
return (
-
+
);
}
diff --git a/src/components/common/Header.js b/src/components/common/Header.js
index fedeed27..db20e459 100644
--- a/src/components/common/Header.js
+++ b/src/components/common/Header.js
@@ -10,7 +10,7 @@ import vars from "../../assets/styles/variables";
const { textWhite, listSelectedTextColor, dropdownBg, dropdownTextColor } = vars;
-const useStyles = makeStyles((theme) => ({
+const useStyles = makeStyles(() => ({
root: {
background: textWhite,
height: '3.5rem',
diff --git a/src/components/common/Layout.js b/src/components/common/Layout.js
index 4835d559..8f796b29 100644
--- a/src/components/common/Layout.js
+++ b/src/components/common/Layout.js
@@ -1,17 +1,11 @@
import React from 'react';
-import { makeStyles } from '@mui/styles';
import { Box } from '@mui/material';
import Header from './Header';
import Main from '../Main';
-const useStyles = makeStyles((theme) => ({
- root: {},
-}));
-
const Layout = ({ children }) => {
- const classes = useStyles();
return (
-
+
diff --git a/src/components/views/mechanisms/CustomNodeWidget.js b/src/components/views/mechanisms/CustomNodeWidget.js
index a6b35330..eec43ed7 100644
--- a/src/components/views/mechanisms/CustomNodeWidget.js
+++ b/src/components/views/mechanisms/CustomNodeWidget.js
@@ -1,7 +1,7 @@
import * as React from "react";
import {DiagramEngine, PortWidget} from "@projectstorm/react-diagrams";
import {MetaNodeModel} from "meta-diagram";
-import {Typography} from "@material-ui/core";
+import {Typography} from "@mui/material";
export class CustomNodeWidget extends React.Component {
render() {
diff --git a/src/components/views/mechanisms/MechMetadata.js b/src/components/views/mechanisms/MechMetadata.js
index 0a2d5f9c..cc6b5103 100644
--- a/src/components/views/mechanisms/MechMetadata.js
+++ b/src/components/views/mechanisms/MechMetadata.js
@@ -6,8 +6,6 @@ import InputOutputNode from "./InputOutputNode";
import TextField from '@mui/material/TextField';
import Typography from "@mui/material/Typography";
-
-
const styles = () => ({
root: {
position: 'relative',
diff --git a/src/components/views/mechanisms/MechSimple.js b/src/components/views/mechanisms/MechSimple.js
index 153ed989..f02be407 100644
--- a/src/components/views/mechanisms/MechSimple.js
+++ b/src/components/views/mechanisms/MechSimple.js
@@ -1,78 +1,21 @@
import * as React from "react";
-import { withStyles } from "@mui/styles";
import { Box, Typography } from "@mui/material";
import NodeSelection from "./NodeSelection";
-import { PortWidget } from "@projectstorm/react-diagrams";
-
-const styles = () => ({
- root: {
- border: 'solid 0.0625rem',
- borderRadius: '50%',
- width: '10rem',
- height: '10rem',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- flexDirection: 'column',
- position: 'relative',
-
- '& img': {
- marginBottom: '0.25rem',
- },
-
- '& p': {
- fontWeight: 500,
- fontSize: '0.8125rem',
- lineHeight: '1.25rem',
- letterSpacing: '-0.005rem',
- margin: 0,
- },
- },
-});
class MechSimple extends React.Component {
render() {
- const { classes, model, model: { options }, engine, changeVisibility } = this.props;
-
- const circlePortStyle = {
- width: "12px",
- height: "12px",
- margin: "2px",
- borderRadius: "4px",
- background: "darkgray",
- cursor: "pointer",
- }
+ const { model, model: { options }, engine, changeVisibility } = this.props;
return (
-
+
{options.selected && (
)}
-
-
-
-
-
-
-
-
-
+
+
{options.name}
@@ -81,4 +24,4 @@ class MechSimple extends React.Component {
}
}
-export default withStyles(styles)(MechSimple);
+export default MechSimple;
diff --git a/src/components/views/mechanisms/NodeSelection.js b/src/components/views/mechanisms/NodeSelection.js
index 6e37b329..94688a72 100644
--- a/src/components/views/mechanisms/NodeSelection.js
+++ b/src/components/views/mechanisms/NodeSelection.js
@@ -1,103 +1,31 @@
import * as React from "react";
-import { withStyles } from "@mui/styles";
import { Box, Button } from "@mui/material";
-import { PortWidget } from "@projectstorm/react-diagrams";
-
-const styles = () => ({
- nodes: {
- width: '10rem',
- height: '10rem',
- border: '0.09375rem solid #18A0FB',
- zIndex: 10,
- position: 'absolute',
- },
-
- nodesDefault: {
- width: '100%',
- height: '100%',
- },
-
- node: {
- width: '0.625rem',
- height: '0.625rem',
- background: '#FFFFFF',
- border: '0.09375rem solid #18A0FB',
- borderRadius: '0.125rem',
- position: 'absolute',
- },
-
- button: {
- '&.MuiButton-root': {
- backgroundColor: '#161A1E',
- borderRadius: '1.125rem',
- fontWeight: 600,
- fontSize: '0.8125rem',
- display: 'flex',
- lineHeight: '1rem',
- letterSpacing: '-0.025625rem',
- color: 'rgba(255, 255, 255, 0.8)',
- margin: '0 !important',
- width: '9.625rem',
- padding: '0',
- height: '2.25rem',
- position: 'absolute',
- top: '-2.625rem',
- fontFamily: 'Inter,sans-serif',
- left: '50%',
- transform: 'translateX(-50%)',
-
- '&:hover': {
- backgroundColor: '#161A1E',
- },
- },
- },
-
- circle: {
- width: '1rem',
- border: 'solid 0.0625rem',
- height: '1rem',
- borderRadius: '50%',
- marginRight: '1.25rem',
- position: 'relative',
-
- '&:after': {
- content: '""',
- height: '1.75rem',
- width: '0.0625rem',
- display: 'block',
- position: 'absolute',
- right: '-0.625rem',
- top: '50%',
- transform: 'translateY(-50%)',
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
- },
- },
-});
+import PortWigetComp from "./PortWidgetComp";
class NodeSelection extends React.Component {
render() {
const { classes, node, node: { options }, engine, text, changeVisibility } = this.props;
-
- const nodeClass = options.shape === 'default' ? classes.nodesDefault : '';
-
+ const selectionPoint = '-0.375rem';
+ const IN = 'in';
+ const OUT = 'out';
return (
<>
-