Is there a way to do this without reloading the entire html and assigning it to the WebWidget? Or is the only available interaction between webwidget and Slicer window.slicerPython.evalPython?
I know I could achieve this my adding a listener within python and then re-loading the full HTML each time, I’m just trying to keep it fast.
You can connect to the qSlicerWebWidget.evalResult signal to get the result of your computation. Since the JS code runs asynchronously, the signal returns both the evaluated JS and the result so you can keep track of which code generated the result.