Skip to content
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

Signal{Widget} display #47

Closed
JobJob opened this issue Jan 6, 2015 · 5 comments
Closed

Signal{Widget} display #47

JobJob opened this issue Jan 6, 2015 · 5 comments

Comments

@JobJob
Copy link
Member

JobJob commented Jan 6, 2015

Hello! I'd like to be able to have widgets display based on values of signals.
Here is an attempt, should it work and allow me to choose the widget that gets displayed?

widget_choice = togglebuttons(["slider","checkbox"], label="choose a widget")
display(widget_choice)
slider_to_show = slider(1:10; label="killr slider")
checkbox_to_show = checkbox(true; label="my new checkcheck")
widget_chosen = lift(x->x=="slider"? slider_to_show : checkbox_to_show, Widget, widget_choice)
display(widget_chosen)

It starts out fine, initially showing the slider, when I choose checkbox I get this:

screen shot 2015-01-06 at 11 36 41 am

If the checkbox is the default in the togglebuttons and then I choose slider, this is the outcome:
screen shot 2015-01-06 at 11 47 10 am

Julia is 0.3.3, Interact is 0.1.6, Reactive is 0.1.10
Cheers.

@JobJob
Copy link
Member Author

JobJob commented Feb 18, 2015

Hi, is your work on Canvas going to be helpful with this? Miss you : )

@JobJob
Copy link
Member Author

JobJob commented Nov 12, 2016

I actually had a branch working for this a long time ago, but from memory I wasn't completely happy with the implementation. From what I recall the problem is that Jupyter Widgets display in a special area, so updating them is not the same as patching the html in the output/display area, and needs to be treated as a special case. When the Signal{Widget}'s value updates, the old widget needs to be removed and the new one added.

Shashi's Canvas package I mentioned above became Escher, and I decided to wait until that was stable before looking at this again. I wondered if we could replace Jupyter's native widgets with Escher's widgets which as well as (I presume) easily fixing this bug, would also give us more flexibility with layouts, possibly making it easier to address #16 #48 #12 and #38

What are your thoughts about getting Escher to work in IJulia @shashi ?

@shashi
Copy link
Member

shashi commented Dec 10, 2016

It would definitely be nice to have Escher work in IJulia. There are some problems however (e.g. you can't serve a directory of static files for IJulia to use). I'm not as happy as I want to be with Escher's stability and the underlying architecture. It definitely needs a re-look and possible simplification which might involve something like WebDisplay.jl acting as the bridge package making the same code work in IJulia / atom / escher server.

@JobJob
Copy link
Member Author

JobJob commented Dec 10, 2016

Ok cheers, will have a look at WebDisplay - Atom (Julia-client/Ink) has really come along - the debugger integration is pretty good, and I just had a PR merged in atom-julia-client that implements a simple cell based mode, which I kinda got used to from Jupyter. The only major thing missing is widgets/interaction. Am definitely very interested in getting it going, but I'm not very familiar with the Escher or Atom/Ink code bases. If I get a chance to work on it (I really do have to do some of my actual work : )) I'll open some issues on WebDisplay.jl to ask you guys some questions.

Btw this is working now - so closing 😄

@JobJob JobJob closed this as completed Dec 10, 2016
@shashi
Copy link
Member

shashi commented Dec 10, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants