@RoyL wrote:
Hi, Long time listener, First time caller…lol
My question is, is it possible to position a node via location or position based on the Image part or any sub-part of a Node, or only the node itself? My issue is I have a node with an image in the center, this image has a standard size, but has other attributes such as ports, and annotations. The annotations can be on top, bottom, left, or right based on a users choice. Problem is once a annotation is loaded at the top of a node, the image isn’t lining up with other nodes that have a annotation at the bottom of the node.
Stubbed out code that resembles my current code.
$(go.Panel, “Table”
{},
$(go.Panel, “Auto”,
{ row: 1, column: 1, name: “BODY” },
),$(go.Picture, {name: 'nodeIcon', row: 1, column: 1, width:36, height:36, stretch: go.GraphObject.Fill}, new go.Binding("source"), new go.Binding("position", "position", go.Point.parse).makeTwoWay(go.Point.stringify) ), //adding left ports getPort($, "leftnode") //adding right ports getPort($, "rightnode") //adding top ports getPort($, "topnode") //adding bottom ports getPort($, "bottomnode") //annotation panel $(go.Panel, 'Auto' {}, new go.Binding('row', '', getRow), new go.Binding('column', '', getColumn), $(go.Shape, 'Rectangle', {fill: bgColor, stroke: 'gray'}), $(go.TextBlock, textStyle()), )
)
Posts: 10
Participants: 2