Added human visuals to app framework

This commit is contained in:
frikky
2022-03-04 04:06:40 +01:00
parent 3d25c768bf
commit 05acf690f4
2 changed files with 33 additions and 1 deletions
+17 -1
View File
@@ -831,9 +831,23 @@ const Framework = (props) => {
setDefaultSearch(data.label.charAt(0).toUpperCase()+(data.label.substring(1)).toLowerCase())
}
const onEdgeAdded = (event) => {
//event.target.data("human", false)
}
const onEdgeSelect = (event) => {
console.log(event)
if (event.target.data("human") === undefined) {
event.target.data("human", true)
} else if (event.target.data("human") === true) {
event.target.remove()
return
//event.target.data("human", false)
}
console.log("Edge selected!", event.target.data())
//event.target.remove()
event.target.unselect()
}
if (graphDone && cyDone === false) {
@@ -842,6 +856,8 @@ const Framework = (props) => {
cy.fit(null, 200);
cy.on("select", "edge", (e) => onEdgeSelect(e));
cy.on("add", "edge", (e) => onEdgeAdded(e));
cy.on("select", "node", (e) => {
onNodeSelect(e)
})