The problem is that you are trying to resize the main element of an “Auto” Panel, which is the element forming the border around the rest of the panel’s elements. An “Auto” Panel needs to have the main border element plus an element around which that main element is sized. But you don’t have that second element, so why have an “Auto” Panel at all?
In fact you have the Node also being a “Spot” Panel, but it too expects there to be other elements which will be positioned relative to the main element (in your case the “Auto” Panel, but should just be the Shape).
Instead you want to be resizing the Node, don’t you? The recommendation not to set the size of the main/border element is given at: GoJS Panels -- Northwoods Software
Combined, the resulting node template is much simpler, but still allows for adding decorations, which I assume you left out of the jsFiddle.
function init() {
var $ = go.GraphObject.make;
myDiagram =
$(go.Diagram, "myDiagramDiv");
myDiagram.nodeTemplate =
$(go.Node, "Spot",
{
locationObjectName: "GEOM", // center of the Shape
selectionObjectName: "GEOM",
resizable: true, resizeObjectName: "GEOM",
rotatable: true, rotationSpot: go.Spot.Center
},
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding("angle").makeTwoWay(),
$(go.Shape,
{ name: "GEOM", fill: "lightgray", strokeWidth: 1.5, strokeJoin: "round", strokeCap: "round"},
{ portId: "" },// this Shape is the Node's port, not the whole Node
new go.Binding("geometryString", "geo").makeTwoWay(),
new go.Binding("fill"),
new go.Binding("stroke"),
new go.Binding("strokeWidth"),
new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify)
),
// ??? missing elements to be aligned relative to the Shape
//$(go.Shape, { alignment: go.Spot.TopRight, fill: "red", width: 10, height: 10 })
);
// Create the Diagram's Model:
var nodeDataArray = [{
"strokeWidth":1.5,
"geo":"F M20 23 A20 20 1 0 0 20 63 L70 63 A20 20 1 0 0 70 23 A10 10 1 0 0 55 13 A15 15 1 0 0 20 23z",
"loc":"5 5","size":"60 37","fill":"rgba(144, 238, 144, 1)", "stroke":"black","key":"G1"
}];
myDiagram.model = new go.GraphLinksModel(nodeDataArray);
}