You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
3.1 KiB

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# JupyterLab Classic"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Widgets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"from ipywidgets import IntSlider\n",
"slider = IntSlider()\n",
"slider"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"slider"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rich Display"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Latex\n",
"Latex(r\"\"\"\\begin{eqnarray}\n",
"\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\\n",
"\\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\n",
"\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\n",
"\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \n",
"\\end{eqnarray}\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"x = np.linspace(0, 10, 100)\n",
"\n",
"plt.plot(x, np.sin(x))\n",
"plt.plot(x, np.cos(x))\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import HTML\n",
"from IPython.display import display\n",
"\n",
"s = \"\"\"<table>\n",
"<tr>\n",
"<th>Header 1</th>\n",
"<th>Header 2</th>\n",
"</tr>\n",
"<tr>\n",
"<td>row 1, cell 1</td>\n",
"<td>row 1, cell 2</td>\n",
"</tr>\n",
"<tr>\n",
"<td>row 2, cell 1</td>\n",
"<td>row 2, cell 2</td>\n",
"</tr>\n",
"</table>\"\"\"\n",
"h = HTML(s)\n",
"display(h)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Installing additional prebuilt (federated) extensions\n",
"\n",
"Execute the following cell:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install jupyterlab-cell-flash"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then reload the page and run a couple of cells. The cells should now be flashing when they have finished executing!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}