{ "cells": [ { "cell_type": "markdown", "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." ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Jupyter Widgets" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "import ipywidgets as widgets\n", "\n", "slider = widgets.FloatSlider(description='$x$')\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", "slider.value = 4\n", "\n", "widgets.VBox([slider, text])" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Basic outputs of code cells" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "import pandas as pd\n", "\n", "iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')\n", "iris" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [], "outputs": [], "metadata": {} } ], "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 }