Hello and thank you for reaching out.
The way you are loading the viewer looks great, and it makes sense that items like the NavCube, AxisTriad, etc are rendering properly. Those items are managed within the WebViewer itself, and thus contained within the canvas element of your app.
The Toolbar and Modeltree on the other hand are example UI elements we have provided on top of the viewer functionality. While they use Communicator APIs to achieve different behaviors in the WebViewer, the buttons, sliders, styling, etc are just HTML elements, CSS stylings, and JS functions.
I would assume you are running into issues due to the fact that we have written this sample UI without any library or framework, and that they are explicitly defined by the HTML (rather than being rendered and mounted when needed like in a library such as Vue). Our standard UI assumes all the HTML elements are already mounted on the DOM before any call to instantiate the Communicator.UI
object is made.
In {HC_INSTALL_DIR}/web_viewer/src/hoops_web_viewer_sample.html
, you can see all the boilerplate HTML elements that go into defining the model tree and toolbar. The web_viewer_ui.js
file assumes this HTML structure is present. In something like Vue, you would be placing these items into a component rather than your index.html
file and then Vue would render them as needed.
In order to make the toolbar work with Vue, you will have to be sure all these elements are mounted to the DOM first, and then instantiate the toolbar. This is similar to the idea that the WebViewer div
must be mounted before you can instantiate the WebViewer. Even then, the toolbar code as provided relies on jQuery, which I assume you are not using alongside Vue. Of course, you can include it in your project, but it is not ideal and adds to your bundle size.
I would recommend using the HTML boilerplate in hoops_web_viewer_sample.html
and the Typescript source for our UI in {HC_INSTALL_DIR}/web_viewer/typescript/ui
to rewrite these components in for Vue. You could try to massage the web_viewer_ui.js
file as is into your Vue application, but I would guess this would not be as pretty as you may hope.
I hope this helps narrow down the issue and provides some guidance for next steps. We hope to have some out of the box UI elements for popular frameworks like Vue, Angular, or React in the future, and appreciate your patience with the example UI current offerings. Let me know if you have any follow up questions.
Chris