[IPython-dev] Notebook + WebGL = Molecule Drawer?
Patrick Fuller
patrickfuller at gmail.com
Wed Mar 20 16:00:08 EDT 2013
I switched it over to js. Seems cleaner. Thanks again!
On Tue, Mar 19, 2013 at 4:19 PM, Brian Granger <ellisonbg at gmail.com> wrote:
> We define the uuid function in the utils.js file and it is available in
> the output context as utils.uuid. But you can also do this from python as
> you have done...
>
>
> On Tue, Mar 19, 2013 at 3:55 PM, Patrick Fuller <patrickfuller at gmail.com>wrote:
>
>> Hi Brian,
>>
>> You did. In IPython/lib/xtk.py, you id'd your divs as
>>
>> var id = 'xtkwidget_' + utils.uuid();var xtkdiv = $('<div/>').attr('id',id);
>>
>> Is this uuid method something inherent in IPython? It seems to be working
>> without me importing anything external into the js, so I'm assuming so.
>>
>> Regards,
>> Pat
>>
>>
>> On Tue, Mar 19, 2013 at 3:24 PM, Brian Granger <ellisonbg at gmail.com>wrote:
>>
>>> I seem to recall that I had solved this by adding special ids to the
>>> divs that were created. Did you look at the code in my repo? I would
>>> rather not get into the habit of creating output divs that are outside of
>>> the output areas. It makes it much more difficult to think about exporting
>>> that to other formats.
>>>
>>> Cheers,
>>>
>>> Brian
>>>
>>>
>>> On Tue, Mar 19, 2013 at 12:35 PM, Patrick Fuller <
>>> patrickfuller at gmail.com> wrote:
>>>
>>>> Hm, the xtk-basic-example suffers from the same issue I'm having - if
>>>> you run the same sample code in two different cells, it doesn't know what
>>>> to do. The easy solution is to carve out a div independent of the notebook
>>>> flow and use that to display all js stuff. I'll just do that.
>>>>
>>>>
>>>> On Tue, Mar 19, 2013 at 12:17 PM, Patrick Fuller <
>>>> patrickfuller at gmail.com> wrote:
>>>>
>>>>> Thanks, guys!
>>>>>
>>>>> I wrapped my js example in some Python and made a repo:
>>>>> https://github.com/patrickfuller/imolecule. I'll read through the
>>>>> examples posted and see if I can clean up my approach. Going off of the
>>>>> browser screenshot alone, I like the idea of generating a single static div
>>>>> to display the output of js execution.
>>>>>
>>>>>
>>>>> On Tue, Mar 19, 2013 at 11:56 AM, Brian Granger <ellisonbg at gmail.com>wrote:
>>>>>
>>>>>> Here is the most up to date IPython repo with XTK stuff:
>>>>>>
>>>>>> https://github.com/ellisonbg/ipython/tree/xtk
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 19, 2013 at 11:52 AM, Rich Stoner <stonerri at gmail.com>wrote:
>>>>>>
>>>>>>> Patrick et. al,
>>>>>>>
>>>>>>> Here is the xtk-ipython repo:
>>>>>>> https://github.com/richstoner/xtk-ipython-examples
>>>>>>>
>>>>>>> I think that, as part of the plans to eliminate arbitrary js
>>>>>>> execution at the notebook interface, building out wrappers around the
>>>>>>> larger js frameworks makes a lot of sense. This is the approach taken here:
>>>>>>> https://github.com/fperez/xtk-ipython
>>>>>>>
>>>>>>>
>>>>>>> Best -
>>>>>>>
>>>>>>> Rich
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Mar 19, 2013 at 9:08 AM, Patrick Fuller <
>>>>>>> patrickfuller at gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi guys,
>>>>>>>>
>>>>>>>> I think that my little demo is more about the potential of webGL +
>>>>>>>> IPython than about the molecule drawer itself. If a bigger project like XTK
>>>>>>>> can be ported easily, it could open up a lot of doors for IPython tools.
>>>>>>>>
>>>>>>>> Anyway, I'll look through the xtk + ipython examples soon and throw
>>>>>>>> this molecule drawer idea into a new repo. If webgl + ipython picks up,
>>>>>>>> it'll be around.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Pat
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Mar 18, 2013 at 10:14 PM, Rich Stoner <stonerri at gmail.com>wrote:
>>>>>>>>
>>>>>>>>> Patrick,
>>>>>>>>>
>>>>>>>>> I have working examples of Ipython + XTK (https://github.com/xtk/X).
>>>>>>>>> It's not the cleanest implementation but I'll throw it on Github later
>>>>>>>>> tonight/tomorrow.
>>>>>>>>>
>>>>>>>>> Best -
>>>>>>>>>
>>>>>>>>> Rich
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Mar 18, 2013 at 6:40 PM, Brian Granger <
>>>>>>>>> ellisonbg at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Patrick,
>>>>>>>>>>
>>>>>>>>>> Hi, this is really exciting to see people doing things like this.
>>>>>>>>>> This Fall we will be working on our APIs for this stuff - we are hoping to
>>>>>>>>>> make it easier - please keep in touch as things move forward.
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>>
>>>>>>>>>> Brian
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Mar 18, 2013 at 5:20 PM, Patrick Fuller <
>>>>>>>>>> patrickfuller at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>
>>>>>>>>>>> I was at Pycon yesterday and saw a really cool IPython notebook
>>>>>>>>>>> + HTML5 talk by Matt Davis. Motivated by the talk, I was curious to see if
>>>>>>>>>>> I could get WebGL running via three.js, so I went ahead and wrote an
>>>>>>>>>>> interactive molecule viewer.
>>>>>>>>>>>
>>>>>>>>>>> [image: Inline image 1]
>>>>>>>>>>>
>>>>>>>>>>> FYI, it's a lazy first-pass port of another molecule viewer I
>>>>>>>>>>> wrote <http://www.patrick-fuller.com/molecule-viewer-alpha/>,
>>>>>>>>>>> which is itself a lazy first pass at learning webGL... which leads me to
>>>>>>>>>>> some questions :-)
>>>>>>>>>>>
>>>>>>>>>>> -
>>>>>>>>>>>
>>>>>>>>>>> I'm confident that I'm misusing the Javascript and HTMLobjects. The
>>>>>>>>>>> Javascript docstring talks about a generated element object,
>>>>>>>>>>> but I couldn't get jQuery to bind to it. My current selector is
>>>>>>>>>>> "div.molecule", which runs into some fairly obvious problems
>>>>>>>>>>> when you draw more than one molecule.
>>>>>>>>>>> -
>>>>>>>>>>>
>>>>>>>>>>> I have no idea what the javascript variable scopes look
>>>>>>>>>>> like. Am I in danger of overwriting something important to IPython?
>>>>>>>>>>>
>>>>>>>>>>> Also, is there any general interest out there in exploring
>>>>>>>>>>> ipython notebook + webgl further? Are there other projects that do so?
>>>>>>>>>>>
>>>>>>>>>>> Thanks for hearing me out (and working on such a cool
>>>>>>>>>>> open-source project!),
>>>>>>>>>>> Pat
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> IPython-dev mailing list
>>>>>>>>>>> IPython-dev at scipy.org
>>>>>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Brian E. Granger
>>>>>>>>>> Cal Poly State University, San Luis Obispo
>>>>>>>>>> bgranger at calpoly.edu and ellisonbg at gmail.com
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> IPython-dev mailing list
>>>>>>>>>> IPython-dev at scipy.org
>>>>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> IPython-dev mailing list
>>>>>>>>> IPython-dev at scipy.org
>>>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> IPython-dev mailing list
>>>>>>>> IPython-dev at scipy.org
>>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> IPython-dev mailing list
>>>>>>> IPython-dev at scipy.org
>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Brian E. Granger
>>>>>> Cal Poly State University, San Luis Obispo
>>>>>> bgranger at calpoly.edu and ellisonbg at gmail.com
>>>>>>
>>>>>> _______________________________________________
>>>>>> IPython-dev mailing list
>>>>>> IPython-dev at scipy.org
>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Brian E. Granger
>>> Cal Poly State University, San Luis Obispo
>>> bgranger at calpoly.edu and ellisonbg at gmail.com
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
>
> --
> Brian E. Granger
> Cal Poly State University, San Luis Obispo
> bgranger at calpoly.edu and ellisonbg at gmail.com
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130320/167f6b8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 159383 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130320/167f6b8e/attachment.png>
More information about the IPython-dev
mailing list