Added color change to edges in graph
This commit is contained in:
@@ -62,8 +62,6 @@ import cxtmenu from 'cytoscape-cxtmenu';
|
|||||||
import { w3cwebsocket as W3CWebSocket } from "websocket";
|
import { w3cwebsocket as W3CWebSocket } from "websocket";
|
||||||
import { useAlert } from "react-alert";
|
import { useAlert } from "react-alert";
|
||||||
|
|
||||||
const hoverColor = "#f85a3e"
|
|
||||||
const hoverOutColor = "#e8eaf6"
|
|
||||||
const surfaceColor = "#27292D"
|
const surfaceColor = "#27292D"
|
||||||
const inputColor = "#383B40"
|
const inputColor = "#383B40"
|
||||||
|
|
||||||
@@ -1142,7 +1140,6 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onNodeHover = (event) => {
|
const onNodeHover = (event) => {
|
||||||
//event.target.style("border-width", "5px")
|
|
||||||
event.target.animate({
|
event.target.animate({
|
||||||
style: {
|
style: {
|
||||||
"border-width": "5px",
|
"border-width": "5px",
|
||||||
@@ -1156,24 +1153,22 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onEdgeHoverOut = (event) => {
|
const onEdgeHoverOut = (event) => {
|
||||||
//event.target.removeStyle()
|
event.target.removeStyle()
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is here to have a proper transition for lines
|
// This is here to have a proper transition for lines
|
||||||
const onEdgeHover = (event) => {
|
const onEdgeHover = (event) => {
|
||||||
|
const sourcecolor = cy.getElementById(event.target.data("source")).style("border-color")
|
||||||
//console.log(event.target.data())
|
const targetcolor = cy.getElementById(event.target.data("target")).style("border-color")
|
||||||
//const sourcecolor = cy.getElementById(event.target.data("source")).style("border-color")
|
event.target.animate({
|
||||||
//const targetcolor = cy.getElementById(event.target.data("target")).style("border-color")
|
style: {
|
||||||
//event.target.animate({
|
"line-fill": "linear-gradient",
|
||||||
// style: {
|
'target-arrow-color': targetcolor,
|
||||||
// "line-fill": "linear-gradient",
|
"line-gradient-stop-colors": [sourcecolor, targetcolor],
|
||||||
// 'target-arrow-color': targetcolor,
|
"line-gradient-stop-positions": [0, 1],
|
||||||
// "line-gradient-stop-colors": [sourcecolor, targetcolor],
|
},
|
||||||
// "line-gradient-stop-positions": [0, 1],
|
duration: 0,
|
||||||
// },
|
})
|
||||||
// duration: 0,
|
|
||||||
//})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user