$(go.Panel, "Horizontal",
new go.Binding("itemArray", "bottomArray"),
{
alignment: go.Spot.BottomCenter,
alignmentFocus: go.Spot.BottomCenter,
// row: 2, column: 1,
itemTemplate:
$(go.Panel,
{
_side: "bottom",
fromSpot: go.Spot.Bottom, toSpot: go.Spot.Bottom,
fromLinkable: true, toLinkable: true, cursor: "pointer",
},
new go.Binding("portId", "portId"),
$(go.Shape, "Circle",
{
stroke: null, strokeWidth: 2,
desiredSize: new go.Size(7, 7),
fill: null,
margin: new go.Margin(0, 0, -3, 0),
})
)
}),
{ // handle mouse enter/leave events to show/hide the ports
mouseEnter: ((e, node) => { showSmallPorts(e, node, true) }),
mouseLeave: ((e, node) => { showSmallPorts(e, node, false)})
} // end itemTemplate
); // end Node
var showSmallPorts = ((e,node,show) => {
node.ports.each((port) => {
if (port.portId !== "") { // don't change the default port, which is the big shape
port.fill = show ? "rgba(0,0,0,.3)" : null;
}
});
})
how to change the fill color in itemTemplete when mouseover