CanvasId for WebAssembly

Hello @Jens_Munk_Hansen

It appears to me that the CanvasId is hard-coded to canvas and VTK only supports a single render window for WASM?
That is correct.

The limitation really came from the lack of support in SDL2’s emscripten code. I’ve lifted the limitation by updating VTK to use the low level emscripten’s HTML5 API in https://gitlab.kitware.com/vtk/vtk/-/commit/540986cdb3be2e5e35edc6717d431d9acb2e8abf and https://gitlab.kitware.com/vtk/vtk/-/commit/4b0b3b317d70c605d8b0b2dd2b88f69f64e788d9. That should technically allow VTK to draw inside canvas element in the DOM whose ID is not “canvas”

Although, support for multiple render windows in VTK.wasm is untested territory. Perhaps your application could be a good testing candidate for us! Please do not hesitate to contact us for further assistance regarding this.