Hi Walter,
Thanks for your quick reply!
-
I don’t think I’ve made a two way binding on the Group, but we do capture the move event and store it in our database + set the location in the data model to the dragged location coordinates. I can see the locations being updated in the console when doing so.
-
The Group.layout is a grid layout:
layout: $(go.GridLayout, { wrappingColumn: wrappingColumnCount, isOngoing: true, alignment: go.GridLayout.Position, }),
- The blue dots, fair question :), those are anchor points which a user can use to draw lines (links) between groups from. They are added to the group and have the following code:
const $ = go.GraphObject.make
return $(go.Shape, 'Circle',
{
fill: '#5F94FF',
margin: new go.Margin(10),
stroke: null,
desiredSize: new go.Size(7, 7),
alignment: spot,
alignmentFocus: spot.opposite(),
portId: name,
fromSpot: spot,
toSpot: spot,
fromLinkable: true, //! this.isReadOnly,
toLinkable: true, //! this.isReadOnly,
cursor: 'pointer',
},
new go.Binding('fill', 'isSelected', (isSelected) => {
return isSelected ? '#4368B3' : '#5F94FF'
}).ofObject(),
)
Thanks for the Diagram.layout hint, I didn’t know that :).
To move on with the issue, I have disabled almost everything we put into the Group template, the issue still presents itself, but is more subtle than before. It makes me however more able to share the code:
Group template = $(go.Group, go.Panel.Spot, this.getSegmentGroupDefaultLayoutPanel())
getSegmentGroupDefaultLayoutPanel: function (): go.Panel {
const $ = go.GraphObject.make
return $(go.Panel, go.Panel.Auto,
$(go.Shape, 'RoundedRectangle',
{ strokeWidth: 4, fill: 'white', margin: new go.Margin(30) },
new go.Binding('stroke', 'isSelected', (isSelected) => {
return isSelected ? 'dodgerblue' : 'transparent'
}).ofObject(),
),
$(go.Panel, go.Panel.Vertical,
{
defaultAlignment: go.Spot.Center,
margin: new go.Margin(30, 30, 35, 30),
},
$(
go.Panel,
go.Panel.Table,
{ defaultAlignment: go.Spot.Top },
$(
go.TextBlock,
{
name: 'groupTextBlock',
isMultiline: false,
font: '16px Fira Sans',
margin: 10,
alignment: go.Spot.Center,
overflow: go.TextBlock.OverflowEllipsis,
row: 1,
maxSize: new go.Size(200, 16),
cursor: 'text',
stretch: go.GraphObject.Fill,
textAlign: 'center',
editable: false,
toolTip: $(
'ToolTip',
$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'text')),
),
},
new go.Binding('text', 'text'),
),
$(
go.TextBlock,
{
font: '12px Fira Sans',
name: 'groupDescriptionBlock',
margin: new go.Margin(0, 0, 10, 0),
isMultiline: false,
alignment: go.Spot.Center,
stroke: '#3B3E548C',
overflow: go.TextBlock.OverflowEllipsis,
maxSize: new go.Size(200, 12),
cursor: 'text',
stretch: go.GraphObject.Fill,
textAlign: 'center',
editable: false,
row: 2,
toolTip: $(
'ToolTip',
$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'description')),
),
},
new go.Binding('text', 'description'),
),
$(
go.TextBlock,
{
font: 'Medium 12px Fira Sans',
name: 'groupCountBlock',
margin: new go.Margin(0, 0, 50, 0),
isMultiline: false,
alignment: go.Spot.Center,
stroke: '#686F8F',
overflow: go.TextBlock.OverflowEllipsis,
maxSize: new go.Size(200, 12),
cursor: 'text',
stretch: go.GraphObject.Fill,
textAlign: 'center',
editable: false,
row: 2,
toolTip: $(
'ToolTip',
$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'count')),
),
},
new go.Binding('text', '', function (data) {
return 'This segment has ' + data.count + ' actors'
}),
),
),
// create a placeholder to represent the area where the contents of the group are
$(go.Placeholder,
{ padding: new go.Margin(0, 10) }),
),
)
},