Skip to main content

Advertisement

Figure 1 | Journal of Cheminformatics

Figure 1

From: ChemDoodle Web Components: HTML5 toolkit for chemical graphics, interfaces, and informatics

Figure 1

JavaScript code for creating an instance of a Viewer component on a web page. The ChemDoodle Web Components library is A included in the web page using the <script> tag. B The Viewer component is initialized with the ‘new’ keyword and is provided an identifying name, and dimensions of width and height. C The style of the Viewer <canvas> and its contents can be optionally customized from default settings. D Molecular data is loaded into the viewer. Here, the contents of a MOL file are first read by CWC, converted into a molecule object, and then loaded in the component. The molecule is automatically centered and scaled to fit the <canvas>.

Back to article page