Hi,
I have uploaded an example of my difficulty here.
In the tab “new”, the two “aaa” nodes are quite close to what I am trying to achieve, but the dark gray rectangle in the center should be as tall as the vertical port columns to its left and right. It is instead sized as though the columns have been disregarded. The MTAPAD node is drawn the way I want, but its template differs in two regards: (1) it lacks the lime green underline rectangle, and (2) it doesn’t involve dynamic ports. I have other nodes that have dynamic ports and no underline rectange that also draw correctly, so I think I’m botching the addition of that lime green underline rectangle somehow. I add it with a nested vertical of two elements.
Here is the node template for the “aaa” nodes:
let $ = go.GraphObject.make;
let node = $(go.Node, "Table",
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
{
toSpot: go.Spot.Left,
fromSpot: go.Spot.Right,
locationSpot: go.Spot.Center
},
$(go.Panel, "Vertical",
{
column : 1,
},
$(go.Panel, "Auto",
{
},
$(go.Shape, "Rectangle",
{
fill: "#333",
stroke: null,
strokeWidth: 0
}),
$(go.TextBlock, "",
new go.Binding("text", "name").makeTwoWay(),
{
editable: true,
isMultiline: false,
textValidation: (textblock, oldname, newname) => { return this.isEmptyOrValidCircuitName(newname, type); },
margin: new go.Margin(6, 6, 1.5, 6),
stroke: "white",
font: "11pt sans-serif"
})),
$(go.Shape, "Rectangle",
{
stretch: go.GraphObject.Fill,
fill: (type == "circuit" ? "lime" : (type == "entry" ? "#FFA500" : "white" )),
height : 6
})),
$(go.Panel, "Vertical",
new go.Binding("itemArray", "inports"),
{
column : 0,
alignment: go.Spot.Left,
itemTemplate: $(go.Panel,
new go.Binding("portId", "pid"),
{
toLinkable: true,
toSpot: go.Spot.Left,
alignment: go.Spot.TopLeft,
cursor: "pointer"
},
$(go.Shape, "TriangleRight",
{
fill: "#4040FF",
desiredSize: new go.Size(15, 15),
}))
}),
$(go.Panel, "Vertical",
new go.Binding("itemArray", "outports"),
{
column : 2,
alignment: go.Spot.Right,
itemTemplate: $(go.Panel,
new go.Binding("portId", "pid"),
{
fromLinkable: true,
fromSpot: go.Spot.Right,
alignment: go.Spot.TopRight,
cursor: "pointer"
},
$(go.Shape, "TriangleRight",
{
fill: "#4040FF",
desiredSize: new go.Size(15, 15),
}))
})
);
(Not sure how to properly format that text for your website.)
Anyway, the culprit seems to be in the column 1 vertical panel. Any suggestions?
Thanks,
-Luddy
.