API

Hierarchy

Documentation

ChemDoodle

this package is the root for all contents of the ChemDoodle Web Components library. It contains access to all packages, canvases and layouts as well as shortcut functions for common tasks.

  • static Array ELEMENT: a hashmap for elemental data where the element’s symbol is the key and the corresponding Element data structure is the value
  • static Array RESIDUE: a hashmap for residue data where the residue’s symbol is the key and the corresponding Residue data structure is the value
  • static Array SYMBOLS: a numbered Array containing all element symbols, where the index is the element’s atomic number – 1 (index starts at 0 for hydrogen)
  • static Function getVersion(): returns the version of the ChemDoodle Web Components library; changing this value in source is not recommended
  • static Function readCIF(String content, Number xSuper, Number ySuper, Number zSuper): shortcut method to read a CIF file and return the corresponding Molecule and unit cell shape without instantiating a CIFInterpreter; the returned object will contain two parameters, molecule and unitCell; the three optional integers specify the supercell dimensions, by default they are all 1, so reading a file without specifying these parameters will produce just the unit cell. In addition to reading atoms from CIF files, this interpreter will also produce a unit cell and other objects relevant to the display of periodic information
    returns Object
  • static Function readCML(): shortcut method to read CML and return the corresponding reaction data without instantiating an CMLInterpreter
    returns Object
  • static Function readJCAMP(String content): shortcut method to read a IUPAC JCAMP-DX file and return the corresponding Spectrum without instantiating a JCAMPInterpreter; this shortcut method will automatically convert HZ to PPM
    returns Spectrum
  • static Function readJSON(String content): shortcut method to read ChemDoodle JSON from a string and return an object with two parameters, molecules and shapes, without instantiating a JSONInterpreter; this function will automatically handle the type of JSON object received
    returns Molecule
  • static Function readMOL(String content, Number multiplier): shortcut method to read a MDL MOLFile and return the corresponding Molecule without instantiating a MOLInterpreter; the optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Ängstroms
    returns Molecule
  • static Function readPDB(String content, Number multiplier): shortcut method to read a RCSB PDB file and return the corresponding Molecule without instantiating a PDBInterpreter; the optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Ängstroms. In addition to reading atoms from PDB files, this interpreter will also read residue data and generate ribbons and cartoons for that data
    returns Molecule
  • static Function readRXN(String content, Number multiplier): shortcut method to read a MDL RXNFile and return the corresponding reaction data without instantiating an RXNInterpreter; the optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Ängstroms
    returns Object
  • static Function readXYZ(String content): shortcut method to read a XYZ file and return the corresponding Molecule without instantiating a XYZInterpreter
    returns Molecule
  • static Function writeCML(Array
    Unit: molecules): shortcut method to write an CML File given an input Molecule array without instantiating an CMLInterpreter
    returns String
  • static Function writeJSON(Array mols, Array shapes): shortcut method to write ChemDoodle JSON into a string given input Molecule and Shape arrays without instantiating a JSONInterpreter
    returns String
  • static Function writeMOL(Molecule mol): shortcut method to write an MDL MOLFile given an input Molecule without instantiating a MOLInterpreter
    returns String
  • static Function writeRXN(Array
    Unit: molecules, Array
    Unit: shapes): shortcut method to write an MDL RXNFile given an input Molecule array and Shape array without instantiating an RXNInterpreter
    returns String

ChemDoodle._Canvas

is the parent class for all ChemDoodle Web Component Canvases, it should not be instantiated. Its basic functionality allows for molecules to be drawn and loaded. This class also hosts the system for handling user input events from the mouse and the keyboard. This class should be extended for custom canvases.

constructor = new Function _Canvas()

  • String id: the HTML id of the associated HTML element
  • Integer width: the width the associated HTML element
  • Integer height: the height of the associated HTML element
  • VisualSpecifications specs: the visual specifications that define how content should be painted
  • Array molecules: an array of Molecule data structures that the Canvas renders
  • Array shapes: an array of Shape data structures that the Canvas renders
  • String emptyMessage: the message to be displayed if there is no content currently present for the canvas to render. If this variable is undefined, no message is displayed if there is no content
  • Image image: the background image, overrides the VisualSpecification backgroundColor property; if undefined, no image is drawn
  • Function addMolecule(Molecule mol): loads the given Molecule, mol, and checks it; the current content of the canvas is not cleared, the input mol is pushed as the next element of the molecules array; repaints canvas
  • Function addShape(_Shape shape): loads the given Shape, shape; the current content of the canvas is not cleared, the input shape is pushed as the next element of the shapes array; repaints canvas
  • Function bondExists(Atom a1, Atom a2): returns true if a bond exists in one of the Canvas’s molecules that contains the two parameter atoms
    returns Boolean
  • Function center(): centers the loaded content in the canvas
  • Function clear(): clears the canvas by emptying the molecules and shapes arrays and then repaints; resets the scale back to 1
  • Function create(String id, Integer width, Integer height): this function places the canvas in the HTML page and is called in every constructor of the children classes. The id is the HTML id of the canvas element, with width and height its dimensions
  • Function getAllAtoms(): returns an Array containing all of the atoms of the molecules contained within the canvas
    returns Array
  • Function getAllPoints(): returns an Array containing all of the Atoms of the molecules and Points of the shapes contained within the canvas
    returns Array
  • Function getBond(Atom a1, Atom a2): returns the bond present in the Canvas’s molecules that contains the two parameter atoms; if such a bond does not exist, undefined is returned
    returns Bond
  • Function getContentBounds(): returns a Bounds object containing the 2D bounds of all of the graphics in the Canvas
    returns Bounds
  • Function getMolecule(): returns the first Molecule element in the molecules array currently associated with the canvas
    returns Molecule
  • Function getMoleculeByAtom(Atom a): returns the Molecule in the Canvas’s molecules array that contains the parameter atom; if such a molecule does not exist, undefined is returned
    returns Molecule
  • Function getMolecules(): returns the Canvas’s array of Molecule objects
    returns Array
    Unit: Molecule
  • Function loadContent(Array mols
    Unit: Molecule, Array shapes
    Unit: Shape): loads the given Molecules and Shapes in the provided mols and shapes Arrays; the current content of the canvas is cleared, the input arrays become the new molecules and shapes Arrays; checks molecules and repaints canvas
  • Function loadMolecule(Molecule mol): loads the given Molecule, mol, and checks it; the current content of the canvas is cleared, the input mol is placed as the first element of the molecules array; repaints canvas
  • Function prehandleEvent(Event e): conditions the user input event and sets a new variable in the Event object named p that contains the coordinates of the event in the canvas
  • Function removeMolecule(Molecule mol): removes the given Molecule, mol from the molecules array; repaints canvas
  • Function removeShape(_Shape shape): removes the given Shape, shape from the shapes array; repaints canvas
  • Function repaint(): repaints the canvas
  • Function resize(Integer width, Integer height): resizes the canvas to the input width and height parameters, this is done efficiently and is the prefered way to resize Canvas objects; this function will automatically recenter content and perform the necessary functions to update rendering
  • Function setBackgroundImage(String url): sets the background image to the image specified by the url parameter
  • optional abstract Function afterLoadContent(): additional function that is called after content is loaded into the Canvas; is called in the loadMolecule and loadContent functions
  • optional abstract Function drawChildExtras(Context ctx): draws extra graphics on top of the base graphics, override this for your custom canvases
  • optional abstract Function subCreate(): additional function to be called during create(), such that child classes can do additional setup before returning to the child constructor
  • //Mobile Touch Events and Gestures
  • optional abstract Function dbltap(Event e): receives the double tap event for mobile devices, override this for your custom canvases, forwards to dblclick if not implemented, if neither dbltap or dblclick are implemented, then the event is forwarded to touchstart or mousedown
  • optional abstract Function gesturechange(Event e): receives the gesture move event for mobile devices, override this for your custom canvases
  • optional abstract Function gestureend(Event e): receives the touch end event for mobile devices, override this for your custom canvases
  • optional abstract Function gesturestart(Event e): receives the gesture start event for mobile devices, override this for your custom canvases
  • optional abstract Function multitouchmove(Event e, Number numFingers): receives an event for mobile devices where multiple fingers are moving on the screen, override this for your custom canvases, the center of the fingers is provided in the Event, the number of fingers touching the screen is also sent to the handler
  • optional abstract Function tap(Event e): receives the tap event for mobile devices (quickly touchstart then touchend), override this for your custom canvases, forwards to click if not implemented
  • optional abstract Function touchend(Event e): receives the touch end event for mobile devices, override this for your custom canvases, forwards to mouseup if not implemented
  • optional abstract Function touchhold(Event e): receives the touch hold event for mobile devices, override this for your custom canvases; will fire if the user touches down and does not lift or move for 1 second
  • optional abstract Function touchmove(Event e): receives the touch move event for mobile devices, override this for your custom canvases, forwards to drag if not implemented
  • optional abstract Function touchstart(Event e): receives the touch start event for mobile devices, override this for your custom canvases, forwards to mousedown if not implemented
  • //Mouse Events
  • optional abstract Function click(Event e): receives the mouse click event, override this for your custom canvases
  • optional abstract Function dblclick(Event e): receives the mouse double click event, override this for your custom canvases
  • optional abstract Function drag(Event e): receives the mouse drag event, override this for your custom canvases
  • optional abstract Function middleclick(Event e): receives the mouse middle click event, override this for your custom canvases
  • optional abstract Function middlemousedown(Event e): receives the mouse middle mouse down event, override this for your custom canvases
  • optional abstract Function middlemouseup(Event e): receives the mouse middle mouse up event, override this for your custom canvases
  • optional abstract Function mousedown(Event e): receives the mouse down event, override this for your custom canvases
  • optional abstract Function mousemove(Event e): receives the mouse move event, override this for your custom canvases
  • optional abstract Function mouseout(Event e): receives the mouse out event, override this for your custom canvases
  • optional abstract Function mouseover(Event e): receives the mouse over event, override this for your custom canvases
  • optional abstract Function mouseup(Event e): receives the mouse up event, override this for your custom canvases
  • optional abstract Function mousewheel(Event e, Number delta): receives the mouse wheel event, override this for your custom canvases; delta is the amount the wheel has spun
  • optional abstract Function rightclick(Event e): receives the mouse right click event, override this for your custom canvases
  • optional abstract Function rightmousedown(Event e): receives the mouse right mouse down event, override this for your custom canvases
  • optional abstract Function rightmouseup(Event e): receives the mouse right mouse up event, override this for your custom canvases
  • //Keyboard Events
  • optional abstract Function keydown(Event e): receives the key down event, override this for your custom canvases
  • optional abstract Function keypress(Event e): receives the key press event, override this for your custom canvases
  • optional abstract Function keyup(Event e): receives the key up event, override this for your custom canvases

ChemDoodle.ViewerCanvas

is a child of the Canvas class and provides a basic canvas for simply displaying a static styled structural drawing

constructor = new Function ViewerCanvas(String id, Integer width, Integer height)

prototype = _Canvas

    ChemDoodle.HyperlinkCanvas

    is a child of the Canvas class and provides a basic button-like canvas: it responds to mouse overs and executes a link or action when clicked on

    constructor = new Function HyperlinkCanvas(String id, Integer width, Integer height, String urlOrFunction)

    prototype = _Canvas

    • String urlOrFunction: this is the url to be directed to when clicked, this can also be a function object and the function will be executed when clicked
    • String color: the color of the mouse over highlight
      Default Value: blue
      Unit: color
    • Number size: the width of the mouse over highlight
      Default Value: 2
      Unit: pixels
    • Boolean openInNewWindow: if true and urlOrFunction is a url, then the url will be opened in a new window instead of changing the current page
      Default Value: false
      Unit: true/false
    • Image hoverImage: if this is initialized, then the mouse over will display an image instead of a hyperlink-like decoration
    • Event e: keeps track of the last event
    • Function setHoverImage(String url): sets the canvas’s hover image to the image url specified
    • override Function click(Event e): performs the mouse click action
    • override Function drawChildExtras(Context ctx): draws extra graphics on top of the base graphics
    • override Function mouseout(Event e): performs the mouse out action
    • override Function mouseover(Event e): performs the mouse over action, currently not called

    ChemDoodle.TransformCanvas

    is a child of the Canvas class and provides a basic canvas for users to transform (translate [alt+drag], rotate [drag], scale [mousewheel]) molecules with

    constructor = new Function TransformCanvas(String id, Integer width, Integer height)

    prototype = _Canvas

    • Point lastPoint: keeps track of the last mouse position
    • Boolean rotate3D: will rotate in 3 dimensions if true, will only rotate around the z axis if false
      Default Value: false
    • Number rotationMultMod: multiplication modifier for the rotation calculations, larger numbers correspond to faster rotations
      Default Value: 1.3
    • Number lastPinchScale: keeps track of the last pinch scale from a mobile gesture
    • Number lastGestureRotate: keeps track of the last rotation magnitude from a mobile gesture
    • override Function dblclick(Event e): performs the double-click action, which centers the molecule
    • override Function drag(Event e): performs the mouse drag action
    • override Function gesturechange(Event e): handles any pinch and rotate gestures from mobile devices which will scale and rotate the molecule
    • override Function gestureend(Event e): resets the gesture tracking variables and ends the gesture
    • override Function mousedown(Event e): performs the mouse down action
    • override Function mousewheel(Event e, Number delta): performs the mouse wheel action

    ChemDoodle.MolGrabberCanvas

    is a child of the Canvas class and provides a basic canvas for users to search databases with.

    constructor = new Function MolGrabberCanvas(String id, Integer width, Integer height)

    prototype = _Canvas

    • Function search(): uses iChemLabs cloud services to contact the database with query term as defined in the form and then updates the Canvas after receiving the molecule data
    • Function setSearchTerm(String term): automatically searches for and loads the input search term

    ChemDoodle.FileCanvas

    is a child of the Canvas class and provides a basic canvas for users to load molecule from their computer with. The action is the server side script to be called that loads the file into a hidden frame. After the asynchronous call is finished, the correct function is called to load the molecule into the canvas with the associated id

    constructor = new Function FileCanvas(String id, Integer width, Integer height, String String, String urlOrFunction, String color, Number size)

    prototype = _Canvas

      ChemDoodle._AnimatorCanvas

      is a child of the Canvas class and is the parent class for all animated ChemDoodle Web Component Canvases, it should not be instantiated. It provides an extendable framework for creating animations. This class should be extended for custom animated canvases.

      constructor = new Function _AnimatorCanvas()

      prototype = _Canvas

      • Timer handle: a handle on the current Timer so it can be started and stopped
      • Number timeout: the default refresh rate
        Default Value: 33 (~30fps)
        Unit: ms
      • Number lastTime: keeps track of the last time the nextFrame() function was called
      • Function isRunning(): returns true if the animation is currently running
        returns Boolean
        Unit: true/false
      • Function startAnimation(): initializes the animation
      • Function stopAnimation(): terminates the animation
      • abstract Function nextFrame(Number delta): called by the timer, in the frequency specified by the interval timeout, this must be overridden for your custom canvases, repaints the canvas after each call; this class keeps track of the time between calls and passes that value to this function for accurate animations

      ChemDoodle.RotatorCanvas

      is a child of the AnimatorCanvas class and provides a basic canvas for displaying molecular rotation animations

      constructor = new Function RotatorCanvas(String id, Integer width, Integer height, String String, Boolean rotate3D)

      • Boolean rotate3D: the animation will rotate in 3 dimensions if true, will only rotate around the z axis if false
        Default Value: false
      • Number xIncrement: the x rotation increment
        Default Value: Math.PI/15
        Unit: radians/sec
      • Number yIncrement: the y rotation increment
        Default Value: Math.PI/15
        Unit: radians/sec
      • Number zIncrement: the z rotation increment
        Default Value: Math.PI/15
        Unit: radians/sec
      • override Function dblclick(Event e): catches double click events and toggles the animation
      • override Function nextFrame(Number delta): updates the state during the rotation animation

      ChemDoodle.SlideshowCanvas

      is a child of the AnimatorCanvas class and provides a basic canvas for displaying transitions between several molecular structures

      constructor = new Function SlideshowCanvas(String id, Integer width, Integer height)

      • Array molecules: the molecular structures to be displayed in the order they are to be displayed in, this should not be empty
      • Integer curIndex: keeps track of the current index in molecules
      • Number timeout: this parameter is inherited from AnimatorCanvas, but it is set to a larger value
        Default Value: 5000
        Unit: ms
      • Number alpha: keeps track of the current alpha during the transition
      • Timer innerHandle: holds on to the second inner Timer for performing the transition, so it can be started and stopped
      • Integer phase: keeps track of the current phase (different types of animations) during the transition
      • Function addMolecule(Molecule molecule): adds a molecule to the slideshow
      • Function breakInnerHandle(): completes the second phase of the animation and the molecule switch
      • override Function drawChildExtras(Context ctx): draws extra graphics on top of the base graphics
      • override Function nextFrame(Number delta): updates the state during the rotation

      ChemDoodle._Canvas3D

      is the parent class for all 3D ChemDoodle Web Component Canvases, it should not be instantiated. Its basic functionality allows for molecules to be rendered in a 3D scene and loaded. This class should be extended for custom 3D canvases.

      constructor = new Function _Canvas3D()

      prototype = _Canvas

      • mat4 rotationMatrix: the rotation matrix to be applied before rendering the 3D scene
        Default Value: mat4.identity([])
        Unit: 4×4 matrix
      • mat4 translationMatrix: the translation matrix to be applied before rendering the 3D scene
        Default Value: mat4.identity([])
        Unit: 4×4 matrix
      • Point lastPoint: the last point in the canvas’s space that the user initiated a mouseDown event
      • Number maxDimension: keeps track of the max dimension to aid in determining the magnitude of scaling
      • Function displayMessage(): controls what the Canvas3D displays if WebGL is unavailable
      • Function pick(Number x, Number y, Boolean includeAtoms, Boolean includeBonds): returns the atom or bond that is located in the 3D scene, closest to the camera, at the <canvas> coordinates of the input x and y values; if no object is at those coordinates, undefined is returned; includeAtoms and includeBonds define whether those objects are selectable (if you make both true and you are only looking to select atoms, bonds will get in the way of selecting atoms)
      • Function renderText(String text, Array position): helper method for rendering text
      • Function setViewDistance(Number distance): helper method to move the camera the input distance away from the center of the scene; distance is in Angstroms
      • Function setupScene(): creates the 3D scene
      • Function updateScene(): updates the projection for the scene without other overhead
      • override Function afterLoadMolecule(): helper method to reset the scene if a gl parameter has been altered
      • override Function center(): centers the molecule in 3D around the origin
      • override Function drag(Event e): performs the mouse drag action
      • override Function gesturechange(Event e): performs the gesturechange action
      • override Function mousedown(Event e): performs the mouse down action
      • override Function mousedown(Event e): performs the mouse up action
      • override Function mousewheel(Event e): performs the mouse scroll action
      • override Function multitouchmove(Event e): performs the multitouchmove action
      • override Function repaint(): renders the 3D scene
      • override Function rightmousedown(Event e): performs the mouse right click action
      • override Function subCreate(): sets up GLContext, alerts viewer to warning if GLContext cannot be created; initializes shaders and scene

      ChemDoodle.ViewerCanvas3D

      is a child of the Canvas3D class and provides a basic canvas for simply displaying a static 3D scene of a molecule

      constructor = new Function ViewerCanvas3D(String id, Integer width, Integer height)

      prototype = _Canvas

      • override Function drag(): set to undefined to ignore this gesture
      • override Function mousedown(): set to undefined to ignore this gesture
      • override Function mousewheel(): set to undefined to ignore this gesture
      • override Function rightmousedown(): set to undefined to ignore this gesture

      ChemDoodle.TransformCanvas3D

      is a child of the Canvas3D class and provides a basic canvas for users to transform (translate [alt+drag], rotate [drag], scale [mousewheel]) molecules with in a 3D scene

      constructor = new Function TransformCanvas3D(String id, Integer width, Integer height)

      prototype = _Canvas

        ChemDoodle.MolGrabberCanvas3D

        is a child of the Canvas3D class and provides a basic 3D canvas for users to search databases with. The content may then be transformed just as in the Transformer3D canvas.

        constructor = new Function MolGrabberCanvas3D(String id, Integer width, Integer height)

        • Function search(): uses iChemLabs cloud services to contact the database with query term as defined in the form and then updates the Canvas3D after receiving the molecule data
        • Function setSearchTerm(String term): automatically searches for and loads the input search term

        ChemDoodle.RotatorCanvas3D

        is a child of the Canvas3D class and provides a basic canvas for displaying molecular rotation animations in a 3D scene, also doubly inherits methods from the AnimatorCanvas class

        constructor = new Function RotatorCanvas3D(String id, Integer width, Integer height)

        • Timer handle: a handle on the current Timer so it can be started and stopped
        • Number timeout: the default refresh rate
          Default Value: 33 (~30fps)
          Unit: ms
        • Number xIncrement: the x rotation increment
          Default Value: Math.PI/15
          Unit: radians/sec
        • Number yIncrement: the y rotation increment
          Default Value: Math.PI/15
          Unit: radians/sec
        • Number zIncrement: the z rotation increment
          Default Value: Math.PI/15
          Unit: radians/sec
        • Function isRunning(): returns true if the animation is currently running
          returns Boolean
          Unit: true/false
        • Function startAnimation(): initializes the animation
        • Function stopAnimation(): terminates the animation
        • override Function dblclick(Event e): catches double click events and toggles the animation
        • override Function drag(): set to undefined to ignore this gesture
        • override Function mousedown(): set to undefined to ignore this gesture
        • override Function mousewheel(): set to undefined to ignore this gesture
        • override Function nextFrame(Number delta): updates the state during the rotation animation
        • override Function rightmousedown(): set to undefined to ignore this gesture

        ChemDoodle.MovieCanvas3D

        is a child of the Canvas3D class and provides a basic canvas for displaying movies of molecules in a 3D scene, also doubly inherits methods from the AnimatorCanvas class

        constructor = new Function MovieCanvas3D(String id, Integer width, Integer height)

        • static Number PLAY_ONCE: specifies that movie will play once to the end and stop
        • static Number PLAY_LOOP: specifies that movie will play continuously, restarting from the first frame once it reaches the end
        • static Number PLAY_SPRING: specifies that movie will play continuously, springing back and forth between the first and last frames
        • Array frames: an array containing molecules and shapes, with each entry representing a frame to be displayed in the order they are to be displayed in, this should not be empty; you should fill this array before the _Canvas.loadMolecule() function is called so all the data is properly setup
        • Timer handle: a handle on the current Timer so it can be started and stopped
        • Number timeout: the default refresh rate
          Default Value: 50 (~20fps)
          Unit: ms
        • Number playMode: set to specify how the movie playback will proceed
          Default Value: PLAY_SPRING
          Unit: MovieCanvas3D.PLAY_*
        • Boolean reverse: used internally to allow the spring playback method to function
        • Number frameNumber: keeps track of the next frame number
        • Function addFrame(Array mols, Array shapes): takes an array of molecules and shapes and adds them to the end of the frame array.
        • Function isRunning(): returns true if the animation is currently running
          returns Boolean
          Unit: true/false
        • Function startAnimation(): initializes the animation
        • Function stopAnimation(): terminates the animation
        • override Function center(): centers all of the frames in the molecules array
        • override Function dblclick(Event e): catches double click events and toggles the animation
        • override Function nextFrame(Number delta): updates the state during the rotation animation

        ChemDoodle._SpectrumCanvas

        is a child of the Canvas class and is the parent class for all Spectrum ChemDoodle Web Component Canvases, it should not be instantiated. This canvas is specifically suited for displaying graphics of spectra.

        constructor = new Function _SpectrumCanvas()

        prototype = _Canvas

        • Spectrum spectrum: the Spectrum data structure that this Canvas displays
        • Function getSpectrum(): returns the Spectrum belonging to this SpectrumCanvas
          returns Spectrum
        • Function loadSpectrum(): loads the spectrum and then repaints
        • override Function repaint(): paints the spectrum

        ChemDoodle.ObserverCanvas

        is a child of the SpectrumCanvas class and provides a basic canvas for simply displaying a static styled spectrum drawing

        constructor = new Function ObserverCanvas(String id, Integer width, Integer height)

        prototype = _SpectrumCanvas

          ChemDoodle.OverlayCanvas

          is a child of the SpectrumCanvas class and provides an basic canvas for viewing several spectra superimposed over each other

          constructor = new Function OverlayCanvas(String id, Integer width, Integer height)

          prototype = _SpectrumCanvas

          • Array overlaySpectra: the additional spectra to be overlaid on the main spectrum
            Default Value: Array
          • Function addSpectrum(Spectrum spectrum): adds a spectrum to the canvas; it is recommended that this function is used over directly populating the overlaySpectra array, as this function will first set the main spectrum if it isn’t set
          • override Function innerRepaint(Context ctx): draws extra graphics on top of the base graphics

          ChemDoodle.PerspectiveCanvas

          is a child of the SpectrumCanvas class and provides an interactive canvas for zooming in on peaks in spectra

          constructor = new Function PerspectiveCanvas(String id, Integer width, Integer height)

          prototype = _SpectrumCanvas

          • Point dragRange: keeps track of the x-coordinates for the start and end of the drag event
          • Boolean rescaleYAxisOnZoom: determines whether the y-axis will rescale upon a zoom
            Default Value: true
            Unit: true/false
          • Number lastPinchScale: keeps track of the last pinch scale from a mobile gesture
          • override Function dblclick(Event e): performs the double-click action, which fits the entire spectrum to the canvas
          • override Function drag(Event e): performs the mouse drag action, which will zoom in on the spectrum; if the shift key is held, then the spectrum will be translated
          • override Function drawChildExtras(Context ctx): draws extra graphics on top of the base graphics
          • override Function gesturechange(Event e): handles any pinch gestures from mobile devices which will scale the spectrum
          • override Function mousedown(Event e): performs the mouse down action
          • override Function mouseup(Event e): performs the mouse up action
          • override Function mousewheel(Event e, Number delta): performs the mouse wheel action

          ChemDoodle.SeekerCanvas

          is a child of the SpectrumCanvas class and provides an interactive canvas for viewing internal coordinates in spectra

          constructor = new Function SeekerCanvas(String id, Integer width, Integer height, String seekType)

          prototype = _SpectrumCanvas

          • static String SEEK_POINTER: seeks the pointer location
          • static String SEEK_PLOT: seeks closest plot coordinate by the x coordinate of the pointer location
          • static String SEEK_PEAK: seeks closest peak coordinate by the x coordinate of the pointer location
          • String seekType: seek method for the canvas, must be one of the SEEK constants
            Default Value: SEEK_POINTER
          • Point p: keeps track of the last point from the user
          • override Function innerRepaint(Context ctx): draws extra graphics on top of the base graphics
          • override Function mousemove(Event e): performs the mouse move action
          • override Function mouseout(Event e): performs the mouse out action
          • override Function touchend(Event e): performs the touch end action
          • override Function touchmove(Event e): performs the touch move action
          • override Function touchstart(Event e): performs the touch start action

          ChemDoodle.PeriodicTableCanvas

          is a child of the Canvas class and displays a periodic table of elements. As with all components, it is completely customizable and interactive.

          constructor = new Function PeriodicTableCanvas(String id, Integer cellDimension)

          prototype = _Canvas

          • Number padding: the padding between the sides of the component and the table
            Default Value: 5
            Unit: pixels
          • Number cellDimension: the width and height of each cell in the periodic table, 20 by default, but also specified in the constructor
            Default Value: 20
            Unit: pixels
          • PeriodicCell hovered: the currently hovered cell, or undefined if there is no cell hovered
          • PeriodicCell selected: the currently selected cell, or undefined if there is no cell selected
          • Function drawCell(Context ctx, VisualSpecifications specs, PeriodicCell cell): draws the provided cell to the canvas that owns the Context using the given VisualSpecifications, override this function to change the rendering of the table
          • Function getHoveredElement(): returns the Element object corresponding to the cell that is currently hovered by the mouse pointer, and returns undefined if no cell is hovered
            returns Element
          • override Function click(Event e): catches double click events and selects a cell
          • override Function getMolecule(): set to undefined to ignore this function from the _Canvas class
          • override Function mousemove(Event e): catches mouse move events and hovers a cell
          • override Function mouseout(Event e): catches mouse out events and sets the hovered cell to undefined
          • override Function repaint(): paints the periodic table
          • override Function setMolecule(): set to undefined to ignore this function from the _Canvas class
          • override Function setupTable(): sets up the table and all the table cells, this function is called by the constructor, but can be called after changing the constructor defaults to re-layout the table
          • override Function touchstart(Event e): catches the touchstart mobile event and hovers a cell

          ChemDoodle.SketcherCanvas

          is a child of the Canvas class and provides a full sketcher for drawing chemical data, modeled off of the popular ChemDoodle desktop applicaiton. This class is not avaialble in the ChemDoodle Web Components core. It is added by including the ChemDoodle Web Components uis extensions.

          constructor = new Function SketcherCanvas(String id, Integer width, Integer height, Object options)

          prototype = _Canvas

          • Boolean isMobile: this is one of the options, controls whether the sketcher optimizes itself for mobile or desktop use; if not defined, this option will automatically default to the correct value after checking if it’s environemnt is mobile or not
            Default Value: ChemDoodle.featureDetection.supports_touch()
            Unit: true/false
          • Boolean useServices: this is one of the options, controls whether or not the sketcher will provide functionality that access iChemLabs Cloud services
            Default Value: false
            Unit: true/false
          • Boolean oneMolecule: this is one of the options, controls whether or not the sketcher will provide full sketching capabilities, or restrict the interface to allow only a single molecule to be drawn
            Default Value: false
            Unit: true/false
          • Boolean includeToolbar: this is one of the options, define this to false to exclude the toolbar
            Default Value: true
            Unit: true/false
          • Boolean includeQuery: this is one of the options, define this to true to inlcude query tools in the toolbar
            Default Value: false
            Unit: true/false
          • ToolbarManager toolbarManager: the toolbar manager
          • StateManager stateManager: the state manager
          • HistoryManager historyManager: the history manager
          • Boolean isHelp: true if the user is hovering over the help icon
          • Number lastPinchScale: keeps track of the pinch gesture
          • Number lastGestureRotate: keeps track of the two finger rotate gesture
          • Atom startAtom: the atom that follows the pointer in the full sketcher
          • Lasso lasso: the lasso, only declared in the full sketcher
          • Function checkScale(): confines the scale of the sketcher
          • Function drawSketcherDecorations(Context ctx): draws extra graphics for the sketcher
          • Function scaleEvent(Event e): scales the event for the current scale of the sketcher
          • override Function click(Event e): performs the mouse click action
          • override Function dblclick(Event e): performs the mouse dblclick action
          • override Function drag(Event e): performs the drag action
          • override Function drawChildExtras(Context ctx): draws extra graphics on top of the base graphics
          • override Function gesturechange(Event e): performs the gesturechange action
          • override Function gestureend(Event e): performs the gestureend action
          • override Function keydown(Event e): performs the keydown action
          • override Function keypress(Event e): performs the keypress action
          • override Function keyup(Event e): performs the keyup action
          • override Function mousedown(Event e): performs the mousedown action
          • override Function mouseout(Event e): performs the mouseout action
          • override Function mouseover(Event e): performs the mouseover action
          • override Function mouseup(Event e): performs the mouseup action
          • override Function mousewheel(Event e): performs the mousewheel action
          • override Function rightclick(Event e): performs the mouse rightclick action
          • override Function rightmousedown(Event e): performs the rightmousedown action
          • override Function rightmouseup(Event e): performs the rightmouseup action
          • override Function touchend(Event e): performs the touchend action
          • override Function touchmove(Event e): performs the touchmove action
          • override Function touchstart(Event e): performs the touchstart action

          ChemDoodle.EditorCanvas3D

          is a child of the Canvas class and provides a 3D molecular editing environment. This class is not avaialble in the ChemDoodle Web Components core. It is added by including the ChemDoodle Web Components uis extensions.

          constructor = new Function EditorCanvas3D(String id, Integer width, Integer height, Object options)

          prototype = _Canvas3D

          • Boolean isMobile: this is one of the options, controls whether the editor optimizes itself for mobile or desktop use; if not defined, this option will automatically default to the correct value after checking if it’s environemnt is mobile or not
            Default Value: ChemDoodle.featureDetection.supports_touch()
            Unit: true/false
          • Boolean useServices: this is one of the options, controls whether or not the editor will provide functionality that access iChemLabs Cloud services
            Default Value: false
            Unit: true/false
          • Boolean includeToolbar: this is one of the options, define this to false to exclude the toolbar
            Default Value: true
            Unit: true/false
          • ToolbarManager3D toolbarManager: the toolbar manager
          • StateManager3D stateManager: the state manager
          • HistoryManager historyManager: the history manager
          • override Function click(Event e): performs the mouse click action
          • override Function dblclick(Event e): performs the mouse dblclick action
          • override Function drag(Event e): performs the drag action
          • override Function keydown(Event e): performs the keydown action
          • override Function keypress(Event e): performs the keypress action
          • override Function keyup(Event e): performs the keyup action
          • override Function mousedown(Event e): performs the mousedown action
          • override Function mouseout(Event e): performs the mouseout action
          • override Function mouseover(Event e): performs the mouseover action
          • override Function mouseup(Event e): performs the mouseup action
          • override Function mousewheel(Event e): performs the mousewheel action
          • override Function rightclick(Event e): performs the mouse rightclick action
          • override Function rightmousedown(Event e): performs the rightmousedown action
          • override Function rightmouseup(Event e): performs the rightmouseup action

          ChemDoodle.extensions

          this package contains helper functions for classes that the ChemDoodle Web Components library doesn’t own.

          ChemDoodle.featureDetection

          this package contains several convenience methods to check for support of verious HTML5 features that the ChemDoodle Web Components library uses.

          • static Function supports_canvas(): returns a boolean corresponding to the browser’s support for the HTML5 <canvas> tag
            returns Boolean
          • static Function supports_canvas_text(): returns a boolean corresponding to the browser’s support for HTML5 <canvas> text rendering
            returns Boolean
          • static Function supports_gesture(): returns a boolean corresponding to the browser’s support for gesture events; this is useful for determining if the current browser can support pinching and zooming, and to resort to ChemDoodle’s handlers if necessary
            returns Boolean
          • static Function supports_touch(): returns a boolean corresponding to the browser’s support for touch events; this is useful for determining if the current browser is on a mobile platform
            returns Boolean
          • static Function supports_webgl(): returns a boolean corresponding to the browser’s support for WebGL
            returns Boolean
          • static Function supports_xhr2(): this method checks the browser’s support for XMLHttpRequest Level 2 functionality
            returns Boolean

          ChemDoodle.iChemLabs

          this package connects to iChemLabs cloud services through AJAX XMLHttpRequest Level 2 for complete access to the entire ChemDoodle Java API. Please see the iChemLabs Cloud services documentation for details.

            ChemDoodle.informatics

            this package hosts all classes that perform cheminformatics algorithms.

            • static Function getPointsPerAngstrom(): returns the pixel/Ängstrom ratio that is currently defined by the default ChemDoodle settings
              returns Number
              Unit: pixels/Ängstrom

            ChemDoodle.informatics.BondDeducer

            is a class for analyzing bonds based on 3D coordinates

            • Number margin: the amount of flexibility in calculating bonds; the larger the number, the more bonds found
              Default Value: 1.1
              Unit: bond lengths
            • Function deduceCovalentBonds(Molecule molecule, Number customPointsPerAngstrom): deduces covalent bonds for the input molecule and appends them to the molecule‘s bonds array. Uses the covalent radii data provided in atomicData. The customPointsPerAngstrom parameters allows you to change the value from that specified by default.

            ChemDoodle.informatics.HydrogenDeducer

            is a class for manipulating hydrogens

            • Function removeHydrogens(Molecule molecule, Boolean removeStereo): removes all hydrogens and bonds attached to them from the given molecule; if removeStereo is not set to true, then hydrogens connected with wedge bonds are retained

            ChemDoodle.informatics.Splitter

            is a class for splitting a Molecule data structure composed of discrete graphs into individual discrete Molecule objects

            • Function split(Molecule molecule): returns an array consisting of each discrete graph data structure in the input molecule, as individual discrete Molecule objects
              returns Array

            ChemDoodle.informatics.StructureBuilder

            is a class for copying and creating molecular structures

            ChemDoodle.informatics._Counter

            is an interface for calculating integer descriptors given a Molecule object. It should not be instantiated. To obtain a value from a Counter, use the following command where mol is a Molecule object and ChildOfCounter is a child of the Counter class: new ChildOfCounter(mol).value

            • Number value: the result of the Counter algorithm
            • Molecule molecule: holds the Molecule object being analyzed by the child derivative
            • Function setMolecule(Molecule molecule): sets the molecule and performs the descriptor calculation. Should be called as the last method in all child constructors.
            • abstract Function innerCalculate(Molecule molecule): this method is defined by all child classes of Counter. This method should calculate the descriptor value given the Molecule stored.

            ChemDoodle.informatics.FrerejacqueNumberCounter

            is a child of the Counter class and calculates the Frèrejacque Number, which is the SSSR count.

            constructor = new Function FrerejacqueNumberCounter(Molecule molecule)

            prototype = _Counter

            • override Function innerCalculate(Molecule molecule): calculates the Frèrejacque Number. This should never be manually called as it is called by the constructor after setup.

            ChemDoodle.informatics.NumberOfMoleculesCounter

            is a child of the Counter class and calculates the real number of molecules in a Molecule object, which can hold disjoint graphs.

            constructor = new Function NumberOfMoleculesCounter(Molecule molecule)

            prototype = _Counter

            • override Function innerCalculate(Molecule molecule): calculates the number of molecules. This should never be manually called as it is called by the constructor after setup.

            ChemDoodle.informatics._RingFinder

            is an interface for ring perception algorithms. It should not be instantiated. Contains helper methods for ring perception and for storing rings. So to obtain a ring set, use the following command where mol is a Molecule object and ChildOfRingFinder is a child of the RingFinder class: new ChildOfRingFinder(mol).rings

            • Array atoms: all atoms that will be analyzed during ring perception are stored here, set by RingFinder.reduce()
            • Array bonds: all bonds that will be analyzed during ring perception are stored here, set by RingFinder.reduce()
            • Array rings: this array holds all the perceived rings
            • Function fuse(): a helper method to find the bonds that belong to the perceived rings if only the atoms are specified.
            • Function reduce(Molecule molecule): reduces this input molecule graph to discard most non-ring atons and all lone atoms to speed up runtimes, sets the atoms and bonds Arrays to the reduced graph.
            • Function setMolecule(Molecule molecule): sets the molecule and performs the ring perception. Should be called as the last method in all child constructors.
            • abstract Function innerGetRings(Molecule molecule): this method is defined by all child classes of RingFinder. This method should find rings based on the reduced atoms and bonds Arrays and then place perceived rings in the rings Array.

            ChemDoodle.informatics.SSSRFinder

            perceives the Smallest Set of Smallest Rings (SSSR) as defined by Plotkin. The SSSR set is not unique. This is not a child of the RingFinder class, as it uses the EulerFacetRingFinder class to perceive rings, and the SSSR is retrieved from that result. It works identically to a RingFinder derivative.

            constructor = new Function SSSRFinder(Molecule molecule)

            • Array rings: this array holds all the perceived rings

            ChemDoodle.informatics.EulerFacetFinder

            is a child of the RingFinder class and perceives a set of rings that defines all Euler facets in a molecule using an algorithm developed by Kevin Theisen. This ring set is thorough, unique and adequately describes rings as a 3D representation of a 2D drawing.

            constructor = new Function EulerFacetFinder(Molecule molecule)

            prototype = _RingFinder

            • Number fingerBreak: is a cutoff for the size of rings to be found. Defines the length of a ring path which is half of a ring. So a value of 5 specifies that only 8 membered rings and smaller should be perceived. Use this setting to improve performance.
              Default Value: 5
            • override Function innerGetRings(Molecule molecule): implements the algorithm to find the Euler facet ring set. This should never be manually called as it is called by the constructor after setup.

            ChemDoodle.io

            this package contains various classes and tools for converting chemical data between formats.

            • static Function fromJSONDummy(Object content): recover a Molecule from JSON format
              returns Molecule
            • static Function toJSONDummy(Molecule mol): convert a Molecule to a consise Object that represents the chemical data for use in JSON protocol
              returns Object

            ChemDoodle.io._Interpreter

            is an interface for reading and writing chemical data. It should not be instantiated. Contains helper methods for dealing with data.

            ChemDoodle.io.JSONInterpreter

            handles converting Javascript objects to and from the ChemDoodle JSON format, this is NOT a child of the Interpreter class

            constructor = new Function JSONInterpreter()

            • Function contentFrom(Object dummy): given the input object represented in ChemDoodle JSON (object, not the string), this function will create the corresponding Object data structure containing an Array of Molecule data structures named molecules and an Array of Shape data structures named shapes
              returns Object
            • Function contentTo(Array mols, Array shapes): creates a dummy object from the input molecules and shapes Arrays corresponding to the ChemDoodle JSON format; use JSON.stringify() to create a JSON string from this dummy object
              returns Object
            • Function molFrom(Object dummy): given the input object represented in ChemDoodle JSON (object, not the string), this function will create the corresponding Molecule data structure
              returns Molecule
            • Function molTo(Molecule mol): creates a dummy object from the input Molecule data structure corresponding to the ChemDoodle JSON format; use JSON.stringify() to create a JSON string from this dummy object
              returns Object
            • Function queryFrom(Object dummy): given the input object represented in ChemDoodle JSON (object, not the string), this function will create the corresponding Query data structure
              returns Query
            • Function queryTo(Molecule mol): creates a dummy object from the input Query data structure corresponding to the ChemDoodle JSON format; use JSON.stringify() to create a JSON string from this dummy object
              returns Object
            • Function shapeFrom(Object dummy, Array mols): given the input object represented in ChemDoodle JSON (object, not the string), this function will create the corresponding Shape data structure; the second parameter is the array of molecules already read, just incase the shape is dependent upon them
              returns _Shape
            • Function shapeTo(Molecule shape): creates a dummy object from the input Shape data structure corresponding to the ChemDoodle JSON format; use JSON.stringify() to create a JSON string from this dummy object
              returns Object

            ChemDoodle.io.JCAMPInterpreter

            reads IUPAC JCAMP-DX files, is a child of the Interpreter class

            constructor = new Function JCAMPInterpreter()

            prototype = _Interpreter

            • Boolean convertHZ2PPM: if true, and the file being read is a NMR spectrum in HZ, then the interpreter will automatically convert the x-axis into PPM
              Default Value: false
              Unit: true/false
            • Function makeStructureSpectrumSet(String id, String content): given an input JCAMP file with structure colleration data, this function creates two canvases, one for a molecule and one for the spectrum, where each has hover events (or touch on mobile) to highlight peaks and the corresponding parts of the molecular structure; the input id is used to generate the canvases, or find previously created canvases; the array that is returned contains the molecule ChemDoodle Web Component and the spectrum ChemDoodle Web Component objects in that order
              returns Array
            • Function read(String content): reads the JCAMP file content and returns the corresponding Spectrum
              returns Spectrum

            ChemDoodle.io.MOLInterpreter

            reads and writes MDL MOLFiles (v2000), is a child of the Interpreter class

            constructor = new Function MOLInterpreter()

            prototype = _Interpreter

            • Function read(String content, Number multiplier): reads MOLFile content and returns the corresponding molecule; the optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Angstroms
              returns Molecule
            • Function write(Molecule molecule): writes and returns a String containing the MOLFile of the given molecule
              returns String

            ChemDoodle.io.RXNInterpreter

            reads and writes MDL RXNFiles (v2000), is a child of the Interpreter class

            constructor = new Function RXNInterpreter()

            prototype = _Interpreter

            • Function read(String content, Number multiplier): reads RXNFile content and returns an object containing the corresponding content. The Object possesses an array of Molecules which an be accessed with the name ‘molecules’ and a shape array by the name of ‘shapes’ which contains only one Line data structure representing the arrow. The optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Angstroms
              returns Object
            • Function write(Array
              Unit: molecules, Array
              Unit: shapes): writes and returns a String containing the RXNFile of the given molecules and shapes
              returns String

            ChemDoodle.io.XYZInterpreter

            reads XYZ files, is a child of the Interpreter class

            constructor = new Function XYZInterpreter()

            prototype = _Interpreter

            • Molecule deduceCovalentBonds: if true, the XYZInterpreter will also calculate covalent bonds for input atoms
              Default Value: true
              Unit: true/false
            • Function read(String content): reads XYZ file content and returns the corresponding molecule
              returns Molecule

            ChemDoodle.io.PDBInterpreter

            reads RCSB PDB files, is a child of the Interpreter class

            constructor = new Function PDBInterpreter()

            prototype = _Interpreter

            • Molecule deduceResidueBonds: if true, the PDBInterpreter deduce bonds between residue atoms
              Default Value: false
              Unit: true/false
            • Molecule calculateRibbonDistances: if true, the PDBInterpreter will also calculate distances for all protein and nucleic acid atoms to the closest ligand atoms for use in display. If no ligand atoms are present, then all atoms will be given a measured distance of 0
              Default Value: false
              Unit: true/false
            • Function read(String content, Number multiplier): reads the PDB file content and returns the corresponding Molecule; the optional multiplier variable will override the default_anstromsPerBondLength variable, set it to 1 for 3D scenes in Angstroms
              returns Molecule

            ChemDoodle.io.CIFInterpreter

            reads Crystallographic Information Files (CIF), is a child of the Interpreter class

            constructor = new Function CIFInterpreter()

            prototype = _Interpreter

            • Function read(String content, Number xSuper, Number ySuper, Number zSuper): reads a CIF file and returns the corresponding Molecule and unit cell shape; the returned object will contain two parameters, molecule and unitCell; the three optional integers specify the supercell dimensions, by default they are all 1, so reading a file without specifying these parameters will produce just the unit cell. In addition to reading atoms from CIF files, this interpreter will also produce a unit cell and other objects relevant to the display of periodic information
              returns Molecule

            ChemDoodle.io.CMLInterpreter

            reads Chemical Markup Language files, is a child of the Interpreter class. Currently supports molecules only, no reactions.

            constructor = new Function CMLInterpreter()

            prototype = _Interpreter

            • Function read(String content): reads CML content and returns an object containing the corresponding content. The Object possesses an array of Molecules which an be accessed with the name ‘molecules’.
              returns Object
            • Function write(Array
              Unit: molecules): writes and returns a String containing the CML of the given molecules.
              returns String

            ChemDoodle.io.file

            this package deals with files.

            • static Function content(String url, Function callback): retrieves the content of a file given an input url; the content is sent to the callback function provided; note that this function uses AJAX, so it will only work for files local to the same origin calling it, unless the server supports XHR2

            ChemDoodle.io.png

            this package generates png images from canvases.

            • static Function create(_Canvas canvas): creates a PNG image from the input Canvas object and opens it in a new window

            ChemDoodle.math

            this package contains various methematical algorithms.

            • static Function angleBetweenLargest(Object data): returns an object with two parameters (angle, largest); angle points between the largest gap of the input Array of angles in radians, largest is the value of the angle between the bonds of the largest gap in radians
              returns Number
            • static Function angleBounds(Number value, Boolean convertToDegrees, Boolean constrainToPi): this is a helper method to alter an angle in radians to be between 0 and 2pi and with an additional parameter to convert to degrees and a last parameter to constrain under Pi (so it will give the 2Pi complement)
              returns Number
            • static Function calculateDistanceInterior(Point to, Point from, Object r): returns the distance of a line inscribed in a rectangle, given that the line has only 1 endpoint in the rectangle; the rectangle is a object with self-explanatory parameters x, y, w, and h
              returns Number
            • static Function clamp(Number value, Number min, Number max): return the value if it is between the min and max, inclusive; returns the min if the value is less than the min, returns the max if the value is greater than the max
              returns Number
            • static Function distanceFromPointToLineInclusive(Point p, Point l1, Point l2): returns the shortest (tangent) distance from the input Point to the line with endpoints defined by the last two input Points. This works by rotating the frame such that the line starts at the origin and points up along the x-axis, and the absolute value of the rotated input Point x-coordinate is returned. If the input Point’s y-coordinate is not between the endpoints, inclusively, a value of -1 is returned.
              returns Number
            • static Function getRGB(String hex, Number mutliplier): returns a 3 membered Array of Numbers corresponding to the RGB magnitudes of the input hex string and multiplied by the input multiplier
              returns Array
            • static Function idx2color(Number value): this is a helper method for our WebGL picking system
              returns String
            • static Function intersectLines(Number x1, Number y1, Number x2, Number y2, Number x3, Number y3, Number x4, Number y4): returns the intersection of two non-parallel line segments, if they intersect
              returns Point
            • static Function isBetween(Number x, Number left, Number right): returns true if the first input parameter is between the last two input parameters, inclusively
              returns Boolean
            • static Function rainbowAt(Number i, Number ii, Array colors): returns an rgb color as a CSS string, this is a helper function for the rainbow coloring in ribbons
              returns String

            ChemDoodle.math.Bounds

            manages 2D and 3D bounds information for graphical objects

            constructor = new Function Bounds()

            • Number minX: the minimum X value for the rectangle that represents these bounds
              Default Value: Infinity
            • Number minY: the minimum Y value for the rectangle that represents these bounds
              Default Value: Infinity
            • Number maxX: the maximum X value for the rectangle that represents these bounds
              Default Value: -Infinity
            • Number maxY: the maximum Y value for the rectangle that represents these bounds
              Default Value: -Infinity
            • Number minZ: the minimum Z value for the rectangular prism that represents these bounds
              Default Value: Infinity
            • Number maxZ: the maximum Z value for the rectangular prism that represents these bounds
              Default Value: -Infinity
            • Function expand(Number x1, Number y1, Number x2, Number y2): this Bounds object will expand the bounds of the current rectangle using the x and y data provided; two sets of coordinates can be provided, but the second set is optional (this way you can expand by point or by rectangle)
            • Function expand(Bounds bounds2): this Bounds object will expand the bounds of the current rectangle (or rectangular prism, if z coordinate information is provided) using the Bounds data provided by the bounds2 parameter
            • Function expand3D(Number x1, Number y1, Number x2, Number y2, Number z1, Number z2): this Bounds object will expand the bounds of the current rectangular prisms using the x, y and z data provided; two sets of coordinates can be provided, but the second set is optional (this way you can expand by point or by rectanglular prism)

            ChemDoodle.monitor

            this package keeps track of user input on the current page, such as the Canvas that is focused and what modifier keys are pressed on the keyboard

            • static Boolean SHIFT: keeps track of whether the shift key is held down
            • static Boolean ALT: keeps track of whether the alt key is held down
            • static Boolean META: keeps track of whether the operating system specific meta key is held down (CTRL on Windows/Linux, CMD on Mac)
            • static _Canvas CANVAS_OVER: keeps track of the canvas that the mouse is currently over. This is undefined if the mouse is over no canvas
            • static _Canvas CANVAS_DRAGGING: keeps track of the canvas that the mouse is currently dragging from. This is undefined if no Canvas is currently being dragged from

            ChemDoodle.structures

            this package hosts all data structures provided by the ChemDoodle Web Components library.

              ChemDoodle.structures.Element

              is data structure for holding information about an element. This is a private class that cannot be instantiated, however, the Elements in the ELEMENT array can be extended.

              constructor = new Function Element(String symbol, String name, Number atomicNumber)

              • String symbol: the symbol of the element
              • String name: the name of the element
              • Number atomicNumber: the atomic number of the element
              • Boolean addH: if true, implicit hydrogens are added to this element
              • Number covalentRadius: the covalent radius of the element
              • Number vdWRadius: the van der Waals radius of the element
              • String jmolColor: the Jmol color of the element
              • String pymolColor: the PyMOL color of the element; all colors are the same as the Jmol set except: H, C, N, O, F, S
              • Number mass: the integer value for the mass of the most abundant isotope of the element
              • Number valency: the maximum valency for an element, or 0 if unknown

              ChemDoodle.structures.Residue

              is data structure for holding information about residue types. This is a private class that cannot be instantiated, however, the Residues in the RESIDUE array can be extended.

              constructor = new Function Residue(String symbol, String name, Number atomicNumber)

              • String symbol: the symbol of the residue
              • String name: the name of the residue
              • Boolean polar: just for amino acids, true if polar, false if non-polar
              • String aminoColor: the color of the residue in the “amino” color set
              • String shapelyColor: the color of the residue in the “shapely” color set
              • Number acidity: the acidity of the residue, -1 for acidic, 0 for neutral, 1 for basic

              ChemDoodle.structures.PeriodicCell

              is data structure for holding information about a single cell in the periodic table for the PeriodicTableCanvas. This is a private class that cannot be instantiated.

              constructor = new Function PeriodicCell(Element element, Number x, Number y, Number dimension)

              • Element element: the corresponding element
              • Number x: the x coordinate of the top-left corner of the cell
              • Number y: the y coordinate of the top-left corner of the cell
              • Number dimension: the width and height of the square cell

              ChemDoodle.structures.VisualSpecifications

              The VisualSpecifications structure contains all the variables that define how all objects are drawn on the canvas. The variables are categorized into Canvas, Atom (atoms_), Bond (bonds_) and Spectrum (plots_) settings. All of these visual specifications are set by the defaults when a Canvas is constructed. The default variables are defined by the global ChemDoodle variable and have the same names as the member variables, except that they are preceded by ChemDoodle.default_. Change the default settings to enforce visual specifications on entire webpages.

              constructor = new Function VisualSpecifications(Number x, Number y)

              • //Canvas Specifications
              • String backgroundColor: background color of the canvas, set this to undefined to create a see-through canvas
                Default Value: white
                Unit: color
              • Number scale: scale of the canvas, set this after the molecule has been loaded, then repaint the canvas
                Default Value: 1
                Unit: %/100
              • Number rotateAngle: rotation angle of the canvas
                Default Value: 0
                Unit: radians
              • Number bondLength_2D: length of the bonds, set the default_ before using an interpreter to read your file; for 2D depiction
                Default Value: 20
                Unit: pixels
              • Number angstromsPerBondLength: number of Angstroms per bond length
                Default Value: 1.25
                Unit: Å/bond length
              • Array lightDirection_3D: the direction the lighting points in 3D scenes
                Default Value: [-.1, -.1, -1]
                Unit: vector
              • String lightDiffuseColor_3D: the diffusive light color in 3D scenes
                Default Value: ‘#FFFFFF’
                Unit: color
              • String lightSpecularColor_3D: the specular light color in 3D scenes
                Default Value: ‘#FFFFFF’
                Unit: color
              • Boolean projectionPerspective_3D: if true, a perspective projection will be used, if false, an orthographic projection will be used
                Default Value: true
                Unit: true/false
              • Number projectionPerspectiveVerticalFieldOfView_3D: the field of view angle for the perspective projection matrix in 3D scenes
                Default Value: 45
                Unit: degrees
              • Number projectionOrthoWidth_3D: the width of the orthographic projection matrix in 3D scenes
                Default Value: 40
                Unit: Angstroms
              • Number projectionWidthHeightRatio_3D: the width/height ratio for the projection matrix in 3D scenes; this setting is automatically handled by the canvas given its dimensions, but can be overridden if preferred (if the value is undefined, then this setting is ignored), this should be width/height of your canvas to keep the aspect ratio square
                Unit: ratio
              • Number projectionFrontCulling_3D: the near camera cutoff distance in 3D scenes
                Default Value: 0.1
                Unit: Angstroms
              • Number projectionBackCulling_3D: the far camera cutoff distance in 3D scenes
                Default Value: 10000
                Unit: Angstroms
              • Boolean cullBackFace_3D: if true, enables the rendering optimization not to render the mesh polygons facing away from the camera
                Default Value: true
                Unit: true/false
              • Number fog_mode_3D: this number defines the fogging algorithm used during the rendering of 3D scenes; 0 – No Fogging, 1 – Linear, 2 – EXP, 3 – EXP^2
                Allowed Values: [0, 1, 2, 3]
                Default Value: 0
              • String fog_color_3D: the fog color
                Default Value: #000000
                Unit: color
              • Number fog_start_3D: the clip to start fogging along the objects
                Default Value: 0
                Unit: %/100
              • Number fog_end_3D: the clip to end fogging along the objects
                Default Value: 1
                Unit: %/100
              • Number fog_density_3D: This number affects the fogging algorithms in different ways, but it related to the magnitude
                Default Value: 1
              • //Atom Specifications
              • Boolean atoms_display: draw the atoms
                Default Value: true
                Unit: true/false
              • String atoms_color: atom color
                Default Value: #000000
                Unit: color
              • Number atoms_font_size_2D: atom text font size for 2D depiction
                Default Value: 12
                Unit: points
              • Array atoms_font_families_2D: the atom text font families, families cascade through the array if not found on the users computer; for 2D depiction
                Default Value: [Helvetica, Arial, Dialog]
                Unit: Array<String>
              • Boolean atoms_font_bold_2D: atom text will be bold
                Default Value: false
                Unit: true/false
              • Boolean atoms_font_italic_2D: atom text will be italicized
                Default Value: false
                Unit: true/false
              • Boolean atoms_circles_2D: draw atoms as circles, text is not drawn; for 2D depiction
                Default Value: false
                Unit: true/false
              • Number atoms_circleDiameter_2D: diameter of atom circles for 2D depiction
                Default Value: 10
                Unit: pixels
              • Number atoms_circleBorderWidth_2D: width of atom circle borders for 2D depiction
                Default Value: 1
                Unit: pixels
              • Boolean atoms_useJMOLColors: use Jmol colors for atoms
                Default Value: false
                Unit: true/false
              • Boolean atoms_usePYMOLColors: use PyMOL colors for atoms, will default to Jmol if that specification is also true
                Default Value: false
                Unit: true/false
              • Boolean atoms_implicitHydrogens_2D: render implicit hydrogens on all labels that are visible
                Default Value: true
                Unit: true/false
              • Boolean atoms_displayTerminalCarbonLabels_2D: show labels for terminal carbons
                Default Value: false
                Unit: true/false
              • Boolean atoms_showHiddenCarbons_2D: show hidden carbons that are located between two nearly parallel bonds of the same bond order
                Default Value: true
                Unit: true/false
              • Boolean atoms_showAttributedCarbons_2D: show carbon labels for carbon atoms with an attribute (charge, radical, lone pair) associated
                Default Value: true
                Unit: true/false
              • Boolean atoms_displayAllCarbonLabels_2D: show all carbon labels
                Default Value: false
                Unit: true/false
              • Number atoms_lonePairDistance_2D: distance between the lone pairs and the atom
                Default Value: 8
                Unit: pixels
              • Number atoms_lonePairSpread_2D: distance between the electrons in lone pairs
                Default Value: 4
                Unit: pixels
              • Number atoms_lonePairDiameter_2D: diameter of the dots representing electrons in lone pairs
                Default Value: 1
                Unit: pixels
              • Number atoms_resolution_3D: the resolution of the sphere vertex buffer used to render atoms in 3D scenes
                Default Value: 60
                Unit: positive integer
              • Number atoms_sphereDiameter_3D: the diameter of atoms in 3D scenes (for ball and stick and wireframe type representations); atoms_useVDWDiameters_3D overrides this property
                Default Value: 0.8
                Unit: Angstroms
              • Boolean atoms_useVDWDiameters_3D: use van der Waals diameters for atoms
                Default Value: false
                Unit: true/false
              • Number atoms_vdwMultiplier_3D: a multiplier for VDW radii
                Default Value: 1
                Unit: %/100
              • String atoms_materialAmbientColor_3D: the ambient color for atoms in 3D scenes
                Default Value: #000000
                Unit: color
              • String atoms_materialSpecularColor_3D: the specular color for atoms in 3D scenes
                Default Value: #555555
                Unit: color
              • Number atoms_materialShininess_3D: the shininess of atoms in 3D scenes
                Default Value: 32
                Unit: positive integer
              • Boolean atoms_nonBondedAsStars_3D: display non-bonded atoms using a star geometry, good for visualizing ions or water oxygens in PDB files
                Default Value: false
                Unit: true/false
              • Boolean atoms_displayLabels_3D: display atom labels in WebGL components
                Default Value: false
                Unit: true/false
              • //Bond Specifications
              • Boolean bonds_display: draw the bonds
                Default Value: true
                Unit: true/false
              • String bonds_color: bond color
                Default Value: #000000
                Unit: color
              • Number bonds_width_2D: width of the bonds for 2D depiction; also controls the width of primitive lines for bonds rendered in WebGL scenes
                Default Value: 1
                Unit: pixels
              • Number bonds_saturationWidth_2D: relative saturation width of double and triple bond lines for 2D depiction
                Default Value: 0.2
                Unit: %/100*bondLength
              • String bonds_ends_2D: bond end style for 2D depiction
                Allowed Values: [butt, round, square]
                Default Value: round
              • Boolean bonds_useJMOLColors: color the bond by using the Jmol colors of the connected atoms, the type of fill is controlled by the bonds_colorGradient specification
                Default Value: false
                Unit: true/false
              • Boolean bonds_usePYMOLColors: color the bond by using the PyMOL colors of the connected atoms, the type of fill is controlled by the bonds_colorGradient specification, will default to Jmol if that specification is also true
                Default Value: false
                Unit: true/false
              • Boolean bonds_colorGradient: color the bond by using a gradient between the two colors of the constituent atoms, rather than by using a color split
                Default Value: false
                Unit: true/false
              • Number bonds_saturationAngle_2D: the angle that saturated double bonds are clipped by for 2D depiction
                Default Value: Math.PI/3
                Unit: radians
              • Boolean bonds_symmetrical_2D: double bonds are drawn symmetrically always, instead of pointing towards the center of a ring, for instance; for 2D depiction
                Default Value: false
                Unit: true/false
              • Boolean bonds_clearOverlaps_2D: draws a small background to the bond in the background color to contrast between overlapping bonds for 2D depiction
                Default Value: false
                Unit: true/false
              • Number bonds_overlapClearWidth_2D: the extent of the overlap clearing in both directions for 2D depiction
                Default Value: 0.5
                Unit: pixels
              • Number bonds_atomLabelBuffer_2D: the amount that the bond pulls back from atom text for 2D depiction
                Default Value: 1
                Unit: pixels
              • Number bonds_wedgeThickness_2D: the thickness of stereochemical wedge bonds for 2D depiction
                Default Value: 0.22
                Unit: %/100*bondLength
              • Number bonds_hashWidth_2D: the width of hashes for 2D depiction
                Default Value: 1
                Unit: pixels
              • Number bonds_hashSpacing_2D: the spacing of hashes for 2D depiction
                Default Value: 2.5
                Unit: pixels
              • Number bonds_dotSize_2D: the diameter of dots used in bond rendering (usually for zero order bonds)
                Default Value: 2
                Unit: pixels
              • Boolean bonds_lewisStyle_2D: this setting controls how whole order bonds are rendered; bonds will be renedered in Lewis Dot style, with perpendicular electron pairs representing the bonds
                Default Value: false
                Unit: true/false
              • Boolean bonds_showBondOrders_3D: renders higher bond orders with multiple cylinders if true, higher bond orders will orient themselves to face the camera
                Default Value: false
                Unit: true/false
              • Number bonds_resolution_3D: the resolution of the cylinder vertex buffer used to render bonds in 3D scenes
                Default Value: 60
                Unit: positive integer
              • Boolean bonds_renderAsLines_3D: renders bonds as primitive lines in WebGL scenes, instead of as meshes
                Default Value: false
                Unit: true/false
              • Number bonds_cylinderDiameter_3D: the diameter of bonds in 3D scenes
                Default Value: 0.3
                Unit: Angstroms
              • Number bonds_pillLatitudeResolution_3D: the latitude resolution of the pill vertex buffer used to render bonds in 3D scenes
                Default Value: 10
                Unit: positive integer
              • Number bonds_pillLongitudeResolution_3D: the longitude resolution of the pill vertex buffer used to render bonds in 3D scenes
                Default Value: 20
                Unit: positive integer
              • Number bonds_pillHeight_3D: the length of hash segments of hash bonds in 3D scenes
                Default Value: 0.3
                Unit: Angstroms
              • Number bonds_pillSpacing_3D: the spacing of hash bonds in 3D scenes
                Default Value: 0.1
                Unit: Angstroms
              • Number bonds_pillDiameter_3D: the diameter of hash bonds in 3D scenes
                Default Value: 0.3
                Unit: Angstroms
              • String bonds_materialAmbientColor_3D: the ambient color for bonds in 3D scenes
                Default Value: #222222
                Unit: color
              • String bonds_materialSpecularColor_3D: the specular color for bonds in 3D scenes
                Default Value: #555555
                Unit: color
              • Number bonds_materialShininess_3D: the shininess of bonds in 3D scenes
                Default Value: 32
                Unit: positive integer
              • //Macromolecule Specifications
              • Boolean proteins_displayRibbon: render ribbons for proteins, if any
                Default Value: true
                Unit: true/false
              • Boolean proteins_displayBackbone: render a stick trace along the alpha carbon backbone for proteins, if any
                Default Value: false
                Unit: true/false
              • Boolean proteins_displayPipePlank: render a pipe and plank model for proteins, if any
                Default Value: false
                Unit: true/false
              • Number proteins_backboneThickness: the thickness of the sticks used to render the alpha carbon backbone
                Default Value: 1.5
                Unit: Angstroms
              • String proteins_backboneColor: the color of the alpha carbon backbone trace
                Default Value: #CCCCCC
                Unit: color
              • Boolean proteins_ribbonCartoonize: display a cartoon version of the ribbons for proteins; by default ribbons and their edges are continuous, by using the cartoon model, ribbon edges will be constant widths for different parts of the structure and will jump at intersections, end of helices and sheets will render an arrowhead
                Default Value: false
                Unit: true/false
              • String proteins_residueColor: color residues by segment when set; by default this is ‘none’, and residues will not be individually colored
                Allowed Values: [none, amino, shapely, polarity - color amino acids by polar(red)/non-polar(white), acidity - color amino acids by acidic(red)/basic(blue)/neutral polar(white)/neutral non-polar(brown), rainbow]
                Default Value: none
              • String proteins_primaryColor: the color of the front of the ribbon
                Default Value: #FF0D0D
                Unit: color
              • String proteins_secondaryColor: the color of the back of the ribbon’ ticks
                Default Value: #FFFF30
                Unit: color
              • String proteins_ribbonCartoonHelixPrimaryColor: the color of the front of helices in cartoon models
                Default Value: #00E740
                Unit: color
              • String proteins_ribbonCartoonHelixSecondaryColor: the color of the back of helices in cartoon models
                Default Value: #9905FF
                Unit: color
              • String proteins_ribbonCartoonSheetColor: the color of sheets in cartoon models
                Default Value: #E8BB99
                Unit: color
              • String proteins_tubeColor: the color of the tubes for pipe and plank protein models
                Default Value: #FF0D0D
                Unit: color
              • Number proteins_tubeResolution_3D: the resolution of the tube used for pipe and plank protein models in 3D scenes
                Default Value: 30
                Unit: positive integer
              • Number proteins_ribbonThickness: the thickness of the mesh for the ribbon
                Default Value: 0.2
                Unit: Angstroms
              • Number proteins_tubeThickness: the thickness of tube meshes built for the pipe and plank models
                Default Value: 0.5
                Unit: Angstroms
              • Number proteins_plankSheetWidth: the thickness of the sheet planks built for the pipe and plank models
                Default Value: 3.5
                Unit: Angstroms
              • Number proteins_cylinderHelixDiameter: the diameter of the helix cylinders built for the pipe and plank models
                Default Value: 4
                Unit: Angstroms
              • Number proteins_verticalResolution: the vertical resolution of ribbon models, must be a positive integer; recommended 10 for hi, 6 for med, 3 for low
                Default Value: 10
                Unit: divisions
              • Number proteins_horizontalResolution: the horizontal resolution of ribbon models, must be a positive odd integer; recommended 9 for hi, 5 for med, 3 for low
                Default Value: 9
                Unit: divisions
              • String proteins_materialAmbientColor_3D: the ambient color for ribbons in 3D scenes
                Default Value: #222222
                Unit: color
              • String proteins_materialSpecularColor_3D: the specular color for ribbons in 3D scenes
                Default Value: #555555
                Unit: color
              • Number proteins_materialShininess_3D: the shininess of ribbons in 3D scenes
                Default Value: 32
                Unit: positive integer
              • Boolean nucleics_display: render tubes and platforms for nucleic acids, if any
                Default Value: true
                Unit: true/false
              • String nucleics_tubeColor: the color of the tubes and base handles for the nucleic acid models
                Default Value: #CCCCCC
                Unit: color
              • String nucleics_baseColor: the color of the base platforms for the nucleic acid models
                Default Value: #C10000
                Unit: color
              • String nucleics_residueColor: color residues by segment when set; by default this is ‘none’, and residues will not be individually colored
                Allowed Values: [none, shapely, rainbow]
                Default Value: none
              • Number nucleics_tubeThickness: the thickness of the tubes that define the backbones of the nucleic acids
                Default Value: 1.5
                Unit: Angstroms
              • Number nucleics_tubeResolution_3D: the resolution of the tube used for the backbones of nucleic acids in 3D scenes
                Default Value: 60
                Unit: positive integer
              • Number proteins_verticalResolution: the vertical resolution of nucleic backbone models, must be a positive integer; recommended 10 for hi, 6 for med, 3 for low
                Default Value: 10
                Unit: divisions
              • String nucleics_materialAmbientColor_3D: the ambient color for nucleic acid models in 3D scenes
                Default Value: #222222
                Unit: color
              • String nucleics_materialSpecularColor_3D: the specular color for nucleic acid models in 3D scenes
                Default Value: #555555
                Unit: color
              • Number nucleics_materialShininess_3D: the shininess of nucleic acid models in 3D scenes
                Default Value: 32
                Unit: positive integer
              • Boolean macro_displayAtoms: render the atoms of the proteins and nucleic acids macromolecules, if any
                Default Value: false
                Unit: true/false
              • Boolean macro_displayBonds: render the bonds of the proteins and nucleic acids macromolecules, if any
                Default Value: false
                Unit: true/false
              • Number macro_atomToLigandDistance: this is the cutoff distance that will determine the distance from ligand molecules that is required to show macromolecule atoms; if no ligands are present, or if there are no distances calculated, this specification will have no effect; the PDBInterpreter must be set to calculate distances; if this value is -1, then all atoms are shown regardless of distance
                Default Value: -1
                Unit: Angstroms
              • Boolean macro_showWater: render water molecules, if any
                Default Value: false
                Unit: true/false
              • Boolean macro_colorByChain: color each individual chain with a unique color, overriding any other coloring specifications; colors are iterated in order, through HSL space
                Default Value: false
                Unit: true/false
              • Array macro_rainbowColors: the colors to interpolate through for the rainbow
                Default Value: [#0000FF, #00FFFF, #00FF00, #FFFF00, #FF0000]
                Unit: Array<String>
              • //Surface Specifications
              • Boolean surfaces_display: render surfaces, if any
                Default Value: true
                Unit: true/false
              • String surfaces_style: the sruface rendering style
                Allowed Values: [Dot, Solid]
                Default Value: Dot
              • String surfaces_color: the color of the surface
                Default Value: #E9B862
                Unit: color
              • String surfaces_materialAmbientColor_3D: the ambient color for surfaces in 3D scenes
                Default Value: #000000
                Unit: color
              • String surfaces_materialSpecularColor_3D: the specular color for surfaces in 3D scenes
                Default Value: #000000
                Unit: color
              • Number surfaces_materialShininess_3D: the shininess of surfaces in 3D scenes
                Default Value: 32
                Unit: positive integer
              • //Spectrum Specifications
              • String plots_color: plot color
                Default Value: #000000
                Unit: color
              • Number plots_width: width of the plot line
                Default Value: 1
                Unit: pixels
              • Boolean plots_showIntegration: display an integration line, typically for NMR spectra
                Default Value: false
                Unit: true/false
              • String plots_integrationColor: integration line color
                Default Value: #c10000
                Unit: color
              • Number plots_integrationLineWidth: width of the integration line
                Default Value: 1
                Unit: pixels
              • Boolean plots_showGrid: display an grid using the axes’ ticks
                Default Value: false
                Unit: true/false
              • String plots_gridColor: integration line color
                Default Value: gray
                Unit: color
              • Number plots_gridLineWidth: width of the integration line
                Default Value: 0.5
                Unit: pixels
              • Boolean plots_showYAxis: display the y-axis
                Default Value: true
                Unit: true/false
              • Boolean plots_flipXAxis: flip the x-axis, typical for certain domain units of NMR and IR spectra
                Default Value: false
                Unit: true/false
              • //Shape Specifications
              • Number text_font_size: shape text font size
                Default Value: 12
                Unit: points
              • Array text_font_families: the shape text font families, families cascade through the array if not found on the users computer
                Default Value: [Helvetica, Arial, Dialog]
                Unit: Array<String>
              • Boolean text_font_bold: shape text will be bold
                Default Value: false
                Unit: true/false
              • Boolean text_font_italic: shape text will be italic
                Default Value: false
                Unit: true/false
              • Boolean text_font_stroke_3D: this specification determines whether labels in WebGL scenes will have a black stroke behind them to improve contrast in complex graphics
                Default Value: true
                Unit: true/false
              • String text_color: shape text color
                Default Value: #000000
                Unit: color
              • String shapes_color: shape color
                Default Value: #000000
                Unit: color
              • Number shapes_lineWidth: shape line width
                Default Value: 1
                Unit: pixels
              • Number shapes_arrowLength_2D: length of any associated arrows
                Default Value: 8
                Unit: pixels
              • Boolean compass_display: this specification determines whether the compass is displayed at the bottom-left of WebGL scenes
                Default Value: false
                Unit: true/false
              • String compass_axisXColor_3D: compass X arrow color
                Default Value: #FF0000
                Unit: color
              • String compass_axisYColor_3D: compass Y arrow color
                Default Value: #00FF00
                Unit: color
              • String compass_axisZColor_3D: compass Z arrow color
                Default Value: #0000FF
                Unit: color
              • Number compass_size_3D: The size of the compass
                Default Value: 50
                Unit: positive integer
              • Number compass_resolution_3D: The resolution of the compass
                Default Value: 10
                Unit: positive integer
              • Boolean compass_displayText_3D: If true, the compass will display labels for the axes (X,Y,Z)
                Default Value: true
                Unit: true/false
              • Number compass_type_3D: the type of compass to be rendered: 0 – bottom left mesh; 1 – center lined strokes
                Allowed Values: [0, 1]
                Default Value: 0
                Unit: pixels
              • Boolean measurement_update_3D: Set this to true to have measurements update on repaint, for dynamic scenes; leave it false for static scenes to improve performance
                Default Value: false
                Unit: true/false
              • Number measurement_angleBands_3D: The resolution of the angle arcs for measurements
                Default Value: 10
                Unit: positive integer
              • Boolean measurement_displayText_3D: If true, text will display the measurement values
                Default Value: true
                Unit: true/false
              • Function set3DRepresentation(String representation): presets the 3D representation for the main molecular structure for a Canvas3D, currently accepts: ‘Ball and Stick’, ‘van der Waals Spheres’, ‘Stick’, ‘Wireframe’, ‘Line’

              ChemDoodle.structures.Point

              represents a 2D point and contains functions for various 2D geometric calculations

              constructor = new Function Point(Number x, Number y)

              • Number x: x coordinate
                Default Value: 0
                Unit: pixels
              • Number y: y coordinate
                Default Value: 0
                Unit: pixels
              • Function add(Point p): add Point p
              • Function angle(Point p): returns the angle to Point p, with the current Point as the origin (y-axis is inverted for the inverted canvases)
                returns Number
                Unit: radians
              • Function angleForStupidCanvasArcs(Point p): same as angle(), but for the contradictory way canvas arcs are handled
                returns Number
                Unit: radians
              • Function distance(Point p): returns the distance to Point p
                returns Number
                Unit: pixels
              • Function sub(Point p): subtract Point p

              ChemDoodle.structures.Query

              this data structure holds query information for chemical objects; range type query variables are arrays filled with objects defining x and y parameters, for a single value range parameter, only x is defined

              constructor = new Function Query(Number type)

              • static String TYPE_ATOM: specifies an atom query
              • static String TYPE_BOND: specifies a bond query
              • String cache: this stores the current value of the query as a String; caching improves rendering performance, make sure to reset the cache if you change the Query by setting it to the output of the toString() function
              • Array elements: this array contains values for the element identity variable, including generics
              • Array charge: this array contains values for the atom charge variable, which is a range variable
              • String chirality: this hash variable defines the stereochemical configuration of the atom
                Allowed Values: [A, R, S]
              • Array connectivity: this array contains values for the atom connectivity variable (all connections including hydrogen), which is a range variable
              • Array connectivityNoH: this array contains values for the atom connectivityNoH variable (all connections excluding hydrogen), which is a range variable
              • Array hydrogens: this array contains values for the atom hydrogen count variable, which is a range variable
              • Boolean hydrogens: this boolean variable defines whether an atom is saturated or not
              • Array orders: this array contains values for the bond type identity variable, including generics
              • String stereo: this hash variable defines the stereochemical configuration of the bond
                Allowed Values: [A, E, Z]
              • Boolean aromatic: this boolean variable defines whether an object is aromatic or not
              • Array ringCount: this array contains values for the object ring count variable, which is a range variable
              • Number type: this type specifies the query context; defined with the static members of this class
              • String stereo: stereochemical bias of the bond, must be one of the BOND_STEREO constants
                Default Value: BOND_STEREO_NONE
              • Function draw(Context ctx, VisualSpecifications specs, Point pos): draws this query to the canvas that owns the Context using the given VisualSpecifications at the input position
              • Function outputRange(Array range): returns a string representing the input range objects
                returns String
              • Function parseRange(String value): returns an array of range values corresponding to the input string value
                returns Array
              • Function toString(): returns a string representing this query in the ChemDoodle query notation format
                returns String

              ChemDoodle.structures.Atom

              represents a chemical atom

              constructor = new Function Atom(String label, Number x, Number y, Number z)

              prototype = Point

              • String label: label of the atom, should be an element symbol; this field is chemically significant and will be expected to be an element symbol
                Default Value: C
                Unit: Element Symbol
              • String altLabel: alternate text to be displayed for an atom, which will override the rendering of the element symbol and any associated attributes; this field is ignored if undefined
                Default Value: undefined
              • Number z: z coordinate
                Default Value: 0
                Unit: pixels
              • Number charge: atomic charge
                Default Value: 0
              • Number mass: mass number, values greater than -1 are rendered
                Default Value: -1
              • Number numLonePair: number of lone pairs to be rendered on an atom; this is a positive integer value
                Default Value: 0
              • Number numRadical: number of radical electrons to be rendered on an atom; this is a positive integer value
                Default Value: 0
              • Boolean isLone: not connected to any other atoms (if Carbon, draws a grey dot)
              • Boolean isHover: if true, this represents that the mouse is hovered, draws a brown circle
              • Boolean isSelected: if true, this represents that this atom is selected, draws a blue circle
              • Boolean isOverlap: for SketcherCanvas, overlaps another atom, draws a red circle
              • Boolean isLassoed: for SketcherCanvas, this atom is contained in the lasso
              • Boolean isHidden: metadata set by the containing Molecule, states if the Atom is hidden
              • Number coordinationNumber: metadata set by the containing Molecule, the valency of the Atom
              • Number bondNumber: metadata set by the containing Molecule, the number of bonds connected to the Atom
              • Number angleOfLeastInterference: metadata set by the containing Molecule, the angle in radians that points towards the largest open space between the bonds connected to the atom
              • Array angles: metadata set by the containing Molecule, an Array of Number storing the bond angle information from this atom
              • Query query: this object stores the query information for this atom; if it is undefined, then there is no query associated with this atom
                Default Value: undefined
              • Point molCenter: metadata set by the containing Molecule, the center of the molecule that contains this atom
              • Function add3D(Atom a): the 3D counterpart to the same Point function
              • Function distance3D(Atom a): the 3D counterpart to the same Point function
              • Function draw(Context ctx, VisualSpecifications specs): draws this atom to the canvas that owns the Context using the given VisualSpecifications
              • Function drawDecorations(Context ctx): draws decorations for the SketcherCanvas that owns the Context and has this Atom hovered
              • Function drawElectrons(Context ctx): draws electrons for the SketcherCanvas that owns the Context and has this Atom hovered
              • Function getBounds(): returns a Bounds object containing the 2D bounds of the graphical atom
                returns Bounds
              • Function getBounds3D(): returns a Bounds object containing the 3D bounds of the graphical atom
                returns Bounds
              • Function getElementColor(Boolean useJMOLColors, Boolean usePYMOLColors, String color, Number dim): this is a helper function for the rendering functions; given the input choices, a color is returned with which to render the atom with
                returns String
              • Function getImplicitHydrogenCount(): returns the number of implicit hydrogens
                returns Number
              • Function isLabelVisible(VisualSpecifications specs): returns true if label is not ‘C’
                returns Boolean
                Unit: true/false
              • Function render(GLContext gl, VisualSpecifications specs, Boolean noColor): renders this atom to the 3D scene in the WebGL canvas that owns the GLContext using the given VisualSpecifications; noColor is a parameter only used by the picking system
              • Function renderHighlight(GLContext gl, VisualSpecifications specs): renders the highlight for this atom the given VisualSpecifications
              • Function sub3D(Atom a): the 3D counterpart to the same Point function

              ChemDoodle.structures.Ring

              represents a chemical ring

              constructor = new Function Ring()

              • Array atoms: constituent atoms
              • Array bonds: constituent bonds
              • Point center: the center of this Ring, cached for performance
              • Function getCenter(): returns a Point that specifies the center of this Ring
                returns Point
                Unit: pixels
              • Function setupBonds(Point p): loops through bonds and sets all Bond.ring objects in to itself, caches center

              ChemDoodle.structures.Bond

              represents a chemical bond

              constructor = new Function Bond(Atom a1, Atom a2, Number bondOrder)

              • static String STEREO_NONE: specifies no stereochemistry
              • static String STEREO_PROTRUDING: specifies a protruding stereochemistry
              • static String STEREO_RECESSED: specifies a recessed stereochemistry
              • static String STEREO_AMBIGUOUS: specifies an ambiguous stereochemistry
              • Atom a1: first Atom
              • Atom a2: second Atom
              • Number bondOrder: bond order
                Allowed Values: [0.5, 1.0, 1.5, 2.0, 3.0]
                Default Value: 1
              • Query query: this object stores the query information for this bond; if it is undefined, then there is no query associated with this bond
                Default Value: undefined
              • String stereo: stereochemical bias of the bond, must be one of the BOND_STEREO constants
                Default Value: BOND_STEREO_NONE
              • Boolean isHover: if true, this represents that this bond is selected, draws brown handles
              • Boolean isSelected: if true, this represents that this atom is selected, draws blue handles
              • Ring ring: the largest containing SSSR ring
              • Point molCenter: metadata set by the containing Molecule, the center of the molecule that contains this bond
              • Function contains(Atom a): returns true if this Bond connects to the input atom
                returns Boolean
                Unit: true/false
              • Function draw(Context ctx, VisualSpecifications specs): draws this bond to the canvas that owns the Context using the given VisualSpecifications
              • Function drawDecorations(Context ctx): draws decorations for the SketcherCanvas that owns the Context and has this Bond hovered
              • Function drawLewisStyle(Context ctx, VisualSpecifications specs, Number y1, Number x2, Number x1, Number y2): draws this bond in Lewis Dot style given the input parameters
              • Function getCenter(): returns a Point that specifies the center between the two Atoms in the Bond
                returns Point
                Unit: pixels
              • Function getLength(): returns the bond length on the XY plane
                returns Number
                Unit: pixels
              • Function getLength3D(): returns the 3D bond length
                returns Number
                Unit: pixels
              • Function getNeighbor(Atom a): returns the Atom opposite Atom a
                returns Atom
              • Function render(GLContext gl, VisualSpecifications specs): renders this bond to the 3D scene in the WebGL canvas that owns the GLContext using the given VisualSpecifications
              • Function renderHighlight(GLContext gl, VisualSpecifications specs): renders the highlight for this bond the given VisualSpecifications
              • Function renderPicker(GLContext gl, VisualSpecifications specs): this function renders the bond for the picking system

              ChemDoodle.structures.Molecule

              represents a chemical molecule

              constructor = new Function Molecule()

              • Array atoms: constituent atoms
              • Array bonds: constituent bonds
              • Array rings: constituent rings
              • Boolean findRings: will find rings in the check() function; this should be disabled by you, if not necessary, to improve performance
                Default Value: true
              • Function check(Boolean force): sets up the molecule for drawing by checking for lone carbons, rings and z-sorting, as well as setting up the metadata for drawing; since this is a cpu intensive function, the force parameter is for efficiency, so the molecule can be checked often, with a false or no parameter and it will keep track that it needs to be checked, then when an important function (such as a render) needs the check to go through, you pass it a true and the check will be forced if the molecule needs to be checked.
              • Function draw(Context ctx, VisualSpecifications specs): draws this molecule to the canvas that owns the Context using the given VisualSpecifications
              • Function getAngles(Atom a): with a as the origin, returns an Array of all the angles to the immediately connected atoms in this Molecule, in ascending order
                returns Array
                Unit: radians
              • Function getAverageBondLength(): calculates the average bond length of the molecule, or returns 0 if there are no bonds, this is a 2D function
                returns Number
                Unit: pixels
              • Function getBonds(Atom a): returns an Array of Bond objects that contain the input Atom a in the molecule
                returns Array
                Unit: Bond
              • Function getBounds(): returns a Bounds object containing the 2D bounds of the graphical molecule
                returns Bounds
              • Function getBounds3D(): returns a Bounds object containing the 3D bounds of the graphical molecule
                returns Bounds
              • Function getCenter(): returns a Point that specifies the center of this Molecule
                returns Point
                Unit: pixels
              • Function getCenter3D(): returns an Atom that specifies the center of this Molecule in 3 dimensions
                returns Atom
                Unit: pixels
              • Function getCoordinationNumber(Array bs): adds the bond orders from the bs (Array of Bond) parameter together to calculate the coordination number
                returns Number
                Unit: coordination number
              • Function getDimension(): returns a Point that specifies the width and height of this Molecule in the XY plane. Among other uses, this method can be used to first find the dimensions of a molecule to set the dimensions of a Canvas to perfectly fit it (make sure to add some aesthetic buffer space).
                returns Point
                Unit: pixels
              • Function render(GLContext gl, VisualSpecifications specs): renders this molecule to the 3D scene in the WebGL canvas that owns the GLContext using the given VisualSpecifications
              • Function renderPickFrame(GLContext gl, VisualSpecifications specs, Array objects, Boolean includeAtoms, Boolean includeBonds): renders the picking scene to the backbuffer for analysis; objects is an indexed array that stores the object information for the primitive geometries; includeAtoms and includeBonds determine if these objects will be selectable
              • Function scaleToAverageBondLength(Number length): scales the molecule so that the average bond length equals the input length, this is a 2D function
              • Function setupMetaData(): sets up metadata for the molecule, used internally to determine how graphics are rendered
              • Function sortAtomsByZ(): sorts atoms in ascending order by z coordinate
              • Function sortBondsByZ(): sorts bonds in ascending order by their z coordinate

              ChemDoodle.structures.Spectrum

              data structure to hold spectrum information

              constructor = new Function Spectrum()

              • Array data: the spectrum plot as an array of Point objects
              • Array metadata: this is an Array of String containing the header records from the JCAMP file
              • Array dataDisplay: this is an Array of Object. Each object describes an item in the list of data items to be displayed on the top left of the spectrum. Three String parameters may be present: tag, display, value. If tag is present, then the JCAMP metadata will be searched for the corresponding JCAMP tag and placed in the list. If this tag is not found, it is ignored. If display is also provided, then the JCAMP tag name is replaced by the more appropriate title. You can also add custom items by providing the display and value parameters. If the value parameter is defined, then the tag parameter will be ignored if also defined.
              • Number minX: the minimum domain value, set up by the setup method to the smallest x value in the data array after the spectrum is read, can also be manually set
              • Number maxX: the maximum domain value, set up by the setup method to the largest x value in the data array after the spectrum is read, can also be manually set
              • Number integrationSensitivity: this value states that only values greater than this percentage of the highest y-value in the spectrum will be considered in the integration
                Default Value: 0.01
                Unit: %/100
              • String title: the title of the spectrum, most spectrum file formats provide a title, no title is displayed if the value is undefined
                Default Value: undefined
              • String xUnit: the unit of the domain to be displayed under the x-axis, no x-axis title is displayed if the value is undefined
                Default Value: undefined
              • String yUnit: the unit of the domain to be displayed under the y-axis, no y-axis title is displayed if the value is undefined
                Default Value: undefined
              • Boolean continuous: determines how the plot will be drawn, if continuous is true, then the plot is rendered as a path from Point to Point in the data array, if continuous is false, then each data point will be rendered as a vertical line from y = 0
                Default Value: true
              • Object memory: an object storing dimension metadata from the previous render
              • Function alertMetadata(): will popup a Javascript alert dialog with the metadata from the JCAMP file
              • Function draw(Context ctx, VisualSpecifications specs, Number width, Number height): draws this spectrum and graph to the canvas that owns the Context using the given VisualSpecifications, the canvas’s width and height are also provided
              • Function drawPlot(Context ctx, VisualSpecifications specs, Number width, Number height, Number offsetTop, Number offsetLeft, Number offsetBottom): draws the spectrum plot to the canvas that owns the Context using the given VisualSpecifications, the canvas’s width and height, and the offsets from the top, bottom, and left are also provided
              • Function getClosestPlotInternalCoordinates(Number x): given the input x-coordinate from the canvas space, this function will return a point containing the plot coordinates of the spectrum point that has its x-coordinate closest to the input x coordinate; because the smallest resolution on screens is a pixel, this function will actually find the highest peak within a pixel range of the input x coordinate to return; can only be called after a render when memory is set, this function doesn’t make sense without a render first anyway
                returns Point
                Unit: spectrum units
              • Function getInternalCoordinates(Number x, Number y): function to obtain the x and y coordinates within the spectrum’s plot space given the input x and y coordinates from the canvas space; can only be called after a render when memory is set, this function doesn’t make sense without a render first anyway; essentially, this just calls getInverseTransformedX() and getInverseTransformedY()
                returns Point
                Unit: spectrum units
              • Function getInverseTransformedX(Number x): function to obtain the x-coordinate within the spectrum’s plot space given the input x-coordinate from the canvas space; can only be called after a render when memory is set, this function doesn’t make sense without a render first anyway
                returns Number
                Unit: x axis units
              • Function getInverseTransformedY(Number y): function to obtain the y-coordinate within the spectrum’s plot space given the input y-coordinate from the canvas space; can only be called after a render when memory is set, this function doesn’t make sense without a render first anyway
                returns Number
                Unit: y axis units
              • Function getTransformedX(Number x, VisualSpecifications specs, Number width, Number offsetLeft): used internally to obtain the x-coordinate within the canvas space given the input x-coordinate from the spectrum’s plot space
                returns Number
                Unit: pixels
              • Function getTransformedY(Number x, VisualSpecifications specs, Number height, Number offsetBottom, Number offsetTop): used internally to obtain the y-coordinate within the canvas space given the input y-coordinate from the spectrum’s plot space
                returns Number
                Unit: pixels
              • Function setup(): analyzes the data array for the default domain and scales the range between 0 and 1, called by the interpreters that read spectra files
              • Function translate(Number dif, Number width): given the signed translation amount in pixels in the canvas’s domain space (in any order), will translate that domain by appropriately setting the minX and maxX parameters given the canvas width
              • Function zoom(Number pixel1, Number pixel2, Number width, Boolean scaleY): given the input pixel1 and pixel2 values in the canvas’s domain space (in any order), will focus in on that domain by appropriately setting the minX and maxX parameters given the canvas width; optionally, if the scaleY parameter is true, this function will return a Number that should be the new scale for the VisualSpecifications.scale value to see the full peak; this function returns nothing if scaleY is false
                returns Number newScale

              ChemDoodle.structures.Queue

              a queue data structure

              constructor = new Function Queue()

              • Function dequeue(): returns and removes the element at the beginning of the queue
                returns Object
              • Function enqueue(Object o): adds an element to the end of the queue
                returns Object
              • Function getOldestElement(): returns, but does not remove, the element at the beginning of the queue
                returns Object
              • Function getSize(): returns the size of the queue
                returns Number
              • Function isEmpty(): returns true if there are no elements in the queue
                returns Boolean

              ChemDoodle.structures.d2

              this package hosts all data structures that represent 2D objects that are rendered in 2D canvases.

                ChemDoodle.structures.d2._Shape

                the parent data structure for all 2D shapes, it should not be instantiated.

                • Function drawAnchor(Context ctx, VisualSpecifications specs, Point p, Boolean hovered): draws this shape’s anchor to the SketcherCanvas that owns the Context using the given VisualSpecifications and mouse position
                • Function drawDecorations(Context ctx, VisualSpecifications specs): draws this shape’s decorations to the SketcherCanvas that owns the Context using the given VisualSpecifications
                • Function getBounds(): returns a Bounds object containing the 2D bounds of the shape
                  returns Bounds

                ChemDoodle.structures.d2.Line

                represents a 2D line, arrows can be attached

                constructor = new Function Line(Point p1, Point p2)

                • static String ARROW_SYNTHETIC: specifies a synthetic arrow
                • static String ARROW_RETROSYNTHETIC: specifies a retrosynthetic arrow
                • static String ARROW_RESONANCE: specifies a resonance arrow
                • static String ARROW_EQUILIBRIUM: specifies a equilibrium arrow
                • String arrowType: the arrow type the line is to be rendered as; if undefined, the line is rendered as a plain line
                  Default Value: undefined
                • String topText: the text to be rendered above the arrow (conditions, etc.); if undefined, no text is rendered above the arrow
                  Default Value: undefined
                • String bottomText: the text to be rendered below the arrow; if undefined, no text is rendered below the arrow
                  Default Value: undefined
                • Point p1: the set of coordinates that represent the start of the line
                • Point p2: the set of coordinates that represent the end of the line
                • Function draw(Context ctx, VisualSpecifications specs): draws this line to the canvas that owns the Context using the given VisualSpecifications
                • Function getPoints(): returns an Array of Point objects that contains p1 and p2
                  returns Array
                  Unit: Point
                • Function isOver(Point p, Number barrier): returns true if the input point is above the shape
                  returns Boolean

                ChemDoodle.structures.d2.Pusher

                represents electron movement, draws a bezier curve between the chemical objects involved with the transfer

                constructor = new Function Pusher(Object o1, Object o2, Integer numElectron)

                • Integer numElectron: the number of electrons being pushed; if the number is -1, this is a bond forming pusher
                  Default Value: 1
                  Unit: 1, 2 or -1
                • Object o1: the chemical object (atom or bond) that the electron(s) are coming from
                • Object o2: the chemical object (atom or bond) that the electron(s) are moving to
                • Function draw(Context ctx, VisualSpecifications specs): draws this pusher to the canvas that owns the Context using the given VisualSpecifications
                • Function getPoints(): returns an empty Array
                  returns Array
                  Unit: Point
                • Function isOver(Point p, Number barrier): returns true if the input point is above the shape
                  returns Boolean

                ChemDoodle.structures.d2.Bracket

                represents a 2D bracket with a charge

                constructor = new Function Bracket(Point p1, Point p2)

                • Number charge: an Integer describing the charge amount associated with this bracket; this number is rendered at the top-right of the bracket
                  Default Value: 0
                • Number mult: an Integer describing the multiple associated with this bracket, useful for reaction schemes; this number is rendered at the left center of the bracket
                  Default Value: 0
                • Number repeat: an Integer describing the repeat count associated with this bracket, useful for polymers; this number is rendered at the bottom-right of the bracket
                  Default Value: 0
                • Point p1: the set of coordinates that represent the start of the bracket
                • Point p2: the set of coordinates that represent the end of the bracket (opposite corner from the start)
                • Function draw(Context ctx, VisualSpecifications specs): draws this bracket to the canvas that owns the Context using the given VisualSpecifications
                • Function getPoints(): returns an Array of Point objects that contains p1 and p2
                  returns Array
                  Unit: Point
                • Function isOver(Point p, Number barrier): returns true if the input point is above the shape
                  returns Boolean

                ChemDoodle.structures.d3

                this package hosts all data structures that represent 3D objects that are rendered in 3D canvases.

                  ChemDoodle.structures.d3._Mesh

                  parent class for all 3D shapes, it should not be instantiated.

                  • Array positionData: an array of floating point values that describe the position of verticies in a mesh.
                  • Array normalData: an array of floating point values that describe the surface normals
                  • Array indexData: an array of integer values that indexes the triplets contained within the positionData and normalData arrays
                  • Function bindBuffers(GLContext gl): binds the vertex buffers to the given WebGL context; calls setupBuffers if buffers have not been already set up.
                  • Function generateBuffers(GLContext gl, Array normalData, Array indexData): given a WebGL context and vertex buffer data, returns an array containing the position, normal, and index buffers.
                  • Function setupBuffers(GLContext gl): sets up vertex buffers for a given WebGL context prior to rendering.
                  • Function storeData(Array positionData, Array normalData, Array indexData): stores position, normal, and index vertex buffer data for later use by other methods.

                  ChemDoodle.structures.d3._Measurement

                  parent class for all 3D measurements, it should not be instantiated.

                  prototype = _Mesh

                  • Function render(GLContext gl, VisualSpecifications specs): renders the measurement to the given WebGL context according to the provided visual specifications
                  • abstract Function calculateData(VisualSpecifications specs): abstract method for measuring the desired quantity and generating rendering data for use in a 3D canvas.
                  • abstract Function getText(VisualSpecifications specs): abstract method for returning an object with the position and value the measurementfor rendering as text in a 3D canvas
                    returns Object

                  ChemDoodle.structures.d3.Angle

                  a child of the _Measurement class, represents the angle between three atoms

                  constructor = new Function Angle(Atom a1, Atom a2, Atom a3)

                  prototype = _Measurement

                  • Atom a1: first of three atoms that form the angle.
                  • Atom a2: second of three atoms that form the angle.
                  • Atom a3: third of three atoms that form the angle.
                  • vec3 vec1: vector from a1 to a2, computed by calculateData
                  • vec3 vec2: vector from a2 to a3, computed by calculateData
                  • Number angle: angle formed by vec1 and vec2, computed by calculateData
                  • override Function calculateData(VisualSpecifications specs): calculates the angle between the three atoms and creates the required data to render the angle in a 3D canvas.
                  • override Function getText(VisualSpecifications specs): returns an object with the position and value of the angle for rendering as text in a 3D canvas
                    returns Object

                  ChemDoodle.structures.d3.Arrow

                  a child of the _Mesh class, represents a cylindrical arrow with head

                  constructor = new Function Arrow(Number radius, Number bands)

                  prototype = _Mesh

                    ChemDoodle.structures.d3.Box

                    a child of the _Mesh class, represents a 3D rectangular prism, or box

                    constructor = new Function Box(Number width, Number height, Number depth)

                    prototype = _Mesh

                      ChemDoodle.structures.d3.Compass

                      helper object to render the compass

                      constructor = new Function Compass(GLContext gl, VisualSpecifications specs)

                      ChemDoodle.structures.d3.Cylinder

                      a child of the _Mesh class, represents a 3D cylinder

                      constructor = new Function Cylinder(Number radius, Number height, Number bands, Boolean closed)

                      prototype = _Mesh

                        ChemDoodle.structures.d3.Distance

                        a child of the _Measurement class, represents the distance between two atoms

                        constructor = new Function Distance(Atom a1, Atom a2, vec3 node, Number offset)

                        prototype = _Measurement

                        • Atom a1: first of the two atoms whose distance is being measured.
                        • Atom a2: second of the two atoms whose distance is being measured.
                        • vec3 node: an optional vector that displaces the measured vector from the midpoint of the two atoms
                        • Number offset: an optional distance to offset the measurement text
                        • override Function calculateData(VisualSpecifications specs): calculates the distance between the two atoms and creates the required data to render the distance in a 3D canvas.
                        • override Function getText(VisualSpecifications specs): returns an object with the position and value of the distance for rendering as text in a 3D canvas
                          returns Object

                        ChemDoodle.structures.d3.Line

                        a child of the _Mesh class, represents a line

                        constructor = new Function Line()

                        prototype = _Mesh

                          ChemDoodle.structures.d3.MolecularSurface

                          a child of the _Mesh class, represents a molecular surface, (such as a van der Waals surface).

                          constructor = new Function MolecularSurface(Molecule molecule, Number latitudeBands, Number longitudeBands, Number probeRadius, Number atomRadius)

                          prototype = _Mesh

                            ChemDoodle.structures.d3.Pill

                            a child of the _Mesh class, represents a 3D pill geometry

                            constructor = new Function Pill(Number radius, Number height, Number latitudeBands, Number longitudeBands)

                            prototype = _Mesh

                              ChemDoodle.structures.d3.Ribbon

                              a child of the _Mesh class, represents a ribbon typically used in protein renderings

                              constructor = new Function Ribbon(Array chain, Number offset, Boolean cartoon)

                              prototype = _Mesh

                              • Array paritions: an array of sub-meshes that make up the ribbon
                              • Array segments: an array of sub-meshes that make up residues in the ribbon.
                              • Array cartoonSegments: an array of sub-meshes that make up cartoonized residues in the ribbon.
                              • Integer partitions.lastRender: keeps track of last partition rendered
                              • Boolean front: indicates whether the front or the back of the ribbon is visible.
                              • Function render(GLContext gl, VisualSpecifications specs): renders the ribbon to the given WebGL context according to the provided visual specifications
                              • override Function storeData(Array positionData, Array normalData, Array indexData): overrides the storeData function of the Mesh class to pull vertex data from the first member of the partition array; clears the partition array to save memory if there is only one partition.

                              ChemDoodle.structures.d3.Shape

                              a child of the _Mesh class, represents a shape described by a set of points in the xy plane and a thickness in the z plane.

                              constructor = new Function Shape(Array points, Number thickness)

                              prototype = _Mesh

                                ChemDoodle.structures.d3.Sphere

                                a child of the _Mesh class, respresents a sphere with a given radius and number of latitude and longitude bands.

                                constructor = new Function Sphere(Number radius, Number latitudeBands, Number latitudeBands)

                                prototype = _Mesh

                                  ChemDoodle.structures.d3.Star

                                  a child of the _Mesh class, represents a small star (mainly used to depict solvent in macromolecule renderings).

                                  constructor = new Function Star()

                                  prototype = _Mesh

                                    ChemDoodle.structures.d3.Tube

                                    a child of the _Mesh class, represents a tube of the sort typically used in macromolecular backbone renderings.

                                    constructor = new Function Tube(Array chain, Number thickness, Number cylinderResolution)

                                    prototype = _Mesh

                                    • Array paritions: cylindrical meshes that make
                                    • Array ends: sphere meshes at the end of the each tube.
                                    • Function render(GLContext gl, VisualSpecifications specs): renders the tube to the given WebGL context according to the provided visual specifications

                                    ChemDoodle.structures.d3.UnitCell

                                    a child of the _Mesh class, represents a crystallographic unit cell rendered from a set of vectors.

                                    constructor = new Function UnitCell(vec3 unitCellVectors)

                                    prototype = _Mesh

                                    ChemDoodle.structures.d3.Light

                                    represents a light source with given RGB specular and diffuse colors, as well as a vector describing the direction it is shining in.

                                    constructor = new Function Light(String specularColor, String diffuseColor, vec3 direction)

                                    • Array diffuseColor: an array of RGB values describing the diffuse color of the light.
                                    • Array specularColor: an array of RGB values describing the specular color of the light.
                                    • vec3 direction: a vector pointing in the direction that the light is shining.

                                    ChemDoodle.structures.d3.Material

                                    contains material properties for a given 3D context

                                    constructor = new Function Material(GLContext gl)

                                    • Array aCache: array storing the ambient color.
                                    • Array dCache: array storing the diffuse color.
                                    • Array sCache: array storing the specular color.
                                    • Number snCache: current shininess value.
                                    • Number alCache: current alpha value.
                                    • Function setDiffuseColor(Array diffuseColor): sets the diffuse color to the values contained in the provided array.
                                    • Function setDiffuseColor(Number alpha): sets the alpha transparency value.
                                    • Function setTempColors(Array ambientColor, Array diffuseColor, Array specularColor, Number shininess): sets temporary values for all colors and shininess.

                                    ChemDoodle.structures.d3.Shader

                                    a vertex and fragment shader for WebGL canvases.

                                    • Function getShader(GLContext gl, String id): finds the shader code described in the element with the given id, and compiles it for the given WebGL canvas.
                                    • Function init(GLContext gl): initializes the vertex and fragment shaders for a given WebGL canvas.
                                    • Function init(GLContext gl): initializes the vertex and fragment shaders for a given WebGL canvas.
                                    • Function loadDefaultFragmentShader(GLContext gl): loads the default fragment shader for a given WebGL canvas.
                                    • Function loadDefaultVertexShader(GLContext gl): loads the default vertex shader for a given WebGL canvas.

                                    ChemDoodle.structures.d3.Fog

                                    handles fogging for WebGL canvases.

                                    constructor = new Function Fog(GLContext gl)

                                    ChemDoodle.structures.d3.TextImage

                                    this class manages an invisible 2D <canvas> for rendering character data to be used in WebGL components.

                                    constructor = new Function TextImage()

                                      ChemDoodle.structures.d3.TextMesh

                                      this class creates the WebGL text objects that are rendered to WebGL components.

                                      constructor = new Function TextMesh()

                                        ChemDoodle.structures.d3.TextShader

                                        this class handles the rendering of text textures that are rendered to WebGL components.

                                        constructor = new Function TextShader()

                                          ChemDoodle.structures.d3.Label

                                          this class sets up WebGL text objects for the chemical objects and manipulates the current shader for rendering.

                                          constructor = new Function Label()

                                            ChemDoodle.structures.d3.Picker

                                            this class manages the picking system for WebGL components.

                                            constructor = new Function Picker()

                                            ChemDoodle.uis

                                            this package contains all of the classes and source to implement the advanced user interfaces which currently includes the ChemDoodle Web Sketcher the ChemDoodle Web 3D Editor. This package is not avaialble in the ChemDoodle Web Components core. It is added by including the ChemDoodle Web Components uis extensions.

                                              ChemDoodle.uis.actions

                                              this package contains all Action classes. Actions define changes to content in the sketcher that can be undone and redone.

                                                ChemDoodle.uis.actions._Action

                                                is the parent class for actions associated with the sketcher. Its basic functionality allows for content to be changed and the ability to reverse those changes.

                                                constructor = new Function _Action()

                                                • Function checks(SketcherCanvas sketcher): checks the content of the given sketcher, reassessing any metadata after the change, finishing by repainting the sketcher
                                                • Function forward(SketcherCanvas sketcher): performs the action for the given sketcher instance
                                                • Function reverse(SketcherCanvas sketcher): reverses the action for the given sketcher instance
                                                • abstract Function innerforward(): must be defined by child Actions to execute the forward changes, is called by forward()
                                                • abstract Function innerreverse(): must be defined by child Actions to execute the reverse changes, is called by reverse()

                                                ChemDoodle.uis.actions.AddAction

                                                is a child of the Action class and handles adding bonds and atoms to a single molecule.

                                                constructor = new Function AddAction(SketcherCanvas sketcher, Atom a, Array as, Array bs)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Atom a: the Atom that identifies the molecule that atoms and bonds are added to
                                                • Array as: the atoms to be added
                                                • Array bs: the bonds to be added
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.AddShapeAction

                                                is a child of the Action class and handles adding a single shape to the sketcher.

                                                constructor = new Function AddShapeAction(SketcherCanvas sketcher, _Shape s)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • _Shape s: the shape that is added to the sketcher
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeBondAction

                                                is a child of the Action class and handles changing the bond type of a Bond.

                                                constructor = new Function ChangeBondAction(Bond b, Integer orderAfter, String stereoAfter)

                                                prototype = _Action

                                                • Bond b: the manipulated bond
                                                • Integer orderBefore: the bond order before the change
                                                • Integer orderAfter: the bond order after; if not provided, this value will be the incrementation of orderBefore, or 1 if orderBefore is 3
                                                • String stereoBefore: the bond stereochemistry setting before the change; this should be one of the Bond stereochemistry values
                                                • String stereoAfter: the bond stereochemistry setting before the change; this should be one of the Bond stereochemistry values; if not provided, this value will be STEREO_NONE
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeBracketChargeAction

                                                is a child of the Action class and handles changing charges for the Charge Bracket shape.

                                                constructor = new Function ChangeBracketChargeAction(Bracket s, Number delta)

                                                prototype = _Action

                                                • Bracket s: the manipulated bracket
                                                • Number delta: the change in charge amount
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeChargeAction

                                                is a child of the Action class and handles changing charges for an Atom.

                                                constructor = new Function ChangeChargeAction(Atom a, Number delta)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • Number delta: the change in charge amount
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeCoordinateAction

                                                is a child of the Action class and handles changing coordinates for a set of Atoms.

                                                constructor = new Function ChangeCoordinateAction(Array as, Array newCoords)

                                                prototype = _Action

                                                • Array as: the manipulated atoms
                                                • Array recs: an array of objects storing the before and after coordinates for the given atoms based on their current coordinates and the newCoords parameter
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeLabelAction

                                                is a child of the Action class and handles changing labels for an Atom.

                                                constructor = new Function ChangeLabelAction(Atom a, String after)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • String before: the label before the change
                                                • String after: the label after the change
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeLonePairAction

                                                is a child of the Action class and handles changing the number of lone pairs for an Atom.

                                                constructor = new Function ChangeLonePairAction(Atom a, Number delta)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • Number delta: the change in lone pair count
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeQueryAction

                                                is a child of the Action class and handles changing queries for an Atom.

                                                constructor = new Function ChangeQueryAction(Object o, String after)

                                                prototype = _Action

                                                • Object o: the manipulated object, an atom or bond
                                                • Query before: the query before the change
                                                • Query after: the query after the change
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeRadicalAction

                                                is a child of the Action class and handles changing the number of radical electrons for an Atom.

                                                constructor = new Function ChangeRadicalAction(Atom a, Number delta)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • Number delta: the change in radical count
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ChangeRgroupAction

                                                is a child of the Action class and handles changing Rgroup labels for an Atom.

                                                constructor = new Function ChangeRgroupAction(Atom a, String after)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • Integer before: the rgroup number before the change
                                                • Integer after: the rgroup number after the change
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ClearAction

                                                is a child of the Action class and handles clearing the sketcher.

                                                constructor = new Function ClearAction(SketcherCanvas sketcher)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Array beforeMols: the molecules present before the clear
                                                • Array beforeShapes: the shapes present before the clear
                                                • Molecule molAfter: the molecule added after the clear in the case of the single molecule sketcher
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.DeleteAction

                                                is a child of the Action class and handles deleting bonds and atoms to a single molecule. This is a reversal of the AddAction class.

                                                constructor = new Function DeleteAction(SketcherCanvas sketcher, Atom a, Array as, Array bs)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Atom a: the Atom that identifies the molecule that atoms and bonds are removed from
                                                • Array as: the atoms to be deleted
                                                • Array bs: the bonds to be deleted
                                                • Array ss: the shapes to be deleted, this array is used if deleting the atoms and bonds also deletes some linked shapes
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.DeleteContentAction

                                                is a child of the Action class and handles deleting any arbitrary amount of atoms, bonds and shapes from the sketcher.

                                                constructor = new Function DeleteContentAction(SketcherCanvas sketcher, Array as, Array ss)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Array as: the atoms to be deleted
                                                • Array bs: the bonds to be deleted, based on the as Array
                                                • Array ss: the shapes to be deleted
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.DeleteShapeAction

                                                is a child of the Action class and handles removing a single shape from the sketcher.

                                                constructor = new Function DeleteShapeAction(SketcherCanvas sketcher, _Shape s)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • _Shape s: the shape that is deleted from the sketcher
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.FlipBondAction

                                                is a child of the Action class and handles flipping the orientation of a Bond.

                                                constructor = new Function FlipBondAction(Bond b)

                                                prototype = _Action

                                                • Bond b: the manipulated bond
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.MoveAction

                                                is a child of the Action class and handles moving atoms and shapes.

                                                constructor = new Function MoveAction(Array ps, Point dif)

                                                prototype = _Action

                                                • Array ps: the points to be edited, including atoms and shape points
                                                • Point dif: the change in X and Y coordinates in a Point data structure
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.NewMoleculeAction

                                                is a child of the Action class and handles adding a new discrete Molecule to the sketcher.

                                                constructor = new Function NewMoleculeAction(SketcherCanvas sketcher, Array as, Array bs)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Array as: the atoms of the new Molecule
                                                • Array bs: the bonds of the new Molecule
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.RotateAction

                                                is a child of the Action class and handles rotating atoms and shapes.

                                                constructor = new Function RotateAction(Array ps, Point dif, Point center)

                                                prototype = _Action

                                                • Array ps: the points to be edited, including atoms and shape points
                                                • Number dif: the rotation angle
                                                  Unit: radians
                                                • Point center: the center of rotation
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.SwitchMoleculeAction

                                                is a child of the Action class and handles switching the current content with a new Molecule in the sketcher.

                                                constructor = new Function SwitchMoleculeAction(SketcherCanvas sketcher)

                                                prototype = _Action

                                                • SketcherCanvas sketcher: the sketcher that this action is associated with
                                                • Array beforeMols: the molecules present before the clear
                                                • Array beforeShapes: the shapes present before the clear
                                                • Molecule molA: the molecule replacing the current content
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.ToggleAnyAtomAction

                                                is a child of the Action class and handles toggling the “any” state of an Atom.

                                                constructor = new Function ToggleAnyAtomAction(Atom a)

                                                prototype = _Action

                                                • Atom a: the manipulated atom
                                                • override Function innerforward(): implements the forward action
                                                • override Function innerreverse(): implements the reverse action

                                                ChemDoodle.uis.actions.HistoryManager

                                                this class manages actions and the undo/redo stacks for a sketcher.

                                                constructor = new Function HistoryManager(SketcherCanvas sketcher)

                                                • SketcherCanvas sketcher: the associated sketcher
                                                • Array undo: the Array of Action objects that acts as the undo stack
                                                • Array redo: the Array of Action objects that acts as the redo stack
                                                • Function clear(): clears the history and resets the undo and redo stacks
                                                • Function pushUndo(_Action a): adds the input Action to the undo stack, performs its forward action and clears the redo stack
                                                • Function redo(): if possible, redoes the last action
                                                • Function undo(): if possible, undoes the last action

                                                ChemDoodle.uis.gui

                                                this package contains any gui components for the sketcher.

                                                  ChemDoodle.uis.gui.desktop

                                                  this package contains any gui components for the desktop sketcher, usually created with jQuery UI.

                                                    ChemDoodle.uis.gui.desktop.Button

                                                    this class defines jQuery UI buttons for the sketcher.

                                                    constructor = new Function Button(String id, String icon, String tooltip, Function func)

                                                    • String id: a unique HTML id for this element in the HTML document
                                                    • String icon: the PNG icon in Base64 encoding
                                                    • String tooltip: the HTML tooltip (used in title attribute) for the button
                                                    • Function func: the function to be executed when this button is clicked
                                                    • Boolean toggle: defines this button as a toggle button in a group or not
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Function disable(): disables the button
                                                    • Function enable(): enables the button
                                                    • Function getElement(): returns the jQuery wrapper around the core HTML element
                                                      returns Object
                                                    • Function getSource(String buttonGroup): returns the HTML source used to create this element
                                                      returns String
                                                    • Function select(): selects the button
                                                    • Function setup(Boolean lone): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.ButtonSet

                                                    this class defines jQuery UI button sets for the sketcher.

                                                    constructor = new Function ButtonSet(String id)

                                                    • String id: a unique HTML id for this element in the HTML document
                                                    • Array buttons: an Array of Button objects that this set contains
                                                    • Boolean toggle: defines this button set as a toggle button set in a group or not
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Function addDropDown(String tooltip): adds a DropDown component to this button set
                                                    • Function getElement(): returns the jQuery wrapper around the core HTML element
                                                      returns Object
                                                    • Function getSource(String buttonGroup): returns the HTML source used to create this element
                                                      returns String
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.ColorPicker

                                                    this class defines color pickers for the 3D editor SpecsDialog. Uses jquery-simple-color.

                                                    constructor = new Function ColorPicker(String id, String tooltip, Function func)

                                                    • String id: a unique HTML id for this element in the HTML document
                                                    • String tooltip: the HTML tooltip, used to describe the picker
                                                    • Function func: the function to be executed when the color is changed
                                                    • Function getElement(): returns the jQuery wrapper around the core HTML element
                                                      returns Object
                                                    • Function getSource(): returns the HTML source used to create this element
                                                      returns String
                                                    • Function setColor(String color): sets the currently selected color on the picker.
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.CheckBox

                                                    a child of the button class, this defines checkboxes for the 3D editor SpecsDialog.

                                                    constructor = new Function CheckBox(String id, String tooltip, Function func, Boolean checked)

                                                    • Boolean checked: tracks whether the box is currently checked or not
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Function check(): sets the checkbox as checked
                                                    • Function getSource(): returns the HTML source used to create this element
                                                      returns String
                                                    • Function uncheck(): unchecks the checkbox

                                                    ChemDoodle.uis.gui.desktop.Dialog

                                                    this class defines jQuery UI dialogs for the sketcher.

                                                    constructor = new Function Dialog(String sketcherid, String subid, String title)

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Information
                                                    • Object buttons: the jQuery UI definition for the buttons in the dialog
                                                      Default Value: undefined
                                                    • String message: the message to be displayed at the top of the dialog
                                                      Default Value: undefined
                                                    • String afterMessage: the message to be displayed at the bottom of the dialog
                                                      Default Value: undefined
                                                    • Boolean includeTextArea: defines whether this dialog should contain a text area
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Boolean includeTextField: defines whether this dialog should contain a text field
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Function getElement(): returns the jQuery wrapper around the core HTML element
                                                      returns Object
                                                    • Function getTextArea(): returns the jQuery wrapper around the core HTML element used to represent this dialog’s text area
                                                      returns Object
                                                    • Function getTextField(): returns the jQuery wrapper around the core HTML element used to represent this dialog’s text field
                                                      returns Object
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.DialogManager

                                                    this class organizes and manages dialogs for the sketcher.

                                                    constructor = new Function DialogManager(SketcherCanvas sketcher)

                                                    • SketcherCanvas sketcher: the associated sketcher
                                                    • Dialog saveDialog: the save dialog
                                                    • Dialog loadDialog: the load dialog
                                                    • Dialog atomQueryDialog: the atom query dialog
                                                    • Dialog bondQueryDialog: the bond query dialog
                                                    • Dialog searchDialog: the search dialog
                                                    • Dialog periodicTableDialog: the Periodic Table dialog
                                                    • Dialog calculateDialog: the calculate dialog
                                                    • Dialog inputDialog: the input dialog

                                                    ChemDoodle.uis.gui.desktop.DropDown

                                                    this class defines jQuery UI drop down components for the sketcher.

                                                    constructor = new Function DropDown(String id, String tooltip, Button dummy)

                                                    • String id: a unique HTML id for this element in the HTML document
                                                    • String tooltip: the tooltip for this drop down group
                                                    • Button dummy: the dummy button that this drop down is linked to
                                                    • ButtonSet buttonSet: the button set that contains this drop down’s children
                                                    • Button defaultButton: the default button, if this isn’t set, the default button is the first declared button in the buttonset
                                                      Default Value: undefined
                                                    • Function getButtonSource(): returns the HTML source used to create this element’s drop down button
                                                      returns String
                                                    • Function getHiddenSource(): returns the HTML source used to create this element’s hidden button set
                                                      returns String
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.DummyButton

                                                    this class is a child of the Button class defines the dummy buttons associated with DropDown objects.

                                                    constructor = new Function DummyButton(String id, String icon, String tooltip)

                                                    prototype = Button

                                                    • String id: a unique HTML id for this element in the HTML document
                                                    • String icon: the PNG icon in Base64 encoding
                                                    • String tooltip: the HTML tooltip (used in title attribute) for the button
                                                    • Boolean toggle: defines this button as a toggle button in a group or not
                                                      Default Value: false
                                                      Unit: true/false
                                                    • Function func: the function to be executed when this button is clicked
                                                      Default Value: undefined
                                                    • Function absorb(Button button): absorbs the parameter button to mimick it and match its function
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.TextButton

                                                    a child of the button class, this defines buttons with text labels instead of icons.

                                                    constructor = new Function TextButton(String id, String tooltip, Function func, Boolean checked)

                                                    • Function check(): sets the button as checked
                                                    • Function getSource(): returns the HTML source used to create this element
                                                      returns String
                                                    • Function uncheck(): removes checked property

                                                    ChemDoodle.uis.gui.desktop.AtomQueryDialog

                                                    this class is a child of the Dialog class and defines the atom query window for the sketcher.

                                                    constructor = new Function AtomQueryDialog(SketcherCanvas sketcher, String subid)

                                                    prototype = Dialog

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Atom Query
                                                    • Function setAtom(Atom a): resets the form to the input atom’s query, or the defaults if no query is set
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.BondQueryDialog

                                                    this class is a child of the Dialog class and defines the bond query window for the sketcher.

                                                    constructor = new Function BondQueryDialog(SketcherCanvas sketcher, String subid)

                                                    prototype = Dialog

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Bond Query
                                                    • Function setBond(Bond b): resets the form to the input bond’s query, or the defaults if no query is set
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.MolGrabberDialog

                                                    this class is a child of the Dialog class and defines the search dialog for the sketcher.

                                                    constructor = new Function MolGrabberDialog(String sketcherid, String subid)

                                                    prototype = Dialog

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: MolGrabber
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.SaveFileDialog

                                                    this class is a child of the Dialog class and defines the save file dialog for the sketcher.

                                                    constructor = new Function SaveFileDialog(String sketcherid, String subid)

                                                    prototype = Dialog

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Save File
                                                    • Function clear(): resets the download link
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.SpecsDialog

                                                    this class is a child of the Dialog class and defines the visual specifications dialog for the Editor.

                                                    constructor = new Function SpecsDialog(EditorCanvas3D editor, String subid)

                                                    prototype = Dialog

                                                    • EditorCanvas3D editor: the EditorCanvas3D this dialog is associated with
                                                    • String subid: a unique HTML id for this dialog element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Visual Specifications
                                                    • Function makeAtomColorSet(SpecsDialog self): creates the atom color button set, sending the function itself
                                                    • Function makeBondColorSet(SpecsDialog self): creates the bond color button set, sending the function itself
                                                    • Function makeCompassPositionSet(SpecsDialog self): creates the compass position button set, sending the function itself
                                                    • Function makeFogModeSet(SpecsDialog self): creates the fog mode button set, sending the function itself
                                                    • Function makeProjectionSet(SpecsDialog self): creates the projection button set, sending the function itself
                                                    • Function setup(SpecsDialog self, EditorCanvas3D editor): writes and sets up the HTML with jQuery UI, sending the function itself and its canvas
                                                    • Function update(VisualSpecifications specs): updates the state of dialog elements with the given visual specifications

                                                    ChemDoodle.uis.gui.desktop.PeriodicTableDialog

                                                    this class is a child of the Dialog class and defines the periodic table dialog for the sketcher.

                                                    constructor = new Function PeriodicTableDialog(String sketcherid, String subid)

                                                    prototype = Dialog

                                                    • String sketcherid: the id of the sketcher this dialog is associated with
                                                    • String subid: a unique HTML id for this button element in the HTML document
                                                    • String title: the title of the dialog
                                                      Default Value: Periodic Table
                                                    • Function setup(): sets up the HTML with jQuery UI

                                                    ChemDoodle.uis.gui.desktop.ToolbarManager

                                                    this class organizes and manages the toolbars for the sketcher.

                                                    constructor = new Function ToolbarManager(SketcherCanvas sketcher)

                                                    • SketcherCanvas sketcher: the associated sketcher
                                                    • Button buttonOpen: the open button
                                                    • Button buttonSave: the save button
                                                    • Button buttonSearch: the search button
                                                    • Button buttonCalculate: the calculate button
                                                    • Button buttonMove: the move button
                                                    • Button buttonErase: the erase button
                                                    • Button buttonClear: the clear button
                                                    • Button buttonClean: the clean button
                                                    • Button buttonQuery: the query button
                                                    • ButtonSet scaleSet: the scale button set
                                                    • Button buttonScalePlus: the zoom in button
                                                    • Button buttonScaleMinus: the zoom out button
                                                    • ButtonSet lassoSet: the lasso button set
                                                    • Button buttonLasso: the lasso button
                                                    • ButtonSet historySet: the history button set
                                                    • Button buttonUndo: the undo button
                                                    • Button buttonRedo: the redo button
                                                    • ButtonSet labelSet: the label button set
                                                    • Button buttonLabel: the label button
                                                    • ButtonSet bondSet: the bond button set
                                                    • Button buttonSingle: the single bond button
                                                    • Button buttonRecessed: the recessed bond button
                                                    • Button buttonProtruding: the protruding bond button
                                                    • Button buttonDouble: the double bond button
                                                    • Button buttonBond: the bond button
                                                    • ButtonSet ringSet: the ring button set
                                                    • Button buttonCyclohexane: the cyclohexane button
                                                    • Button buttonBenzene: the benzene button
                                                    • Button buttonRing: the ring button
                                                    • ButtonSet attributeSet: the attribute button set
                                                    • Button buttonAttribute: the attribute button
                                                    • ButtonSet shapeSet: the shape button set
                                                    • Button buttonShape: the shape button
                                                    • Function makeAttributeSet(ToolbarManager self): creates the attribute button set, sending the function itself
                                                    • Function makeBondSet(ToolbarManager self): creates the bond button set, sending the function itself
                                                    • Function makeHistorySet(ToolbarManager self): creates the history button set, sending the function itself
                                                    • Function makeLabelSet(ToolbarManager self): creates the label button set, sending the function itself
                                                    • Function makeLassoSet(ToolbarManager self): creates the lasso button set, sending the function itself
                                                    • Function makeRingSet(ToolbarManager self): creates the ring button set, sending the function itself
                                                    • Function makeScaleSet(ToolbarManager self): creates the scale button set, sending the function itself
                                                    • Function makeShapeSet(ToolbarManager self): creates the shape button set, sending the function itself
                                                    • Function setup(): sets up the HTML with jQuery UI
                                                    • Function write(): collects all the HTML source for the toolbar and creates it in the DOM

                                                    ChemDoodle.uis.gui.desktop.ToolbarManager3D

                                                    this class organizes and manages the toolbars for the editor.

                                                    constructor = new Function ToolbarManager3D(EditorCanvas3D editor)

                                                    • EditorCanvas3D editor: the associated editor
                                                    • Button buttonOpen: the open button
                                                    • Button buttonSave: the save button
                                                    • Button buttonSearch: the search button
                                                    • Button buttonCalculate: the calculate button
                                                    • Button buttonTransform: the transform button
                                                    • Button buttonSettings: the settings button
                                                    • Button buttonAnimation: the animation button
                                                    • Button buttonClear: the clear button
                                                    • Button buttonClean: the clean button
                                                    • Function makeHistorySet(ToolbarManager3D self): creates the history button set, sending the function itself
                                                    • Function makeMeasurementsSet(ToolbarManager3D self): creates the shape button set, sending the function itself
                                                    • Function makeScaleSet(ToolbarManager3D self): creates the scale button set, sending the function itself
                                                    • Function setup(): sets up the HTML with jQuery UI
                                                    • Function write(): collects all the HTML source for the toolbar and creates it in the DOM

                                                    ChemDoodle.uis.gui.imageDepot

                                                    this package stores the sketcher icons and images as data URIs. Please note that these images are iChemLabs Proprietary and may only be used in projects using ChemDoodle Web Components.

                                                    • static String ADD_LONE_PAIR: the “ADD_LONE_PAIR” icon encoded as a Base64 string
                                                    • static String ADD_RADICAL: the “ADD_RADICAL” icon encoded as a Base64 string
                                                    • static String ARROW_DOWN: the group button expansion icon encoded as a Base64 string
                                                    • static String ARROW_EQUILIBRIUM: the “ARROW_EQUILIBRIUM” icon encoded as a Base64 string
                                                    • static String ARROW_RESONANCE: the “ARROW_RESONANCE” icon encoded as a Base64 string
                                                    • static String ARROW_RETROSYNTHETIC: the “ARROW_RETROSYNTHETIC” icon encoded as a Base64 string
                                                    • static String ARROW_SYNTHETIC: the “ARROW_SYNTHETIC” icon encoded as a Base64 string
                                                    • static String BENZENE: the “BENZENE” icon encoded as a Base64 string
                                                    • static String BOND_ANY: the “BOND_ANY” icon encoded as a Base64 string
                                                    • static String BOND_DOUBLE: the “BOND_DOUBLE” icon encoded as a Base64 string
                                                    • static String BOND_DOUBLE_AMBIGUOUS: the “BOND_DOUBLE_AMBIGUOUS” icon encoded as a Base64 string
                                                    • static String BOND_HALF: the “BOND_HALF” icon encoded as a Base64 string
                                                    • static String BOND_PROTRUDING: the “BOND_PROTRUDING” icon encoded as a Base64 string
                                                    • static String BOND_QUADRUPLE: the “BOND_QUADRUPLE” icon encoded as a Base64 string
                                                    • static String BOND_QUINTUPLE: the “BOND_QUINTUPLE” icon encoded as a Base64 string
                                                    • static String BOND_RECESSED: the “BOND_RECESSED” icon encoded as a Base64 string
                                                    • static String BOND_RESONANCEF: the “BOND_RESONANCE” icon encoded as a Base64 string
                                                    • static String BOND_SEXTUPLE: the “BOND_SEXTUPLE” icon encoded as a Base64 string
                                                    • static String BOND_SINGLE: the “BOND_SINGLE” icon encoded as a Base64 string
                                                    • static String BOND_TRIPLE: the “BOND_TRIPLE” icon encoded as a Base64 string
                                                    • static String BOND_ZERO: the “BOND_ZERO” icon encoded as a Base64 string
                                                    • static String BROMINE: the “BROMINE” icon encoded as a Base64 string
                                                    • static String CALCULATE: the “CALCULATE” icon encoded as a Base64 string
                                                    • static String CARBON: the “CARBON” icon encoded as a Base64 string
                                                    • static String CHARGE_BRACKET: the “CHARGE_BRACKET” icon encoded as a Base64 string
                                                    • static String CHLORINE: the “CHLORINE” icon encoded as a Base64 string
                                                    • static String CLEAR: the “CLEAR” icon encoded as a Base64 string
                                                    • static String CYCLOBUTANE: the “CYCLOBUTANE” icon encoded as a Base64 string
                                                    • static String CYCLOHEPTANE: the “CYCLOHEPTANE” icon encoded as a Base64 string
                                                    • static String CYCLOHEXANE: the “CYCLOHEXANE” icon encoded as a Base64 string
                                                    • static String CYCLOOCTANE: the “CYCLOOCTANE” icon encoded as a Base64 string
                                                    • static String CYCLOPENTANE: the “CYCLOPENTANE” icon encoded as a Base64 string
                                                    • static String CYCLOPROPANE: the “CYCLOPROPANE” icon encoded as a Base64 string
                                                    • static String DECREASE_CHARGE: the “DECREASE_CHARGE” icon encoded as a Base64 string
                                                    • static String ERASE: the “ERASE” icon encoded as a Base64 string
                                                    • static String FLUORINE: the “FLUORINE” icon encoded as a Base64 string
                                                    • static String HYDROGEN: the “HYDROGEN” icon encoded as a Base64 string
                                                    • static String INCREASE_CHARGE: the “INCREASE_CHARGE” icon encoded as a Base64 string
                                                    • static String IODINE: the “IODINE” icon encoded as a Base64 string
                                                    • static String LASSO: the “LASSO” icon encoded as a Base64 string
                                                    • static String LASSO_SHAPES: the “LASSO_SHAPES” icon encoded as a Base64 string
                                                    • static String MARQUEE: the “MARQUEE” icon encoded as a Base64 string
                                                    • static String MOVE: the “MOVE” icon encoded as a Base64 string
                                                    • static String NITROGEN: the “NITROGEN” icon encoded as a Base64 string
                                                    • static String OPEN: the “OPEN” icon encoded as a Base64 string
                                                    • static String OPTIMIZE: the “OPTIMIZE” icon encoded as a Base64 string
                                                    • static String OXYGEN: the “OXYGEN” icon encoded as a Base64 string
                                                    • static String PERIODIC_TABLE: the “PERIODIC_TABLE” icon encoded as a Base64 string
                                                    • static String PHOSPHORUS: the “PHOSPHORUS” icon encoded as a Base64 string
                                                    • static String PUSHER_BOND_FORMING: the “PUSHER_BOND_FORMING” icon encoded as a Base64 string
                                                    • static String PUSHER_DOUBLE: the “PUSHER_DOUBLE” icon encoded as a Base64 string
                                                    • static String PUSHER_SINGLE: the “PUSHER_SINGLE” icon encoded as a Base64 string
                                                    • static String QUERY: the “QUERY” icon encoded as a Base64 string
                                                    • static String REDO: the “REDO” icon encoded as a Base64 string
                                                    • static String REMOVE_LONE_PAIR: the “REMOVE_LONE_PAIR” icon encoded as a Base64 string
                                                    • static String REMOVE_RADICAL: the “REMOVE_RADICAL” icon encoded as a Base64 string
                                                    • static String SAVE: the “SAVE” icon encoded as a Base64 string
                                                    • static String SEARCH: the “SEARCH” icon encoded as a Base64 string
                                                    • static String SULFUR: the “SULFUR” icon encoded as a Base64 string
                                                    • static String UNDO: the “UNDO” icon encoded as a Base64 string
                                                    • static String ZOOM_IN: the “ZOOM_IN” icon encoded as a Base64 string
                                                    • static String ZOOM_OUT: the “ZOOM_OUT” icon encoded as a Base64 string
                                                    • static Function getURI(String s): given the String parameter of a Base64 encoded PNG image, returns the correctly formatted data URI to be used as an image in HTML
                                                      returns String

                                                    ChemDoodle.uis.states

                                                    this package contains all State classes. States define how the sketcher behaves at any given point, usually associated with input events and button presses.

                                                      ChemDoodle.uis.states._State

                                                      is the parent class for states associated with the sketcher. Its basic functionality allows defines the behavior of the sketcher.

                                                      constructor = new Function _State()

                                                      • SketcherCanvas sketcher: the sketcher that this state defines behavior for
                                                      • Function click(Event e): handles the click event for the sketcher
                                                      • Function dblclick(Event e): handles the dblclick event for the sketcher
                                                      • Function drag(Event e): handles the drag event for the sketcher
                                                      • Function enter(): this method gets called when a state is entered
                                                      • Function exit(): this method gets called when a state is exited
                                                      • Function findHoveredObject(Event sketcher, Boolean includeAtoms, Boolean includeBonds, Boolean includeShapes): finds the closest hovered object to the input event point, in the set permitted by the parameter booleans
                                                      • Function getOptimumAngle(Atom a, Boolean bondOrder): finds the optimal angle to grow bonds from the input sprout atom; provide a bondOrder to be set for better placement
                                                      • Function keydown(Event e): handles the keydown event for the sketcher
                                                      • Function keypress(Event e): handles the keypress event for the sketcher
                                                      • Function keyup(Event e): handles the keyup event for the sketcher
                                                      • Function mousedown(Event e): handles the mousedown event for the sketcher
                                                      • Function mousemove(Event e): handles the mousemove event for the sketcher
                                                      • Function mouseout(Event e): handles the mouseout event for the sketcher
                                                      • Function mouseover(Event e): handles the mouseover event for the sketcher
                                                      • Function mouseup(Event e): handles the mouseup event for the sketcher
                                                      • Function mousewheel(Event e): handles the mousewheel event for the sketcher
                                                      • Function removeStartAtom(): hides the start atom
                                                      • Function rightclick(Event e): handles the rightclick event for the sketcher
                                                      • Function rightmousedown(Event e): handles the rightmousedown event for the sketcher
                                                      • Function rightmouseup(Event e): handles the rightmouseup event for the sketcher
                                                      • Function setup(SketcherCanvas sketcher): called by child State classes as a super method in the constructor
                                                      • optional abstract Function draw(Context ctx): draws additional graphics to the sketcher as metadata for the state
                                                      • optional abstract Function innerclick(Event e): called by the click function, handled by child
                                                      • optional abstract Function innerdblclick(Event e): called by the dblclick function, handled by child
                                                      • optional abstract Function innerdrag(Event e): called by the drag function, handled by child
                                                      • optional abstract Function innerenter(): called by the enter function, handled by child
                                                      • optional abstract Function innerexit(): called by the exit function, handled by child
                                                      • optional abstract Function innerkeydown(Event e): called by the keydown function, handled by child
                                                      • optional abstract Function innerkeypress(Event e): called by the keypress function, handled by child
                                                      • optional abstract Function innerkeyup(Event e): called by the keyup function, handled by child
                                                      • optional abstract Function innermousedown(Event e): called by the mousedown function, handled by child
                                                      • optional abstract Function innermousemove(Event e): called by the mousemove function, handled by child
                                                      • optional abstract Function innermouseout(Event e): called by the mouseout function, handled by child
                                                      • optional abstract Function innermouseover(Event e): called by the mouseover function, handled by child
                                                      • optional abstract Function innermouseup(Event e): called by the mouseup function, handled by child
                                                      • optional abstract Function innermousewheel(Event e): called by the mousewheel function, handled by child
                                                      • optional abstract Function innerrightclick(Event e): called by the rightclick function, handled by child
                                                      • optional abstract Function innerrightmousedown(Event e): called by the rightmousedown function, handled by child
                                                      • optional abstract Function innerrightmouseup(Event e): called by the rightmouseup function, handled by child

                                                      ChemDoodle.uis.states.QueryState

                                                      is a child of the State class and defines behavior for the sketcher to modify the query properties of an atom.

                                                      constructor = new Function QueryState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.ChargeState

                                                      is a child of the State class and defines behavior for the sketcher to modify the charge on an atom.

                                                      constructor = new Function ChargeState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Number delta: the change in charge to be used for actions
                                                        Default Value: 1
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.EraseState

                                                      is a child of the State class and defines behavior for the sketcher to erase content.

                                                      constructor = new Function EraseState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Function handleDelete(): handles the delete functionality
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.LabelState

                                                      is a child of the State class and defines behavior for the sketcher to modify the atom label.

                                                      constructor = new Function LabelState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • String label: the label used for actions
                                                        Default Value: C
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousedrag(Event e): handles the mousedrag event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.LassoState

                                                      is a child of the State class and defines behavior for the sketcher when using the lasso.

                                                      constructor = new Function LassoState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • override Function draw(Context ctx): draws additional metadata
                                                      • override Function innerclick(Event e): handles the click event
                                                      • override Function innerdblclick(Event e): handles the dblclick event
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousedrag(Event e): handles the mousedrag event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.LonePairState

                                                      is a child of the State class and defines behavior for the sketcher to modify the number of lone pairs on an atom.

                                                      constructor = new Function LonePairState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Number delta: the change in the number of lone pairs to be used for actions
                                                        Default Value: 1
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.MoveState

                                                      is a child of the State class and defines behavior for the sketcher to move content.

                                                      constructor = new Function MoveState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • _Action action: this is the current action, the state keeps track of it during a drag event
                                                        Default Value: undefined
                                                      • override Function innerdrag(Event e): handles the drag event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.NewBondState

                                                      is a child of the State class and defines behavior for the sketcher when using the bond tools.

                                                      constructor = new Function NewBondState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Integer bondOrder: the bond order to be applied
                                                        Default Value: 1
                                                      • String stereo: the bond stereo to be applied
                                                        Default Value: ChemDoodle.structures.Bond.STEREO_NONE
                                                      • Function incrementBondOrder(Bond b): increments a bond order
                                                      • override Function innerclick(Event e): handles the click event
                                                      • override Function innerdrag(Event e): handles the drag event
                                                      • override Function innerexit(): handles the state exit
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseout(Event e): handles the mouseout event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.NewRingState

                                                      is a child of the State class and defines behavior for the sketcher when using the bond tools.

                                                      constructor = new Function NewRingState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Integer numSides: the number of bonds in the ring to be applied
                                                        Default Value: 6
                                                      • String unsaturated: this defines whether created rings will be saturated or not
                                                        Default Value: false
                                                        Unit: true/false
                                                      • Function getRing(Atom a, Integer numSides, Number bondLength, Number angle, Boolean setOverlaps): returns an Array of Atom representing the requested ring to be formed based on the input parameters around an Atom
                                                        returns Array
                                                      • Function getRing(Bond b, Integer numSides): returns an Array of Atom representing the requested ring to be formed based on the input parameters around a Bond
                                                        returns Array
                                                      • override Function innerclick(Event e): handles the click event
                                                      • override Function innerdrag(Event e): handles the drag event
                                                      • override Function innerexit(): handles the state exit
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseout(Event e): handles the mouseout event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.PusherState

                                                      is a child of the State class and defines behavior for the sketcher to draw electron pushing arrows.

                                                      constructor = new Function PusherState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Number numElectron: the number of electrons to push to be used for actions
                                                        Default Value: 1
                                                      • override Function draw(Context ctx): draws additional metadata
                                                      • override Function innerdrag(Event e): handles the drag event
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.RadicalState

                                                      is a child of the State class and defines behavior for the sketcher to modify the number of radicals on an atom.

                                                      constructor = new Function RadicalState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • Number delta: the change in the number of radicals to be used for actions
                                                        Default Value: 1
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states.ShapeState

                                                      is a child of the State class and defines behavior for the sketcher to draw generic shapes.

                                                      constructor = new Function ShapeState(SketcherCanvas sketcher)

                                                      prototype = _State

                                                      • static Number LINE: specifies a line
                                                      • static Number ARROW_SYNTHETIC: specifies a synthetic arrow
                                                      • static Number ARROW_RETROSYNTHETIC: specifies a retrosynthetic arrow
                                                      • static Number ARROW_RESONANCE: specifies a resonance arrow
                                                      • static Number ARROW_EQUILIBRIUM: specifies a equilibrium arrow
                                                      • static Number BRACKET: specifies a charge bracket
                                                      • Number shapeType: the type of Shape to be created
                                                        Default Value: LINE
                                                      • override Function draw(Context ctx): draws additional metadata
                                                      • override Function innerdrag(Event e): handles the drag event
                                                      • override Function innerenter(): handles the state enter
                                                      • override Function innerexit(): handles the state exit
                                                      • override Function innermousedown(Event e): handles the mousedown event
                                                      • override Function innermousemove(Event e): handles the mousemove event
                                                      • override Function innermouseup(Event e): handles the mouseup event

                                                      ChemDoodle.uis.states._State3D

                                                      is the parent class for states associated with the 3D Editor. Its basic functionality defines the behavior of the sketcher.

                                                      constructor = new Function _State3D()

                                                      • EditorCanvas3D editor: the editor that this state defines behavior for
                                                      • Function click(Event e): handles the click event for the editor
                                                      • Function dblclick(Event e): handles the dblclick event for the editor
                                                      • Function drag(Event e): handles the drag event for the editor
                                                      • Function enter(): this method gets called when a state is entered
                                                      • Function exit(): this method gets called when a state is exited
                                                      • Function keydown(Event e): handles the keydown event for the editor
                                                      • Function keypress(Event e): handles the keypress event for the editor
                                                      • Function keyup(Event e): handles the keyup event for the editor
                                                      • Function mousedown(Event e): handles the mousedown event for the editor
                                                      • Function mousemove(Event e): handles the mousemove event for the editor
                                                      • Function mouseout(Event e): handles the mouseout event for the editor
                                                      • Function mouseover(Event e): handles the mouseover event for the editor
                                                      • Function mouseup(Event e): handles the mouseup event for the editor
                                                      • Function mousewheel(Event e): handles the mousewheel event for the editor
                                                      • Function rightclick(Event e): handles the rightclick event for the editor
                                                      • Function rightmousedown(Event e): handles the rightmousedown event for the editor
                                                      • Function rightmouseup(Event e): handles the rightmouseup event for the editor
                                                      • Function setup(SketcherCanvas sketcher): called by child State classes as a super method in the constructor
                                                      • optional abstract Function innerclick(Event e): called by the click function, handled by child
                                                      • optional abstract Function innerdblclick(Event e): called by the dblclick function, handled by child
                                                      • optional abstract Function innerdrag(Event e): called by the drag function, handled by child
                                                      • optional abstract Function innerenter(): called by the enter function, handled by child
                                                      • optional abstract Function innerexit(): called by the exit function, handled by child
                                                      • optional abstract Function innerkeydown(Event e): called by the keydown function, handled by child
                                                      • optional abstract Function innerkeypress(Event e): called by the keypress function, handled by child
                                                      • optional abstract Function innerkeyup(Event e): called by the keyup function, handled by child
                                                      • optional abstract Function innermousedown(Event e): called by the mousedown function, handled by child
                                                      • optional abstract Function innermousemove(Event e): called by the mousemove function, handled by child
                                                      • optional abstract Function innermouseout(Event e): called by the mouseout function, handled by child
                                                      • optional abstract Function innermouseover(Event e): called by the mouseover function, handled by child
                                                      • optional abstract Function innermouseup(Event e): called by the mouseup function, handled by child
                                                      • optional abstract Function innermousewheel(Event e): called by the mousewheel function, handled by child
                                                      • optional abstract Function innerrightclick(Event e): called by the rightclick function, handled by child
                                                      • optional abstract Function innerrightmousedown(Event e): called by the rightmousedown function, handled by child
                                                      • optional abstract Function innerrightmouseup(Event e): called by the rightmouseup function, handled by child

                                                      ChemDoodle.uis.states.ViewState3D

                                                      is a child of the State3D class and defines behavior for the editor when not in any other state.

                                                      constructor = new Function ViewState3D(EditorCanvas3D editor)

                                                      prototype = _State3D

                                                        ChemDoodle.uis.states.MeasureState3D

                                                        is a child of the State3D class and defines behavior for the editor to measure distances, angles, and torsions between atoms.

                                                        constructor = new Function MeasureState3D(EditorCanvas3D editor)

                                                        prototype = _State3D

                                                        • Array selectedAtoms: An array holding the selected atoms
                                                        • Function reset(): deselects all selected atoms and repaints the canvas
                                                        • override Function innerenter(): is called when the state is entered, calls reset
                                                        • override Function innerexit(): is called when the state is exited, calls reset
                                                        • override Function innermousedown(Event e): handles the mousedown event
                                                        • override Function innermousemove(Event e): handles the mousemove event

                                                        ChemDoodle.uis.states.StateManager

                                                        this class organizes and manages the states for the sketcher.

                                                        constructor = new Function StateManager(SketcherCanvas sketcher)

                                                        • _State STATE_NEW_BOND: the new bond state
                                                        • _State STATE_NEW_RING: the new ring state
                                                        • _State STATE_CHARGE: the charge state
                                                        • _State STATE_LONE_PAIR: the lone pair state
                                                        • _State STATE_RADICAL: the radical state
                                                        • _State STATE_MOVE: the move state
                                                        • _State STATE_ERASE: the erase state
                                                        • _State STATE_LABEL: the label state
                                                        • _State STATE_LASSO: the lasso state
                                                        • _State STATE_SHAPE: the shape state
                                                        • _State STATE_PUSHER: the pusher state
                                                        • _State STATE_QUERY: the query state
                                                        • Function getCurrentState(): returns the current state.
                                                          returns _State
                                                        • Function setState(_State nextState): sets the state, exiting the current state and entering the parameter state.

                                                        ChemDoodle.uis.states.StateManager3D

                                                        this class organizes and manages the states for the 3D Editor.

                                                        constructor = new Function StateManager3D(EditorCanvas3D editor)

                                                        • _State STATE_VIEW: the view state
                                                        • _State STATE_MEASURE: the measure state
                                                        • Function getCurrentState(): returns the current state.
                                                          returns _State
                                                        • Function setState(_State nextState): sets the state, exiting the current state and entering the parameter state.

                                                        ChemDoodle.uis.tools

                                                        this package contains any tools that the sketcher uses to perform functions.

                                                          ChemDoodle.uis.tools.Lasso

                                                          this class is the implementation of the lasso tool.

                                                          constructor = new Function Lasso(SketcherCanvas sketcher)

                                                          • static String MODE_LASSO: specifies the standard lasso behavior
                                                          • static String MODE_LASSO_SHAPES: specifies the standard lasso behavior only for shapes
                                                          • static String MODE_RECTANGLE_MARQUEE: specifies the standard rectangular marquee behavior
                                                          • SketcherCanvas sketcher: the associated sketcher
                                                          • Array atoms: the lassoed atoms, if any
                                                          • Array shapes: the lassoed shapes, if any
                                                          • Bounds bounds: the bounds of the lassoed objects, if any, undefined otherwise
                                                            Default Value: undefined
                                                          • String mode: the lasso mode, one of the static mode variables associated with this class
                                                            Default Value: MODE_LASSO
                                                          • Array points: the array of points that holds the mouse outline when users are making a selection
                                                          • Function addPoint(Point p): manages the points array given the lasso mode and the input Point from the user
                                                          • Function draw(Context ctx, VisualSpecifications specs): draws this lasso to the sketcher that owns the Context using the given VisualSpecifications
                                                          • Function empty(): empties the lasso
                                                          • Function getAllPoints(): returns an Array of Point data structures including all the lassoed atoms and the points of all the lassoed shapes
                                                            returns Array
                                                          • Function getFirstMolecule(): returns the Molecule that contains the first lassoed Atom; if no Atoms are lassoed, then undefined is returned
                                                            returns Molecule
                                                          • Function isActive(): returns true if there is lassoed content, false otherwise
                                                            returns Boolean
                                                          • Function select(Array atoms, Array shapes): selects the atoms and shapes based on the points Array and the associated sketcher. If atoms and shapes are provided, then those arrays become the new selection.
                                                          • Function setBounds(): sets the bounds variable for the lasso based on lassoed content
                                                          • abstract Function enableButtons(): enables or disables toolbar buttons for the associated sketcher depending on the content that is lassoed.