The above figure is the result I want and the result I made now, the main problem is probably in getting the right of the previous shape, the following is my existing code
$(go.Shape, 'Rectangle', {
name: 'AShape',
stroke: null,
fill: Color.ANode,
alignment: go.Spot.Left,
height: Size._commonTemplateHeight,
}).bind('width', 'AProportion', function (s) {
return s * Size._commonTemplateWidth;
}),
$(
go.Shape,
'Rectangle',
{
name: 'BShape',
stroke: null,
fill: Color.BNode,
alignment: go.Spot.Left,
height: Size._commonTemplateHeight,
},
new go.Binding('width', 'BProportion', function (s) {
return s * Size._commonTemplateWidth;
}),
new go.Binding('alignment', 'naturalBounds', function (s: go.Rect) {
console.log(s.width);
console.log(s.right);
return new go.Spot(s.right / Size._commonTemplateWidth, 0, 0, 0);
}).ofObject('AShape')
),
$(
go.Shape,
'Rectangle',
{
name: 'CShape',
stroke: null,
fill: Color.CNode,
alignment: go.Spot.Left,
height: Size._commonTemplateHeight,
},
new go.Binding('width', 'CProportion', function (s) {
return s * Size._commonTemplateWidth;
}),
new go.Binding('alignment', 'naturalBounds', function (s: go.Rect) {
console.log(s.width);
console.log(s.right);
return new go.Spot(s.right / Size._commonTemplateWidth, 0, 0, 0);
}).ofObject('BShape')
),
The problem I found is that both right and width are 100, but according to the actual result, it should not be this, if the result of right can be correctly obtained, then I can achieve my purpose with this method, please help to see why right can only get 100, or is there a better way?