Hi,
I am implementing the local-view example with local-view in a pop-up.
However, the local-view diagram is not showing in the canvas until we click on the canvas and drag it a bit.
Actually it is being shown in a very small size 2-3 pixels only (as if its zoomed out a lot) but, if we click on it, the diagram is zoomed according to the container size.
///////////////// local diagram definition ////////////////
GO(go.Diagram, “localDiagram”,
{
initialAutoScale: go.Diagram.Uniform,
autoScale: go.Diagram.Uniform,
contentAlignment: go.Spot.Center,
isReadOnly: true,
initialScale: 2,
layout: GO(go.TreeLayout,
{ angle: 90, sorting: go.TreeLayout.SortingAscending }),
maxSelectionCount: 1
});
//////////// function to open the local diagram ////////////////////////////
function printNodes() {
showLocalOnFullClick();
$( ".print-subtree-fn" ).show( "slow", function() {
myLocalDiagram.zoomToFit()
});
<span =“Apple-tab-span” style=“white-space:pre”> $(’.SelectSectionoverlay’).show();
}
//////////////////////////// showLocalOnFullClick function ////////////////
function showLocalOnFullClick() {
//myLocalDiagram.layout = myDiagram.layout;
var currentNode = myDiagram.selection.first();
if (!currentNode.isGroup) {
currentNode = myDiagram.selection.first().containingGroup;
}
if (currentNode !== null) {
// move the large yellow node behind the selected node to highlight it
//highlighter.location = node.location;
// create a new model for the local Diagram
var model = new go.GraphLinksModel();
// add the selected node and its children and grandchildren to the local diagram
var nearby = currentNode.findTreeParts(99);
// create the model using the same node data as in myFullDiagram's model
linkDataArray = [];
for (var it = nearby.iterator; it.next() ;) {
var n = it.value;
if (n instanceof go.Node) model.addNodeData(n.data);
if (n instanceof go.Group){
var subParts = n.findSubGraphParts()
for (var subPart = subParts.iterator; subPart.next() ;) {
var subPartVal = subPart.value;
model.addNodeData(subPartVal.data);
}
}
if (n instanceof go.Link) linkDataArray.push(n.data);
}
myLocalDiagram.model = model;
myLocalDiagram.model.linkDataArray = linkDataArray;
myDiagram.startTransaction("rescale localDiagram");
myLocalDiagram.zoomToFit();
myDiagram.commitTransaction("rescale localDiagram");
}
}
/////////////////////////////////////////////////////////////////////
any ideas or suggestions that why is the localdiagram is not displaying correctly.
Thanks and Regards