![]() Our script from above should now be changed to look like this: Repaints the canvas, so there is no need to use the Canvas.repaint() function at this time, so we will TheĬanvas.loadMolecule() function will then set the molecule, center it, scale it (if necessary to fit), andįinish with the necessary cheminformatics algorithms (such as finding rings, etc.). Page (The SpectrumCanvas class has an analogous loadSpectrum() function). Molecule object that is derived from any of the methods described on the previous The Canvas.loadMolecule() function takes a Now that we have created our component, we can load data into it. You may change this border, remove it, or add other styling by changing that file. ![]() ![]() Because all ChemDoodle WebĬomponents are just HTML objects, their styles can be controlled byĬSS. This is defined in theĬhemDoodleWeb.css file that you installed on your website. The page and is very useful when you want the Canvas to change after updating it.Īs an optional note, notice that there is a 1 pixel thick, black border around the component. Lastly, we called the Canvas.repaint() function at the end, this function redraws the canvas on We will just add that for debugging purposes and to show something in thisĮxample. When emptyMessage is set to a non- undefined string, the canvas will render Note that we set a variable for the canvas calledĮmptyMessage. You should see the empty ViewerCanvas displayed above. M圜anvas.emptyMessage = 'No Data Loaded!' Let m圜anvas = new ChemDoodle.ViewerCanvas('id', 150, 150) ViewerCanvas is initialized by the following code: For thorough instruction on this, see the advanced tutorial: Initializing Components after Closing the DOM.įinally, all canvas classes are accessed at the top level of the ChemDoodle variable. This method is a bit more powerful, as you can create ChemDoodle Web Components after the DOM has been closed. The component will then be created from the existing Just create the element and give it the same id you pass to the future Canvas constructor. In some cases, it may be convenient to explicitly create the element in the DOM, instead of having the ChemDoodle Web Components generate it for you. Interactive tools for investigating spectrum coordinates. displays an interactive spectrum where a user can zoom in and scale peaks. SpectrumCanvas - parent class for all canvases thatĭisplays several spectra overlaid on the same domain.Works likeĬomponent to display, animate and interact with molecular movies.Ī complete interface for interacting with 3D data. a more complex canvas that has an associated search field for accessing databases. displays an interactive 3D rendering of a molecule that can be rotated, translated and scaled. shows a rotating animation of a 3D rendering of a molecule. Simply displays a 3D rendering of a molecule. Canvas3D - parent class for all canvases that.shows any number of molecules, one at a time, with animated transitions in between. Shows a rotating animation of a molecule. Show animations provides a framework for high-quality animations. AnimatorCanvas - parent class for all canvases that.More complex canvas that has an associated search field for accessing databases. Canvas - parent class for all canvases, provides genericįunctionality for displaying chemical data.ĭisplays an image of a molecule and provides "button" functionality for users.ĭisplays an interactive molecule that can be rotated, translated and scaled.This is only aīrief overview, the instantiable canvases are individually covered in the following links. Let's briefly go over the class hierarchy for Canvas. Abstract means that the class is not instantiable and should never be called, its children should be used All canvases can be initialized by following three general steps:Īll canvases in the ChemDoodle Web Components library are children of the abstract CanvasĬlass.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |