Skip to content

Commit dc27295

Browse files
Update Documentation (#333)
* fix: storybook * storybook: favot micropip * storybook: lexical * Automatic application of license header * chore: kernel indicator * example: add indicator to notebook lite * docs: fix * chore: make @jupyterlite/pyodide-kernel-extension a dependency * chore: make @jupyterlite/pyodide-kernel-extension a dependency * examples: config * docs: review * toc: docs * docs: lint * Automatic application of license header --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7588586 commit dc27295

File tree

116 files changed

+817
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+817
-739
lines changed

docs/docs/about/index.mdx

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,48 @@
1-
---
2-
description: About Jupyter UI.
3-
---
4-
51
import ModalImage from "react-modal-image";
62

73
# 🪐 ⚛️ About Jupyter UI
84

9-
Jupyter UI is a set of [React.js](https://reactjs.org) components that allow a frontend developer to build data products compatible with the [Jupyter](https://jupyter.org) ecosystem. The user interface delivers executable notebooks, cells, terminals, file browsers and allows the developer to manage a full integrated React tree instead of relying on iframes to display the Jupyter noteboks.
5+
Jupyter UI is a set of [React.js](https://reactjs.org) components that allow a Web application developer to build [Data Products and Data Platforms](https://datalayer.tech/docs/glossary) compatible with the [Jupyter](https://jupyter.org) ecosystem. The user interface delivers executable notebooks, cells, terminals, file browsers and allows the developer to manage a full integrated React tree instead of relying on iframes to display the Jupyter Notebooks.
106

11-
The Jupyter(Lab) Notebook is a tool that allows data scientist to analyse dataset. However, it is not easy to create a custom user interface integrated in an existing application. Jupyter UI, [an open-source library](https://github.com/datalayer/jupyter-ui), fills that gap and provides components that a developer can easily integrate in any React.js application.
7+
Jupyter(Lab) Notebook is a tool that allows Data Scientists to analyse datasets. However, it is not easy to create a custom user interface integrated in an existing application. Jupyter UI, [an open-source library](https://github.com/datalayer/jupyter-ui), fills that gap and provides components that a developer can easily integrate in any React.js application.
128

139
We ensure React.js as a first-class citizen in the Jupyter:
1410

15-
- [Components](/docs/category/components): JupyterLab visual as React.js components
16-
- [Integrations](/docs/category/integrations): Embed Jupyter in Docusaurus.
17-
- [Themes](/docs/category/themes): Themes for your data analysis.
18-
19-
You can get kick-started with simple [examples](/docs/category/examples)
20-
21-
## Problems with JupyterLab for Web developers
22-
23-
In terms of technical stack, the Jupyter(Lab) user interface is built on top of Lumino, which is an imperative way to build user interface and **can not** be consumed by industry standard declarative frameworks like React.js. As a user interface developer, if you want to create a custom data product on top of Jupyter, you have to stick to Lumino and carry-on the full notebook interface not tailored to your specific needs. This is not what you want. You just want to expose what you need, you want to develop with your favorite toolkit (like React.js) and you also want to integrate on a per-component basis the Jupyter functionality in your application.
11+
- [Components](/docs/components): JupyterLab visual as React.js components
12+
- [Integrations](/docs/integrations): Integrate Jupyter in Docusaurus, Next.js...
13+
- [Themes](/docs/themes): Themes for your data analysis.
2414

25-
[JupyterLab](https://github.com/jupyterlab/jupyterlab) is built on the [Lumino](https://github.com/jupyterlab/lumino) widget toolkit.
26-
27-
1. Lumino allows to wrap React components and expose them as Lumino Widgets.
28-
2. React.js **can not** use Lumino Widgets.
15+
## Why?
2916

30-
:::caution
17+
:::info
3118

3219
Although a developer can embed a React.js component into JupyterLab, the reverse is not possible.
3320

34-
**You can NOT embed JupyterLab into a React.js application**.
21+
**You can NOT embed JupyterLab into a React.js application - This is that issue that Jupyter UI solves.**.
3522

3623
:::
3724

38-
## Jupyter UI at the rescue
25+
JupyterLab is not usagble by Web Developers. Jupyter(Lab) user interfaces are built on top of [Lumino](https://github.com/jupyterlab/lumino) widget toolkit, which is an [imperative way](https://en.wikipedia.org/wiki/Imperative_programming) to build user interface and **can not** be consumed by industry standard declarative frameworks like React.js. As a user interface developer, if you want to create a custom [Data Products and Data Platforms](https://datalayer.tech/docs/glossary) on top of Jupyter, you have to stick to Lumino and carry-on the full notebook interface not tailored to your specific needs. This is not what you want. You just want to expose what you need, you want to develop with your favorite [declarative](https://en.wikipedia.org/wiki/Declarative_programming) toolkit (like React.js) and you also want to integrate on a per-component basis the Jupyter functionality in your application.
3926

40-
Jupyter UI provides the foundations to build a modern and flexible data prodcut user interface. Underneath, it gathers the minimum set of [Lumino](https://github.com/jupyterlab/lumino) and [JupyterLab](https://github.com/jupyterlab/jupyterlab) technologies. We wrap Lumino Widget in a React.js component and expose Redux Observables actions that proxy Lumino Commands. We bind Redux Observables Epics to Lumino Signals. Those bindings convert Lumino Signals to Observable to run the needed actions in the [Observable Epics](https://redux-observable.js.org/docs/basics/Epics.html).
27+
1. Lumino allows to wrap React components and expose them as Lumino Widgets.
28+
2. React.js **can not** use Lumino Widgets.
29+
30+
## Jupyter UI at the Rescue
31+
32+
Jupyter UI provides the foundations to build a modern and flexible [Data Products and Data Platforms](https://datalayer.tech/docs/glossary) user interface. Underneath, it gathers the minimum set of [Lumino](https://github.com/jupyterlab/lumino) and [JupyterLab](https://github.com/jupyterlab/jupyterlab) technologies. We wrap Lumino Widget in a React.js component and expose Zustands actions that proxy Lumino Commands. We bind Zustands Epics to Lumino Signals. Those bindings convert Lumino Signals to Observable to run the needed actions in the [Observable Epics](https://redux-observable.js.org/docs/basics/Epics.html).
4133

4234
- Services to connect to kernels.
4335
- Extension injection system.
44-
- Lumino signals and messages integrated with Redux.
36+
- Lumino signals and messages integrated with Zustand.
4537
- Lumino commands.
4638

47-
To solve the above issues, Jupyter UI ships components to easily create a React.js data product compatible with the Jupyter ecosystem. Those components can be used in any React.js application, and also in static websites like Docusaurus, Next.js or Remix. They wrap underneath the JupyterLab code and allow developing React.js applications with code execution capability. State management is based on Redux, and Mobx is to be added.
39+
To solve the above issues, Jupyter UI ships components to easily create a React.js [Data Products and Data Platforms](https://datalayer.tech/docs/glossary) compatible with the Jupyter ecosystem. Those components can be used in any React.js application, and also in static websites like Docusaurus, Next.js or Remix. They wrap underneath the JupyterLab code and allow developing React.js applications with code execution capability. State management is based on Zustand, and Mobx is to be added.
4840

49-
The Jupyter UI components expose JupyterLab visuals as React.js components and offers a bi-directional communication between React.js/Redux and JupyterLab/Lumino.
41+
The Jupyter UI components expose JupyterLab visuals as React.js components and offers a bi-directional communication between React.js/Zustand and JupyterLab/Lumino.
5042

5143
```
52-
Host application -> Redux Observable Actions -> Jupyter UI -> JupyterLab Commands
53-
Host application <- Redux State <- Redux Observable Epics <- Jupyter UI <- JupyterLab Signals
44+
Host application -> Zustand Actions -> Jupyter UI -> JupyterLab Commands
45+
Host application <- Redux State <- Jupyter UI <- JupyterLab Signals
5446
```
5547

5648
<ModalImage
@@ -65,31 +57,17 @@ You can find more context reading this [abstract](https://fosdem.org/2022/schedu
6557

6658
## Examples
6759

68-
The below image shows a gallery of the available React.js components ready to be used in you custom application. These open source components are used to build the [online Datalayer platform](https://datalayer.io), a collaborative platform for data analysis.
60+
The below image shows a gallery of the available React.js components ready to be used in you custom application. These open source components are used to build the [Datalayer SaaS, a collaborative platform for data analysis](https://datalayer.io).
6961

7062
<ModalImage
7163
small="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-gallery.gif"
7264
large="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-gallery.gif"
7365
alt="Jupyter UI Gallery"
7466
/>
7567

76-
## Open Source
77-
78-
The open source components removes the above limitations and supports:
79-
80-
- Predefined Redux actions, epics and reducers with [Observable Epics](https://redux-observable.js.org/docs/basics/Epics.html)
81-
- Everything is created in a single React tree to ensure Jupyter UI components can use any context created by the host application.
82-
- IPyWidgets and Panel interactive widgets are supported.
83-
- Collaborative RTC is also supported.
84-
- Plays nice with Jupyter Auth, Jupyterpool, Primer React, Material-UI , Storybook, Docusaurus, Emotion.js... and many other standard libraries.
85-
- A React.js context for Authentication, Authorization, Theming and Redux injectable store.
86-
- Benefits from current and new JupyterLab development, eg edit mode navigation, colored-collapser, collaborative cursor.
87-
- Authentication via Jupyter tokens.
88-
- Theming.
89-
- Terminals.
90-
9168
## Listed
9269

93-
Listed on:
70+
We love when people talk about us.
9471

95-
- [reactjs-example](https://reactjsexample.com/react-components-compatible-with-the-jupyter-ecosystem-to-create-your-own-custom-data-product)
72+
- [Reactjs Example.com](https://reactjsexample.com/react-components-compatible-with-the-jupyter-ecosystem-to-create-your-own-custom-data-product).
73+
- [How We Made Jupyter Notebooks Load 10 Times Faster](https://www.singlestore.com/blog/how-we-made-notebooks-load-10-times-faster).

docs/docs/components/_category_.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
label: "Components"
2+
position: 3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: "Button"
2-
position: 3
2+
position: 5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: "Cell"
2-
position: 4
2+
position: 3

docs/docs/components/cell/index.mdx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ This component displays a Jupyter Cell.
1010

1111
## With a Jupyter server
1212

13-
<StorybookView
14-
story='components-cell--default'
15-
/>
13+
<StorybookView story='components-cell--default' />
1614

1715
```jsx
1816
<Jupyter
@@ -46,19 +44,16 @@ plt.show()
4644
/>
4745
```
4846

49-
## With in-browser kernel
47+
## With in-browser Kernel
5048

51-
You can use an in-browser kernel by setting the `lite` property
52-
of `Jupyter` component:
49+
You can use an in-browser kernel by setting the `lite` property of `Jupyter` component:
5350

5451
<StorybookView
5552
story='components-cell--lite-python'
5653
/>
5754

5855
```jsx
59-
<Jupyter
60-
lite={true}
61-
>
56+
<Jupyter lite={true}>
6257
<Cell
6358
source={`import sys
6459
print(f"{sys.platform=}")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: "Console"
2-
position: 6
2+
position: 3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: "Context"
2-
position: 1
2+
position: 9

docs/docs/components/context/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: The Context component.
44

55
# 🪐 Context
66

7-
Every component should be wrapped inside a Context to get the needed CSS.
7+
Every component can be wrapped inside a Context to get the needed CSS.
88

99
```tsx
1010
root.render(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: "File Manager"
2-
position: 4
2+
position: 5

docs/docs/components/index.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import DocCardList from '@theme/DocCardList';
2+
import ModalImage from "react-modal-image";
3+
4+
# Components
5+
6+
As a React.js developer, you just write a few lines of code get a live notebook or live cell in your application.
7+
8+
<ModalImage
9+
small="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-snippet.png"
10+
large="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-snippet.png"
11+
alt="Jupyter UI Snippet"
12+
/>
13+
14+
Jupyter UI can be used in any React.js application with the `@datalayer/jupyter-react` npm package.
15+
16+
<ModalImage
17+
small="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-notebook.png"
18+
large="https://datalayer-jupyter-examples.s3.amazonaws.com/jupyter-react-notebook.png"
19+
alt="Jupyter UI Notebook"
20+
/>
21+
22+
:::note
23+
24+
The Jupyter UI components support:
25+
26+
- Predefined Zustand actions.
27+
- Everything is created in a single React tree to ensure Jupyter UI components can use any context created by the host application.
28+
- IPyWidgets and Panel interactive widgets are supported.
29+
- Collaborative RTC is also supported.
30+
- Plays nice with Primer React, Material-UI, Storybook, Docusaurus, Styled Components, Emotion.js... and many other standard libraries.
31+
- A React.js context for Authentication, Authorization and Theming.
32+
- Benefits from current and new JupyterLab development, eg edit mode navigation, colored-collapser, collaborative cursor.
33+
- Authentication via Jupyter tokens.
34+
- Theming.
35+
- Terminals.
36+
37+
:::
38+
39+
<DocCardList/>

0 commit comments

Comments
 (0)