Interact slider, clear cell output question; WebIO problem?

I want to update the output in a jupyter cell based on a slider, but need to clear the cell as I go.
Something like:

l  = collect(1:10)  # simplistic: actual code has a list of PrettyTables
N_steps = length(l)

step_ctrl = slider(1:N_steps, label="Step")
function show_l(i)
    IJulia.clear_output(true)
    display.([step_ctrl, l[1:i]])
end

Interact.@on show_l( &step_ctrl )
step_ctrl[] = 1

How would I need to modify the above code to get it to work?
The topics and stackoverflow results give hints, but…

I got a little further: the browser console output
has an error message:
Error: Cannot send 2 comm.js:112:18
when I move the slider

I tried to reinstall the jupyter webio extension.
the log for WebIO.install_jupyter_labextension()
is

Yarn configuration loaded.
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 93, in start
    ans = self.run_task()

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 210, in run_task
    for arg in self.extra_args

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 210, in <listcomp>
    for arg in self.extra_args

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 535, in unlink_package
    return handler.unlink_package(package)

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 955, in unlink_package
    raise ValueError('No linked package for %s' % path)

ValueError: No linked package for @webio/webio

Exiting application: jupyter

Any suggestions?

could somebody tell me whether the above code snippet works for them?
I.e., do I look at fixing the code, or do I have a problem with my software installation?

Sort of solved the issue: managed to reinstall WebIO (needed to make a fix in the code).

The code snippet in the original post now works in chromium,
but not in firefox…

There is an initialization issue for WebIO of some sort.
I opened issue #386 on JuliaGizmos/ WebIO.jl

Reloading the notebook in the browser to reestablish comms fixes the problem.
It appears to be tied to restarting the IJulia kernel

1 Like