skip to main content

@tonyfast s notebooks

site navigation
notebook summary
title
running pidgy in voila
description
this notebook demonstrates pidgy widget and voila integration.
cells
7 total
4 code
state
executed in order
kernel
Python [conda env:root] *
language
python
name
conda-root-py
lines of code
19
outputs
5
table of contents
{"kernelspec": {"display_name": "Python [conda env:root] *", "language": "python", "name": "conda-root-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.9.13"}, "widgets": {"application/vnd.jupyter.widget-state+json": {"state": {"2d87d54548194acd955da7d1d5e0016e": {"model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {}}, "4ddab38140394b759f63c83bdddee5e0": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": {"layout": "IPY_MODEL_2d87d54548194acd955da7d1d5e0016e", "style": "IPY_MODEL_636b9b6698994f29bce0f8d4dd65a170", "value": "<h2><code>pidgy</code> widget integration</h2>\n<p>out of the box, <code>pidgy</code> relies on <code>IPython</code>s markdown display, but in this document we use the <code>pidgy.displays.IPyWidgetsHtml</code> display</p>\n<pre><code>shell.weave.template_cls = pidgy.displays.IPyWidgetsHtml\n</code></pre>\n<p>the reactive and asynchronous <code>pidgy.displays.IPyWidgetsHtml</code> display passes the input through a jinja environment then it is parsed into html by <code>shell.weave.markdown_renderer</code>.</p>\n<p>after each exection we link undeclared variables in the jinja templates to any interactive widgets.\nwhen widgets change, the display changes as shown in the COOOKIES demo.</p>\n"}}, "61f66c8575d44bb29df2becd55d538ba": {"model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {}}, "636b9b6698994f29bce0f8d4dd65a170": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": {"description_width": "", "font_size": null, "text_color": null}}, "a761b1c1a5344ac68bd244cb208e038c": {"model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {}}, "c2aecbfa15fd4cc2ab29c05d0c0822a2": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "IntSliderModel", "state": {"behavior": "drag-tap", "description": "COOKIES", "layout": "IPY_MODEL_61f66c8575d44bb29df2becd55d538ba", "min": 1, "style": "IPY_MODEL_fe3089005cb24917879753004399e720", "value": 3}}, "c91a3037a55f406d9b31ddd00b3117bc": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": {"layout": "IPY_MODEL_a761b1c1a5344ac68bd244cb208e038c", "style": "IPY_MODEL_d2cd7a98622c4750bf63fbae65ff881a", "value": "<p>if you eat 3 that you consume 150 calories.</p>\n"}}, "d2cd7a98622c4750bf63fbae65ff881a": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": {"description_width": "", "font_size": null, "text_color": null}}, "fe3089005cb24917879753004399e720": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "SliderStyleModel", "state": {"description_width": ""}}}, "version_major": 2, "version_minor": 0}}, "title": "running pidgy in voila", "description": "this notebook demonstrates pidgy widget and voila integration."}
notebook toolbar
Activate
cell ordering
1

running in

this notebook demonstrates pidgy widget and voila integration.

2

image.png

3 1 outputs.
4

COOOKIES!

the cookies demo is a go to demo from Bret Viktor's tanglejs .

5 1 outputs.
6 2 outputs.
7 1 outputs.