Skip to content

Instantly share code, notes, and snippets.

@gnestor
Last active October 24, 2016 18:07
Show Gist options
  • Save gnestor/29433f308eeb6c09ca52e1650a705eed to your computer and use it in GitHub Desktop.
Save gnestor/29433f308eeb6c09ca52e1650a705eed to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"from ipywidgets import *"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget": "6ccb7904f8f24fcfa6152a462dd55c74"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def func(x=0, y=0, z=0):\n",
" pass\n",
"\n",
"widget = interactive(func, x=(0, 3), y=(0, 3), z=(0, 3))\n",
"widget"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"widget.children[-2].layout.display = 'none'\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(<ipywidgets.widgets.widget_int.IntSlider at 0x10458b2b0>,\n",
" <ipywidgets.widgets.widget_int.IntSlider at 0x10458b550>,\n",
" <ipywidgets.widgets.widget_int.IntSlider at 0x10458b668>,\n",
" <ipywidgets.widgets.widget_output.Output at 0x10458b278>)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"widget.children"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget": "24147514db574f8b86e816c99b7184ea"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Tab([widget])"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"Accordion([widget])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"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.5.2"
},
"widgets": {
"state": {
"24147514db574f8b86e816c99b7184ea": {
"views": [
{
"cell_index": 3
}
]
},
"6ccb7904f8f24fcfa6152a462dd55c74": {
"views": [
{
"cell_index": 1
}
]
}
},
"version": "2.0.0-dev"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment