Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WebGL ChemDoodle viewer if supported #4

Merged
merged 12 commits into from Feb 5, 2015
Merged

Conversation

mcs07
Copy link

@mcs07 mcs07 commented Feb 5, 2015

This should gracefully fall back to the old style viewer in older versions of OS X, but I haven't tested.

There are a few other minor changes as well, each individual commit should be fairly self explanatory.

The HTML template is a bit unwieldy with large portions of embedded javascript and CSS, so this moves them into their own files and then embeds them in the same way as ChemDoodle and the template variables.
Pass PDB and CIF files straight to ChemDoodle. For all other files, use Open Babel if available to convert to ChemDoodle JSON and pass that to ChemDoodle.
The function now returns a copy of the molecule so we can have differently scaled molecules for each viewer canvas.
Render slightly larger, increase buffer between bonds and element labels, and allow zooming and rotation.
This allows for better 3D rendering in general, and unit cell display with CIFs.
If the user has other chemistry apps installed, they can re-assign the UTI of files to something else. By adding those UTIs to `LSItemContentTypes` we register ChemLook as still being able to preview them.
@ghutchis
Copy link
Owner

ghutchis commented Feb 5, 2015

I'm actually going to switch from ChemDoodle for WebGL to a different package (http://3dmol.csb.pitt.edu) but I appreciate the commit.. definitely a big improvement.

ghutchis added a commit that referenced this pull request Feb 5, 2015
Use WebGL ChemDoodle viewer if supported
@ghutchis ghutchis merged commit daf51b5 into ghutchis:master Feb 5, 2015
@mcs07 mcs07 deleted the cd7 branch February 6, 2015 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants