Hi,
Using PolylineDrawingTool sample Polygon Drawing Tool, I am trying to create group’s in different shape. I am facing some issue of assigning the group panel size after shape is drawn.
GroupTemplate:
myDiagram.groupTemplate =
$(go.Group, “Vertical”,
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
{
resizable: true,
resizeObjectName: “Shape”,
selectionObjectName: “PANEL”,
ungroupable: true,
mouseDrop: finishDrop
},
$(go.Panel, “Auto”,
{ name: “PANEL” },
$(go.Shape,
{ fill: “white”, stroke: “black”, strokeWidth: 2, name: “Shape” },
new go.Binding(“stroke”, “color”).makeTwoWay(),
new go.Binding(“angle”).makeTwoWay(),
new go.Binding(“desiredSize”, “size”, go.Size.parse).makeTwoWay(go.Size.stringify),
new go.Binding(“geometryString”, “geo”).makeTwoWay(),
new go.Binding(“strokeDashArray”, “strokeDashArray”).makeTwoWay(),
new go.Binding(“strokeWidth”, “strokeWidth”).makeTwoWay()
),
$(go.Placeholder, { padding: 10 })
)
);
-
After shape is drawn then group panel is look this:
But that actual height and width is not like this. -
But after resizing the panel,then group look like this:
I believe that in group template I have not added any code for binding the size for panel. Can you tell how to bind the shaped size as panel size?.