diff --git a/FailingNotebook.ipynb b/FailingNotebook.ipynb new file mode 100644 index 0000000..4ef1f8b --- /dev/null +++ b/FailingNotebook.ipynb @@ -0,0 +1,66 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import Label, Button, AppLayout, Checkbox, HBox, VBox, Output\n", + "\n", + "show = Button(description='Click me')\n", + "out = Output()\n", + "\n", + "@out.capture(clear_output=True)\n", + "def callback(*args):\n", + " print(args[0])\n", + "\n", + "class Container(VBox):\n", + " \n", + " def __init__(self, **kwargs):\n", + " self.main = HBox()\n", + " super().__init__(children=[self.main], **kwargs)\n", + " \n", + " def load(self, *args):\n", + " check1 = Checkbox(description=\"test1\")\n", + " check1.observe(callback, 'value')\n", + " check2 = Checkbox(description=\"test2\")\n", + " check2.observe(callback, 'value')\n", + " self.main.children = (check1, check2)\n", + "\n", + "center = Container()\n", + "\n", + "show.on_click(center.load)\n", + " \n", + "AppLayout(\n", + " header=None,\n", + " left_sidebar=VBox((Label(description=\"hello\"), show, )),\n", + " center=center,\n", + " right_sidebar=None,\n", + " footer=out\n", + ")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [conda env:voila]", + "language": "python", + "name": "conda-env-voila-py" + }, + "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 +} diff --git a/README.md b/README.md index f11e023..b0a298f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # voila-material -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/voila-dashboards/voila-material/master?urlpath=voila) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/voila-dashboards/voila-material/stable?urlpath=voila) Material design template for voila diff --git a/environment.yml b/environment.yml index 8b45107..70f9cdd 100644 --- a/environment.yml +++ b/environment.yml @@ -4,4 +4,5 @@ channels: dependencies: - ipywidgets=7.5.1 - bqplot - - voila=0.1.12 + - voila=0.1.21 + - voila-material=0.3.0 diff --git a/gaussian_process_regression.ipynb b/gaussian_process_regression.ipynb index 82d565e..76a7c1d 100644 --- a/gaussian_process_regression.ipynb +++ b/gaussian_process_regression.ipynb @@ -102,9 +102,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "fig_margin=dict(top=60, bottom=40, left=50, right=0)\n", @@ -180,6 +178,35 @@ "fig.on_displayed(update_reg_line)\n", "VBox([fig, VBox(check_boxes + [reset_button])])" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "check_box = Checkbox(description=\"Broken checkbox\")\n", + "output = Output()\n", + "\n", + "@output.capture()\n", + "def callback(*args):\n", + " print(\"Called by checkbox\")\n", + "\n", + "check_box.observe(callback, 'value')\n", + "\n", + "VBox((check_box, output))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "@interact(a=True)\n", + "def interactive_f(a):\n", + " print(\"Interactive \" + str(a))\n" + ] } ], "metadata": { diff --git a/postBuild b/postBuild deleted file mode 100644 index 589a374..0000000 --- a/postBuild +++ /dev/null @@ -1,2 +0,0 @@ -# Install template -pip install .