Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyterlab active scroll bars for long results

Tags:

I'm using Jupyterlab for my datascience studies. Everything is Ok with this new tool, but some process as GridSearchCV has long logs and this results pollutes the notebook. There is a way to active scroll bars to avoid this like in traditional Jupyter notebooks?

like image 702
Juliano Oliveira Avatar asked Feb 15 '18 20:02

Juliano Oliveira


People also ask

How do I keep my JupyterLab running?

This can be done by typing jupyter notebook in the terminal, which will open a browser. Then, navigate to the respective jupyter notebook file in the browser and open it. Click Cell > Run All on the toolbar. All done!

Is JupyterLab replacing Jupyter Notebook?

JupyterLab will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab.

How do you scroll output in a Jupyter Notebook?

You can try Cell -> Current Outputs -> Toggle Scrolling in the Jupyter UI to enable the scrolling for the output of one cell.

Is JupyterLab better than notebook?

#1. This is one of the key differences that Jupyterlab will make in your data science life. It brings the classic notebooks, text editor, terminal, and directory viewer all under one view. It makes everything more efficient for you and creates a more unified experience that you will love.


2 Answers

You have a few options:

  1. Right click on cell's output -> "Enable Scrolling for Outputs". This will limit output view's height and enable scrolling, like in the classic notebook.
  2. Right click on cell's output -> "Create New Output View". This will create a separate scrollable view and dock it to the bottom of the screen. You can then collapse the view in the main window so it doesn't clutter the notebook.
like image 142
aldanor Avatar answered Sep 18 '22 05:09

aldanor


there is an automatic way to do this. First, you must install the addon "Stylus" (available on both Chrome and Firefox). This addon allows you to write custom CSS on websites.

Next, go to your JupyterLab page at localhost:8888/lab and click on the Stylus icon in the top right, and click "Write style for this URL"

Under the URL, i changed localhost to localhost:8888/lab. Then, I copied in this script by user Buckle2000 from Github (https://github.com/jupyterlab/jupyterlab/issues/4028#issuecomment-446820575)

.jp-OutputArea-child {     max-height: 15em; }  .jp-OutputArea-child .jp-OutputArea-output {     overflow: auto; } 

Then click the Save button, and you should be good to go. I believe you can change the number 15 to make it activate for different heights. It should look like this:

JupyterLab Automatic Scrolling Custom CSS

like image 30
Corey Levinson Avatar answered Sep 21 '22 05:09

Corey Levinson