Self link is not moving along with Node in Tree layout

Hi @Walter,

Self link is not moving along with Node in Tree layout when node is inside a panel.

Pic-1
Pic-2
Pic-3

Is the user just dragging the “b” node?
Is that a group whose Group.layout is a TreeLayout?
Does that TreeLayout have the Layout.isRealtime property set, and if so, to what value?

I’m sorry, but I am unable to reproduce any problem. Here’s the complete sample:

<!DOCTYPE html>
<html>
<head>
  <title>Minimal GoJS Sample</title>
  <!-- Copyright 1998-2022 by Northwoods Software Corporation. -->
</head>
<body>
  <div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:600px"></div>

  <script src="https://unpkg.com/gojs"></script>
  <script id="code">
const $ = go.GraphObject.make;

const myDiagram =
  $(go.Diagram, "myDiagramDiv",
    {
      "undoManager.isEnabled": true
    });

myDiagram.nodeTemplate =
  $(go.Node, "Auto",
    $(go.Shape,
      { fill: "white" },
      new go.Binding("fill", "color")),
    $(go.TextBlock,
      { margin: 8, editable: true },
      new go.Binding("text").makeTwoWay())
  );

myDiagram.groupTemplate =
  $(go.Group, "Auto",
    {
      layout: $(go.TreeLayout)
    },
    $(go.Shape, { fill: "transparent", stroke: "green", strokeWidth: 2 }),
    $(go.Panel, "Vertical",
      $("SubGraphExpanderButton", { alignment: go.Spot.Left }),
      $(go.Placeholder, { padding: 5 })
    )
  );

myDiagram.model = new go.GraphLinksModel(
[
  { key: 0, isGroup: true },
  { key: 1, text: "Alpha", color: "lightblue", group: 0 },
  { key: 2, text: "Beta", color: "orange", group: 0 },
  { key: 3, text: "Gamma", color: "lightgreen", group: 0 },
  { key: 4, text: "Delta", color: "pink", group: 0 },
],
[
  { from: 1, to: 2 },
  { from: 1, to: 3 },
  { from: 2, to: 2 },
  { from: 3, to: 4 },
]);
  </script>
</body>
</html>

image

yes, we are just dragging the ‘b’ node . It’s a TreeLayout but we are not setting Layout.isRealtime property.

So what is different in your situation compared to the sample I just made for you? How can we reproduce the problem?

Precisely which version of GoJS are you using?

currently we are using GoJS v2.0.0

Please update to v2.0.21, at least. Although I recommend upgrading to the latest version., since v2.0 is rather old.