I’ve got some difficulty creating a resizeable node that contains an Image and a Title. The Diagram is configured to use a Grid Layout like in the Planogram Sample.
What I got so far:
But as you can see, the image is behind the title, and I was unable to add spacing between them. Here is the node template:
new Node(Panel.Auto, {
resizable: true,
resizeObjectName: 'PANEL',
locationSpot: new Spot(0, 0, 50 / 2, 50 / 2),
}).add(
new Panel(Panel.Auto, {
name: 'PANEL',
background: 'white',
minSize: new Size(100, 100),
desiredSize: new Size(100, 100),
})
.add(
new Picture({
imageStretch: GraphObject.Uniform,
name: 'IMAGE',
}).bind('source', '', (data: Element) => {
return data.image;
}),
)
.add(
new Panel(Panel.Auto, {
alignment: Spot.BottomCenter,
alignmentFocus: Spot.TopCenter,
alignmentFocusName: 'IMAGE',
stretch: GraphObject.Horizontal,
margin: new Margin(10, 0, 0, 0),
background: '#3F7899',
minSize: new Size(100, 10),
}).add(
new TextBlock({
stretch: GraphObject.Horizontal,
background: '#3F7899',
margin: 10,
textAlign: 'center',
stroke: 'white',
}).bind('text', 'name'),
),
),
)
The Grid has a 50×50 Size.
Do you have any Idea how I could add some spacing between the Image and the text while still being able to resize the node?
Thanks in advance