File tree 4 files changed +6965
-5084
lines changed
4 files changed +6965
-5084
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,4 @@ yarn-error.log*
35
35
36
36
# Jupyter Notebook
37
37
.ipynb_checkpoints
38
+ .yarn
Original file line number Diff line number Diff line change
1
+ nodeLinker : node-modules
Original file line number Diff line number Diff line change @@ -5,8 +5,17 @@ import { nord } from 'react-syntax-highlighter/dist/cjs/styles/prism'
5
5
6
6
//TODO: We could remove xarrray installation step by requesting xarray to be added to the Pyodide standard lib
7
7
//TODO: Or wait until jupyterlite has streamlined the installation process of user-specified packages
8
+
9
+ // use for install xarray via micropip
10
+ const preRun =
11
+ 'import%20micropip%0Aawait%20micropip.install%28%5B%27xarray%27%2C%20%27matplotlib%27%5D%29'
12
+
8
13
// See: https://github.com/jupyterlite/jupyterlite/issues/151
9
- const preRunCode = `%22%22%22%0AThe%20next%20two%20commands%20are%20only%20needed%20on%20this%20webpage%0APlease%20do%20not%20try%20to%20run%20them%20outside%20of%20this%20webpage%2C%20otherwise%20you%20will%20get%20an%20error%0A%22%22%22%0Aimport%20micropip%0Aawait%20micropip.install%28%5B%27xarray%27%2C%20%27matplotlib%27%5D%29%0A%0A%23%20Import%20packages%0Aimport%20xarray%20as%20xr%0Aimport%20numpy%20as%20np%0Aimport%20pandas%20as%20pd%0A%25matplotlib%20inline`
14
+ const preRunCode = `%23%20Import%20packages%0Aimport%20xarray%20as%20xr%0Aimport%20numpy%20as%20np%0Aimport%20pandas%20as%20pd%0A%25matplotlib%20inline`
15
+
16
+ // https://github.com/jobovy/jupyterlite-repl-prerun
17
+ const jupyterliteInstance =
18
+ 'https://jupyterlite-repl-prerun.readthedocs.io/en/latest/lite/repl'
10
19
11
20
const sampleCode = `"""
12
21
To try Xarray in the browser,
@@ -82,7 +91,7 @@ export const Repl = () => {
82
91
< AspectRatio ratio = { 4 / 3 } >
83
92
< iframe
84
93
title = 'repl'
85
- src = { `https://jupyterlite.github.io/demo/repl/ ?toolbar=1&kernel=python&code=${ preRunCode } ` }
94
+ src = { `${ jupyterliteInstance } / ?toolbar=1&kernel=python&prerun= ${ preRun } &prerun- code=${ preRunCode } ` }
86
95
alt = 'demo'
87
96
/>
88
97
</ AspectRatio >
You can’t perform that action at this time.
0 commit comments