A new version of TwistyMol is available. It's now ready for use by others (that means YOU). Here's a simple example and here's another with a few more molecules.
What's changed since last time? Well I've added in an SDF file parser, made it possible to have multiple TwistyMols on the same page, sorted out the rotation (at least for the moment) and gone a bit overboard on the shadows. Performance on IE is still a big problem, and displaying more than a handful of molecules at the same time is out of the question (too slow). I still don't know if this is an intrinsic problem with VML or just the whole Canvas to Excanvas to VML conversion.
If you want to use it yourself, download the Javascript files referenced in the HEAD section of the demo page, and look at the code on the demo page itself. The only tricky part is getting the SDF file into Javascript - you'll either have to place it on a webserver and use an Ajax call or do as I did and convert it to a Javascript string variable (hint: read() it in with Python and convert \n to \\n).
Feel free to modify and distribute the code. You could add a comment below with a link if you use it anywhere.
This gives me an evil thought. On Mac, you can create HTML previews of documents. This includes JavaScript.
ReplyDeleteI may hack this into a molecule previewer. Sound OK to you?
Hi,
ReplyDeleteWould it be OK if I have a look at adding this to iBabel?
Chris
That would be cool and groovy respectively.
ReplyDeleteVery nice! Any plans for zoom? that would make it a nice alternative to JMol, which does take some time to load
ReplyDeleteZoom? All that stuff's working already. Try the middle or right mouse buttons.
ReplyDeleteAah; coolest!
ReplyDeleteand of course the shadows are cool :)
ReplyDelete