Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(#111): fix initial render #112

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

nicolaserny
Copy link

On the initial render, the div root used by GoJS must have clientWidth and clientHeight defined. If not, the canvas will have a zero size. It leads to an empty diagram.
Sadly, in ComponentDidMount, there is no guarantee that clientWidth and ClientHeight are correctly defined. So I have te defer the diagram init.

It fixes #111

@nicolaserny nicolaserny added the bug Something isn't working label Jun 26, 2020
@nicolaserny nicolaserny self-assigned this Jun 26, 2020
@coveralls
Copy link

coveralls commented Jun 26, 2020

Coverage Status

Coverage decreased (-0.7%) to 94.211% when pulling d4702b9 on nicolaserny:init-layout-bug into d054bc4 on xcomponent:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 94.271% when pulling dfd339b on nicolaserny:init-layout-bug into d054bc4 on xcomponent:master.

}
intervalCount++;
}
}, 10);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if the machine is slow? (big graph to display)
maybe the worst case should be around ~10s.

@nicolaserny nicolaserny merged commit 2d352e2 into xcomponent:master Jun 26, 2020
@nicolaserny nicolaserny deleted the init-layout-bug branch June 26, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes, the GoJS canvas has a zero size (but the div width and height are defined).
3 participants