Skip to content

[WIP] IPyWidgets Backend for TraitsUI #469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
edd78d1
Initial commit of ipywidgets toolkit code.
corranwebster Jul 14, 2018
be0f877
WIP: First cut of bool and text editors.
prabhuramachandran Jul 15, 2018
1e12dcf
First working widgets.
corranwebster Jul 15, 2018
9017638
Test Jupyter notebook.
corranwebster Jul 15, 2018
a73b3f2
Get grid layouts working.
corranwebster Jul 15, 2018
60ca4a9
Add button_editor file
ku-ya Jul 15, 2018
2ffcfb4
More work on getting things up and running. Tabbed and VFold now work.
corranwebster Jul 15, 2018
1c4c74d
ENH: add html editor for ipywidgets
ku-ya Jul 15, 2018
23b8535
CLN: remove button editor from ipywidgets
ku-ya Jul 15, 2018
285e634
FLK: remove unused import
ku-ya Jul 15, 2018
8844c59
Merge pull request #470 from enthought/enh/ipywidgets-html-editor
corranwebster Jul 15, 2018
d5b6d62
Adding a range editor.
prabhuramachandran Jul 21, 2018
e622c7b
Adding a very simple button editor.
prabhuramachandran Jul 22, 2018
21e7529
Update notebook with more traits.
prabhuramachandran Jul 22, 2018
c9bc71c
Allow traits object to be immediately displayed.
prabhuramachandran Jul 22, 2018
9627db2
Mirror changes in #473.
prabhuramachandran Jul 25, 2018
a37da63
First cut at image support for IPyWidgets (untested).
corranwebster Jul 30, 2018
913c5c8
Get image editor working.
corranwebster Jul 13, 2019
b1c6069
First attempt at a date editor.
corranwebster Jul 13, 2019
8babcf8
Merge branch 'master' into feature/ipywidgets-backend
corranwebster Jul 13, 2019
8d212fc
Add stubbed-out pyface action API to avoid import errors.
corranwebster Jul 13, 2019
398f41b
Clean up HasTraits patching.
corranwebster Jul 13, 2019
1f90ac9
Better way of adding Jupyter HTML rendering of traits.
corranwebster Jul 13, 2019
02f3d97
Merge branch 'master' of github.com:enthought/traitsui into feature/i…
Apr 27, 2021
a166c26
FIX : Ignore flake8 errors in traitsui.ipywidgets for now
Apr 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update notebook with more traits.
  • Loading branch information
prabhuramachandran committed Jul 22, 2018
commit 21e752919c416a3f4d3ea53a2e71fbabd3da3ad5
91 changes: 77 additions & 14 deletions traitsui/ipywidgets/TestIPyWidgets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -13,17 +13,83 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"from traits.api import HasTraits, Unicode, Bool, Int\n",
"from traits.api import HasTraits, Unicode, Bool, Int, Range, Button\n",
"\n",
"from traitsui.group import VGroup, Tabbed, VFold, VGrid\n",
"from traitsui.item import Item\n",
"from traitsui.view import View\n",
"from traitsui.ui import UI\n",
"from traitsui.ui import UI"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"class TestObjInline(HasTraits):\n",
" text = Unicode\n",
" boolean = Bool\n",
" integer = Int\n",
" rng = Range(0, 100, 10)\n",
" large_range = Range(0.0, 10000000.0, 1.0)\n",
" button = Button('Click me!')\n",
"\n",
" view = View(\n",
" Tabbed(\n",
" VGroup(\n",
" Item(label='test'),\n",
" Item('text'),\n",
" Item('rng'),\n",
" Item('large_range'),\n",
"# Item('button'),\n",
" label=\"Tab 1\",\n",
" ),\n",
" VGroup(\n",
" Item('boolean'),\n",
" Item('integer'),\n",
" label=\"Tab 2\"\n",
" ),\n",
" ),\n",
" )\n",
"\n",
" def _button_fired(self):\n",
" print(\"Clicked\")\n",
" self.integer += 1\n",
" self.large_range += 1.0"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<__main__.TestObjInline at 0x10a1478e0>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t1 = TestObjInline()\n",
"t1"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"class TestObj(HasTraits):\n",
" text = Unicode\n",
" boolean = Bool\n",
Expand All @@ -45,12 +111,12 @@
" ),\n",
" ),\n",
")\n",
"ui = test_obj.edit_traits(view=test_view, kind='live')\n"
"ui = test_obj.edit_traits(view=test_view, kind='live')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -67,13 +133,13 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ad6fbfa88e5d47088de44c5fb1d77511",
"model_id": "4503d7dc6a3a4d1fbc05b8cc727265f9",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -86,9 +152,6 @@
}
],
"source": [
"from IPython.display import display\n",
"#from traitsui.ipywidgets.ui_panel import panel\n",
"\n",
"t = ui.control\n",
"t"
]
Expand Down Expand Up @@ -206,13 +269,13 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5ca16f2ce9a747f1ac13b2e41bf034e5",
"model_id": "e8bf7960786f436890895053c2b427e4",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -235,7 +298,7 @@
" grid_template_rows='80px auto 80px',\n",
" grid_gap='5px 10px')\n",
" )\n",
"display(gb)"
"gb"
]
},
{
Expand Down