InsightSoftwareConsortium / itkwidgets

An elegant Python interface for visualization on the web platform to interactively generate insights into multidimensional images, point sets, and geometry.
https://itkwidgets.readthedocs.io/
Apache License 2.0
576 stars 83 forks source link

Imjoy plugin loaded check. Or always show some cell output. #685

Open PaulHax opened 10 months ago

PaulHax commented 10 months ago

When folks first pip install itkwidgets, my understanding is folks must refresh the notebook page to load the Imjoy extension. If they don't, view(thing) shows no cell output. Should always show some output.

The Env check notebook has some code to cope with that:

%%javascript
let needReload = (typeof window.loadImJoyRPC === "undefined");
if (needReload) {
    needReload = false;
    location.reload();
}

Is it possible to put this this check "client" side and show a error message with what to do about it.

Also, the check should check the Imjoy version number, as having an old Imjoy version passes this check, but still get no viewer rendering because error caused by Server/Client Imjoy version incomatablity.