Is there any way to show scroll when zooming in/out the diagram?


  • Browser(Chrome latest)
  • go.js 2.0.16

Hi, I’m wondering if there’s any way to show scroll when zooming in/out the diagram. The reason I’m curious about this feature is that the user may wonder where he/she is at the moment while traveling around the diagram through zooming. I’ve noticed I could sort of achieve the needs through overview but it’s just my curiosity if the showing scroll is possible on zooming.

I’m leaving an might-related code setting below:

this.diagram = go.GraphObject.make(go.Diagram, this.option.container, {
  allowDelete: false,
  maxSelectionCount: 1,
  initialContentAlignment: go.Spot.Center
this.diagram.animationManager.isEnabled = false;
this.diagram.scrollMode = go.Diagram.InfiniteScroll;
this.diagram.toolManager.mouseWheelBehavior = go.ToolManager.WheelZoom;
this.diagram.allowDrop = false;

Thanks for your help in advance!

You have set Diagram.scrollMode to go.Diagram.InfiniteScroll.

  • If you don’t set that, the user will see the scrollbars.
  • If you do set that as you have, what could the scrollbars possibly show? There’s an infinite area to scroll in.

Perhaps instead of using InfiniteScroll you just want to use a large Diagram.padding or Diagram.scrollMargin or both.

Thanks for your reply.
As you said, the scrollbars shows up if I don’t set the scrollMode as InfiniteScroll.

But I noticed go.js used to work like showing the scrollbars and supporting infinite scroll at the same time.
Has the source changed lately?

The library is continually getting better, as you can see with the new features we are adding in 2.1.

But until we added InfiniteScroll scrollMode, the user always saw a scrollbar whenever the whole documentBounds was not entirely within the viewportBounds, unless the programmer had turned off scrollbars altogether.