Re: [jupyter] Re: jupyterlab version of vpython

2018-05-22 Thread Matt Craig
I'm a little biased, but like the idea of moving towards an 
ipywidgets-based interaction with the notebook (i.e. vpython as a 
widget)can probably help with that later this summer once SciPy is done 
:)

Matt


On Tuesday, May 22, 2018 at 10:45:36 AM UTC-5, Jason Grout wrote:
>
> Right, JLab uses it's own extension system, and webpack to bundle 
> javascript up, and does not use require or the nbextension system.
>
> I think maybe you can do something like this for the first steps:
>
> 1. Write an npm package containing the vpython javascript. JLab extensions 
> are fundamentally npm packages containing some extra metadata.
> 2. Write a very simple extension (perhaps like the beginning steps of the 
> xkcd extension?) whose sole purpose is to get the js on the page. You do 
> this by importing the vpython js modules into your main extension file that 
> JupyterLab loads.
> 3. Decide how vpython is going to display. It seems that there are lots of 
> parallels with ipywidgets and vpython, so you might look to ipywidgets for 
> inspiration. For example, we now display using the ipython display system 
> and a custom widget mimetype and custom mimetype renderer.
>
> Jason
>
>
> On Tue, May 22, 2018 at 7:10 AM Steve Spicklemire  > wrote:
>
>> My understanding is that webpack is used, but that’s based on the 
>> tutorials I read. Have I got that right?
>>
>> thanks,
>> -steve
>>
>> > On May 22, 2018, at 10:02 AM, John  
>> wrote:
>> > 
>> > For classic jupyter notebook, vpython is copying javascript files to 
>> the nbextensions directory by calling the routine
>> > 
>> > notebook.nbextensions.install_nbextension()
>> > 
>> > from the vpython package directory. 
>> (site-packages/vpython/vpython_libraries/) . These javascript files are 
>> loaded into the notebook from the nbextensions directory using ipython 
>> display method along with requirejs.
>> > 
>> > 
>> display(Javascript("""require(["nbextensions/vpython_libraries/glowcomm"], 
>> function(){console.log("GLOWCOMM LOADED");})"""))
>> > This works in classic jupyter notebook but not in Jupyterlab . Does 
>> jupyterlab use the nbextensions directory or does it is place javascript 
>> fles in a different directory. What should be used in place of requirejs to 
>> load javascript files?
>> > 
>> > 
>> > 
>> > 
>> > On Tuesday, May 22, 2018 at 6:11:57 AM UTC-7, Steve Spicklemire wrote:
>> > Hi Jupyter folks,
>> > 
>> > I'm hoping to carve out some time in the next few weeks to make some 
>> serious progress on a jupyterlab compatible version of vpython (
>> http://vpython.org).
>> > 
>> > The jupyter notebook interaction of vpython involves opening a 
>> communication channel (ipykernel.comm.Comm) between the kernel process and 
>> a javascript program running in the browser handling the display. The 
>> javascript code is currently embedded in the python package 
>> (site-packages/vpython/vpython_libraries/) and transferred into 
>> nbextensions on demand and then pulled into the notebook using 
>> ipython.display.display.
>> > 
>> > It has been suggested that this whole scheme needs to be redesigned 
>> under jupyterlab. I'm hoping to begin that design process now, but being 
>> new to jupyterlab, I'm not really sure where to begin. I did read through 
>> the tutorials for jupyterlab extensions, but I'm not clear what sort of 
>> extension would be needed here since it doesn't seem to exactly match the 
>> use cases described in the exam extensions. I'd love some input from any 
>> jupyterlab veterans about how we should go about planning/building this. 
>> Ideally users would be able to take code that works in the jupyter 
>> notebook, and run it unchanged in jupyterlab.
>> > 
>> > something like:
>> > 
>> > ---
>> > from vpython import *
>> > 
>> > s=sphere()
>> > 
>> > 
>> > 
>> > without needing any magics or other python code if possible.
>> > 
>> > thanks,
>> > -steve
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "Project Jupyter" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to jupyter+u...@googlegroups.com .
>> > To post to this group, send email to jup...@googlegroups.com 
>> .
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/279ebceb-50f6-49fb-aae2-f3e74cf04009%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jupyter+u...@googlegroups.com .
>> To post to this group, send email to jup...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/6BE31AFE-8531-4261-B191-91E989974474%40gmail.com
>> .
>> For more options, visit 

Re: [jupyter] Re: jupyterlab version of vpython

2018-05-22 Thread Jason Grout
Right, JLab uses it's own extension system, and webpack to bundle
javascript up, and does not use require or the nbextension system.

I think maybe you can do something like this for the first steps:

1. Write an npm package containing the vpython javascript. JLab extensions
are fundamentally npm packages containing some extra metadata.
2. Write a very simple extension (perhaps like the beginning steps of the
xkcd extension?) whose sole purpose is to get the js on the page. You do
this by importing the vpython js modules into your main extension file that
JupyterLab loads.
3. Decide how vpython is going to display. It seems that there are lots of
parallels with ipywidgets and vpython, so you might look to ipywidgets for
inspiration. For example, we now display using the ipython display system
and a custom widget mimetype and custom mimetype renderer.

Jason


On Tue, May 22, 2018 at 7:10 AM Steve Spicklemire <
stevespicklem...@gmail.com> wrote:

> My understanding is that webpack is used, but that’s based on the
> tutorials I read. Have I got that right?
>
> thanks,
> -steve
>
> > On May 22, 2018, at 10:02 AM, John  wrote:
> >
> > For classic jupyter notebook, vpython is copying javascript files to the
> nbextensions directory by calling the routine
> >
> > notebook.nbextensions.install_nbextension()
> >
> > from the vpython package directory.
> (site-packages/vpython/vpython_libraries/) . These javascript files are
> loaded into the notebook from the nbextensions directory using ipython
> display method along with requirejs.
> >
> >
> display(Javascript("""require(["nbextensions/vpython_libraries/glowcomm"],
> function(){console.log("GLOWCOMM LOADED");})"""))
> > This works in classic jupyter notebook but not in Jupyterlab . Does
> jupyterlab use the nbextensions directory or does it is place javascript
> fles in a different directory. What should be used in place of requirejs to
> load javascript files?
> >
> >
> >
> >
> > On Tuesday, May 22, 2018 at 6:11:57 AM UTC-7, Steve Spicklemire wrote:
> > Hi Jupyter folks,
> >
> > I'm hoping to carve out some time in the next few weeks to make some
> serious progress on a jupyterlab compatible version of vpython (
> http://vpython.org).
> >
> > The jupyter notebook interaction of vpython involves opening a
> communication channel (ipykernel.comm.Comm) between the kernel process and
> a javascript program running in the browser handling the display. The
> javascript code is currently embedded in the python package
> (site-packages/vpython/vpython_libraries/) and transferred into
> nbextensions on demand and then pulled into the notebook using
> ipython.display.display.
> >
> > It has been suggested that this whole scheme needs to be redesigned
> under jupyterlab. I'm hoping to begin that design process now, but being
> new to jupyterlab, I'm not really sure where to begin. I did read through
> the tutorials for jupyterlab extensions, but I'm not clear what sort of
> extension would be needed here since it doesn't seem to exactly match the
> use cases described in the exam extensions. I'd love some input from any
> jupyterlab veterans about how we should go about planning/building this.
> Ideally users would be able to take code that works in the jupyter
> notebook, and run it unchanged in jupyterlab.
> >
> > something like:
> >
> > ---
> > from vpython import *
> >
> > s=sphere()
> >
> > 
> >
> > without needing any magics or other python code if possible.
> >
> > thanks,
> > -steve
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Project Jupyter" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to jupyter+unsubscr...@googlegroups.com.
> > To post to this group, send email to jupyter@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/279ebceb-50f6-49fb-aae2-f3e74cf04009%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/6BE31AFE-8531-4261-B191-91E989974474%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHx%2BQ7SBg9DmnNygf0j_9dXkj6MWdVN8-ieKi0GKj%2Bfkcg%40mail.gmail.com.

Re: [jupyter] Re: jupyterlab version of vpython

2018-05-22 Thread Steve Spicklemire
My understanding is that webpack is used, but that’s based on the tutorials I 
read. Have I got that right?

thanks,
-steve

> On May 22, 2018, at 10:02 AM, John  wrote:
> 
> For classic jupyter notebook, vpython is copying javascript files to the 
> nbextensions directory by calling the routine
> 
> notebook.nbextensions.install_nbextension()
> 
> from the vpython package directory. 
> (site-packages/vpython/vpython_libraries/) . These javascript files are 
> loaded into the notebook from the nbextensions directory using ipython 
> display method along with requirejs.
> 
> display(Javascript("""require(["nbextensions/vpython_libraries/glowcomm"], 
> function(){console.log("GLOWCOMM LOADED");})"""))
> This works in classic jupyter notebook but not in Jupyterlab . Does 
> jupyterlab use the nbextensions directory or does it is place javascript fles 
> in a different directory. What should be used in place of requirejs to load 
> javascript files?
> 
> 
> 
> 
> On Tuesday, May 22, 2018 at 6:11:57 AM UTC-7, Steve Spicklemire wrote:
> Hi Jupyter folks,
> 
> I'm hoping to carve out some time in the next few weeks to make some serious 
> progress on a jupyterlab compatible version of vpython (http://vpython.org).
> 
> The jupyter notebook interaction of vpython involves opening a communication 
> channel (ipykernel.comm.Comm) between the kernel process and a javascript 
> program running in the browser handling the display. The javascript code is 
> currently embedded in the python package 
> (site-packages/vpython/vpython_libraries/) and transferred into nbextensions 
> on demand and then pulled into the notebook using ipython.display.display.
> 
> It has been suggested that this whole scheme needs to be redesigned under 
> jupyterlab. I'm hoping to begin that design process now, but being new to 
> jupyterlab, I'm not really sure where to begin. I did read through the 
> tutorials for jupyterlab extensions, but I'm not clear what sort of extension 
> would be needed here since it doesn't seem to exactly match the use cases 
> described in the exam extensions. I'd love some input from any jupyterlab 
> veterans about how we should go about planning/building this. Ideally users 
> would be able to take code that works in the jupyter notebook, and run it 
> unchanged in jupyterlab.
> 
> something like:
> 
> ---
> from vpython import *
> 
> s=sphere()
> 
> 
> 
> without needing any magics or other python code if possible.
> 
> thanks,
> -steve
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jupyter/279ebceb-50f6-49fb-aae2-f3e74cf04009%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/6BE31AFE-8531-4261-B191-91E989974474%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Re: jupyterlab version of vpython (was jupyterlab version of python)

2018-05-22 Thread Steve Spicklemire
Ack! Of course my browser cleverly turned "vpython" into "python" and I 
didn't catch it!

sorry.
-steve

On Tuesday, May 22, 2018 at 9:11:57 AM UTC-4, Steve Spicklemire wrote:
>
> Hi Jupyter folks,
>
> I'm hoping to carve out some time in the next few weeks to make some 
> serious progress on a jupyterlab compatible version of vpython (
> http://vpython.org).
>
> The jupyter notebook interaction of vpython involves opening a 
> communication channel (ipykernel.comm.Comm) between the kernel process and 
> a javascript program running in the browser handling the display. The 
> javascript code is currently embedded in the python package 
> (site-packages/vpython/vpython_libraries/) 
> and transferred into nbextensions on demand and then pulled into the 
> notebook using ipython.display.display.
>
> It has been suggested that this whole scheme needs to be redesigned under 
> jupyterlab. I'm hoping to begin that design process now, but being new to 
> jupyterlab, I'm not really sure where to begin. I did read through the 
> tutorials for jupyterlab extensions, but I'm not clear what sort of 
> extension would be needed here since it doesn't seem to exactly match the 
> use cases described in the exam extensions. I'd love some input from any 
> jupyterlab veterans about how we should go about planning/building this. 
> Ideally users would be able to take code that works in the jupyter 
> notebook, and run it unchanged in jupyterlab.
>
> something like:
>
> ---
> from vpython import *
>
> s=sphere()
>
> 
>
> without needing any magics or other python code if possible.
>
> thanks,
> -steve
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/d715af03-d022-48b5-bacd-562352eced55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.