Hello, I’m stuck trying to figure out what I’ve done wrong in the following construction. I’m trying to make sure the TextBlock and RoundedRectangle are keeping a minimum width. I’m noticing that this is causing render problems particularly for boundaries of parent templates that use this Panel. Anything stick out as things gone wrong/done improperly especially with the combinations of the stretch
and minSize/maxSize
properties?
return $(go.Panel, "Horizontal", {
shadowVisible: false,
stretch: go.GraphObject.Horizontal,
},
new go.Binding("minSize", "", function(nodeData, thisObj) {
var parentPanelWidth = thisObj.panel.actualBounds.width;
return new go.Size(parentPanelWidth, 24);
}).ofObject(),
$(go.Panel, "Auto", {
stretch: go.GraphObject.Horizontal,
},
new go.Binding("minSize", "", function(data, thisObj) {
var parentPanelWidth = thisObj.panel.actualBounds.width;=
return new go.Size(parentPanelWidth, 24);
}).ofObject(),
$(go.Shape, "RoundedRectangle", {
fill: "#E4E6E7",
stroke: null,
height: 24,
stretch: go.GraphObject.Horizontal,
}),
$(go.Panel, "Horizontal", {
stretch: go.GraphObject.Fill,
},
new go.Binding("maxSize", "", function(data, thisObj) {
var parentPanelWidth = thisObj.panel.actualBounds.width;
var parentPanelHeight = thisObj.panel.actualBounds.height;
return new go.Size(parentPanelWidth, parentPanelHeight);
}).ofObject(),
$(go.TextBlock, {
stretch: go.GraphObject.Horizontal,
font: '12px "Open Sans", sans-serif',
textAlign: "left",
editable: true,
height: 24,
overflow: go.TextBlock.OverflowEllipsis,
maxLines: 1,
row: 0,
verticalAlignment: go.Spot.Center,
name: "AnnotationTextBlock"
},
new go.Binding("margin", "", function(nodeData, thisObj) {
if (data.instanceType === "FlowLogicInstanceType") {
return new go.Margin(0, 0, 0, 8);
}
return new go.Margin(0, 0, 0, 8);
}),
new go.Binding("text", "comment").makeTwoWay()
), {
toolTip: $(go.Adornment, "Auto",
$(go.Panel, "Auto", {
background: "black",
},
$(go.TextBlock, {
margin: 7,
stroke: "white",
font: '10px "Open Sans", sans-serif',
maxSize: new go.Size(175, NaN)
},
new go.Binding("text", "", function(nodeData) {
if (nodeData.comment) {
return nodeData.comment;
}
return "";
})
)
)
)
}
)
)
);