I don’t have your data, but maybe the problem is that you do not specify the desiredSize of the Pictures:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
$(go.Shape, { fill: "whitesmoke" }),
$(go.Panel, "Table",
$(go.TextBlock,
{
row: 0,
column: 0,
width: 150,
maxSize: new go.Size(200, NaN),
margin: new go.Margin(0, 0, 0, 4),
stroke: "#475454",
font: "600 16px 'Open Sans'",
alignment: go.Spot.Left
},
new go.Binding("text", "Name")),
$(go.Picture,
{
row: 0,
column: 1,
margin: 6,
width: 10,
height: 10,
desiredSize: new go.Size(10, 10),
visible: false,
background: "red",
source: '/images/RedStar.png',
alignment: go.Spot.TopLeft
},
new go.Binding("visible", "IsPrimary", function (isPrimary) {
return isPrimary;
})),
$(go.Picture,
{
row: 0,
column: 2,
desiredSize: new go.Size(16, 16),
width: 16,
height: 16,
visible: false,
alignment: go.Spot.TopRight,
stretch: go.GraphObject.Horizontal,
background: "orange",
source: '/images/AnkleUpside.png'
},
new go.Binding("visible", "HasParents", function (hasParents) {
return hasParents;
})),
$(go.TextBlock,
{
row: 1,
column: 0,
maxSize: new go.Size(200, NaN),
margin: new go.Margin(0, 0, 0, 4),
stroke: "#a0a0a0",
font: "normal 16px 'Open Sans'",
alignment: go.Spot.Left
},
new go.Binding("text", "Type")),
$(go.Picture,
{
row: 2,
column: 0,
columnSpan: 2,
margin: new go.Margin(20, 0, 0, 0),
desiredSize: new go.Size(16, 16),
visible: false,
alignment: go.Spot.BottomLeft,
background: "purple",
source: '/images/AnkleDownside.png'
},
new go.Binding("visible", "HasChildrens")),
$(go.TextBlock,
{
row: 2,
column: 2,
width: 20,
height: 20,
maxSize: new go.Size(20, 20),
font: "bold 14px 'Open Sans'",
alignment: go.Spot.BottomRight,
textAlign: "center"
},
new go.Binding("background", "Color"))
)
);
I tried all eight combinations of visible and not visible, and everything looks good to me.