Timing issue with new viewProxy's setOrientation()
See original GitHub issueI’ve been working on updating some code to accommodate newer vtk.js releases and have run into an issue with the setOrientation method of the vtkViewProxy. For background, I’m working within a React framework and currently trying to update to vtk version 7.11.1. Before, I had set up the proper view orientation in the constructor of my component, then set container, added representations, subscriptions, etc. in the componentDidMount method and it worked just fine. Now, using relatively the same setup, I’m seeing an initial camera/view orientation that is somewhere in between the default and the values I input. After investigating a bit, I’m seeing that the callback within the returned Promise doesn’t complete until after the componentDidMount and even componentDidUpdate methods are called. I inserted some console logs and set a break point to demonstrate here (there are 2 Viewport3D components):

I guess I have a couple questions about this: Is this indeed an issue with unexpected/undesired timing of events? If so, how can we modify that initial setup to ensure everything is properly setup before adding any representations and rendering. If not, what is the optimal workflow/pipeline for setting up the view, then adding representations, subscriptions, etc. and rendering?
Thanks for the help, -Logan
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)

Top Related StackOverflow Question
Right, I was thinking in addition to the logic you provided but just replacing that line I had indicated. I suppose it doesn’t matter. You can’t supply a callback to that Promise return anyway with it being within the initialization. I’ll put a PR together with just those changes. Thanks again!
🎉 This issue has been resolved in version 7.11.2 🎉
The release is available on:
Your semantic-release bot 📦🚀