Configure initial layout

Dear all,
we try to figure out whether it is possible to configure JupyterLab such that every new user sees a predefined layout. This layout should have a few extensions (for example showing a step-by-step tutorial) opened at given positions and width/height fractions of the browser window.
Ideally we’d also like to implement a “Reset Layout” button that switches back to this initial layout at any given time.
We need this to provide a consistent view for all students of a high school class.

Ernst

1 Like

Hi @ernstch,

The dask example project is achieving something similar by providing a JupyterLab workspace: https://github.com/dask/dask-examples/blob/d7a69122d9c1c24f6583e7d46cd089cf1eb70ae8/binder/jupyterlab-workspace.json

The layout is then automatically loaded when the server is started on mybinder.org

For resetting the layout maybe a link to reset the workspace could work?

https://jupyterlab.readthedocs.io/en/stable/user/urls.html#resetting-a-workspace

1 Like

Thanks, jtp, we thought about exactly these steps, but we were not sure how and where to write the configuration file. Your links make it very clear. We’ll see if we get it working for us.

In addition to the Dask example that @jtp pointed out. There is this example by @ian-r-rose that only requires a requirements.txt file to impost restriction to JupyterLab 1.0 or greater. Some users may find that an easier solution to adapt because you can easily add additional dependencies there. Plus, the repo includes how to control the theme setting as an example of controlling other settings.

I will mention though that although my workspace.json file spelled out a rather simple set up with just four terminal panes, I had to import it in the start step like the Dask example. The build would fail with not locating the jupyterlab-workspace.json file for some reason when I put the import command in the postBuild step, like in @ian-r-rose’s example. When I moved it back to start, it worked again.

2 Likes