@datalayer/jupyter-react 0.18.1 → 0.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/tabs/ComponentsTab.js.map +1 -1
- package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
- package/lib/components/cell/CellAdapter.js +3 -3
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/console/ConsoleAdapter.d.ts +2 -2
- package/lib/components/console/ConsoleAdapter.js.map +1 -1
- package/lib/components/filebrowser/FileBrowser.js +2 -2
- package/lib/components/filebrowser/FileBrowser.js.map +1 -1
- package/lib/components/filemanager/lab/FileManagerAdapter.d.ts +1 -1
- package/lib/components/filemanager/lab/FileManagerAdapter.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabApp.d.ts +12 -8
- package/lib/components/jupyterlab/JupyterLabApp.js +14 -10
- package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabAppAdapter.d.ts +1 -1
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js +6 -5
- package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
- package/lib/components/notebook/Notebook.js +1 -0
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +2 -2
- package/lib/components/notebook/NotebookAdapter.js +2 -2
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/examples/All.js.map +1 -1
- package/lib/examples/Cell.js +1 -1
- package/lib/examples/Cell.js.map +1 -1
- package/lib/examples/CellLite.js +2 -2
- package/lib/examples/CellLite.js.map +1 -1
- package/lib/examples/CellsExecute.js +42 -0
- package/lib/examples/CellsExecute.js.map +1 -0
- package/lib/examples/ConsoleLite.js +2 -1
- package/lib/examples/ConsoleLite.js.map +1 -1
- package/lib/examples/JupyterLabApp.js +5 -3
- package/lib/examples/JupyterLabApp.js.map +1 -1
- package/lib/examples/{JupyterLabHeadlessApp.js → JupyterLabAppHeadless.js} +14 -10
- package/lib/examples/JupyterLabAppHeadless.js.map +1 -0
- package/lib/examples/JupyterLabAppHeadlessServerless.d.ts +1 -0
- package/lib/examples/JupyterLabAppHeadlessServerless.js +75 -0
- package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -0
- package/lib/examples/JupyterLabAppServerless.d.ts +1 -0
- package/lib/examples/JupyterLabAppServerless.js +41 -0
- package/lib/examples/JupyterLabAppServerless.js.map +1 -0
- package/lib/examples/JupyterLabAppServiceManager.d.ts +1 -0
- package/lib/examples/JupyterLabAppServiceManager.js +44 -0
- package/lib/examples/JupyterLabAppServiceManager.js.map +1 -0
- package/lib/examples/KernelExecute.js +16 -8
- package/lib/examples/KernelExecute.js.map +1 -1
- package/lib/examples/KernelExecutor.js +3 -3
- package/lib/examples/KernelExecutor.js.map +1 -1
- package/lib/examples/Kernels.js +22 -14
- package/lib/examples/Kernels.js.map +1 -1
- package/lib/examples/Matplotlib.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLite.js.map +1 -1
- package/lib/examples/NotebookNoContext.js +4 -5
- package/lib/examples/NotebookNoContext.js.map +1 -1
- package/lib/examples/NotebookServiceManager.d.ts +1 -0
- package/lib/examples/NotebookServiceManager.js +42 -0
- package/lib/examples/NotebookServiceManager.js.map +1 -0
- package/lib/examples/NotebookTheme.js +1 -1
- package/lib/examples/NotebookTheme.js.map +1 -1
- package/lib/examples/NotebookThemeColorMode.js +1 -1
- package/lib/examples/NotebookThemeColorMode.js.map +1 -1
- package/lib/examples/Output.js.map +1 -1
- package/lib/examples/Outputs.js.map +1 -1
- package/lib/examples/RunningSessions.js +1 -1
- package/lib/examples/RunningSessions.js.map +1 -1
- package/lib/examples/Terminal.js.map +1 -1
- package/lib/examples/Viewer.js.map +1 -1
- package/lib/index.d.ts +4 -12
- package/lib/index.js +25 -30
- package/lib/index.js.map +1 -1
- package/lib/jupyter/Jupyter.js +3 -3
- package/lib/jupyter/Jupyter.js.map +1 -1
- package/lib/jupyter/JupyterConfig.js +2 -2
- package/lib/jupyter/JupyterConfig.js.map +1 -1
- package/lib/jupyter/JupyterContext.d.ts +79 -69
- package/lib/jupyter/JupyterContext.js +21 -14
- package/lib/jupyter/JupyterContext.js.map +1 -1
- package/lib/jupyter/ipywidgets/classic/renderer.js +2 -2
- package/lib/jupyter/ipywidgets/classic/renderer.js.map +1 -1
- package/lib/jupyter/kernel/Kernel.js +1 -1
- package/lib/jupyter/kernel/Kernel.js.map +1 -1
- package/lib/jupyter/kernel/KernelExecutor.js +4 -4
- package/lib/jupyter/kernel/KernelExecutor.js.map +1 -1
- package/lib/jupyter/lab/JupyterLabTheme.d.ts +9 -0
- package/lib/jupyter/lab/JupyterLabTheme.js +17 -0
- package/lib/jupyter/lab/JupyterLabTheme.js.map +1 -0
- package/lib/jupyter/services/JupyterServiceManagerLess.d.ts +187 -0
- package/lib/jupyter/services/JupyterServiceManagerLess.js +415 -0
- package/lib/jupyter/services/JupyterServiceManagerLess.js.map +1 -0
- package/lib/jupyter/services/{Services.d.ts → JupyterServices.d.ts} +9 -6
- package/lib/jupyter/services/{Services.js → JupyterServices.js} +3 -3
- package/lib/jupyter/services/JupyterServices.js.map +1 -0
- package/lib/jupyter/services/index.d.ts +2 -0
- package/lib/jupyter/services/index.js +8 -0
- package/lib/jupyter/services/index.js.map +1 -0
- package/lib/state/IJupyterReactConfig.d.ts +6 -0
- package/lib/state/{IState.js → IJupyterReactConfig.js} +1 -1
- package/lib/state/IJupyterReactConfig.js.map +1 -0
- package/lib/state/{State.d.ts → JupyerReactState.d.ts} +13 -12
- package/lib/state/{State.js → JupyerReactState.js} +80 -63
- package/lib/state/JupyerReactState.js.map +1 -0
- package/lib/state/index.d.ts +2 -2
- package/lib/state/index.js +2 -2
- package/lib/state/index.js.map +1 -1
- package/lib/{jupyter/theme.js → themes/primerTheme.js} +1 -1
- package/lib/themes/primerTheme.js.map +1 -0
- package/package.json +5 -5
- package/lib/examples/CellExecuteControl.js +0 -38
- package/lib/examples/CellExecuteControl.js.map +0 -1
- package/lib/examples/JupyterLabHeadlessApp.js.map +0 -1
- package/lib/jupyter/services/Services.js.map +0 -1
- package/lib/jupyter/theme.js.map +0 -1
- package/lib/state/IState.d.ts +0 -6
- package/lib/state/IState.js.map +0 -1
- package/lib/state/State.js.map +0 -1
- /package/lib/examples/{CellExecuteControl.d.ts → CellsExecute.d.ts} +0 -0
- /package/lib/examples/{JupyterLabHeadlessApp.d.ts → JupyterLabAppHeadless.d.ts} +0 -0
- /package/lib/{jupyter/theme.d.ts → themes/primerTheme.d.ts} +0 -0
package/lib/examples/CellLite.js
CHANGED
|
@@ -11,6 +11,6 @@ import Cell from '../components/cell/Cell';
|
|
|
11
11
|
const div = document.createElement('div');
|
|
12
12
|
document.body.appendChild(div);
|
|
13
13
|
const root = createRoot(div);
|
|
14
|
-
root.render(_jsxs(Jupyter, { lite: true, children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell with a Lite Kernel" }), _jsx(Cell, { source: `
|
|
15
|
-
get_ipython()` })] }));
|
|
14
|
+
root.render(_jsxs(Jupyter, { lite: true, children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell with a Lite Kernel" }), _jsx(Cell, { source: `import sys
|
|
15
|
+
print(f"👋 Hello Jupyter UI Lite {sys.platform} {get_ipython()}")` })] }));
|
|
16
16
|
//# sourceMappingURL=CellLite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellLite.js","sourceRoot":"","sources":["../../src/examples/CellLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAE3C,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"CellLite.js","sourceRoot":"","sources":["../../src/examples/CellLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAE3C,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,IAAI,mBACX,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,kDAAwC,EACpD,KAAC,IAAI,IACH,MAAM,EAAE;kEACoD,GAC5D,IACM,CACX,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { createRoot } from 'react-dom/client';
|
|
9
|
+
import { Button, Box } from '@primer/react';
|
|
10
|
+
import { cellsStore } from '../components/cell/CellState';
|
|
11
|
+
import JupyterLabTheme from '../jupyter/lab/JupyterLabTheme';
|
|
12
|
+
import Cell from '../components/cell/Cell';
|
|
13
|
+
const CODE_CELL_1 = `import time
|
|
14
|
+
time.sleep(3)
|
|
15
|
+
print("Cell 1 done.")`;
|
|
16
|
+
const CODE_CELL_2 = `import time
|
|
17
|
+
time.sleep(3)
|
|
18
|
+
print("Cell 2 done.")`;
|
|
19
|
+
const CellsExecute = () => {
|
|
20
|
+
const [executionDisable, setExecutionDisable] = useState(false);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const handleChange = (newState) => {
|
|
23
|
+
setExecutionDisable(newState.isAnyCellExecuting);
|
|
24
|
+
};
|
|
25
|
+
const unsubscribe = cellsStore.subscribe(handleChange);
|
|
26
|
+
return () => {
|
|
27
|
+
unsubscribe();
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
const onExecuteClick = () => {
|
|
31
|
+
cellsStore.getState().execute();
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(JupyterLabTheme, { children: _jsxs(Box, { style: { marginTop: '20px' }, children: [_jsx(Cell, { id: '1', type: 'code', source: CODE_CELL_1, autoStart: false, showToolbar: false }), _jsx(Cell, { id: '2', type: 'code', source: CODE_CELL_2, autoStart: false, showToolbar: false }), _jsx(Button, { onClick: onExecuteClick, disabled: executionDisable, style: {
|
|
34
|
+
marginLeft: '50px',
|
|
35
|
+
marginTop: '20px'
|
|
36
|
+
}, children: "Execute all" })] }) }));
|
|
37
|
+
};
|
|
38
|
+
const div = document.createElement('div');
|
|
39
|
+
document.body.appendChild(div);
|
|
40
|
+
const root = createRoot(div);
|
|
41
|
+
root.render(_jsx(CellsExecute, {}));
|
|
42
|
+
//# sourceMappingURL=CellsExecute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellsExecute.js","sourceRoot":"","sources":["../../src/examples/CellsExecute.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA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ACvB,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE;wBACL,UAAU,EAAE,MAAM;wBAClB,SAAS,EAAE,MAAM;qBAClB,4BAGM,IACL,GACU,CACnB,CAAA;AACH,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,YAAY,KAAE,CAAC,CAAC"}
|
|
@@ -13,5 +13,6 @@ document.body.appendChild(div);
|
|
|
13
13
|
const root = createRoot(div);
|
|
14
14
|
root.render(_jsxs(Jupyter, { lite: true, children: [_jsx(Box, { as: "h1", children: "A Jupyter Console with a Lite Kernel" }), _jsx(Console, { code: `import piplite
|
|
15
15
|
await piplite.install('numpy')
|
|
16
|
-
|
|
16
|
+
import numpy
|
|
17
|
+
print(f'👋 Hello Jupyter Console with a Lite Kernel and numpy {numpy.__version__}')` })] }));
|
|
17
18
|
//# sourceMappingURL=ConsoleLite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLite.js","sourceRoot":"","sources":["../../src/examples/ConsoleLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,+BAA+B,CAAC;AAEpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"ConsoleLite.js","sourceRoot":"","sources":["../../src/examples/ConsoleLite.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,+BAA+B,CAAC;AAEpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,IAAI,mBACX,KAAC,GAAG,IAAC,EAAE,EAAC,IAAI,qDAA2C,EACvD,KAAC,OAAO,IACN,IAAI,EAAE;;;oFAGwE,GAC9E,IACM,CACX,CAAC"}
|
|
@@ -15,11 +15,11 @@ import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
|
15
15
|
const JupyterLabAppExample = () => {
|
|
16
16
|
const onJupyterLab = async (jupyterLabAdapter) => {
|
|
17
17
|
const jupyterLab = jupyterLabAdapter.jupyterLab;
|
|
18
|
-
console.log('JupyterLab is
|
|
18
|
+
console.log('JupyterLab is ready', jupyterLab);
|
|
19
19
|
jupyterLab.commands
|
|
20
20
|
.execute('notebook:create-new', { kernelName: 'python3' })
|
|
21
21
|
.then((notebookPanel) => {
|
|
22
|
-
console.log('Notebook Panel', notebookPanel);
|
|
22
|
+
console.log('Jupyter Notebook Panel', notebookPanel);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
return (_jsx(JupyterLabApp, { plugins: [
|
|
@@ -27,7 +27,9 @@ const JupyterLabAppExample = () => {
|
|
|
27
27
|
ipywidgetsPlugins,
|
|
28
28
|
plotlyPlugins,
|
|
29
29
|
reactPlugins,
|
|
30
|
-
], mimeRenderers: [
|
|
30
|
+
], mimeRenderers: [
|
|
31
|
+
plotlyMimeRenderers
|
|
32
|
+
], height: "calc(100vh - 74px)", onJupyterLab: onJupyterLab }));
|
|
31
33
|
};
|
|
32
34
|
const div = document.createElement('div');
|
|
33
35
|
document.body.appendChild(div);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JupyterLabApp.js","sourceRoot":"","sources":["../../src/examples/JupyterLabApp.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,aAAa,MAAM,wCAAwC,CAAC;AAGnE,OAAO,KAAK,iBAAiB,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,mBAAmB,MAAM,uCAAuC,CAAC;AAE7E,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,MAAM,YAAY,GAAG,KAAK,EAAE,iBAAuC,EAAE,EAAE;QACrE,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;QAC/C,UAAU,CAAC,QAAQ;aAChB,OAAO,CAAC,qBAAqB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;aACzD,IAAI,CAAC,CAAC,aAA4B,EAAE,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"JupyterLabApp.js","sourceRoot":"","sources":["../../src/examples/JupyterLabApp.tsx"],"names":[],"mappings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,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,OAAO,IAAC,kBAAkB,EAAE,KAAK,EAAE,iBAAiB,mBACnD,kDAA+B,EAC/B,KAAC,oBAAoB,KAAG,IAChB,CACX,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { Box, Text, ToggleSwitch, ThemeProvider, useTheme
|
|
9
|
+
import { Box, Text, ToggleSwitch, ThemeProvider, useTheme } from '@primer/react';
|
|
10
10
|
import { ThemeManager } from '@jupyterlab/apputils';
|
|
11
11
|
// import { NotebookTracker } from '@jupyterlab/notebook';
|
|
12
12
|
import Jupyter from '../jupyter/Jupyter';
|
|
@@ -18,9 +18,12 @@ import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
|
18
18
|
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
19
19
|
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
20
20
|
const height = '900px';
|
|
21
|
-
const PATHS = [
|
|
21
|
+
const PATHS = [
|
|
22
|
+
'ipywidgets.ipynb',
|
|
23
|
+
'plotly.ipynb',
|
|
24
|
+
];
|
|
22
25
|
const PATH_INDEX = 1;
|
|
23
|
-
const
|
|
26
|
+
const JupyterLabAppHeadless = () => {
|
|
24
27
|
const [notebookBoxPanel, setNotebookBoxPanel] = useState();
|
|
25
28
|
const [theme, setTheme] = useState('light');
|
|
26
29
|
const [jupyterLabAdapter, setJupyterlabAdapter] = useState();
|
|
@@ -39,9 +42,10 @@ const JupyterLabHeadlessAppExample = () => {
|
|
|
39
42
|
const handleSwitchChange = (dark) => {
|
|
40
43
|
setDark(dark);
|
|
41
44
|
};
|
|
42
|
-
const onJupyterLab = async (
|
|
43
|
-
setJupyterlabAdapter(
|
|
44
|
-
|
|
45
|
+
const onJupyterLab = async (jupyterLab) => {
|
|
46
|
+
setJupyterlabAdapter(jupyterLab);
|
|
47
|
+
console.log('JupyterLab is ready', jupyterLab);
|
|
48
|
+
const boxPanel = await jupyterLab.notebook(PATHS[PATH_INDEX]);
|
|
45
49
|
setNotebookBoxPanel(boxPanel);
|
|
46
50
|
};
|
|
47
51
|
const onPlugin = (themeManager) => {
|
|
@@ -55,17 +59,17 @@ const JupyterLabHeadlessAppExample = () => {
|
|
|
55
59
|
maxHeight: height,
|
|
56
60
|
width: '100%',
|
|
57
61
|
},
|
|
58
|
-
}, children: _jsx(Lumino, { children: notebookBoxPanel }) }) })), _jsx(JupyterLabApp, { plugins: [
|
|
62
|
+
}, children: _jsx(Lumino, { children: notebookBoxPanel }) }) })), _jsx(JupyterLabApp, { headless: true, plugins: [
|
|
59
63
|
lightThemePlugins,
|
|
60
64
|
darkThemePlugins,
|
|
61
65
|
ipywidgetsPlugins,
|
|
62
66
|
plotlyPlugins,
|
|
63
67
|
], mimeRenderers: [
|
|
64
68
|
plotlyMimeRenderers
|
|
65
|
-
],
|
|
69
|
+
], onJupyterLab: onJupyterLab, pluginId: "@jupyterlab/apputils-extension:themes", PluginType: ThemeManager, onPlugin: onPlugin })] }) }));
|
|
66
70
|
};
|
|
67
71
|
const div = document.createElement('div');
|
|
68
72
|
document.body.appendChild(div);
|
|
69
73
|
const root = createRoot(div);
|
|
70
|
-
root.render(_jsx(
|
|
71
|
-
//# sourceMappingURL=
|
|
74
|
+
root.render(_jsx(JupyterLabAppHeadless, {}));
|
|
75
|
+
//# sourceMappingURL=JupyterLabAppHeadless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JupyterLabAppHeadless.js","sourceRoot":"","sources":["../../src/examples/JupyterLabAppHeadless.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EA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M,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,qBAAqB,KAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { createRoot } from 'react-dom/client';
|
|
9
|
+
import { Box, Text, ToggleSwitch, ThemeProvider, useTheme } from '@primer/react';
|
|
10
|
+
import { ThemeManager } from '@jupyterlab/apputils';
|
|
11
|
+
// import { NotebookTracker } from '@jupyterlab/notebook';
|
|
12
|
+
import JupyterLabTheme from '../jupyter/lab/JupyterLabTheme';
|
|
13
|
+
import Lumino from '../components/lumino/Lumino';
|
|
14
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
15
|
+
import * as darkThemePlugins from '@jupyterlab/theme-dark-extension';
|
|
16
|
+
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
17
|
+
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
18
|
+
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
19
|
+
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
20
|
+
const height = '900px';
|
|
21
|
+
const PATHS = [
|
|
22
|
+
'ipywidgets.ipynb',
|
|
23
|
+
'plotly.ipynb',
|
|
24
|
+
];
|
|
25
|
+
const PATH_INDEX = 1;
|
|
26
|
+
const JupyterLabAppHeadless = () => {
|
|
27
|
+
const [notebookBoxPanel, setNotebookBoxPanel] = useState();
|
|
28
|
+
const [theme, setTheme] = useState('light');
|
|
29
|
+
const [jupyterLabAdapter, setJupyterlabAdapter] = useState();
|
|
30
|
+
const { setColorMode } = useTheme();
|
|
31
|
+
const [isDark, setDark] = useState(false);
|
|
32
|
+
const onSwitchClick = async () => {
|
|
33
|
+
if (jupyterLabAdapter) {
|
|
34
|
+
await jupyterLabAdapter.commands.execute('apputils:change-theme', {
|
|
35
|
+
theme: isDark ? 'JupyterLab Light' : 'JupyterLab Dark',
|
|
36
|
+
});
|
|
37
|
+
setTheme(isDark ? 'light' : 'dark');
|
|
38
|
+
setColorMode(isDark ? 'night' : 'day');
|
|
39
|
+
}
|
|
40
|
+
setDark(!isDark);
|
|
41
|
+
};
|
|
42
|
+
const handleSwitchChange = (dark) => {
|
|
43
|
+
setDark(dark);
|
|
44
|
+
};
|
|
45
|
+
const onJupyterLab = async (jupyterLab) => {
|
|
46
|
+
setJupyterlabAdapter(jupyterLab);
|
|
47
|
+
console.log('JupyterLab is ready', jupyterLab);
|
|
48
|
+
const boxPanel = await jupyterLab.notebook(PATHS[PATH_INDEX]);
|
|
49
|
+
setNotebookBoxPanel(boxPanel);
|
|
50
|
+
};
|
|
51
|
+
const onPlugin = (themeManager) => {
|
|
52
|
+
// const notebookTracker = jupyterlabAdapter.service("@jupyterlab/notebook-extension:tracker") as NotebookTracker;
|
|
53
|
+
console.log('Current theme', themeManager.theme);
|
|
54
|
+
};
|
|
55
|
+
return (_jsx(_Fragment, { children: _jsxs(JupyterLabTheme, { children: [_jsx(ThemeProvider, { colorMode: theme === 'light' ? 'day' : 'night', dayScheme: "light", nightScheme: "dark_high_contrast", children: _jsxs(Box, { display: "flex", color: "fg.default", bg: "canvas.default", children: [_jsx(Box, { mr: 3, children: _jsx(Text, { as: "h2", children: "JupyterLab Headless Serverless Application" }) }), _jsxs(Box, { children: [_jsx(Box, { children: _jsx(Text, { fontSize: 2, fontWeight: "bold", id: "switch-label", display: "block", mb: 1, children: "Dark theme" }) }), _jsx(Box, { children: _jsx(ToggleSwitch, { size: "small", onClick: onSwitchClick, onChange: handleSwitchChange, checked: isDark, statusLabelPosition: "end", "aria-labelledby": "switch-label" }) })] })] }) }), notebookBoxPanel && (_jsx("div", { style: { position: 'relative' }, children: _jsx(Box, { className: "jp-LabShell", sx: {
|
|
56
|
+
position: 'relative',
|
|
57
|
+
'& .dla-Jupyter-Notebook': {
|
|
58
|
+
height,
|
|
59
|
+
maxHeight: height,
|
|
60
|
+
width: '100%',
|
|
61
|
+
},
|
|
62
|
+
}, children: _jsx(Lumino, { children: notebookBoxPanel }) }) })), _jsx(JupyterLabApp, { headless: true, serverless: true, plugins: [
|
|
63
|
+
lightThemePlugins,
|
|
64
|
+
darkThemePlugins,
|
|
65
|
+
ipywidgetsPlugins,
|
|
66
|
+
plotlyPlugins,
|
|
67
|
+
], mimeRenderers: [
|
|
68
|
+
plotlyMimeRenderers
|
|
69
|
+
], onJupyterLab: onJupyterLab, pluginId: "@jupyterlab/apputils-extension:themes", PluginType: ThemeManager, onPlugin: onPlugin })] }) }));
|
|
70
|
+
};
|
|
71
|
+
const div = document.createElement('div');
|
|
72
|
+
document.body.appendChild(div);
|
|
73
|
+
const root = createRoot(div);
|
|
74
|
+
root.render(_jsx(JupyterLabAppHeadless, {}));
|
|
75
|
+
//# sourceMappingURL=JupyterLabAppHeadlessServerless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JupyterLabAppHeadlessServerless.js","sourceRoot":"","sources":["../../src/examples/JupyterLabAppHeadlessServerless.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,0DAA0D;AAC1D,OAAO,eAAe,MAAM,g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datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { createRoot } from 'react-dom/client';
|
|
8
|
+
import { JupyterLabTheme } from '../jupyter/lab/JupyterLabTheme';
|
|
9
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
10
|
+
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
11
|
+
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
12
|
+
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
13
|
+
// import * as reactPlugins from './../jupyter/lab/index';
|
|
14
|
+
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
15
|
+
const JupyterLabAppServerless = () => {
|
|
16
|
+
const onJupyterLab = async (jupyterLabAdapter) => {
|
|
17
|
+
const jupyterLab = jupyterLabAdapter.jupyterLab;
|
|
18
|
+
console.log('JupyterLab is ready', jupyterLab);
|
|
19
|
+
jupyterLab.commands.execute('apputils:activate-command-palette');
|
|
20
|
+
jupyterLab.commands.execute('apputils:display-notifications');
|
|
21
|
+
jupyterLab.commands.execute('toc:show-panel');
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(JupyterLabApp, { serverless: true,
|
|
24
|
+
// nosplash
|
|
25
|
+
plugins: [
|
|
26
|
+
lightThemePlugins,
|
|
27
|
+
ipywidgetsPlugins,
|
|
28
|
+
plotlyPlugins,
|
|
29
|
+
// reactPlugins,
|
|
30
|
+
], disabledPlugins: [
|
|
31
|
+
// "@jupyterlab/apputils-extension:themes",
|
|
32
|
+
// "@jupyterlab/apputils-extension:themes-palette-menu",
|
|
33
|
+
], mimeRenderers: [
|
|
34
|
+
plotlyMimeRenderers
|
|
35
|
+
], height: "calc(100vh - 74px)", onJupyterLab: onJupyterLab }));
|
|
36
|
+
};
|
|
37
|
+
const div = document.createElement('div');
|
|
38
|
+
document.body.appendChild(div);
|
|
39
|
+
const root = createRoot(div);
|
|
40
|
+
root.render(_jsxs(JupyterLabTheme, { children: [_jsx("h1", { children: "JupyterLab Serverless Application" }), _jsx(JupyterLabAppServerless, {})] }));
|
|
41
|
+
//# sourceMappingURL=JupyterLabAppServerless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JupyterLabAppServerless.js","sourceRoot":"","sources":["../../src/examples/JupyterLabAppServerless.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,aAAa,MAAM,wCAAwC,CAAC;AAGnE,OAAO,KAAK,iBAAiB,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,yCAAyC,CAAC;AACzE,0DAA0D;AAE1D,OAAO,KAAK,mBAAmB,MAAM,uCAAuC,CAAC;AAE7E,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,MAAM,YAAY,GAAG,KAAK,EAAE,iBAAuC,EAAE,EAAE;QACrE,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;QAC/C,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;QACjE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;QAC9D,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC,CAAC;IACF,OAAO,CACL,KAAC,aAAa,IACZ,UAAU;QAChB,gBAAgB;QACV,OAAO,EAAE;YACP,iBAAiB;YACjB,iBAAiB;YACjB,aAAa;YACrB,uBAAuB;SAChB,EACD,eAAe,EAAE;QACvB,kDAAkD;QAClD,+DAA+D;SACxD,EACD,aAAa,EAAE;YACb,mBAAmB;SACpB,EACD,MAAM,EAAC,oBAAoB,EAC3B,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,eAAe,eACd,6DAA0C,EAC1C,KAAC,uBAAuB,KAAG,IACX,CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { createRoot } from 'react-dom/client';
|
|
9
|
+
import JupyterLabTheme from '../jupyter/lab/JupyterLabTheme';
|
|
10
|
+
import JupyterLabApp from '../components/jupyterlab/JupyterLabApp';
|
|
11
|
+
import JupyterServiceManagerLess from '../jupyter/services/JupyterServiceManagerLess';
|
|
12
|
+
import * as lightThemePlugins from '@jupyterlab/theme-light-extension';
|
|
13
|
+
import * as ipywidgetsPlugins from '@jupyter-widgets/jupyterlab-manager';
|
|
14
|
+
import * as plotlyPlugins from 'jupyterlab-plotly/lib/jupyterlab-plugin';
|
|
15
|
+
// import * as reactPlugins from './../jupyter/lab/index';
|
|
16
|
+
import * as plotlyMimeRenderers from 'jupyterlab-plotly/lib/plotly-renderer';
|
|
17
|
+
const JupyterLabAppServiceManager = () => {
|
|
18
|
+
const [serviceManager, _] = useState(new JupyterServiceManagerLess());
|
|
19
|
+
const onJupyterLab = async (jupyterLabAdapter) => {
|
|
20
|
+
const jupyterLab = jupyterLabAdapter.jupyterLab;
|
|
21
|
+
console.log('JupyterLab is ready', jupyterLab);
|
|
22
|
+
jupyterLab.commands.execute('apputils:activate-command-palette');
|
|
23
|
+
jupyterLab.commands.execute('apputils:display-notifications');
|
|
24
|
+
jupyterLab.commands.execute('toc:show-panel');
|
|
25
|
+
jupyterLab.commands
|
|
26
|
+
.execute('notebook:create-new', { kernelName: 'python3' })
|
|
27
|
+
.then((notebookPanel) => {
|
|
28
|
+
console.log('Jupyter Notebook Panel', notebookPanel);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
return (_jsx(JupyterLabApp, { serviceManager: serviceManager, plugins: [
|
|
32
|
+
lightThemePlugins,
|
|
33
|
+
ipywidgetsPlugins,
|
|
34
|
+
plotlyPlugins,
|
|
35
|
+
// reactPlugins,
|
|
36
|
+
], mimeRenderers: [
|
|
37
|
+
plotlyMimeRenderers
|
|
38
|
+
], height: "calc(100vh - 74px)", onJupyterLab: onJupyterLab }));
|
|
39
|
+
};
|
|
40
|
+
const div = document.createElement('div');
|
|
41
|
+
document.body.appendChild(div);
|
|
42
|
+
const root = createRoot(div);
|
|
43
|
+
root.render(_jsxs(JupyterLabTheme, { children: [_jsx("h1", { children: "JupyterLab Application with Service Manager property" }), _jsx(JupyterLabAppServiceManager, {})] }));
|
|
44
|
+
//# sourceMappingURL=JupyterLabAppServiceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JupyterLabAppServiceManager.js","sourceRoot":"","sources":["../../src/examples/JupyterLabAppServiceManager.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,aAAa,MAAM,wCAAwC,CAAC;AAEnE,OAAO,y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M,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CACT,MAAC,eAAe,eACd,gFAA6D,EAC7D,KAAC,2BAA2B,KAAG,IACf,CACnB,CAAC"}
|
|
@@ -7,28 +7,36 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import { Box, Heading, Textarea, Button } from '@primer/react';
|
|
10
|
-
import Jupyter from '../jupyter/Jupyter';
|
|
11
10
|
import { useJupyter } from '../jupyter/JupyterContext';
|
|
11
|
+
import Jupyter from '../jupyter/Jupyter';
|
|
12
12
|
import KernelProgressBar from './../components/kernel/KernelProgressBar';
|
|
13
13
|
export const KernelExecuteView = () => {
|
|
14
|
-
const { defaultKernel } = useJupyter();
|
|
14
|
+
const { defaultKernel: kernel } = useJupyter();
|
|
15
15
|
const [running, setRunning] = useState(false);
|
|
16
16
|
const [code, setCode] = useState('');
|
|
17
17
|
const [result, setResult] = useState();
|
|
18
18
|
const handleChange = (event) => {
|
|
19
19
|
setCode(event.target.value);
|
|
20
20
|
};
|
|
21
|
-
const exec =
|
|
21
|
+
const exec = () => {
|
|
22
22
|
setRunning(true);
|
|
23
23
|
setResult('');
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
kernel?.execute(code)?.result
|
|
25
|
+
.then((result) => {
|
|
26
|
+
setResult(result);
|
|
27
|
+
})
|
|
28
|
+
.catch((error) => {
|
|
29
|
+
console.log('Error', error);
|
|
30
|
+
setResult(error);
|
|
31
|
+
})
|
|
32
|
+
.finally(() => {
|
|
33
|
+
setRunning(false);
|
|
34
|
+
});
|
|
27
35
|
};
|
|
28
36
|
const interrupt = () => {
|
|
29
|
-
|
|
37
|
+
kernel?.interrupt();
|
|
30
38
|
};
|
|
31
|
-
return (_jsxs(Box, { m: 3, children: [_jsx(Heading, { children: "Wait on
|
|
39
|
+
return (_jsxs(Box, { m: 3, children: [_jsx(Heading, { children: "Wait on code execution" }), _jsxs(Box, { children: [_jsx(Textarea, { placeholder: "Enter some code, e.g. print('1+1'), and click on the Execute button.", onChange: handleChange, value: code }), _jsxs(Box, { mt: 3, display: "flex", children: [_jsx(Box, { children: _jsx(Button, { disabled: !kernel || running, onClick: exec, variant: !kernel || running ? 'default' : 'primary', children: "Execute" }) }), _jsx(Box, { ml: 3, children: _jsx(Button, { disabled: !running, onClick: interrupt, variant: "danger", children: "Interrupt" }) })] })] }), running && (_jsx(Box, { mt: 3, children: _jsx(KernelProgressBar, {}) })), result && (_jsxs(Box, { mt: 3, children: [_jsx(Heading, { as: "h3", children: "Result" }), _jsx(Box, { children: _jsx("pre", { children: result }) })] }))] }));
|
|
32
40
|
};
|
|
33
41
|
const KernelExecute = () => {
|
|
34
42
|
return (_jsx(Jupyter, { children: _jsx(KernelExecuteView, {}) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelExecute.js","sourceRoot":"","sources":["../../src/examples/KernelExecute.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"KernelExecute.js","sourceRoot":"","sources":["../../src/examples/KernelExecute.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA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C;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ import Jupyter from '../jupyter/Jupyter';
|
|
|
11
11
|
import { useJupyter } from '../jupyter/JupyterContext';
|
|
12
12
|
import { Output } from '../components/output/Output';
|
|
13
13
|
const CODE = `from time import sleep
|
|
14
|
-
for i in range(0,
|
|
14
|
+
for i in range(0, 15):
|
|
15
15
|
sleep(1)
|
|
16
16
|
print("👉 " + str(i))
|
|
17
17
|
|
|
@@ -25,12 +25,12 @@ const KernelExecutorView = () => {
|
|
|
25
25
|
if (defaultKernel?.connection) {
|
|
26
26
|
const iopubMessageHook = (msg) => {
|
|
27
27
|
// Do something with the IOPub message.
|
|
28
|
-
console.log('
|
|
28
|
+
console.log('Jupyter Kernel iopub message', msg);
|
|
29
29
|
return true;
|
|
30
30
|
};
|
|
31
31
|
const shellMessageHook = (msg) => {
|
|
32
32
|
// Do something with the Shell message.
|
|
33
|
-
console.log('
|
|
33
|
+
console.log('Jupyter Kernel shell message', msg);
|
|
34
34
|
return true;
|
|
35
35
|
};
|
|
36
36
|
const kernelExecutor = defaultKernel.execute(CODE, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelExecutor.js","sourceRoot":"","sources":["../../src/examples/KernelExecutor.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAM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AG,GACd,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7B,IAAI,CAAC,MAAM,CAAC,KAAC,cAAc,KAAG,CAAC,CAAC"}
|
package/lib/examples/Kernels.js
CHANGED
|
@@ -11,40 +11,48 @@ import Jupyter from '../jupyter/Jupyter';
|
|
|
11
11
|
import { useJupyter } from '../jupyter/JupyterContext';
|
|
12
12
|
import { KERNEL_STATES, KernelProgressBar, KernelIndicator, KernelActionMenu, KernelSelector, KernelUsage, KernelInspector, KernelLauncher, KernelVariables, KernelLogs, Kernels, } from './../components/kernel';
|
|
13
13
|
export const KernelExecResultView = () => {
|
|
14
|
-
const { defaultKernel } = useJupyter();
|
|
14
|
+
const { defaultKernel: kernel } = useJupyter();
|
|
15
15
|
const [running, setRunning] = useState(false);
|
|
16
16
|
const [code, setCode] = useState('');
|
|
17
17
|
const [result, setResult] = useState();
|
|
18
18
|
const handleChange = (event) => {
|
|
19
19
|
setCode(event.target.value);
|
|
20
20
|
};
|
|
21
|
-
const exec =
|
|
21
|
+
const exec = () => {
|
|
22
22
|
setRunning(true);
|
|
23
23
|
setResult('');
|
|
24
|
-
const kernelExecutor =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const kernelExecutor = kernel?.execute(code);
|
|
25
|
+
kernelExecutor?.result
|
|
26
|
+
.then((result) => {
|
|
27
|
+
setResult(result);
|
|
28
|
+
})
|
|
29
|
+
.catch((error) => {
|
|
30
|
+
console.log('Error', error);
|
|
31
|
+
setResult(error);
|
|
32
|
+
})
|
|
33
|
+
.finally(() => {
|
|
34
|
+
setRunning(false);
|
|
35
|
+
});
|
|
28
36
|
};
|
|
29
37
|
const interrupt = () => {
|
|
30
|
-
|
|
38
|
+
kernel?.interrupt();
|
|
31
39
|
};
|
|
32
|
-
return (_jsxs(Box, { m: 3, children: [_jsxs(Box, { children: [_jsx(Textarea, { placeholder: "Enter some code, e.g. print('1+1')", onChange: handleChange, value: code }), _jsxs(Box, { mt: 3, display: "flex", children: [_jsx(Box, { children: _jsx(Button, { disabled: !
|
|
40
|
+
return (_jsxs(Box, { m: 3, children: [_jsxs(Box, { children: [_jsx(Textarea, { placeholder: "Enter some code, e.g. print('1+1')", onChange: handleChange, value: code }), _jsxs(Box, { mt: 3, display: "flex", children: [_jsx(Box, { children: _jsx(Button, { disabled: !kernel || running, onClick: exec, variant: !kernel || running ? 'default' : 'primary', children: "Execute" }) }), _jsx(Box, { ml: 3, children: _jsx(Button, { disabled: !running, onClick: interrupt, variant: "danger", children: "Interrupt" }) })] })] }), running && (_jsx(Box, { mt: 3, children: _jsx(KernelProgressBar, {}) })), result && (_jsxs(Box, { mt: 3, children: [_jsx(Heading, { children: "Result" }), _jsx(Box, { children: _jsx("pre", { children: result }) })] }))] }));
|
|
33
41
|
};
|
|
34
42
|
const KernelComponents = () => {
|
|
35
|
-
const {
|
|
43
|
+
const { kernel } = useJupyter();
|
|
36
44
|
const selectKernel = (kernelModel) => {
|
|
37
|
-
console.log('Kernel model', kernelModel);
|
|
45
|
+
console.log('Jupyter Kernel model', kernelModel);
|
|
38
46
|
};
|
|
39
47
|
const selectKernelSpec = (specModel) => {
|
|
40
|
-
console.log('
|
|
48
|
+
console.log('Jupyter Kernelspec model', specModel);
|
|
41
49
|
};
|
|
42
50
|
return (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", children: [_jsx(Box, { children: _jsx(KernelExecResultView, {}) }), _jsxs(Box, { children: [_jsxs(Box, { display: "flex", mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: {
|
|
43
51
|
color: 'fg.onEmphasis',
|
|
44
52
|
bg: 'neutral.emphasis',
|
|
45
53
|
m: 0,
|
|
46
54
|
p: 2,
|
|
47
|
-
}, children: "Kernel Status" }) }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel:
|
|
55
|
+
}, children: "Kernel Status" }) }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel: kernel?.connection }) }), _jsx(Box, { ml: 3, children: Array.from(KERNEL_STATES.entries()).map(entry => {
|
|
48
56
|
return (_jsxs(Box, { display: "flex", children: [_jsx(Box, { style: {
|
|
49
57
|
verticalAlign: 'middle',
|
|
50
58
|
display: 'inline-flex',
|
|
@@ -54,7 +62,7 @@ const KernelComponents = () => {
|
|
|
54
62
|
bg: 'neutral.emphasis',
|
|
55
63
|
m: 0,
|
|
56
64
|
p: 2,
|
|
57
|
-
}, children: "Kernel Action Menu" }) }), _jsx(Box, { ml: 3, style: { verticalAlign: 'middle', display: 'inline-flex' }, children: _jsx(KernelActionMenu, { kernel:
|
|
65
|
+
}, children: "Kernel Action Menu" }) }), _jsx(Box, { ml: 3, style: { verticalAlign: 'middle', display: 'inline-flex' }, children: _jsx(KernelActionMenu, { kernel: kernel }) })] }), _jsxs(Box, { display: "flex", mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: {
|
|
58
66
|
color: 'fg.onEmphasis',
|
|
59
67
|
bg: 'neutral.emphasis',
|
|
60
68
|
m: 0,
|
|
@@ -69,7 +77,7 @@ const KernelComponents = () => {
|
|
|
69
77
|
bg: 'neutral.emphasis',
|
|
70
78
|
m: 0,
|
|
71
79
|
p: 2,
|
|
72
|
-
}, children: "Kernel Logs" }) }), _jsx(Box, { ml: 3, style: { verticalAlign: 'middle', display: 'inline-flex' }, children: _jsx(KernelLogs, {}) })] })] })] }), _jsxs(Box, { mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: { color: 'fg.onEmphasis', bg: 'neutral.emphasis', m: 0, p: 2 }, children: "Kernel Usage" }) }), _jsx(Box, { ml: 3, children: _jsx(KernelUsage, { kernel:
|
|
80
|
+
}, children: "Kernel Logs" }) }), _jsx(Box, { ml: 3, style: { verticalAlign: 'middle', display: 'inline-flex' }, children: _jsx(KernelLogs, {}) })] })] })] }), _jsxs(Box, { mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: { color: 'fg.onEmphasis', bg: 'neutral.emphasis', m: 0, p: 2 }, children: "Kernel Usage" }) }), _jsx(Box, { ml: 3, children: _jsx(KernelUsage, { kernel: kernel }) })] }), _jsxs(Box, { mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: { color: 'fg.onEmphasis', bg: 'neutral.emphasis', m: 0, p: 2 }, children: "Kernel Variables" }) }), _jsx(Box, { ml: 3, children: _jsx(KernelVariables, { kernel: kernel }) })] }), _jsxs(Box, { mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: { color: 'fg.onEmphasis', bg: 'neutral.emphasis', m: 0, p: 2 }, children: "Kernels" }) }), _jsx(Box, { ml: 3, children: _jsx(Kernels, {}) })] }), _jsxs(Box, { mt: 3, children: [_jsx(Box, { children: _jsx(Text, { as: "p", sx: { color: 'fg.onEmphasis', bg: 'neutral.emphasis', m: 0, p: 2 }, children: "Kernel Inspector" }) }), _jsx(Box, { children: _jsx(KernelInspector, { kernel: kernel }) })] })] }));
|
|
73
81
|
};
|
|
74
82
|
const div = document.createElement('div');
|
|
75
83
|
document.body.appendChild(div);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kernels.js","sourceRoot":"","sources":["../../src/examples/Kernels.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG/E,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,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AC,QAAQ,wCAAiC,EAC1C,KAAC,gBAAgB,KAAG,IACZ,CACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matplotlib.js","sourceRoot":"","sources":["../../src/examples/Matplotlib.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAE1E,OAAO,QAAQ,MAAM,mCAAmC,CAAC;AAEzD,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,MAAC,OAAO,IAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Matplotlib.js","sourceRoot":"","sources":["../../src/examples/Matplotlib.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAE1E,OAAO,QAAQ,MAAM,mCAAmC,CAAC;AAEzD,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,MAAC,OAAO,IAAC,iBAAiB,mBACxB,KAAC,aAAa,IAAC,SAAS,EAAC,OAAO,GAAG,EACnC,KAAC,QAAQ,IACP,QAAQ,EAAE,QAA4B,EACtC,EAAE,EAAC,wBAAwB,EAC3B,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,iBAAiB,EAAE,GAAG,EACtB,WAAW,EAAE,WAAW,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