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

ihaskell-widgets runs with no error, however, displays no widget #870

Closed
eldad-a opened this issue Jun 4, 2018 · 16 comments
Closed

ihaskell-widgets runs with no error, however, displays no widget #870

eldad-a opened this issue Jun 4, 2018 · 16 comments

Comments

@eldad-a
Copy link

eldad-a commented Jun 4, 2018

Hello,

The short version:
ihaskell-widgets runs with no error, however shows no widget.

Long version:
This is my first experience with Haskell and I am thankful to the Devs for creating an interface based on jupyter notebook, which I find very friendly.

The following example code executes with no error, however, with no widget displayed either.

import IHaskell.Display.Widgets
slider <- mkFloatSlider

setField slider ChangeHandler $ do
    value <- getField slider FloatValue
    print value
    
slider

The above is copied from Demo of IHaskell Notebook by Andew Giabiansky, January 20, 2016

To run the example notebooks from the ihaskell-widgets IHaskell repository I had to rename the stack.yaml in the ihaskell-display/ihaskell-widgets/, as suggested in Cannot install ihaskell-display widgets with stack #715
.

Then the examples (two notebooks I tried) run with no errors, but still, no widget is displayed.

Hope you could guide me how to resolve this matter.

@vaibhavsagar
Copy link
Member

It looks like ihaskell-widgets hasn't been updated in some time (beyond version bumps by me) and the protocol version it speaks is out of date. I'm not sure when I'll get around to fixing this and I'm sorry I don't have a better answer for you!

ihaskell-widget-protocol-mismatch

@vaibhavsagar
Copy link
Member

This issue looks related: JuliaGizmos/Interact.jl#176

@vaibhavsagar
Copy link
Member

For myself or whoever decides to implement this: here is a document describing the new protocol and the changes would probably have to made to IHaskell.Display.Widgets.

@eldad-a
Copy link
Author

eldad-a commented Jun 7, 2018

@vaibhavsagar

A. Many thanks for the quick and detailed reply!

B.

This issue looks related: JuliaGizmos/Interact.jl#176

Following that link I did:
pip3 uninstall ipywidgets
followed by
pip install ipywidgets==6.0.0

and the slider example above works :-)

@vaibhavsagar
Copy link
Member

Great to see you found a workaround!

@kyagrd
Copy link

kyagrd commented Nov 2, 2018

I just updated my docker hub image kyagrd/ihaskell for IHaskell based on lts-12.19, which runs both Display and Widgets -- the slider example works :)
Basically what it does is the same as the workaround: instead of pip/pip3 user install/uninstall dance, I just used what the current Debian buster repository provides because the ipython widget package happens to be the 6.0.0 version at present.

Dockerfile that I used to build this is also available on https://cloud.docker.com/repository/docker/kyagrd/ihaskell

Image is of course large compared to the --fast option install because it includes all the compiled stuff for IHaskell Display and Widget libraries.

@jamesdbrock
Copy link
Member

ipywidgets version 7.0 changelog

https://ipywidgets.readthedocs.io/en/stable/changelog.html#id5

@jamesdbrock
Copy link
Member

jamesdbrock commented May 13, 2019

So to summarize and repeat what's already been said here by @vaibhavsagar :

IHaskell Widgets currently supports the Widget messaging protocol version 1 , implemented in ipywidgets up to version 6.0.1.

ipywidgets from version 7.0.0 implements the Widget messaging protocol version 2.

The work would involve the IHaskell and ihaskell-widgets packages:

  1. IHaskell/Eval/Widgets.hs
  2. ihaskell-display/ihaskell-widgets

I would approach this work in these steps:

  1. Build a test environment with ipywidgets==6.0.1 in which ihaskell-widgets is working.
  2. Upgrade IHaskell to widget messaging protocol 2.
  3. Build a test environment with ipywidgets==7.4.2 in which ihaskell-widgets is working.

It would be nice if the test environment could be included in the IHaskell repo.

I would be very grateful if @sumitsahrawat or @gibiansky would offer any advice about this upgrade. Especially advice about getting debugging visibility into the comms.

@jamesdbrock
Copy link
Member

The stack --docker configuration from @jcberentsen bc6d9ca is going to be a good way to set up the test environment.

@rehno-lindeque
Copy link

rehno-lindeque commented Aug 24, 2019

Especially advice about getting debugging visibility into the comms.

Not sure if this is what was meant, but just to mention: it's possible to see websocket messages for comms in the chrome browser's development tools. I found that there's buttons to clear messages on each individual websocket (don't clear all network traffic; that prevents you from seeing new messages).

@jamesdbrock
Copy link
Member

I think it's gonna turn out that issue #1144 is required to resolve this issue.

@jamesdbrock
Copy link
Member

jamesdbrock commented Mar 1, 2020

@jamesdbrock
Copy link
Member

jupyter-widgets/ipywidgets#2798 (comment)

So the story to users/developers is:

  • ipywidgets 7 fully supports jlab 1 and jlab 2. Custom widgets will need a patch release to add support for jlab 2 (just like they did for jlab 1)
  • ipywidgets 8 supports jlab 2 (but not jlab 1). Custom widgets will need a major release to support ipywidgets 8
  • Both ipywidgets 7 and 8 support classic notebook

@jamesdbrock
Copy link
Member

@jamesdbrock
Copy link
Member

@daviddavo is working on this issue for Google Summer of Code 2021 and he is making excellent progress.

@jamesdbrock
Copy link
Member

This issue has been solved by #1242

Thx David!

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

5 participants