Hi,
Thanks for all this. Its working now.
However we have got another issue now…
As you can see in the image the links are being connected to the container node for case 1 and 5.
However, we need to implement it such that it touches the figure’s edges/boundary.
I am also attaching the code …
myDiagram.nodeTemplateMap.add(“RootNodeShape”,
GO(go.Node, “Auto”, {
mouseDrop: fnRootDrop,
//selectionAdornmentTemplate:
// GO(go.Adornment, "Auto",
// GO(go.Shape, "Rectangle",
// { fill: null, stroke: "white", strokeWidth: 0 }),
// GO(go.Placeholder)
// ),
movable:false
},
GO(go.Shape, {
name: "rootNodeShapePart",
width: 200,
height: 200,
strokeWidth: 1,
stroke: "#000",
//fromArrow:"OpenTriangle"
},
new go.Binding("figure", "Shape"),
new go.Binding("fill", "color")
),
GO(go.TextBlock,
{
font: "12pt helvetica, arial, sans-serif",
stroke: "black"
},
new go.Binding("text", "DisplayText").makeTwoWay()),
new go.Binding("location", "loc",
function (l) { return new go.Point(scaleWidth(l.x), l.y); }),
GO("TreeExpanderButton", {
alignment: go.Spot.Bottom,
alignmentFocus: go.Spot.Bottom
}, {
visible: true
})
));
--------------------Link template --------------------------------------
myDiagram.linkTemplateMap.add(“RootInternal”,
GO(go.Link,
{ routing: go.Link.AvoidsNodes },
GO(go.Shape,
{ stroke: OrgChartConfig.RootInternalLinkColor, strokeWidth: 1, strokeDashArray: [6, 3] }),
GO(go.Shape,
{ toArrow: "OpenTriangle", stroke: OrgChartConfig.RootInternalLinkColor, strokeWidth: 1 })
)
);
----------------------Link data array----------------------------
var getLinkDataArray = function () {
return [
{
category: “WeakLink”,
from: “F”,
text: “descriptive text”,
to: “B”
},
{
category: “RootInternal”,
from: “RData”,
to: OrgChartConfig.RootNodeShapeKey
},
{
---------------------------Layout of the group that contains the shape node , and green box node--------------------
myDiagram.groupTemplateMap.add(“RootContainer”,
GO(go.Group, “Auto”, {
ungroupable: false,
layout: GO(go.TreeLayout,
{
treeStyle: go.TreeLayout.StyleLayered,
arrangement: go.TreeLayout.ArrangementHorizontal,
// properties for most of the tree:
angle: 180,
layerSpacing: 65,
sorting: go.TreeLayout.SortingReverse
}
)
},
GO(go.Shape, {
width: OrgChartConfig.RootContainerWidth,
height: 300,
strokeWidth: 1,
stroke: “#fff”,
figure: “Rectangle”,
fill:"#fff"
})
));