$(
go.Node,
$(
go.Panel,
"Spot",
$(
go.Panel,
"Spot",
{
mouseEnter: (e, node) => {
enterAnimation(node);
},
mouseLeave: (e, node, nextObj) => {
exitAnimation(node);
},
},
$(go.Shape, "RoundedRectangle", {
width: 200,
height: 150,
fill: "white",
stroke: "#E4E5E8",
name: "SELECTIONADORNMENTGO",
shadowVisible: true,
parameter1: 12,
}),
$(
go.Panel,
"Spot",
{ isClipping: true },
$(go.Shape, "RoundedRectangle", {
width: 200,
height: 150,
fill: "transparent",
stroke: "transparent",
parameter1: 12,
}),
$(
go.Picture,
{ width: 145, height: 145, name: "NODEICON" },
new go.Binding("source", "_src")
)
),
$(go.Shape, "Circle", {
cursor: "pointer",
fill: "transparent",
stroke: "transparent",
width: 1,
height: 1,
portId: TO_PORT,
alignment: go.Spot.Left,
toSpot: go.Spot.Left,
toLinkable: true,
}),
$(go.Shape, "Circle", {
fill: "transparent",
stroke: "transparent",
width: 1,
height: 1,
portId: FROM_PORT,
alignment: go.Spot.Right,
fromSpot: go.Spot.Right,
fromLinkable: true,
name: "FROMPORTGO",
}),
$(go.Shape, "RoundedRectangle", {
width: 0,
height: 0,
background: "#263238",
opacity: 0.2,
name: "HOVEROVERLAY",
stroke: "transparent",
parameter1: 12,
})
),
),
new go.Binding("location", "location", go.Point.parse).makeTwoWay(
go.Point.stringify
)
);
Enter Animation
(node) => {
const animation = new go.Animation();
animation.duration = 300;
const iconPanel = node.findObject("NODEICON");
const hoverPanel = node.findObject("HOVEROVERLAY");
const mainPanel = node.findObject("SELECTIONADORNMENTGO");
hoverPanel.width = mainPanel.width;
hoverPanel.height = mainPanel.height;
// animation.add(hoverPanel, "width", 0, mainPanel.width);
// animation.add(hoverPanel, "height", 0, mainPanel.height);
animation.add(iconPanel, "scale", 1, 1.1);
animation.start();
};
Exit Animation
(node) => {
const animation = new go.Animation();
animation.duration = 300;
const iconPanel = node.findObject("NODEICON");
const hoverPanel = node.findObject("HOVEROVERLAY");
// const mainPanel = node.findObject("SELECTIONADORNMENTGO");
hoverPanel.width = 0;
hoverPanel.height = 0;
// animation.add(hoverPanel, "width", mainPanel.width, 0);
// animation.add(hoverPanel, "height", mainPanel.height, 0);
animation.add(iconPanel, "scale", 1.1, 1);
animation.start();
};