Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React flow integration #957

Merged
merged 44 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
743b125
react flow tabular dnd init
karkir0003 Jul 9, 2023
08104fd
tabular dnd
karkir0003 Jul 9, 2023
5d93186
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Jul 15, 2023
6cb2488
test
farisdurrani Jul 15, 2023
c1240dc
importing uselazy
farisdurrani Jul 15, 2023
7942058
adding types to nodes
farisdurrani Jul 15, 2023
cfd9772
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Jul 19, 2023
b51014a
Generalized html tooltip
farisdurrani Jul 19, 2023
c676bbe
got dnd with start
farisdurrani Jul 19, 2023
3d60d8a
adding params to nodes
farisdurrani Jul 19, 2023
f563697
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Jul 19, 2023
f6f2f73
adding params to nodes
farisdurrani Jul 19, 2023
f5849ea
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Jul 21, 2023
69c6897
parameter updating in data
farisdurrani Jul 22, 2023
53a3f41
wrapping of layers
farisdurrani Jul 22, 2023
52933d3
Pulling in changes
farisdurrani Jul 22, 2023
1fd9fc0
export layers function init
farisdurrani Jul 22, 2023
ac097d3
minor aesthetics
farisdurrani Jul 22, 2023
4f256e7
pushing last code
farisdurrani Jul 28, 2023
3930e80
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Aug 12, 2023
837a507
dummy
farisdurrani Aug 14, 2023
b04d59e
Pulled latest
farisdurrani Aug 25, 2023
6cdd2c0
Minor correction
farisdurrani Aug 25, 2023
563b4b7
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Sep 1, 2023
4b8637c
pulled
farisdurrani Sep 7, 2023
ebc4f19
function to read layers
farisdurrani Sep 8, 2023
0e34d89
Standardizing default datasets
farisdurrani Sep 8, 2023
2a99dd5
function to read layers
farisdurrani Sep 8, 2023
a8a8e2f
Default layers for Iris
farisdurrani Sep 8, 2023
622d132
Restricted implemented train types
farisdurrani Sep 8, 2023
84585b0
Added DnD to step and reading layers
farisdurrani Sep 8, 2023
1a0cb4e
fixed implemented_da
farisdurrani Sep 12, 2023
5bc2385
Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…
farisdurrani Sep 12, 2023
3a74c23
minor typo
farisdurrani Sep 13, 2023
43a3fb2
aesthetics for flow
farisdurrani Sep 13, 2023
54de4ab
removed old dnd
farisdurrani Sep 13, 2023
f3a1a29
added nanoid, removed unused code
farisdurrani Sep 13, 2023
a95820b
added ImageFlow
farisdurrani Sep 13, 2023
552db0c
:art: Auto-generated directory tree for repository in Architecture.md
farisdurrani Sep 13, 2023
365c5db
settings.json removed change
farisdurrani Sep 15, 2023
63c18ea
:art: Auto-generated directory tree for repository in Architecture.md
farisdurrani Sep 15, 2023
d83b34d
nit
farisdurrani Sep 15, 2023
edbdf1b
Merge branch 'nextjs' into react-flow-integration-trainspace
farisdurrani Sep 15, 2023
413b7e0
Merge remote-tracking branch 'origin/react-flow-integration-trainspac…
farisdurrani Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
| | | | | | |- 📂 constants:
| | | | | | | |- 📜 imageConstants.ts
| | | | | | |- 📂 components:
| | | | | | | |- 📜 ImageFlow.tsx
farisdurrani marked this conversation as resolved.
Show resolved Hide resolved
| | | | | | | |- 📜 ImageTrainspace.tsx
| | | | | | | |- 📜 ImageDatasetStep.tsx
| | | | | | | |- 📜 ImageReviewStep.tsx
Expand All @@ -93,6 +94,7 @@
| | | | | | |- 📂 components:
| | | | | | | |- 📜 TabularParametersStep.tsx
| | | | | | | |- 📜 TabularDatasetStep.tsx
| | | | | | | |- 📜 TabularFlow.tsx
| | | | | | | |- 📜 TabularTrainspace.tsx
| | | | | | | |- 📜 TabularReviewStep.tsx
| | | | | | |- 📂 types:
Expand Down Expand Up @@ -137,9 +139,11 @@
| | | |- 📂 components:
| | | | |- 📜 ClientOnlyPortal.tsx
| | | | |- 📜 EmailInput.tsx
| | | | |- 📜 HtmlTooltip.tsx
| | | | |- 📜 TitleText.tsx
| | | | |- 📜 NavBarMain.tsx
| | | | |- 📜 Footer.tsx
| | | | |- 📜 DlpTooltip.tsx
| | | | |- 📜 Spacer.tsx
| | | |- 📂 utils:
| | | | |- 📜 firebase.ts
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
},
"python.formatting.provider": "none",
"python.terminal.activateEnvironment": false,
"python.analysis.typeCheckingMode": "basic"
"python.analysis.typeCheckingMode": "basic",
"cSpell.words": ["reactflow"]
farisdurrani marked this conversation as resolved.
Show resolved Hide resolved
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,4 @@ See [Architecture.md](./.github/Architecture.md)
Deep Learning Playground is MIT licensed, as found in the [LICENSE](./LICENSE) file.

Deep Learning Playground documentation is Creative Commons licensed, as found in the [LICENSE-docs](./.github/LICENSE-docs) file.

farisdurrani marked this conversation as resolved.
Show resolved Hide resolved
49 changes: 22 additions & 27 deletions aws_write/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"jszip": "^3.10.1",
"local-storage-fallback": "^4.1.2",
"lodash.camelcase": "^4.3.0",
"nanoid": "^5.0.1",
"next": "^13.2.4",
"next-redux-wrapper": "^8.1.0",
"openai": "^3.3.0",
Expand All @@ -65,6 +66,7 @@
"react-select": "^5.3.2",
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^9.0.7",
"reactflow": "^11.7.4",
"socket.io-client": "^4.5.1",
"styled-components": "^5.3.5",
"typescript": "^5.0.2",
Expand Down
61 changes: 61 additions & 0 deletions frontend/src/common/components/DlpTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from "react";
import IconButton from "@mui/material/IconButton";
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
import { styled } from "@mui/material/styles";

interface DlpTooltipProps {
children: React.ReactNode;
title: React.ReactNode;
isIcon?: boolean;
onClick?: () => void;
className?: string;
disabled?: boolean;
}

const DlpTooltip = (props: DlpTooltipProps) => {
const { children, title, isIcon, onClick, className, disabled } = props;

if (isIcon) {
return (
<Tooltip title={title} className={className}>
<span>
<IconButton
onClick={onClick}
style={{ width: "fit-content", aspectRatio: 1 }}
disabled={disabled}
className={className}
>
{children}
</IconButton>
</span>
</Tooltip>
);
}

return styled(
({
className,
title,
children,
...props
}: {
className?: string;
children: React.ReactElement;
title: React.ReactNode;
}) => (
<Tooltip title={title} {...props} classes={{ popper: className }}>
{children}
</Tooltip>
)
)(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: "rgba(255, 255, 255, 0.95)",
color: "rgba(0, 0, 0, 0.87)",
maxWidth: 220,
fontSize: theme.typography.pxToRem(12),
border: "none",
},
}));
};

export default DlpTooltip;
30 changes: 30 additions & 0 deletions frontend/src/common/components/HtmlTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { tooltipClasses, Tooltip } from "@mui/material";
import { styled } from "@mui/material/styles";
import React from "react";

const HtmlTooltip = styled(
({
className,
title,
children,
...props
}: {
className?: string;
children: React.ReactElement;
title: React.ReactNode;
}) => (
<Tooltip title={title} {...props} classes={{ popper: className }}>
{children}
</Tooltip>
)
)(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: "rgba(255, 255, 255, 0.95)",
color: "rgba(0, 0, 0, 0.87)",
maxWidth: 220,
fontSize: theme.typography.pxToRem(12),
border: "none",
},
}));

export default HtmlTooltip;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useRouter } from "next/router";
import { useAppDispatch } from "@/common/redux/hooks";
import {
ALL_TRAINSPACE_SETTINGS,
DATA_SOURCE_ARR,
IMPLEMENTED_DATA_SOURCE_ARR,
} from "@/features/Train/constants/trainConstants";
import { formatDate } from "@/common/utils/dateFormat";
import { removeTrainspaceData } from "@/features/Train/redux/trainspaceSlice";
Expand Down Expand Up @@ -178,7 +178,7 @@ const NewTrainSpaceMenu = ({
open={open}
onClose={handleClose}
>
{DATA_SOURCE_ARR.map((source) => (
{IMPLEMENTED_DATA_SOURCE_ARR.map((source) => (
<MenuItem
key={source}
value={source}
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/features/Train/components/CreateTrainspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAppDispatch } from "@/common/redux/hooks";
import { useRouter } from "next/router";
import {
ALL_TRAINSPACE_SETTINGS,
DATA_SOURCE_ARR,
IMPLEMENTED_DATA_SOURCE_ARR,
} from "../constants/trainConstants";
import { createTrainspaceData } from "../redux/trainspaceSlice";
const CreateTrainspace = () => {
Expand All @@ -18,9 +18,7 @@ const CreateTrainspace = () => {
control,
setValue,
} = useForm<BaseTrainspaceData>({
defaultValues: {
name: "My Trainspace",
},
defaultValues: { name: "My Trainspace" },
});
const dispatch = useAppDispatch();
const router = useRouter();
Expand All @@ -32,6 +30,7 @@ const CreateTrainspace = () => {
setValue("dataSource", router.query.source as DATA_SOURCE);
}
}, [router.isReady]);

return (
<Grid
container
Expand Down Expand Up @@ -76,7 +75,7 @@ const CreateTrainspace = () => {
value={value ?? ""}
helperText={errors.dataSource ? "Data Source is required" : ""}
>
{DATA_SOURCE_ARR.map((source) => (
{IMPLEMENTED_DATA_SOURCE_ARR.map((source) => (
<MenuItem key={source} value={source}>
{ALL_TRAINSPACE_SETTINGS[source].name}
</MenuItem>
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/features/Train/constants/trainConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ export const DATA_SOURCE_ARR = [

export const ALL_TRAINSPACE_SETTINGS = {
TABULAR: TABULAR_TRAINSPACE_SETTINGS,
PRETRAINED: TABULAR_TRAINSPACE_SETTINGS,
IMAGE: IMAGE_TRAINSPACE_SETTINGS,
AUDIO: TABULAR_TRAINSPACE_SETTINGS,
TEXTUAL: TABULAR_TRAINSPACE_SETTINGS,
CLASSICAL_ML: TABULAR_TRAINSPACE_SETTINGS,
OBJECT_DETECTION: TABULAR_TRAINSPACE_SETTINGS,
};
export const IMPLEMENTED_DATA_SOURCE_ARR = Object.keys(
ALL_TRAINSPACE_SETTINGS
) as (keyof typeof ALL_TRAINSPACE_SETTINGS)[];

export const ALL_STEP_SETTINGS = {
TABULAR: TABULAR_STEP_SETTINGS,
Expand Down
Loading
Loading