CanvasId for WebAssembly

It look super arbitrary that we write the height and width to the heap and shift is 0 bits. You are right, it is the new helper code from the vtkWebAssemblyRenderWindowInteractor.js .

That library code is an implementation detail in VTK. This is how it communicates the size available for rendering to VTK. In the event handler in C++, we decode the contents of the returned pointer into width and height.

Also, would it be a good idea to expose to JavaScript, vtkInitializeCanvasElement and use this for creating additional canvases and perhaps vtkGetParentElementBoundingRectSize for resizing canvases when resizing a canvas.

Hmm, those two are already javascript functions and could be accessible on the wasm instance. Can you try searching the generated JS for those?