Skip to content

Instantly share code, notes, and snippets.

@lapis-zero09
Created June 1, 2018 02:43
Show Gist options
  • Save lapis-zero09/301e1ff6b2161c28a1e55192adca442d to your computer and use it in GitHub Desktop.
Save lapis-zero09/301e1ff6b2161c28a1e55192adca442d to your computer and use it in GitHub Desktop.
the_agile_samurai.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"ExecuteTime": {
"start_time": "2018-06-01T02:42:30.288590Z",
"end_time": "2018-06-01T02:42:30.748832Z"
},
"trusted": true,
"hideCode": false,
"hidePrompt": false
},
"cell_type": "code",
"source": "from ipywidgets import Textarea, Layout, Box, VBox, Label\nfrom IPython.display import display\nimport ipywidgets as widgets\nimport matplotlib.pyplot as plt",
"execution_count": 1,
"outputs": []
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2018-06-01T02:42:31.299688Z",
"end_time": "2018-06-01T02:42:31.401479Z"
},
"trusted": true,
"hideCode": false,
"hidePrompt": false
},
"cell_type": "code",
"source": "box_layout = Layout(display='flex',\n flex_flow='column',\n align_items='stretch',\n border='solid',\n width='100%')\n\nitems_auto = [\n Label('やること・やらないことリスト'),\n VBox([VBox([Label('やる'), Textarea()], layout=Layout(align_items='center',flex='auto', width='50%')),\n VBox([Label('やらない'), Textarea()], layout=Layout(align_items='center',flex='auto', width='50%'))\n ],\n layout=Layout(flex='auto', flex_flow='row', width='auto')),\n VBox([Label('あとで決める'), Textarea()], layout=Layout(align_items='center', width='100%')),\n\n ]\n\n \nBox(children=items_auto, layout=box_layout)\n",
"execution_count": 2,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "Box(children=(Label(value='やること・やらないことリスト'), VBox(children=(VBox(children=(Label(value='やる'), Textarea(value='')), layout=Layout(align_items='center', flex='auto', width='50%')), VBox(children=(Label(value='やらない'), Textarea(value='')), layout=Layout(align_items='center', flex='auto', width='50%'))), layout=Layout(flex='auto', flex_flow='row', width='auto')), VBox(children=(Label(value='あとで決める'), Textarea(value='')), layout=Layout(align_items='center', width='100%'))), layout=Layout(align_items='stretch', border='solid', display='flex', flex_flow='column', width='100%'))",
"text/html": "<p>Failed to display Jupyter Widget of type <code>Box</code>.</p>\n<p>\n If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n that the widgets JavaScript is still loading. If this message persists, it\n likely means that the widgets JavaScript library is either not installed or\n not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n Widgets Documentation</a> for setup instructions.\n</p>\n<p>\n If you're reading this message in another frontend (for example, a static\n rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n it may mean that your frontend doesn't currently support widgets.\n</p>\n",
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "f9de26b3fb384cf7ac7cf489a8628a7c"
}
},
"metadata": {}
}
]
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2018-06-01T02:42:36.009555Z",
"end_time": "2018-06-01T02:42:36.234995Z"
},
"trusted": true,
"hideCode": false,
"hidePrompt": false
},
"cell_type": "code",
"source": "trade_off_slider_item_layout = Layout(\n display='flex',\n flex_flow='row',\n justify_content='space-between'\n)\n\ntrade_off_slider_items = [Label('トレードオフ・スライダー')]\n\nfor idx, item in enumerate(['スコープ', '予算', '時間', '品質']):\n slider = widgets.IntSlider(min=1, max=10, step=1, value=5)\n slider.style.handle_color = plt.rcParams['axes.prop_cycle'].by_key()['color'][idx]\n trade_off_slider_items.append(\n Box([Label(item), slider], layout=trade_off_slider_item_layout),\n )\n trade_off_slider_items.append(\n Box([Label('memo'), Textarea()], layout=trade_off_slider_item_layout),\n )\n \n \ntrade_off_slider = Box(trade_off_slider_items,\n layout=Layout(\n display='flex',\n flex_flow='column',\n border='solid 2px',\n align_items='stretch',\n width='50%'\n ))\ntrade_off_slider",
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "Box(children=(Label(value='トレードオフ・スライダー'), Box(children=(Label(value='スコープ'), IntSlider(value=5, max=10, min=1, style=SliderStyle(handle_color='#1f77b4'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='memo'), Textarea(value='')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='予算'), IntSlider(value=5, max=10, min=1, style=SliderStyle(handle_color='#ff7f0e'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='memo'), Textarea(value='')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='時間'), IntSlider(value=5, max=10, min=1, style=SliderStyle(handle_color='#2ca02c'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='memo'), Textarea(value='')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='品質'), IntSlider(value=5, max=10, min=1, style=SliderStyle(handle_color='#d62728'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='memo'), Textarea(value='')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between'))), layout=Layout(align_items='stretch', border='solid 2px', display='flex', flex_flow='column', width='50%'))",
"text/html": "<p>Failed to display Jupyter Widget of type <code>Box</code>.</p>\n<p>\n If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n that the widgets JavaScript is still loading. If this message persists, it\n likely means that the widgets JavaScript library is either not installed or\n not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n Widgets Documentation</a> for setup instructions.\n</p>\n<p>\n If you're reading this message in another frontend (for example, a static\n rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n it may mean that your frontend doesn't currently support widgets.\n</p>\n",
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "0d5276d295ed46c4a7b13eb7fd0a6ebb"
}
},
"metadata": {}
}
]
},
{
"metadata": {
"trusted": true,
"hideCode": false,
"hidePrompt": false
},
"cell_type": "code",
"source": "",
"execution_count": null,
"outputs": []
},
{
"metadata": {
"trusted": true,
"hideCode": false,
"hidePrompt": false
},
"cell_type": "code",
"source": "",
"execution_count": null,
"outputs": []
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
},
"language_info": {
"name": "python",
"version": "3.6.4",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
},
"latex_envs": {
"eqNumInitial": 1,
"eqLabelWithNumbers": true,
"current_citInitial": 1,
"cite_by": "apalike",
"bibliofile": "biblio.bib",
"LaTeX_envs_menu_present": true,
"labels_anchors": false,
"latex_user_defs": false,
"user_envs_cfg": false,
"report_style_numbering": false,
"autoclose": false,
"autocomplete": true,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
}
},
"toc": {
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"base_numbering": 1,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"window_display": false,
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"library": "var_list.py",
"delete_cmd_prefix": "del ",
"delete_cmd_postfix": "",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"library": "var_list.r",
"delete_cmd_prefix": "rm(",
"delete_cmd_postfix": ") ",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
]
},
"hide_code_all_hidden": false,
"gist": {
"id": "",
"data": {
"description": "the_agile_samurai.ipynb",
"public": true
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment