Ask Your Question
2

Interact in Jupyterlab vs Jupyter

asked 2020-03-09 00:09:38 -0500

dsejas gravatar image

Hello, Sage community!

I find Jupyterlab to be more comfortable than Jupyter, so I installed it with

sage -pip install jupyterlab

and I execute it with

sage -n jupyterlab

Everything work well, except when I try to execute an interact, in which case, no sliders, no selection boxes, etc. appear. However, if I use Jupyter with

sage -n jupyter

the interact works well.

Here is a minimal working example:

@interact
def const(k = slider(-5,5,0.1,1,label='Constant')):
    print(k)

In this particular case, I obtain in Jupyterlab just 1.00000000000000 without any controls, nor the possibility to change the value of k.

Can somebody explain why it is not possible to use interacts in Jupyterlab while it is possible in Jupyter?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2020-03-19 00:42:01 -0500

nbruin gravatar image

It looks like lab takes a different approach than notebook regarding javascript in output cells. It would be nice to have a more official source, but the following Q/A seems to contain some valuable info:

https://stackoverflow.com/questions/4...

it looks like there's some work to do once sagemath starts moving to lab in earnest.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-09 00:09:38 -0500

Seen: 157 times

Last updated: Mar 19