Contents
- License
- Download
- Installation
- Community Resources
- Browser Compatibilities
- Getting Help
- Version History
The ChemDoodle Web Components library is licensed under version 3 of the GNU GENERAL PUBLIC LICENSE with the following exception:
As a special exception to the GPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference, shall be deemed a separate work for copyright law purposes. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
This means that your websites do NOT need to be released under GPL even if you call the ChemDoodle Web Components library.
Contact us for alternate licensing options.
To ensure the continued success of ChemDoodle Web Components, iChemLabs is dedicated to funding and developing this project. Please also help us by mentioning it to your colleagues and friends and placing a link to us on your webpage. If you really like ChemDoodle Web Components, you may also enjoy ChemDoodle, our advanced and affordable chemical structure environment that works on all operating systems.
Note that if you are using the 3D components, we are constantly working to ensure they are compatible with the nightly builds of Apple WebKit and Mozilla MineField. It is very possible that upgrading to a newer nightly build will produce an incompatibility. If you find that your 3D components are not working after a nightly build update, check our website and see if our demos are working. If ours are, then we have fixed the issue and you should redownload our library. We will not be announcing any fixes to the 3D ChemDoodle Web Components while WebGL is in beta status.
Download ChemDoodle Web Components v3.5.0
MD5 checksum:
d13597383ba28a26a22e16a2b03a4a06
ChemDoodleWeb.js is only
102 KB!
Installation is very simple and consists of 5 easy steps:
- Download the ChemDoodle Web Components library above
-
Install the following files on your website:
- ChemDoodleWeb.css
- ChemDoodleWeb-libs.js
- ChemDoodleWeb.js
-
Link to the essential files as URI resources in the HEAD
section of all the pages in which you would like to use the components. The meta tag listed first is to ensure that Google Chrome Frame is used in Internet Explorer.
-
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="[path]/ChemDoodleWeb.css" type="text/css">
<script type="text/javascript" src="[path]/ChemDoodleWeb-libs.js"></script>
<script type="text/javascript" src="[path]/ChemDoodleWeb.js"></script>
-
-
If using the MolGrabber
or File Loader
components, create and install the necessary server programs to access databases
or read files.
We provide 4 sample PHP scripts for accessing server-side resources:
CDWfile2js.php This script can be called to write a file on your server into a local javascript variable in the client HTML page. CDWGetLocalFile.php This script can be called to load a local file from the users computer into a FileLoader canvas. CDWProteinDataBank.php This script can be called to query the Protein Data Bank database and receive the resultant PDB file. CDWGetPubChem.php This script can be called to query the PubChem database and display the resulting mol file in a MolGrabber canvas. Use our provided PHP scripts as examples only. You should write your own server side scripts to appropriately suit your own website's security and logistic concerns.
- There are two displayable objects provided in the ChemDoodle Web Components library, Canvases and Layouts. Canvases are individual HTML5 canvas elements to display structures and draw on. Follow the instructions on the Canvases page to begin. Layouts define how one or more associated Canvas objects are laid out on a webpage and if and where other graphical decorations will be displayed (ie. for reactions). Layouts are discussed on the Layouts page. You may also refer to the samples directory of the downloaded file for complete web pages showing how to use the components.
For more advanced instruction on using ChemDoodle Web Components, calling the API, and customizing the components, please refer to the API.
- ChemSpider integrates ChemDoodle Web Components August 8, 2010
- Vladimir Vukićević presents ChemDoodle Web Components at SIGGRAPH 2010 July 29, 2010
- ChemDoodle Web Components power Dr. Samuel Bertrand's Siderophores database rendering July 22, 2010
- ChemExper uses ChemDoodle Web Components to draw molecules without Java June 15, 2010
- Harvard uses ChemDoodle Web Components to teach website development May 5, 2010
- The plate is bad talks about Javascript molecular editors on mobile devices Apr 1, 2010
- Vladimir Vukićević mentions ChemDoodle in his presentation about WebGL at the Game Developer's Conference Mar 10, 2010
- Tony Yuan discusses 3D ChemDoodle Web Components Feb 23, 2010
- Using ChemDoodle to generate ChemDoodle Web Components Feb 23, 2010
- Martin Hassman: WebGL is a paradise for chemists Feb 12, 2010
- Giles Thomas encourages WebGL development in the sciences after presenting ChemDoodle Web Components Feb 8, 2010
- The Khronos Group covers 3D ChemDoodle Web Components Feb 8, 2010
- 3D ChemDoodle Web Components announced at MacResearch Feb 8, 2010
- Peter Ertl discusses ChemDoodle Web Components in a brief review of chemical sketchers on the web Feb 2, 2010
- Christoph Steinbeck describes ChemDoodle Web Components Oct 8, 2009
- Noel O'Boyle provides a timeline of the use of Javascript in Chemistry leading up to ChemDoodle Web Components Oct 7, 2009
- ChemSpider4FriendFeed integrates ChemDoodle Web Components Oct 4, 2009
- Ajaxian briefly discusses ChemDoodle Web Components Oct 1, 2009
- ChemDoodle Web Components presented at canvasdemos Oct 1, 2009
- Protein Data Bank Demo and Canvas Technology Analysis Sept 17, 2009
- Chris Swain on ChemDoodle Web Components Aug 25, 2009
Always make sure to have the latest version of your browser installed, and recommend this to the users of your site. The browsers below are listed in order of best performance, with Apple Safari the recommended browser on Mac, and with Google Chrome the recommended browser on Windows and Linux. ChemDoodle Web Components also work very well in Mobile Safari on iPhone OS and Browser on Android. All known issues are noted.
Mac
-
Apple Safari-
perfect.
-
Google Chrome/Chromium-
perfect.
-
Mozilla Firefox-
perfect. Has a neat Save Image As..." function when right-clicking on a canvas.
-
Opera-
text placement is not ideal, but performance is good. Some arrow glyphs are not supported. Modifier keys are not recognized.
Windows
-
Google Chrome-
nearly perfect, radial gradient is reversed. Drawing spectra with many data points is slower than all other browsers.
-
Mozilla Firefox-
nearly perfect, radial gradient does not paint. Has a neat Save Image As..." function when right-clicking on a canvas.
-
Apple Safari-
nearly perfect, Transformer
component repaints very slowly while dragging.
-
Microsoft Internet Explorer-
requires Google Chrome Frame installed. Everything is identical to Google Chrome.
-
Opera-
text placement is not ideal, but performance is good. Y axis title is not rotated correctly.
Linux
-
Google Chrome/Chromium-
nearly perfect, radial gradient is reversed; incredibly fast!
-
Mozilla Firefox-
graphics are almost perfect, radial gradient does not paint, Transformer
component repaints very slowly while dragging, performance is very poor. Has a neat Save Image As..." function when right-clicking on a canvas.
-
Opera-
text placement is not ideal, but performance is good, modifier key handling is not reliable.
iPhone OS
-
Apple Mobile Safari-
almost perfect. Selection of fonts in limited. Animations are slower. All touch events and gestures are supported.
-
Opera Mini-
text is not rendered. Animations don't work. Touch events are ignored.
Android
-
Browser-
almost perfect. Selection of fonts in limited. Animations are slower. All touch events and gestures are supported. Some low powered Android devices will have difficulty loading spectra with a large number of plot points.
If you believe you have found a bug, would like to report an issue, request a feature or license change or any other form of support, please contact us.
3.5.0
August 15, 2010Executive Summary
Components for spectra and reactions have been added. The entire library has been optimized to significantly improve performance across browsers and to minimize size, including the removal of several external libraries. 3D ChemDoodle Web Components have also been optimized and updated to reflect recent retrospective changes to the development browsers.Additions
- Spectrum graphics are now provided. Added SpectrumCanvas as a child of Canvas for rendering spectra. There are currently two children, ObserverCanvas, which displays a static image of a spectrum, and PerspectiveCanvas which allows for interaction with a spectrum. Spectrum graphics are completely customizable and grids and integration lines can be shown.
- Added JCAMPInterpreter that reads JCAMP-DX spectra for the spectrum Canvases. All compressed JCAMP-DX data formats are read. Additional spectrum descriptors are also read, such as title, units, etc.
- Reactions graphics are now provided. Added a new component, Layout, which defines how multiple, related Canvases are displayed relative to each other. Currently, there is only a single Layout, SimpleReactionLayout that shows reactants and products with plus symbols in the appropriate places, as well as a reaction arrow and condition text. All decorations for Layouts are customizable.
- Charges are now rendered on molecules. Charges are now read and written by MDLInterpreter. The Doodler now manipulates charges using the + and - keys while an atom is hovered.
- Optimized the ChemDoodle Web Component library for faster loads, interpretation and runtimes.
- Hidden Carbons (those connecting two and only two bonds of the same bond order that are parallel to each other) will now have their labels drawn. The VisualSpecifications.atoms_showHiddenCarbons_2D boolean variable now controls this setting. It is true by default.
- Added more ring perception algorithms. All ring perception classes are now children of the RingFinder class which contains methods for reducing molecule graphs to improve perception runtimes. Ring perception classes include HanserRingFinder, EulerFacetRingFinder and SSSRFinder. ChemDoodle Web Components now use a more efficient means to calculate rings, rather than just using the Hanser method, leading to much faster page loads.
- Added Molecule.scaleToAverageBondLength() and Molecule.getAverageBondLength() to help in standardizing input from various sources of chemical files.
- Added Molecule.getBonds(Atom a) as a helper file to return an array of the Bonds connected to the input Atom. Removed the Molecule.getBondNumber(Atom a) function as it is now redundant. Changed the Molecule.getCoordinationNumber(Atom a) function to Molecule.getCoordinationNumber(Array bonds) to be more efficient with the added getBonds method.
- Added Bond.getLength() and Bond.getLength3D() helper methods.
- Added a new Counter class that is the parent for objects that calculate integer descriptors for molecules. Both FrerejacqueNumberCounter and NumberOfMoleculesCounter have been added.
- Setting VisualSpecifications.backgroundColor to null will now allow you to show transparent components.
- Added middlemousedown, middleclick and middlemouseup events to the Canvas class.
- File Loader now displays a message if the input file does not contain chemical or compatible data.
- The latest version of jQuery, 1.4.2, has been integrated.
- Removed the antiquated BrowserDetect external library. Replaced with simpler internal source.
- The Sylvester and glUtils external libraries have been replaced with the smaller and more efficient glMatrix library.
Fixes
- Changed the default framerate of animations to 20fps to greatly improve performance.
- Fixed a bug in the pre-handling of mobile events where coordinates were offset.
- Fixed issue where the default mobile actions for events were overridden even if the event was not supported.
- Fixed several issues in Opera, and the browser is now fairly well supported.
- Fixed bug where unsaturated terminal atoms would incorrectly stack Hydrogens vertically.
- Replaced the right-click and drag jQuery extensions with simpler and more reliable internal source. This fixes a number of inconsistencies in mouse gestures for some browsers.
- Removed unneeded source to make the library smaller and Google Closure is now used instead of Yahoo YUI to minimize and optimize the source.
- Modifier keys now call the Doodler to repaint for immediate visual feedback.
- Fixed issue where the bond highlight in the Doodler sometimes drew a full circle in Google Chrome.
- The quaternion rotations option for Transformer Canvases has been removed. The trackball external library has been removed.
- ChemDoodle Web Components will no longer hang when loading highly embedded ring systems.
- Fixed boundary conditions in Hydrogen label stacking to prefer horizontal layouts.
- Fixed issue where some rings were not discovered if the Molecule object's graph was disjoint.
- Fixed issue where empty message did not appear in Firefox.
- Stopped automatic firing of the File Loader action when loaded in Firefox.
- 3D ChemDoodle Web Components have been updated to reflect the recent retrospective changes to the browsers.
- 3D ChemDoodle Web Components now use the correct recent WebGL typed arrays.
3.1.0
July 23, 2010Executive Summary
Major additions in this release are the rendering of implicit hydrogens in 2D components and an advanced framework for handling touch events and gestures from mobile devices. iPhone OS and Android are now fully supported!Additions
The ChemDoodle Web Component framework for handling touch events and gestures from mobile devices (notably iPhone OS and Android) has been completed. The Canvas class now has 6 new optional abstract methods: touchstart, touchmove, touchend, gesturestart, gesturechange and gestureend.
Users can interact with ChemDoodle Web Components through a desktop browser using a keyboard and mouse or through a mobile browser using touch events and gestures. For desktop browsers, implement the mouse and keyboard event listeners to perform actions. On mobile devices, the touch events and gestures will be closely mapped to the most equivalent mouse and keyboard event handlers. This is perfect for simple applications as the drag, mousedown and mouseup events are closely matched to touch events. However, hovering is something that is not possible on mobile devices, so mousemove handlers will never be called. Additionally, gestures like pinching have no mouse equivalent.
To rectify this, write event handlers for any of the touch or gesture events to have mobile device interactions forwarded to more appropriate methods. If those mobile gesture handlers are implemented, the Canvas class will forward the corresponding events to them instead of to the mapped mouse and keyboard events. This way, you can implement all of the handlers for your single component and it will perform suitably on both desktop and mobile browsers!
- Implicit hydrogens are now rendered in 2D components for all atoms with visible labels. This specification is controlled by the VisualSpecifications' atoms_implicitHydrogens_2D variable which is true by default. The numbers in hydrogen labels will be properly subscripted and the hydrogens will stack depending on the orientations of bonds from the concerned atom.
- To correspond with the rendering of implicit hydrogens, a new VisualSpecifications variable, atoms_displayTerminalCarbonLabels_2D, has been added that will show carbon labels for terminal carbons. Combined with the atoms_implicitHydrogens_2D specification, methyl groups can be nicely displayed. This specification is false by default.
- Animations for Rotators and Rotator3Ds can now be toggled by double clicking on them.
Fixes
- The zoom scale for Transformer components can no longer become a negative value, which caused molecules to invert.
- The element selecting algorithm performed when setting atom labels in the Doodler component has been greatly improved to mirror how ChemDoodle works.
3.0.0
February 06, 2010Executive Summary
This release introduces 3D components based on WebGL technology to provide hardware accelerated 3D graphics in web browsers. The 3D components are in an alpha state due to the fact that the standard browsers do not yet support WebGL; they are fairly stable in the development browsers. Several prebuilt components are provided. Several visual representations are built in. An advanced Phong shader has been implemented in javascript/GLSL to provide quality graphics. A few minor issues with the 2D components have been fixed.Additions
- New 3D components have been included: Viewer3D, Rotator3D, Transformer3D and MolGrabber3D. Their implementation and functionality is very similar to their 2D analogues. The API has been updated for these new components.
Fixes
- Fixed small issue where short bond lengths were not clearing bond overlaps.
- Expanded the atomic data system to better match our ElementalData database. A new Element class has been added for storing elemental data, and an array of Elements is now provided in the ELEMENT hash array where the element symbol is the lookup key.
- Added more links and updated the browser compatibility list.
2.5.0
October 08, 2009Executive Summary
This release stabilizes the API and provides in-depth extendable functionality for creating your own custom components. The API has seen some major changes (it has been significantly improved), so make sure to review it before upgrading. jQuery has been introduced to standardize the handling of user input events, simplifying the Canvas class. Two new components have been introduced: Slideshow and Hyperlink. In addition, our test driven development suite is now exposed on the site using a modified version of QUnit. ChemDoodle Web Components 2.5 works on all major browsers, including Microsoft Internet Explorer, Mozilla Firefox, Apple Safari and Google Chrome/Chromium. Yahoo YUI Compressor is now used to minify the libs for even faster page loads.Additions
- A new Slideshow component has been added for displaying multiple molecules, one at a time, with transitions in between.
- A new Hyperlink component has been added to provide basic button-like interaction with visitors. This component is completely customizable, view the components page to see some nice examples. They can redirect users to urls or execute functions on click.
- The API for handling user input events has been changed significantly, all canvases are now extendable, and there is a new class called AnimatorCanvas to provide an extendable framework for producing animated components. The RotatorCanvas.startRotation() and RotatorCanvas.stopRotation() functions have been replaced with AnimatorCanvas.startAnimation() and AnimatorCanvas.stopAnimation() respectively. The API provided on the web is now much more thorough, better formatted, and is linked for easy navigation.
- The jQuery library is now used by the Canvas class to standardize the handling of user input events.
- Our test driven development suite is now exposed on the site using a modified version of QUnit.
- Images are now supported. You can set background images for the components, and hover images for the Hyperlinks. Images override the backgroundColor visual specification.
- Support for Google Chrome Frame has been implemented. The ChemDoodle Web Components now work beautifully on Microsoft Internet Explorer.
- Bond stereochemistry is now possible. You can specify protruding and recessed single bonds as well as ambiguous double bonds. They are drawn as solid and dashed wedges and a crossing double bond.
- New visual specifications added: atom label buffer, wedge thickness, hash width, hash spacing.
- Added another algorithm to the TransformCanvas for standard x and y axis 3D rotation. This is the default, as there seems to be an issue with quaternion rotations, where some mouse directions are reversed. To enable quaternion rotations, set the TransformCanvas.useQuaternions boolean to true.
- A new MolGrabberCanvas function, setSearchTerm(), has been added to preset a term to be queried on page load.
- Google Chromium added to the list of supported Linux browsers, and it works very, very well with the ChemDoodle Web Components.
- Yahoo YUI Compressor is now used to minify the the libs for even faster page loads.
- Added more links to the Community Resources section. If you have discussed or used the ChemDoodle Web Components, let us know and we will add a link to you as well.
Fixes
- Fixed issue where strokeStyle was not being set when drawing atoms as circles, leading to unexpected graphical effects when specifying bonds_JMOLColors to true. The strokeStyle is now set to 'black'.
2.1.0
September 14, 2009Executive Summary
This release adds new functionality and fixes some minor issues. For a nice demo of the enhanced ChemDoodle Web Components, visit web.chemdoodle.com/pdb.php.Additions
- Sample PHP code for querying the RCSB Protein Data Bank has been added.
- The ability to read PDB files has been added, along with a new Angstroms per bond length visual specification.
- Both atoms and bonds within a molecule can now be sorted by z coordinates.
- Covalent bonds can now be calculated based on covalent radii.
- Added new functions for manipulating 3D coordinates between atoms.
- New visual specifications for contrasting bond overlaps.
- A function to remove Hydrogens and their bonds.
- Added a function to copy structures.
- The API has been completed.
Fixes
- When reading MOLFiles, the y coordinate is now flipped so that structures appear right side up on the inverted canvas.
- MOLFile output is now centered first.
- Fixed minor bug that mishandled null content sent to writeMOL(content).
- Fixed bug where strokeStyle was bring set for atom circle width instead of the correct lineWidth property.
- Submit button names no longer cause conflicts.
2.0.0
August 16, 2009Initial public release.
1.0.0
June 15, 2009Initial internal release.