Hi Walter,
i am expecting diagram to be group by like radial.
can you help me with the group template, how can i achieve this ?
sample image attached, is it possible?
Please find the code,
myDiagram.groupTemplate = $(go.Group, "Auto",
{
layout: $(RadialLayout, {
maxLayers: 2,
rotateNode: function(node, angle, sweep, radius) { // method override must be function, not =>
// rotate the nodes and make sure the text is not upside-down
node.angle = angle;
var label = node.findObject("TEXTBLOCK");
if (label !== null) {
label.angle = ((angle > 90 && angle < 270 || angle < -90) ? 180 : 0);
}
},
commitLayers: function() { // method override must be function, not =>
// optional: add circles in the background
// need to remove any old ones first
const diagram = this.diagram;
var gridlayer = diagram.findLayer("Grid");
var circles = new go.Set(/*go.Part*/);
gridlayer.parts.each(circle => {
if (circle.name === "CIRCLE") circles.add(circle);
});
circles.each(circle => diagram.remove(circle));
// add circles centered at the root
for (var lay = 1; lay <= this.maxLayers; lay++) {
var radius = lay * this.layerThickness;
var circle =
$(go.Part,
{ name: "CIRCLE", layerName: "Grid" },
{ locationSpot: go.Spot.Center, location: this.root.location },
$(go.Shape, "Circle",
{ width: radius * 2, height: radius * 2 },
{ fill: "rgba(200,200,200,0.2)", stroke: null }));
diagram.add(circle);
}
}
}),
minSize: new go.Size(180, 180)
},
$(go.Shape, "Circle",
{ fill: "rgba(200,200,200,0.2)"}),
$(go.Placeholder),
);