how can I set the renderwindow to a div in my DOM?
// vtk.js code
this.vtk = {};
this.vtk.renderWindow = vtkRenderWindow.newInstance();
this.vtk.renderer = vtkRenderer.newInstance();
this.vtk.renderWindow.addRenderer(this.vtk.renderer);
// OpenGlRenderWindow
this.vtk.openGlRenderWindow = vtkOpenGLRenderWindow.newInstance();
this.vtk.renderWindow.addView(this.vtk.openGlRenderWindow);
// Interactor
this.vtk.interactor = vtkRenderWindowInteractor.newInstance();
this.vtk.interactor.setView(this.vtk.openGlRenderWindow);
this.vtk.interactor.initialize();
this.container = document.querySelector('.classToSelectYourDiv');
this.vtk.openGlRenderWindow.setContainer(this.container);
this.vtk.interactor.bindEvents(this.container);
You may have to resize it based on its container
const dims = this.container.getBoundingClientRect();
this.vtk.openGlRenderWindow.setSize(dims.width, dims.height);
Most helpful comment