Hi everyone,
I am trying to create a simple node template but I am struggeling with the behavior of the RoundedRectangle shape.
Everytime I change radius of the RoundedRectangle using parameter1, a margin (red in the picture) is added to the inner table making it much larger. Any suggestions?
Here’s my template:
return go.GraphObject.make(go.Node, 'Auto',
{
fromSpot: go.Spot.AllSides,
fromLinkable: true,
fromLinkableSelfNode: true,
toSpot: go.Spot.AllSides,
toLinkable: true,
toLinkableSelfNode: true
},
go.GraphObject.make(go.Shape, 'RoundedRectangle',
{
name: "Shape",
stroke: '#e0e0e0',
fill: '#f00',
parameter1: 30
}
),
go.GraphObject.make(go.Panel, "Table",
{
row: 1,
height: 30,
stretch: go.GraphObject.Fill,
background: 'white'
},
go.GraphObject.make(go.RowColumnDefinition, { column: 0, width: 30 }),
go.GraphObject.make(go.RowColumnDefinition, { column: 1, minimum: 60 }),
go.GraphObject.make(go.RowColumnDefinition, { column: 2, width: 30 }),
new go.Panel("Horizontal",
{
column: 1,
alignment: go.Spot.Center
})
.add(new go.Shape(
{
figure: "Circle",
desiredSize: new go.Size(8, 8),
margin: new go.Margin(0, 5, 0, 0),
stroke: null,
})
.bind("fill", "color")
)
.add(new go.TextBlock(
{
name: "NameBlock",
alignment: go.Spot.Center,
verticalAlignment: go.Spot.LeftCenter,
cursor: 'text',
height: 24,
editable: true,
isMultiline: false,
mouseEnter: (e, text: go.TextBlock) => {
text.background = "#f0f0f0";
},
mouseLeave: (e, text: go.TextBlock) => {
text.background = null;
}
})
.bind(new go.Binding("text", "label").makeTwoWay())
)
)
);