<p dir="ltr"><br>
On Oct 1, 2015 8:08 AM, "Kiko" <<a href="mailto:kikocorreoso@gmail.com">kikocorreoso@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> 2015-10-01 14:45 GMT+02:00 Gijs Molenaar <<a href="mailto:gijsmolenaar@gmail.com">gijsmolenaar@gmail.com</a>>:<br>
>><br>
>> 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:<br>
>><br>
>> <a href="http://js9.si.edu/">http://js9.si.edu/</a><br>
>><br>
>> You can find my initial work here:<br>
>><br>
>> <a href="https://github.com/gijzelaerr/js9notebook">https://github.com/gijzelaerr/js9notebook</a><br>
>><br>
>> 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. <br>
>><br>
>> <a href="https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18">https://github.com/gijzelaerr/js9notebook/blob/master/js9notebook/__init__.py#L18</a><br>
>><br>
>> 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:<br>
>><br>
>> <a href="https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb">https://github.com/gijzelaerr/js9notebook/blob/master/example/js9notebook.ipynb</a><br>
>><br>
>> So basically I have two questions:<br>
>><br>
>>  * 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?<br>
>>  * What am I doing wrong loading javascript this way?<br>
>><br>
>><br>
>> Greetings,<br>
><br>
><br>
> Hi,<br>
><br>
> Maybe the following links can help you to find the path:<br>
><br>
> <a href="https://github.com/jdfreder/jupyter-pip">https://github.com/jdfreder/jupyter-pip</a><br>
> <a href="https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter">https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter</a><br>
>  <br>
> If you are successfull and you have time it would be great to document it.</p>
<p dir="ltr">is this similar to the pattern your are looking for? <br>
<a href="https://github.com/ricklupton/ipython-d3-sankey/blob/master/setup.py">https://github.com/ricklupton/ipython-d3-sankey/blob/master/setup.py</a></p>
<p dir="ltr">><br>
> :-D<br>
><br>
>><br>
>> -- <br>
>> Gijs Molenaar<br>
>> <a href="http://pythonic.nl">http://pythonic.nl</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> IPython-dev mailing list<br>
>> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
>> <a href="https://mail.scipy.org/mailman/listinfo/ipython-dev">https://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> IPython-dev mailing list<br>
> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
> <a href="https://mail.scipy.org/mailman/listinfo/ipython-dev">https://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
><br>
</p>