Oh, I am sorry. I just added the code of the Panel, that accesses the Part with the TextBlock.
Maybe a more fitting name for the variable, in which the TextBlock ist looked for, would be node
.
Anyway. The Node is defined as follows (omitting the irrelevant parts):
$(go.Node, 'Spot',
...
$(go.Panel, 'Auto',
{
// ...
},
$(go.Shape, 'RoundedRectangle',
// ...
),
$(go.Panel, 'Table',
// ...
$(go.Panel, 'Auto',
{
alignment: go.Spot.Left,
name: 'historyCommentPanel',
padding: new go.Margin(2, 2, 0, 2),
stretch: go.GraphObject.Fill,
},
$(go.TextBlock,
{
font: 'normal 8px Noto Sans',
name: 'textBlock',
overflow: go.TextBlock.OverflowEllipsis,
textAlign: 'left',
},
new go.Binding('text', 'historyComment'),
),
),
// ...
$(go.Panel, 'Position',
{
// ...
},
new go.Binding('opacity', '', (data, panel) => {
const textBlock = panel.part.findObject('textBlock') as any;
const metrics = textBlock.metrics;
console.log(data.version, panel, textBlock, metrics);
return 1;
}
),
$(go.Shape,
// ..
),
)
),
),
// ...
);