Skip to content

Instantly share code, notes, and snippets.

@jtpio
Last active February 22, 2023 09:01
Show Gist options
  • Save jtpio/f94afdaf24ffd6e0726ced4a92cff588 to your computer and use it in GitHub Desktop.
Save jtpio/f94afdaf24ffd6e0726ced4a92cff588 to your computer and use it in GitHub Desktop.
Voila 0.4.0 on Binder

Voila 0.4.0 on Binder

voila-logo

Try it on Binder!

Voilà JupyterLab
Binder Binder
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# So easy, *voilà*!\n",
"\n",
"In this example notebook, we demonstrate how Voilà can render Jupyter notebooks with interactions requiring a roundtrip to the kernel."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Jupyter Widgets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"\n",
"slider = widgets.FloatSlider(description='$x$', value=4)\n",
"text = widgets.FloatText(disabled=True, description='$x^2$')\n",
"\n",
"def compute(*ignore):\n",
" text.value = str(slider.value ** 2)\n",
"\n",
"slider.observe(compute, 'value')\n",
"\n",
"widgets.VBox([slider, text])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Basic outputs of code cells"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')\n",
"iris"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bqplot
ipywidgets~=8.0
jupyterlab~=3.5.3
matplotlib
nbconvert>=7
pandas
voila==0.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment