[IPython-dev] embedding js9 into a notebook

Gijs Molenaar gijsmolenaar at gmail.com
Thu Oct 1 09:16:04 EDT 2015


Hi Kiko,

I was looking into extensions, but wasn't sure if that was the right way to
go. As far is I know for example bokeh is not an extension. Also as far as
I know one needs to manually enable an extension to use them. Please
correct me if i'm wrong.

greetings,

 - Gijs

2015-10-01 15:08 GMT+02:00 Kiko <kikocorreoso at gmail.com>:

>
>
> 2015-10-01 14:45 GMT+02:00 Gijs Molenaar <gijsmolenaar at gmail.com>:
>
>> Hi all!  I'm trying to embed JS9 into a notebook, but I'm not successful
>> yet. I hope this is the right place to ask a question about this. JS9 is
>> the javascript version of DS9, an astronomical image viewer:
>>
>> http://js9.si.edu/
>>
>> You can find my initial work here:
>>
>> https://github.com/gijzelaerr/js9notebook
>>
>> I could not really find documentation on how to create such a thing. My
>> idea was to create a python package which you can pip and load, just like
>> bokeh works.  I see multiple ways you can inject javascript into the
>> browser from the python code, but I think using
>> IPython.core.displaypub.publish_display_data is probably best.
>>
>>
>> https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18
>>
>> I was assuming reading the javascript file like this and then executing
>> it with publish_display_data would be the same as loading it with a script
>> tag, but I keep getting all kind of errors about objects not defined:
>>
>>
>> https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb
>>
>> So basically I have two questions:
>>
>>  * Is this the right way to do such a thing? I find it a bit hard to find
>> out where the problems are, isn't it possible to serve the javascript
>> somewhere static?
>>  * What am I doing wrong loading javascript this way?
>>
>>
>> Greetings,
>>
>
> Hi,
>
> Maybe the following links can help you to find the path:
>
> https://github.com/jdfreder/jupyter-pip
>
> https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter
>
> If you are successfull and you have time it would be great to document it.
>
> :-D
>
>
>> --
>> Gijs Molenaar
>> http://pythonic.nl
>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
Gijs Molenaar
http://pythonic.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20151001/b6bfff9a/attachment.html>


More information about the IPython-dev mailing list