Toggling GroupTemplate Margin changes does not work

I used the setCategoryForNodeData method to change the category of the group as follows
this.myDiagram?.model.setCategoryForNodeData(node.data,‘margin’)
GroupTemplate:
this.myDiagram.groupTemplate =
this.$(go.Group, ‘Vertical’,
{
layout: this.$(go.TreeLayout, {
layerSpacing: 100,
// setsPortSpots: false,
angle: 90,
},
),
selectionAdornmentTemplate: this.$(go.Adornment, ‘Auto’, this.$(go.Shape, ‘Rectangle’, {fill: ‘white’, stroke: null})),
isSubGraphExpanded: true,

                },
                this.$(go.Panel, 'Auto',
                    // new go.Binding('margin', '',this.test.bind(this)),

                    this.$(go.Shape, 'RoundedRectangle',  // surrounds the Placeholder
                        {
                            parameter1: 14,
                            fill: 'rgba(128,128,128,1)',
                            stroke: 'rgba(1, 1, 1, 1)',
                            margin: new go.Margin(305, 0, 0, 0),
                        }),

                    this.$(go.Placeholder,    // represents the area of all member parts,
                        {padding: 5}),  // with some extra padding around them
                ),
            );
        this.myDiagram.groupTemplateMap.add('margin', this.$(go.Group, 'Vertical',
            {
                layout: this.$(go.TreeLayout, {
                        layerSpacing: 100, 
                        // setsPortSpots: false,
                        angle: 90,
                    },
                ),
                selectionAdornmentTemplate: this.$(go.Adornment, 'Auto', this.$(go.Shape, 'Rectangle', {fill: 'white', stroke: null})),
                isSubGraphExpanded: true,

            },
            this.$(go.Panel, 'Auto',
                // new go.Binding('margin', '',this.test.bind(this)),
                // {margin: new go.Margin(305, 0, 0, 0),},
                this.$(go.Shape, 'RoundedRectangle',  // surrounds the Placeholder
                    {
                        parameter1: 14,
                        fill: 'rgba(128,128,128,0)',
                        stroke: 'rgba(1, 1, 1, 0)',
                       margin: new go.Margin(0, 0, 0, 0),
                    }),

                this.$(go.Placeholder,    // represents the area of all member parts,
                    {padding: 5}),  // with some extra padding around them
            ),
        ));

Attributes like fill and stroke change depending on the category, but margin does not。
I don’t know how to solve it, please help me

Just as with HTML’s box model, the “margin” is outside of the element, and the “padding” is inside the element. (For GoJS, it doesn’t make sense for there to be padding on primitive objects such as Picture, Shape, or TextBlock, so only Panels have padding.)

So if you set some margin on a node (or a group), you will not see any differences in how that node is measured or drawn.