I may only be coding it incorrectly, but there is an unexpected interaction between the color of the node I’m clicking on for the context menu to show up and the color of the context menu buttons. The buttons are are currently go.Shapes that are supposed to be their own color with an internal table and text block. Instead, they end up being the same color as the node I clicked on, rather than their intended colors.
$('ContextMenuButton',
// Second option.
$(go.Shape,
'Rectangle',
{ stroke: null, strokeWidth: 0, fill: 'green' },
new go.Binding('fill', 'color'),
{ click: function(e, obj) { console.log('Clicked the button.'); }}
),
$(
go.Panel,
'Table',
{ margin: 6, maxSize: new go.Size(150, NaN) },
$(go.RowColumnDefinition, {
column: 0,
alignment: go.Spot.Center
}),
// the text
$(
go.TextBlock,
{
row: 0,
column: 0,
maxSize: new go.Size(250, NaN),
margin: 1,
font: '500 15px Roboto, sans-serif',
alignment: go.Spot.Center
},
'Do Nothing'
)
)
)