I am trying to draw nested shapes with GoJS library. For now I have rectangle with a single line inside. Whole Object is a panel with two shapes, a rectangle and a minus line. At this point it is fine, MinusLine is rendered in the center of a rectangle.
What I want to achieve is to position/change location of a MinusLine from top to bottom and etc. based on some conditions that I got however I cannot move it in any way.
For example move perfectly centered YELLOW line to position of RED or BROWN
Code looks like:
GO(go.Node, "Table",
{
layerName: "AfterForeground",
movable: false,
locationObjectName: "BODY",
locationSpot: go.Spot.parse("0.5 0 0 0 "),
selectionObjectName: "MAIN_SHAPE",
selectionObjectName: "MAIN_SHAPE",
},
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
GO(go.Panel,go.Panel.Position, "Auto", {
row: 1,
column: 1,
name: "BODY",
stretch: go.GraphObject.Fill
},
GO(go.Shape, "Rectangle", {
fill: wellColor,
name: "MAIN_SHAPE",
stroke: myColor,
strokeWidth: 0.4,
}, new go.Binding("fill", "wellColor"),
) , new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify)
,GO(go.Shape, "MinusLine", {}), // <-- Move this YELLOW line vertically somehere inside Rectangle
)