I am slowly working my way through this. I think the key is to remove the line width: 100vw; from #editor in the css.
Thank you for your question.
We don't have such a ready to go example, but you can probably draw inspiration from the "math inside page" example:
In this example, you click on the equation to open a fixed size box where you can modify the equation.
The corresponding code is available here https://github.com/MyScript/iinkJS/blob/master/examples/v4/math-inside-page.html
I want to control the size of the editor (columns and row depth) by placing it in a bootstrap 5 container so that it does not take up the whole page. My code only works on the <nav> portion of the html.