Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Angularjs: angular-ui tabs, and diagram not centered on initial render

$
0
0

@mutt_1924 wrote:

While implementing the basic AngularJS demo from the GoJS samples inside of angular-ui tabs, I am running into an issue where the diagram gets rendered, but it is stuck in the top right corner of the canvas, instead of being centered as per initialContentAlignment: go.Spot.Center. I don't know why the alignment does not center.

When logging out the diagram.contentAlignment inside the scope.$watch("model", function(newmodel) {, the x and the y coordinates come out as NaN.

To fix - and this seems like an utter hack - adding this check inside the watch seems to help.

if (isNaN(diagram.contentAlignment.x)) {
    diagram.contentAlignment = go.Spot.Center;
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles