A JupyterLab UI Tour inspired by @cdat/jupyterlab-tutorial.
Project description
jupyterlab-tour
A JupyterLab UI Tour based on react-joyride.
This extension has the following features:
- Default tours:
- Welcome tour
- Notebook tour
- Toast proposing to start a tour - to experienced users the need to exit each time the tour.
- If a tour has already be seen by the user, this is saved in the state database. So you can start tour on event only if the user have not seen it; e.g. the welcome tour is launched at JupyterLab start except if the user have seen it.
The state is cleaned if this extension is updated
- Tooltip are styled using JupyterLab theming system
- Commands to add and launch tours
- Through the tour manager (
ITourManager
extension token), add, modify or delete a tour - Connect to tour events through signals
- Override the default style (and options) for the tour separately
This extension is inspired by @cdat/jupyterlab-tutorial licensed under BSD 3-Clause License with Copyright (c) 2020, Lawrence Livermore National Security, LLC.
Requirements
- JupyterLab >= 3.0
For JupyterLab 2.x, have look there.
For developers, the API has changed between v3 (for JupyterLab 3) and v2 (for JupyterLab 2).
How to add tour for my JupyterLab extension
There are two methods to add a tour: the easiest is to use JupyterLab commands and the advanced version is to request this
extension token ITourManager
.
Add easily a tour
const { commands } = app;
// Add a tour - returns the tour or null if something went wrong
const tour = (await app.commands.execute('jupyterlab-tour:add', {
tour: { // Tour must be of type ITour - see src/tokens.ts
id: 'test-jupyterlab-tour:welcome',
label: 'Welcome Tour',
hasHelpEntry: true,
steps: [ // Step must be of type IStep - see src/tokens.ts
{
content:
'The following tutorial will point out some of the main UI components within JupyterLab.',
placement: 'center',
target: '#jp-main-dock-panel',
title: 'Welcome to Jupyter Lab!'
},
{
content:
'This is the main content area where notebooks and other content can be viewed and edited.',
placement: 'left-end',
target: '#jp-main-dock-panel',
title: 'Main Content'
}
]
}
})) as ITour;
if ( tour ) {
app.commands.execute('jupyterlab-tour:launch', {
id: 'test-jupyterlab-tour:welcome',
force: false // Optional, if false the tour will start only if the user have not seen or skipped it
})
}
One example is available on Mamba navigator. Test it on binder.
Install
pip install jupyterlab-tour
or
conda install -c conda-forge jupyterlab-tour
Uninstall
pip uninstall jupyterlab-tour
or
conda remove -c conda-forge jupyterlab-tour
Contributing
Development install
Note: You will need NodeJS to build the extension package.
The jlpm
command is JupyterLab's pinned version of
yarn that is installed with JupyterLab. You may use
yarn
or npm
in lieu of jlpm
below.
# Clone the repo to your local environment
# Change directory to the jupyterlab-tour directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the jlpm run build
command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
jupyter lab build --minimize=False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jupyterlab-tour-3.0.1.tar.gz
.
File metadata
- Download URL: jupyterlab-tour-3.0.1.tar.gz
- Upload date:
- Size: 85.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b423e3c262dd5d812c83c840f09a35f28d54319bae10a8d42bf7a86bfc6aa0 |
|
MD5 | 4724dbed8ec800aa2666967366a45cb3 |
|
BLAKE2b-256 | 9c6d2b778f3c85d88b36e03611769be3422c16d0b3fc827c9cb11952f7ae9b12 |
File details
Details for the file jupyterlab_tour-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: jupyterlab_tour-3.0.1-py3-none-any.whl
- Upload date:
- Size: 143.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac97c6f3658626a102db663b8943900c457cb96854115cfb8488189e8dc49c65 |
|
MD5 | 5502005c74734512c66f6e78dabae2e8 |
|
BLAKE2b-256 | 78e32d0cc67345128a9b8b6ccea5a219953fe91b8c23d6039ca5ef684066226d |