$(
go.Node,
'Auto',
$(go.Shape, { fill: 'white', stroke: '#F4F4F4', name: 'SHAPE', maxSize: new go.Size(271, 1300) }),
$(
go.Panel,
'Vertical',
$(
go.Panel,
'Table',
$(
//go.Panel,
'ScrollingTable',
{
name: 'MAJOR',
stretch: go.GraphObject.Fill,
defaultAlignment: go.Spot.Left,
defaultColumnSeparatorStroke: 'gray',
defaultRowSeparatorStroke: 'gray',
maxSize: new go.Size(271, 130),
},
new go.Binding('TABLE.itemArray', 'operations'),
{
'TABLE.itemTemplate': $(
go.Panel,
'TableRow',
// this Panel is a row in the containing Table
new go.Binding('portId', 'id'), // this Panel is a "port"
{
fromSpot: go.Spot.LeftRightSides,
toSpot: go.Spot.LeftRightSides,
},
$(
go.Panel,
'Vertical',
{ width: 256, height: 60, background: '#F4F4F4' },
$(
go.TextBlock,
{
column: 1,
stroke: '#161616',
alignment: go.Spot.Left,
margin: new go.Margin(22, 5, 5, 18),
},
new go.Binding('text', 'name'),
new go.Binding('visible', '', function (node) {
return node.operations.length > 0;
})
)
)
),
'TABLE.defaultRowSeparatorStroke': 'white',
'TABLE.defaultRowSeparatorStrokeWidth': 3,
'TABLE.background': 'white',
'TABLE.defaultSeparatorPadding': new go.Margin(1, 5, 1, 5),
}
),
$(
go.Panel,
'Table',
$(
//go.Panel,
'ScrollingTable',
{
name: 'PROPERTIES',
stretch: go.GraphObject.Fill,
defaultAlignment: go.Spot.Left,
defaultColumnSeparatorStroke: 'gray',
defaultRowSeparatorStroke: 'gray',
width: 271,
margin: new go.Margin(0, 0, 5, 0),
},
new go.Binding('visible', 'properties', (arr) => arr.length > 0),
new go.Binding('TABLE.itemArray', 'properties'),
{
'TABLE.itemTemplate': $(
go.Panel,
'TableRow',
// this Panel is a row in the containing Table
new go.Binding('portId', 'id'), // this Panel is a "port"
{
fromSpot: go.Spot.LeftRightSides,
toSpot: go.Spot.LeftRightSides,
// allow drawing links from or to this port:
fromLinkable: true,
toLinkable: true,
fromLinkableDuplicates: true,
},
$(
go.Panel,
'Vertical',
{ width: 256, height: 60, background: '#F4F4F4' },
$(
go.Panel,
'Horizontal',
{ stretch: go.GraphObject.Horizontal },
$(
go.Panel,
'Horizontal',
{ stretch: go.GraphObject.Horizontal },
$(
go.Picture,
{
width: 25,
height: 25,
column: 0,
source: `assets/img/warning.svg`,
margin: new go.Margin(16, 13, 2, 18),
imageAlignment: go.Spot.Right,
name: 'ErrorIcon',
visible: false,
},
new go.Binding('visible', '', function (data) {
return data.error;
})
),
$(
go.Picture,
{
width: 25,
height: 25,
column: 0,
source: `/img/warning--alt.svg`,
margin: new go.Margin(16, 13, 2, 18),
imageAlignment: go.Spot.Right,
name: 'WarningIcon',
visible: false,
},
)
),
$(
go.TextBlock,
{ stretch: go.GraphObject.Horizontal },
{
column: 1,
stroke: '#161616',
alignment: go.Spot.Left,
margin: new go.Margin(15, 5, 5, 18),
},
new go.Binding('text', 'name'),
{
// define a tooltip for each node that displays the error or warning message
toolTip: $(
'ToolTip',
new go.Binding('visible', '', function (data) {
return data.error || data.warning;
}),
$(
go.TextBlock,
new go.Binding('text', '', function (data) {
return data.error ? data.message : data.warning ? data.message : '';
})
)
), // end of Adornment
}
)
),
$(
go.TextBlock,
{ stretch: go.GraphObject.Horizontal },
{
column: 2,
stroke: '#525252',
alignment: go.Spot.Left,
margin: new go.Margin(-1, 5, 5, 18),
},
new go.Binding('width', 'desiredSize').makeTwoWay(),
new go.Binding('text', '', function (data) {
return data.value
}),
new go.Binding('margin', '', function (data) {
if (data.error || data.warning) {
return new go.Margin(-4, 5, 5, 50);
} else return new go.Margin(-2, 5, 5, 18);
}),
{
// define a tooltip for each node that displays the color as text
toolTip: $(
'ToolTip',
$(
go.TextBlock,
new go.Binding('text', '', function (data) {
return data.value
})
)
), // end of Adornment
}
)
)
),
'TABLE.defaultRowSeparatorStroke': 'white',
'TABLE.defaultRowSeparatorStrokeWidth': 3,
'TABLE.background': 'white',
'TABLE.defaultSeparatorPadding': new go.Margin(1, 5, 1, 5),
}
)
This is the layout , any issues with layout , may be some closure braces you might be missing , but i want to show you this is the way we structured