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-vega not working in JupyterLab 2 #12

Open
jamesdbrock opened this issue Apr 27, 2020 · 4 comments
Open

ihaskell-vega not working in JupyterLab 2 #12

jamesdbrock opened this issue Apr 27, 2020 · 4 comments

Comments

@jamesdbrock
Copy link
Member

DougBurke/hvega#141

@chapmanbe
Copy link

I don't know if this is the same cause you were experiencing when you created this issue, but I get an error when I execute vlshow for example from VegaLiteGallery.ipynb:

vlShow barFromColumns
Javascript Error: requirejs is not defined

Similar errors in other example notebooks.

@jamesdbrock
Copy link
Member Author

Hi @chapmanbe , thanks for the note. Yeah, I see the same thing.

It looks like @DougBurke released v0.4.0.0 of ihaskell-hvega in October. I'll try an omni-upgrade of the ihaskell-notebook and let's see if that's an improvement.

@jamesdbrock
Copy link
Member Author

Update: this problem still appears with versions

ihaskell-0.10.2.2
ghc-8.10.7
hvega-0.12.0.2
ihaskell-hvega-0.5.0.2
JupyterLab 3.2.5

I'll publish a new ihaskell-notebook image with these version updates anyway.

@DougBurke
Copy link

Random comments that may or may not be helpful

  • the behavior depends on whether you are using jupyter notebook or lab
  • it depends what version of jupyter lab you are using (although I forget now what problems this can cause)

If you are using jupyter notebook and recent versions of the whole stack then you should just be able to display a VegaLite instance without any problem. This relies on javascript code external to the notebook stack (https://vega.github.io/vega-lite/usage/embed.html) and so there's always the chance that there's a problem with this.

If you are using jupyter lab then you have to use vlShow to convert the type into something that has the correct mimetype for the jupyter display code to display, and this uses the in-built support (in the lab stack) for Vega-Lite. This requires using a version of jupyter lab which matches ihaskell/ihaskell-hvega (e.g. that ihaskell sends the appropriate mime-type).

If you use vlShow when you are running jupyter notebook (or forget to include it when you are using jupyter lab) then things don't work.

I ended up getting getting frustrated trying to get this to all work well together in all combinations as it felt like whenever I tried to address it there was some problem in the stack somewhere. I got to DougBurke/hvega#141 (comment) and then ran out of energy/time/interest.

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

3 participants