Ask Your Question
3

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

Comments

Thanks for reporting! This is now tracked at

slelievre gravatar imageslelievre ( 2020-07-29 07:17:49 -0500 )edit

Update: the ticket

was merged in Sage 9.2.beta11.

slelievre gravatar imageslelievre ( 2020-09-02 20:11:30 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
3

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
1

answered 2020-09-02 20:10:13 -0500

slelievre gravatar image

Starting from Sage 9.2.beta11, you can install JupyterLab and its jupyterlab-widgets extension for Sage:

$ sage -i jupyterlab_widgets

and then the interact in the question works fine!

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: 396 times

Last updated: Sep 02