Tuesday, 13 January 2009

Molecular viewer now works on Internet Explorer

I've managed to get my mimimal molecular viewer (see previous post) working on Internet Explorer. Smooth, it is not, but at least it works (I recommend Firefox instead). I've also renamed it to TwistyMol. Minimol sounded a bit boring, like Microsoft. You can try it out here.

So what was the problem with Internet Explorer? Well, for graphics, TwistyMol uses processing.js which draws the molecule using the Canvas tag. Unfortunately, Internet Explorer is the only browser that doesn't support Canvas; instead, it has invented its own system called VML (Vector Markup Language). So, for IE users, I need to import the ExplorerCanvas Javascript library developed by Google; this converts all calls to Canvas to their equivalent in VML. (I also needed to make a few changes to processing.js to enable IE support.)

Next steps - sort out the rotation (Simon suggested a possible solution), turn the Javascript into proper Javascript (encapsulate it a bit), stick in a file format parser (I'm hoping Rich will come through on this one), and deploy to the masses.

1 comment:

Rich Apodaca said...

Great job, Noel!

"stick in a file format parser (I'm hoping Rich will come through on this one)"

For progress, check out this and this.