Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 19 21:08
    Calebs97 closed #65
  • Aug 01 14:23
    mubelsjedenn opened #108
  • Jul 16 22:56
    initmaks opened #107
  • May 14 15:34
    ocefpaf opened #106
  • Jan 27 19:39
    ELC opened #105
  • Jan 25 16:27
    lukasheinrich edited #104
  • Jan 25 16:27
    lukasheinrich opened #104
  • Jan 25 01:26
    ELC edited #103
  • Jan 25 01:25
    ELC edited #103
  • Jan 25 01:17
    ELC edited #103
  • Jan 25 01:16
    ELC opened #103
  • Jan 04 23:53
    mpilosov commented #102
  • Jan 04 02:46
    SamLau95 closed #102
  • Jan 04 02:46
    SamLau95 closed #101
  • Jan 04 02:46
    SamLau95 commented #102
  • Jan 03 02:49
    SamLau95 synchronize #102
  • Jan 03 02:48
    SamLau95 opened #102
  • Jan 01 05:12
    SamLau95 edited #101
  • Jan 01 05:12
    SamLau95 edited #101
  • Jan 01 05:10
    SamLau95 assigned #101
mathematicalmichael
@mathematicalmichael
I have gone through a number of iterations, but the most recent one has been confirmed to be working exactly as one would expect (mimicks behavior in jupyter notebook exactly). Honestly, I'm looking for any solution that allows me to rapidly link the widgets to a server somewhere I rent out (or similar) for computations. It would make writing whitepapers with interactive elements so incredibly convenient. (Also, I will be looking into setting up binderhub on my university's servers, since we have quite a bit of available server time).
mathematicalmichael
@mathematicalmichael
unpkg.com/nbinteract-core@0.2.1/index.js:1 Failed to load resource: the server responded with a status of 404 ()
/favicon-32x32.png:1 Failed to load resource: the server responded with a status of 404 ()
/favicon-16x16.png:1 Failed to load resource: the server responded with a status of 404 ()
/favicon-96x96.png:1 Failed to load resource: the server responded with a status of 404 ()
/android-chrome-192x192.png:1 Failed to load resource: the server responded with a status of 404 () .... none of your sites are working anymore because of a failed resource at unpkg.com
Sam Lau
@SamLau95
@mathematicalmichael Heya! Sorry about the unpkg issue. Not sure what happened there but I just cut a new version that seems to fix your website.
mathematicalmichael
@mathematicalmichael
thanks! that's really great. Since last writing on here, I've managed to learn about Voila and Thebelab. I still think the functionality and ease-of-use nbinteract provides is clearly the most impressive though. I know how to set up a nbserver on my server, but still can't quite tell how I might be able to change the HTML to query a live kernel there instead of on mybinder.org. I don't feel comfortable setting up my own mybinder.org, but it seems to be based on what it does that if nbinteract is given the location of a live kernel + the dependencies from unpkg, it can perform all the necessary work. Could you possibly shed some insight onto whether this is possible to tell nbinteract about a non-binder location of a live kernel? Would this potentially improve response/load times considerably? What if I had a ready-to-go docker image on that server, so I could "skip" the building of the image, but still have a binder-like setup since docker would spawn a new container for each visitor of the website?
Sam Lau
@SamLau95

@mathematicalmichael Yup, Voila and Thebelab are great projects. Right now the nbinteract code essentially does the following sequence of steps:

  1. Request notebook server from Binder
  2. Request Python kernel from notebook server
  3. Run code on Python kernel

Now that you ask, I realize that we can change nbinteract to skip step 1 if it's given a running notebook server to start with. This is what I do for local development on nbinteract; nbinteract will start a kernel assuming a notebook server is running locally on port 8889.

Since step one takes up the vast majority of the initial boot time, I think this could make the initial boot time much faster
However, it will likely not make individual interaction times faster since each interaction still has to complete a round trip from computer to the kernel and back
Matplotlib charts are especially slow because every interaction produces a completely new image which is quite large when you need to send multiple images per second
This was the motivation for nbinteracts plotting functions
mathematicalmichael
@mathematicalmichael

individual interaction times, even with the matplotlib I'm using, aren't that bad. I tried and failed to get nbinteract's plotting to work, because I think it looks excellent, but that may have been tied to the same issue that was causing problems over at unpkg.
step one is indeed the largest delay I want to get rid of, so it sounds like it's possible given what you do for local development. Let's say I run a notebook server via docker accessible via reverse-proxy at subdomain.domain.com (so the port 8889 part is now gone from the address, and https is handled by the reverse proxy), If I were to visit https://subdomain.domain.com, I would see a notebook interface running in an isolated container. What changes need to be made to the HTML/nbinteract setup in order to get my embedded html page to query my nbserver instead of mybinder.org? (aka what exactly do you do to get the local development working?)

Sorry for the questions, I'm learning (quickly) a lot of this networking/architecture stuff, and really appreciate your responses. I think your project is far easier to deploy a good-looking dashboard within a static site when compared to the other two projects.

I'm also considering using the instructions for local-testing of mybinder to deploy mybinder on my server with minikube (https://github.com/jupyterhub/binderhub/blob/master/CONTRIBUTING.md), but this appears that it would not reduce latency in step 1.
(or use kubeadm?)
Sam Lau
@SamLau95
@mathematicalmichael Right now, there's no way of telling nbinteract to use a notebook server instead of a binder server. To use the local notebook server, I have to hard-code the URL in the package JS. However, this sounds like pretty easy feature to implement. I'll make an issue and see if I can get something running this week.
mathematicalmichael
@mathematicalmichael
you're amazing. thank you so much. can't wait to test it out.
FabioRossiArcetri
@FabioRossiArcetri
Great project guys! I started to play with it a few days ago and planning on using it for quick web deployment of small apps. One thing I'd like to do, if possible, is to use nbinteract in together with bokeh to visualize pretty and interactive plots. I know bokeh is quite a different beast and has it own client-server mechanism for web deployment, but it would be nice to have somenthing like this working:

import numpy as np
import ipywidgets as widgets

from bokeh.plotting import figure, output_file, show, helpers
from bokeh.models import ColumnDataSource
from bokeh.models.tools import HoverTool
from bokeh.palettes import Category20
from bokeh.io import output_notebook

rolls = np.random.choice([1, 2, 3, 4, 5, 6], size=300)
averages = np.cumsum(rolls) / np.arange(1, 301)

def x_vals(num_rolls):
return range(num_rolls)

def y_vals(xs):
return averages[:len(xs)]

def plotting_func(num_rolls):
myplot = figure(plot_width=800, plot_height=400)
myplot.line(x=x_vals(num_rolls), y=y_vals(x_vals(num_rolls)) )
show(myplot)

output_notebook()

widgets.interact(plotting_func, num_rolls=(0,100));
Trying this I get:
JavaScript output is disabled in JupyterLab
Several times, together with the widget visualization
FabioRossiArcetri
@FabioRossiArcetri
So no free lunch? I have to say I am a beginner to web development, I know Python but not Javascript, otherwise I guess I might have not posed the silly use case at all !!!
Aleksandr Deineha
@AleksandrDeynega
Hallo everyone! I am now trying to reproduce exaple from this tutorial https://www.nbinteract.com/tutorial/tutorial_intro.html . I've done all of the instruction. But when I open tutorial.htm I click show widgets I only see 'Initializing widgets...' but nothing happens. What should I check or do? Help me pls!) My repo https://github.com/AleksandrDeynega/nbinteract-tutorial
Aleksandr Deineha
@AleksandrDeynega
It's now working! I skipped the part of selecting the master branch as the GitHub pages source, that was the problem. Your project is awesome! Thank you! I'm also waiting for feature of setting up my own local backend, that would be great. Thanks again for you project!
Sam Lau
@SamLau95
@FabioRossiArcetri right now we don't support bokeh. we could, but it would require some work and i don't have spare cycles for the near term, sadly
@AleksandrDeynega good to hear!
sergeyfridrikh
@sergeyfridrikh
Hi, Is it possible to run nbinteract on your own computer without making your code public by using Github?
Sam Lau
@SamLau95
@sergeyfridrikh yup, you just open the HTML page in Google Chrome instead of uploading it to GitHub. However, just running the notebook locally might be easier if all you want is to play with your interactive content
sergeyfridrikh
@sergeyfridrikh
Thank you Sam, I actually need more than running my noteboook myself. I am looking for an easy way of converting it into a user friendly data analysis application (used by a handful of colleagues) with all the code hidden from them. By the way, what happens with all the imports (including my own classes and functions) when I use nbinteract?
Sam Lau
@SamLau95
@sergeyfridrikh got it. You can use whatever classes and functions you want. If you're using outside packages, you'll have to edit the requirements.txt file for Binder to install them
Mundy Reimer
@mundyreimer

Hello everyone! I really do appreciate all the work you guys have put into this Sam! I'm really looking forward to making some great interactive tutorials, and will definitely spread the word on this neat project. Great job!

However, if you don't mind could I get some quick help @SamLau95 ?

I'm sure I am missing something simple here, but as I was following your tutorial, I was having a problem with the publishing step here: https://www.nbinteract.com/tutorial/tutorial_publishing.html

Specifically, I can see my page being published, but when I try clicking the "Show Widgets" button, I get an error:

Error, try refreshing the page:<br>Could not resolve ref for gh:nbinteract/tutorial/master. Double check your url

So after a quick look at a similar issue brought up by user SantiagoG, you mentioned that we just might need to open up the .nbinteract.json file on GitHub and change the spec to read {my username here}/nbinteract-tutorial/master, but after doing this and refreshing my html page I still get the same error.

Any help would greatly be appreciated! Thanks! :)

My repo: https://github.com/mundyreimer/nbinteract-tutorial.git

Sam Lau
@SamLau95
@mundyreimer it looks like https://mundyreimer.github.io/nbinteract-tutorial/tutorial.html is working for me. I had to do a hard refresh for some reason (Cmd + Shift + R). does it still not work for you?
Mundy Reimer
@mundyreimer
Ah, got it working!
It turns out I needed to pull my git changes and then recreate the html page and then push again
Still new to this, thanks though!
Especially for your super prompt response! @SamLau95
Sam Lau
@SamLau95
Glad things worked out!
jemme07
@jemme07

Hello @SamLau95 and @Calebs97, Thank you very much for your fantastic work!!! I wonder if you could help me to implement nbinteract for some of my projects. I followed the tutorials and I think I have done everything. However, none of my HTML files works, not even locally. When I click show widgets, I only see 'Initializing widgets'. Could you please help me? I tried both matplotlib and plotting using nbinteract directly. I have two files in https://github.com/jemme07/web_widgets.git

Any help would be highly appreciated.

Roi Weinreb
@RoiWeinreb_twitter

Hello, first of all, @SamLau95 and @Calebs97, I would like to thank you for this awesome project!!
I do have a problem though. I'm trying to initialize the widgets but for some reason it gets stuck (buttons show "initializing widgets" forever). I opened the browser console and saw the following error:

Uncaught (in promise) DOMException: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

Any ideas how to solve this?

Roi Weinreb
@RoiWeinreb_twitter
the above happens when I open the html file from the notebook. if I navigate to the html using its github url, I just see "initializing widgets" with no error in the console.
Varun Sundar
@varun19299

Hi, I'm trying to use nbinteract for typesetting a course (notes).

I love the binder integration and concept, but I'm still not able to figure out how I can use the css formatting of gitbook with the output html

For instance the DS100 book and the nbinteract website both use the gitbook theme
Varun Sundar
@varun19299
Hi, anyone active on this channel? Sorry to hurry you up, but an update would be nice
Sam Lau
@SamLau95
@RoiWeinreb_twitter you won't be able to view widgets through the jupyter HTML view. You should instead use the github url. If you share the github url that isn't working for you I can take a closer look
@varun19299 if you'd like to use a theme, I suggest looking at the jupyter-book project on GitHub. That will let you turn a set of notebooks into a online textbook
kgiacobbi
@kgiacobbi
hi, i would like to know if we can use ipyleaflet librairy ?
Daniel Gao
@danielgaoyy
Hi, I'm trying to include a map widget created by gmaps module in my web page. Every other widgets seem to load successfully except the map widget. The browser console suggets "Could not initiate widget". I have included gmaps in the requirements.txt, and the map widget works perfectly in my jupyter notebook. What could be the problem?
thewinner2019
@thewinner2019
@SamLau95 i have a problem with use nbinteract ,it doesn't work can you help me?
kaibawong
@kaibawong
@SamLau95 Hi sam, very cool tutorial.. unfortunately when I sahre the github url, it says initializing widgets but nothing happens. Can you take a look perhaps: https://kaibawong.github.io/nbinteract-tutorial/tutorial.html
@RoiWeinreb_twitter did you managed to solve the frozen git url with 'initializing widget' but no widget appear ? I have the same problem, will appreciate if you know the solution to this . many thanks