-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,7 @@ | |
} | ||
|
||
.operatorButton { | ||
user-select: none; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
import { DropdownMenuItem } from "../Dropdown/dropdown"; | ||
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; | ||
import styles from './createNodeItem.module.css'; | ||
|
||
function CreateNodeItem({ varKey, graph, classURI, selectedNode, edgeLabel, property, isOptional, isFromInstance, addNode, addEdge }) { | ||
// On click, add a node of the selected type with the selected edge targeting it. | ||
const handleAddTargetedNode = (e) => { | ||
e.stopPropagation(); | ||
const newNode = addNode(varKey.toUpperCase(), null, varKey, true, graph, classURI, false, false); | ||
addEdge(selectedNode.id, newNode.id, edgeLabel, property, isOptional, isFromInstance); | ||
} | ||
|
||
return ( | ||
<DropdownMenuItem onClick={handleAddTargetedNode} disableRipple={true} style={{ padding: 0 }}> | ||
<div className={styles.createNodeItem}> | ||
<span className={styles.createNodeText}>New {varKey.toUpperCase()}</span> | ||
<AddCircleOutlineIcon className={styles.createNodeIcon} /> | ||
</div> | ||
</DropdownMenuItem> | ||
) | ||
} | ||
|
||
export default CreateNodeItem; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.createNodeItem { | ||
padding: 4px 10px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: #ffffff; | ||
border: 1px solid #d0d0d0; | ||
border-radius: 4px; | ||
margin: 2px 10px; | ||
box-sizing: border-box; | ||
width: calc(100% - 20px); | ||
transition: background-color 0.3s ease; | ||
cursor: pointer; | ||
font-size: 14px; | ||
} | ||
|
||
|
||
.createNodeItem:hover { | ||
background-color: #e6e6e6; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); | ||
} | ||
|
||
.createNodeText { | ||
color: #555; | ||
font-weight: 400; | ||
margin-left: 8px; | ||
text-align: left; | ||
flex-grow: 1; | ||
} | ||
|
||
.createNodeIcon { | ||
color: #555; | ||
text-align: left; | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
} | ||
|
||
.big_button { | ||
user-select: none; | ||
display: inline-block; | ||
padding: 2px; | ||
font-size: 1vw; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.file_button { | ||
user-select: none; | ||
padding: 2px; | ||
display: flex; | ||
justify-content: center; | ||
|