Scroll in tree mapper

i m using tree mapper as my base diagram the no of nodes is way to large to be shown on a single screen what i need is to implement a scroll in each group of tree mapper how do i do it?

Take a look at this sample: Scrolling Groups. You should be able to adapt it to your needs.

do u have an angular example for this?

after converting to angular i get this error

export class ScrollingGroupLayout extends go.Layout 
{
  _topIndex = 0;
  _spacing = 10;
    _count = 0;
  _lastIndex = 0;
  constructor() {
    super();
  go.Layout.call(this);
 
    ScrollingGroupLayout.prototype.cloneProtected = (copy) =>{
     this.cloneProtected.call(this, copy);
      copy._topIndex = this._topIndex;
      copy._spacing = this._spacing;
    };


    Object.defineProperty(ScrollingGroupLayout.prototype, "topIndex", {
      get: ()=> { return this._topIndex; },
      set: (val)=> {
        if (typeof val !== "number") throw new Error("new value for ScrollingGroupLayout.topIndex is not a number: " + val);
        if (this._topIndex !== val) {
          this._topIndex = val;
          this.invalidateLayout();
        }
      }
    });

    Object.defineProperty(ScrollingGroupLayout.prototype, "spacing", {
      get: ()=> { return this._spacing; },
      set: (val)=> {
        if (typeof val !== "number") throw new Error("new value for ScrollingGroupLayout.spacing is not a number: " + val);
        if (this._spacing !== val) {
          this._spacing = val;
          this.invalidateLayout();
        }
      }
    });

    Object.defineProperty(ScrollingGroupLayout.prototype, "count", {
      get: ()=> { return this._count; }
    });

    Object.defineProperty(ScrollingGroupLayout.prototype, "lastIndex", {
      get: ()=> { return this._lastIndex; }
    });



    ScrollingGroupLayout.prototype.doLayout = (coll)=> {
      var diagram = this.diagram;
      var group = this.group;
      if (group === null) throw new Error("ScrollingGroupLayout must be a Group.layout, not a Diagram.layout");
  
      if (diagram !== null) diagram.startTransaction("Scrolling Group Layout");
      this.arrangementOrigin = this.initialOrigin(this.arrangementOrigin);
      var arr = [];
      // can't use Layout.collectParts here, because we're intentionally making some
      // member nodes not visible, which would normally prevent them from being laid out
      var it = group.memberParts.iterator;
      while (it.next()) {
        var part = it.value;
        if (part instanceof go.Link) continue;
        part.ensureBounds();
        arr.push(part);
      }
      this._count = arr.length;
      //?? ought to support custom sort ordering
      var x = this.arrangementOrigin.x;
      var y = this.arrangementOrigin.y;
      
      var maxy = y + group.resizeObject.height ;
      var i = 0;
      var last = -1;
      while (i < arr.length && i < this._topIndex) {
         part = arr[i++];
        part.visible = false;
        part.moveTo(x, y);
      }
      while (i < arr.length && y < maxy) {
         part = arr[i++];
        part.moveTo(x, y);
        if (y + part.actualBounds.height < maxy) {
          part.visible = true;
          y += part.actualBounds.height + this._spacing;
          last = i - 1;
        } else {
          part.visible = false;
          break;
        }
      }
      while (i < arr.length) {
         part = arr[i++];
        part.visible = false;
        part.moveTo(x, y);
      }
      this._lastIndex = last;
      var up = group.findObject("UP");
      if (up !== null) up.visible = this._lastIndex < this._count - 1;
      var down = group.findObject("DOWN");
      if (down !== null) down.visible = this._topIndex > 0;
      if (diagram !== null) diagram.commitTransaction("Scrolling Group Layout");
    };
}


}

No, but what you pasted has issues with misplaced braces.

how so is it not suppose to be in the constructor of the class?

You don’t need to email and use the forum. You seem to be mixing Javascript and Typescript. For an example of a custom layout in Typescript, see GoJS/FishboneLayout.ts at master · NorthwoodsSoftware/GoJS · GitHub

Sorry about that thanx any ways i will try to convert to ts properly.