I get it, but then I don’t… so I guess I don’t…
looking at this code example and following the docs GraphObject.html#mouseDragEnter, the event prop mouseDragEnter for a go.Node, when I set the 2nd param to Type go.GraphObject the method elt() doesn’t exist, if I set the Type to go.Node then the stroke prop doesn’t exist…
const docletTypeNodes = $(
go.Node,
'Auto',
new go.Binding(
'copyable',
'',
(event: go.ObjectData) => event.state !== GoJsNodeState.Copied
),
{
mouseDrop: nodeDropped,
mouseDragEnter: (ev: go.InputEvent, node: go.GraphObject) => {
node.elt(0).stroke = '#ffc74c';
},
mouseDragLeave: (ev: go.InputEvent, node: any) => {
node.elt(0).stroke = '#1776D2';
},
selectionChanged,
},
$(
go.Shape,
new go.Binding('fill', '', (event: any) => {
if (event.state === GoJsNodeState.Copied) return '#ccc';
if (
event.state === GoJsNodeState.Palette ||
event.state === GoJsNodeState.Diagram
)
return 'white';
}),
new go.Binding('stroke', '', (event: any) => {
if (event.state === GoJsNodeState.Copied) return '#ccc';
if (
event.state === GoJsNodeState.Palette ||
event.state === GoJsNodeState.Diagram
)
return '#1776D2';
}),
{
strokeWidth: 1,
figure: 'RoundedRectangle',
alignment: go.Spot.Center,
}
),
$(
go.Panel,
{
stretch: go.GraphObject.Horizontal,
alignment: go.Spot.Center,
},
'Horizontal',
$(
go.TextBlock,
{
margin: new go.Margin(2, 10, 0, 5),
font: 'bold 10pt Barlow, sans-serif',
},
new go.Binding('text', 'title')
),
$(
'Button',
new go.Binding(
'visible',
'',
(event: any) => event.part.data.state === GoJsNodeState.Diagram
).ofObject(),
{
width: 22,
height: 22,
'ButtonBorder.stroke': null,
_buttonStrokeOver: null,
'ButtonBorder.fill': null,
_buttonFillOver: null,
click: deleteFromTemplate,
},
$(go.Picture, {
desiredSize: new go.Size(17, 17),
source: '/icons/circle-xmark-regular-black.png',
})
)
)
);