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

Feature: Integration of Drag-and-Drop Functionality for Dropout Nodes #34

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions tensormap-client/src/Variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
--input_header: rgb(93, 149, 34);
--flatten_background: rgb(247, 173, 20);
--flatten_header: rgb(170, 121, 24);
--dropout_background: rgb(103, 247, 103);
--dropout_header: rgb(20, 87, 42);
--node_label_font_color:#ffffff;
--node_header_font_color:#ffffff;
--node_border_color:#000000;
Expand Down
51 changes: 51 additions & 0 deletions tensormap-client/src/components/ButtonGroup/ButtonGroup.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react'
import { Button, Confirm } from 'semantic-ui-react';

export const ButtonGroup = () => {

const handleDelete = (rowIndex) => {
setShowConfirmDelete(true);
setModifyRow(rowIndex);
};

const handleConfirmDelete = () => {
// Implement delete action here
console.log(`Deleting row ${modifyRow}`);
// Close the confirmation dialog
setShowConfirmDelete(false);
};

const handleCancelDelete = () => {
// Close the confirmation dialog
setShowConfirmDelete(false);
};

const handleModify = (rowIndex, columnIndex) => {
setShowModifyInput(true);
setModifyRow(rowIndex);
setModifyColumn(columnIndex);
};

const handleModifyConfirm = () => {
// Implement modify action here
console.log(`Modifying row ${modifyRow} column ${modifyColumn} with value ${modifyValue}`);
// Clear modify value and hide input
setModifyValue("");
setShowModifyInput(false);
};

return (
<>
<Button.Group>
<Button icon="trash" onClick={() => handleDelete(modifyRow)}>Delete</Button>
<Button icon="edit" onClick={() => handleModify(modifyRow, modifyColumn)}>Modify</Button>
</Button.Group>
<Confirm
open={showConfirmDelete}
onCancel={handleCancelDelete}
onConfirm={handleConfirmDelete}
content={`Are you sure you want to delete row ${modifyRow + 1}?`}
/>
</>
)
}
Loading