Overview box scale is not correct

The overview box scale is very perfect in wpf version at our product. But in GOJS, the box scale is not correct when node is small number.
In wpf:


In GoJs:

The settings for overview is:
var myOverview =goMake(go.Overview, aOverViewDivID,
{
observed: myDiagram,
contentAlignment:go.Spot.Center
});

	function setupOverviewBox(aOverView) {
		var box = new go.Part();
		var s = new go.Shape();
		s.stroke = 'magenta';
		s.strokeWidth = 2;
		s.fill = 'transparent';
		s.name = 'BOXSHAPE';
		box.selectable = true;
		box.selectionObjectName = 'BOXSHAPE';
		box.locationObjectName = 'BOXSHAPE';
		box.resizeObjectName = 'BOXSHAPE';
		box.cursor = 'move';
		box.selectionAdorned = false;
		box.add(s);

		aOverView.box = box;
	}

Could you tell me what is wrong?
By the way the version is V1.7.5 is our current used

What are the main diagram’s Diagram.documentBounds, and how does that compare with where the Parts are?

Your Overview seems to be showing everything, so your question must be about where it is drawing the Parts within the Overview’s viewport. You have set Overview.contentAlignment, so it will try to center the contents within the viewport. It appears that it is doing so, except that it seems shifted a little bit to the right of what I would expect. That is why I’m asking about what the observed diagram’s Diagram.documentBounds are relative to the Parts of that Diagram – it might account for why there seems to be a little bit of empty space on the left side.

Hi walter,
Sorry for confuse. I want to say the overview red box in go js can not display complete when nodes is small number. But in wpf it is display completed. You can see the red box is outside of right in gojs . I guess it is scale of overview issue. So create this topic. Sorry make you confuse.

Oh, OK, I thought you were talking about where or how large the contents of the observed diagram appeared in the Overview, whereas you just care about having the magenta Overview.box always appear in full within the Overview’s viewport. You could implement that by overriding this method:

    myOverview.computeBounds = function() {
      var observed = this.observed;
      if (observed === null) return new go.Rect();
      var b = observed.documentBounds.copy();
      b.unionRect(observed.viewportBounds);
      b.inflate(8, 8);
      return b;
    }

Hi walter,
Sorry for replay later, I have a holiday in several days, I override the computeBounds function but it never trigger. Do you know why? I also use sample orgChartStatic.html to test. It is the same. Like this:

Ah, we haven’t made that method be overridable. We’ll do that for the next release, which should be next week.