HI Simon,
Here is the template that I am using.
$(go.Node,{
dragComputation: stayInGroup
}, 'Table', nodeStyle(),
$(go.Panel, 'Auto', {
row: 1,
column: 1,
name: 'BODY',
stretch: go.GraphObject.Default
},
$(go.Shape, 'Rectangle', {
fill: '#AC193D',
stroke: null,
strokeWidth: 0
}, new go.Binding('figure', 'figure'), new go.Binding('fill',
'fill'),new go.Binding('fill', 'isSelected',function(sel){
if(sel){
return '#424949';
}else{
return 'transparent';
}
}).ofObject('')),
$(go.Picture, {
margin:new go.Margin(9, 10, 22, 10),
alignment: go.Spot.Top,
background: "yellow",
imageStretch: go.GraphObject.Fill/*,
desiredSize: new go.Size(50, 50)*/
}, new go.Binding('source', 'source', boFactory.changeicon)),
$(go.TextBlock, {
textAlign: 'center',
font: '400 24px noto_sansregular',
stroke:'#ebeff0',
editable: false,
margin:new go.Margin(70, 0, 0, 0),
isMultiline: true,
alignment: go.Spot.Bottom,
stretch: go.GraphObject.Horizontal
},
new go.Binding('text', 'name').makeTwoWay(),
new go.Binding('stroke', 'textColor',function(textColor){
if(textColor === null){
return '#ebeff0';
}else{
return textColor;
}
}))),
$(go.Panel, 'Horizontal', new go.Binding('itemArray','topArray'), {
row: 0,
column: 1,
itemTemplate: $(go.Panel, {
_side: 'top',
fromSpot: go.Spot.Top,
toSpot: go.Spot.Top,
fromLinkable: true,
toLinkable: true,
cursor: 'pointer',
stretch: go.GraphObject.Horizontal
//contextMenu: portMenu
}, new go.Binding('portId', 'portId'), $(go.Shape,
'Rectangle', {
stroke: null,
strokeWidth: 0,
desiredSize: portSize,
margin: new go.Margin(0, 1)
}, new go.Binding('fill', 'portColor')))
// end itemTemplate
}), $(go.Panel, 'Vertical', new go.Binding('itemArray',
'rightArray'), {
row: 1,
column: 2,
itemTemplate: $(go.Panel, {
_side: 'right',
fromSpot: go.Spot.Right,
toSpot: go.Spot.Right,
fromLinkable: true,
toLinkable: true,
cursor: 'pointer',
stretch: go.GraphObject.Vertical,
//contextMenu: portMenu
}, new go.Binding('portId', 'portId'), $(go.Shape,
'Rectangle', {
stroke: null,
strokeWidth: 0,
desiredSize: portSize,
margin: new go.Margin(1, 0)
}, new go.Binding('fill', 'portColor')))
// end itemTemplate
}), $(go.Panel, 'Horizontal', new go.Binding('itemArray',
'bottomArray'), {
row: 2,
column: 1,
itemTemplate: $(go.Panel, {
_side: 'bottom',
fromSpot: go.Spot.Bottom,
toSpot: go.Spot.Bottom,
fromLinkable: true,
toLinkable: true,
cursor: 'pointer',
stretch: go.GraphObject.Horizontal
//contextMenu: portMenu
}, new go.Binding('portId', 'portId'), $(go.Shape,
'Rectangle', {
stroke: null,
strokeWidth: 0,
desiredSize: portSize,
margin: new go.Margin(0, 1)
}, new go.Binding('fill', 'portColor')))
// end itemTemplate
}), $(go.Panel, 'Vertical', new go.Binding('itemArray',
'leftArray'), {
row: 1,
column: 0,
itemTemplate: $(go.Panel, {
_side: 'left', // internal property to make it easier to tell which side it's on
fromSpot: go.Spot.Left,
toSpot: go.Spot.Left,
fromLinkable: true,
toLinkable: true,
cursor: 'pointer',
stretch: go.GraphObject.Vertical
//contextMenu: portMenu
}, new go.Binding('portId', 'portId'), $(go.Shape,
'Rectangle', {
stroke: null,
strokeWidth: 0,
desiredSize: portSize,
margin: new go.Margin(1, 0)
}, new go.Binding('fill', 'portColor')))
// end itemTemplate
}),
{
selectionAdornmentTemplate:
$(go.Adornment, 'Auto',
$(go.Shape,
{ fill: null, stroke: null, strokeWidth: 0}),
$(go.Placeholder)
) // end Adornment
});
This is almost the same template using in Dynamic Port sample.
Unfortunately, the Editor here does not allow me to up load the SVG file.
I am also unable to paste the SVG file content as well.