Hi,
I am trying to set the width and height to my custom shape. I have the following node structure.
const node =
$(go.Node, 'Table',
{ linkConnected: this.updatePort, linkDisconnected: this.updatePort },
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
// the body
$(go.Panel, 'Auto',
{
row: 1, column: 1, name: 'BODY'
},
$(go.Shape, 'TriggerCompRect',
{
stroke: '#D7D7D7', fill: 'yellow', fromLinkable: true, toLinkable: true,
width: 240, height: 120,
stretch: go.GraphObject.Fill,
minSize: new go.Size(240, 120)
},
),
$(go.Panel, 'Table',
{
row: 0, column: 0, name: 'BODY',
stretch: go.GraphObject.Fill,
margin: new go.Margin(0, 0, 0, 25)
},
The shape itself is not changing as per the size 240x120. The container size is increasing while the shape itself remains the same, causing empty spaces in my node. Please see the result:
This is how i have generated the shape:
go.Shape.defineFigureGenerator('TriggerCompRect', function(shape, w, h) {
const geo = go.Geometry.parse('M30.36.5H196c9.113,0,17.621-2.612,16.5,16.5V78.042c0,.276,3.145,26.137-12.838,26.458H30.36C-6.553,93.241-8.643,41.97,6.227,17,13.681,4.482,30.36.5,30.36.5Z', true);
return geo;
});
I am unable to resize the shape. How can this be done?