Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6969

Custom shape for group using PolygonDrawing sample

$
0
0

@JP wrote:

Hi,
Using PolylineDrawingTool sample http://gojs.net/latest/extensions/PolygonDrawing.html, 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 })
)
);

  1. After shape is drawn then group panel is look this:

    But that actual height and width is not like this.

  2. 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?.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles