UNPKG

smiles-drawer

Version:

A SMILES drawer and parser. Generate molecular structure depictions in pure JavaScript.

3,237 lines (719 loc) 477 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Global - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_bridgeDfs">_bridgeDfs</a></li><li><a href="global.html#_ccCountDfs">_ccCountDfs</a></li><li><a href="global.html#_ccGetDfs">_ccGetDfs</a></li><li><a href="global.html#_init">_init</a></li><li><a href="global.html#_initInfos">_initInfos</a></li><li><a href="global.html#add">add</a></li><li><a href="global.html#addAnchoredRing">addAnchoredRing</a></li><li><a href="global.html#addChild">addChild</a></li><li><a href="global.html#addEdge">addEdge</a></li><li><a href="global.html#addNeighbouringElement">addNeighbouringElement</a></li><li><a href="global.html#addRing">addRing</a></li><li><a href="global.html#addRingbondChild">addRingbondChild</a></li><li><a href="global.html#addRingConnection">addRingConnection</a></li><li><a href="global.html#addVertex">addVertex</a></li><li><a href="global.html#angle">angle</a></li><li><a href="global.html#annotateStereochemistry">annotateStereochemistry</a></li><li><a href="global.html#apothem">apothem</a></li><li><a href="global.html#areSetsEqual">areSetsEqual</a></li><li><a href="global.html#areVerticesInSameRing">areVerticesInSameRing</a></li><li><a href="global.html#atomicNumbers">atomicNumbers</a></li><li><a href="global.html#attachPseudoElement">attachPseudoElement</a></li><li><a href="global.html#averageDirection">averageDirection</a></li><li><a href="global.html#backupRingInformation">backupRingInformation</a></li><li><a href="global.html#backupRings">backupRings</a></li><li><a href="global.html#bonds">bonds</a></li><li><a href="global.html#bondsToAtoms">bondsToAtoms</a></li><li><a href="global.html#centralAngle">centralAngle</a></li><li><a href="global.html#chooseSide">chooseSide</a></li><li><a href="global.html#clear">clear</a></li><li><a href="global.html#clockwise">clockwise</a></li><li><a href="global.html#clone">clone</a></li><li><a href="global.html#contains">contains</a></li><li><a href="global.html#containsAll">containsAll</a></li><li><a href="global.html#containsRing">containsRing</a></li><li><a href="global.html#count">count</a></li><li><a href="global.html#createBridgedRing">createBridgedRing</a></li><li><a href="global.html#createNextBond">createNextBond</a></li><li><a href="global.html#createRing">createRing</a></li><li><a href="global.html#deepCopy">deepCopy</a></li><li><a href="global.html#degFactor">degFactor</a></li><li><a href="global.html#distance">distance</a></li><li><a href="global.html#distanceSq">distanceSq</a></li><li><a href="global.html#divide">divide</a></li><li><a href="global.html#divideScalar">divideScalar</a></li><li><a href="global.html#dot">dot</a></li><li><a href="global.html#draw">draw</a></li><li><a href="global.html#drawAromaticityRing">drawAromaticityRing</a></li><li><a href="global.html#drawBall">drawBall</a></li><li><a href="global.html#drawCircle">drawCircle</a></li><li><a href="global.html#drawDashedWedge">drawDashedWedge</a></li><li><a href="global.html#drawDebugPoint">drawDebugPoint</a></li><li><a href="global.html#drawDebugText">drawDebugText</a></li><li><a href="global.html#drawEdge">drawEdge</a></li><li><a href="global.html#drawEdges">drawEdges</a></li><li><a href="global.html#drawLine">drawLine</a></li><li><a href="global.html#drawPoint">drawPoint</a></li><li><a href="global.html#drawText">drawText</a></li><li><a href="global.html#drawVertices">drawVertices</a></li><li><a href="global.html#drawWedge">drawWedge</a></li><li><a href="global.html#each">each</a></li><li><a href="global.html#eachMember">eachMember</a></li><li><a href="global.html#edgeRingCount">edgeRingCount</a></li><li><a href="global.html#equals">equals</a></li><li><a href="global.html#extend">extend</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#getAdjacencyList">getAdjacencyList</a></li><li><a href="global.html#getAdjacencyMatrix">getAdjacencyMatrix</a></li><li><a href="global.html#getAngle">getAngle</a></li><li><a href="global.html#getAtomicNumber">getAtomicNumber</a></li><li><a href="global.html#getAttachedPseudoElements">getAttachedPseudoElements</a></li><li><a href="global.html#getAttachedPseudoElementsCount">getAttachedPseudoElementsCount</a></li><li><a href="global.html#getBondCount">getBondCount</a></li><li><a href="global.html#getBridgedRingRings">getBridgedRingRings</a></li><li><a href="global.html#getBridgedRings">getBridgedRings</a></li><li><a href="global.html#getBridges">getBridges</a></li><li><a href="global.html#getChargeText">getChargeText</a></li><li><a href="global.html#getClosestVertex">getClosestVertex</a></li><li><a href="global.html#getColor">getColor</a></li><li><a href="global.html#getCommonRingbondNeighbour">getCommonRingbondNeighbour</a></li><li><a href="global.html#getCommonRings">getCommonRings</a></li><li><a href="global.html#getComponentsAdjacencyMatrix">getComponentsAdjacencyMatrix</a></li><li><a href="global.html#getConnectedComponentCount">getConnectedComponentCount</a></li><li><a href="global.html#getConnectedComponents">getConnectedComponents</a></li><li><a href="global.html#getCurrentCenterOfMass">getCurrentCenterOfMass</a></li><li><a href="global.html#getCurrentCenterOfMassInNeigbourhood">getCurrentCenterOfMassInNeigbourhood</a></li><li><a href="global.html#getDistanceMatrix">getDistanceMatrix</a></li><li><a href="global.html#getDoubleBondCount">getDoubleBondCount</a></li><li><a href="global.html#getDrawnNeighbours">getDrawnNeighbours</a></li><li><a href="global.html#getEdge">getEdge</a></li><li><a href="global.html#getEdgeCount">getEdgeCount</a></li><li><a href="global.html#getEdgeList">getEdgeList</a></li><li><a href="global.html#getEdgeNormals">getEdgeNormals</a></li><li><a href="global.html#getEdges">getEdges</a></li><li><a href="global.html#getFusedRings">getFusedRings</a></li><li><a href="global.html#getHeavyAtomCount">getHeavyAtomCount</a></li><li><a href="global.html#getLargestOrAromaticCommonRing">getLargestOrAromaticCommonRing</a></li><li><a href="global.html#getLastVertexWithAngle">getLastVertexWithAngle</a></li><li><a href="global.html#getLeftChiral">getLeftChiral</a></li><li><a href="global.html#getLeftElement">getLeftElement</a></li><li><a href="global.html#getLeftVector">getLeftVector</a></li><li><a href="global.html#getLength">getLength</a></li><li><a href="global.html#getMaxBonds">getMaxBonds</a></li><li><a href="global.html#getNeighbourCount">getNeighbourCount</a></li><li><a href="global.html#getNeighbours">getNeighbours</a></li><li><a href="global.html#getNextInRing">getNextInRing</a></li><li><a href="global.html#getNonRingNeighbours">getNonRingNeighbours</a></li><li><a href="global.html#getOrderedNeighbours">getOrderedNeighbours</a></li><li><a href="global.html#getOverlapScore">getOverlapScore</a></li><li><a href="global.html#getPathIncludedDistanceMatrices">getPathIncludedDistanceMatrices</a></li><li><a href="global.html#getPolygon">getPolygon</a></li><li><a href="global.html#getRightChiral">getRightChiral</a></li><li><a href="global.html#getRightElement">getRightElement</a></li><li><a href="global.html#getRightVector">getRightVector</a></li><li><a href="global.html#getRing">getRing</a></li><li><a href="global.html#getRingbondCount">getRingbondCount</a></li><li><a href="global.html#getRingbondType">getRingbondType</a></li><li><a href="global.html#getRingCandidates">getRingCandidates</a></li><li><a href="global.html#getRingConnection">getRingConnection</a></li><li><a href="global.html#getRingConnections">getRingConnections</a></li><li><a href="global.html#getRingCount">getRingCount</a></li><li><a href="global.html#getRings">getRings</a></li><li><a href="global.html#getRotateAwayFromAngle">getRotateAwayFromAngle</a></li><li><a href="global.html#getRotateToAngle">getRotateToAngle</a></li><li><a href="global.html#getRotateTowardsAngle">getRotateTowardsAngle</a></li><li><a href="global.html#getSize">getSize</a></li><li><a href="global.html#getSpanningTreeNeighbours">getSpanningTreeNeighbours</a></li><li><a href="global.html#getSpiros">getSpiros</a></li><li><a href="global.html#getSSSR">getSSSR</a></li><li><a href="global.html#getSubgraphAdjacencyList">getSubgraphAdjacencyList</a></li><li><a href="global.html#getSubgraphAdjacencyMatrix">getSubgraphAdjacencyMatrix</a></li><li><a href="global.html#getSubgraphDistanceMatrix">getSubgraphDistanceMatrix</a></li><li><a href="global.html#getSubringCenter">getSubringCenter</a></li><li><a href="global.html#getSubtreeOverlapScore">getSubtreeOverlapScore</a></li><li><a href="global.html#getTextDirection">getTextDirection</a></li><li><a href="global.html#getTotalOverlapScore">getTotalOverlapScore</a></li><li><a href="global.html#getTreeDepth">getTreeDepth</a></li><li><a href="global.html#getVertexList">getVertexList</a></li><li><a href="global.html#getVertices">getVertices</a></li><li><a href="global.html#getVerticesAt">getVerticesAt</a></li><li><a href="global.html#hasBridgedRing">hasBridgedRing</a></li><li><a href="global.html#hasEdge">hasEdge</a></li><li><a href="global.html#haveCommonRingbond">haveCommonRingbond</a></li><li><a href="global.html#initPseudoElements">initPseudoElements</a></li><li><a href="global.html#initRings">initRings</a></li><li><a href="global.html#innerAngle">innerAngle</a></li><li><a href="global.html#intersection">intersection</a></li><li><a href="global.html#invert">invert</a></li><li><a href="global.html#isBenzeneLike">isBenzeneLike</a></li><li><a href="global.html#isBridge">isBridge</a></li><li><a href="global.html#isEdgeInRing">isEdgeInRing</a></li><li><a href="global.html#isEdgeRotatable">isEdgeRotatable</a></li><li><a href="global.html#isHeteroAtom">isHeteroAtom</a></li><li><a href="global.html#isInPolygon">isInPolygon</a></li><li><a href="global.html#isPartOfBridgedRing">isPartOfBridgedRing</a></li><li><a href="global.html#isPointInRing">isPointInRing</a></li><li><a href="global.html#isRingAromatic">isRingAromatic</a></li><li><a href="global.html#isSupersetOf">isSupersetOf</a></li><li><a href="global.html#isTerminal">isTerminal</a></li><li><a href="global.html#kkLayout">kkLayout</a></li><li><a href="global.html#length">length</a></li><li><a href="global.html#lengthSq">lengthSq</a></li><li><a href="global.html#mass">mass</a></li><li><a href="global.html#matrixToString">matrixToString</a></li><li><a href="global.html#maxBonds">maxBonds</a></li><li><a href="global.html#meanAngle">meanAngle</a></li><li><a href="global.html#merge">merge</a></li><li><a href="global.html#midpoint">midpoint</a></li><li><a href="global.html#multiply">multiply</a></li><li><a href="global.html#multiplyScalar">multiplyScalar</a></li><li><a href="global.html#neighbouringElementsEqual">neighbouringElementsEqual</a></li><li><a href="global.html#normalize">normalize</a></li><li><a href="global.html#normalized">normalized</a></li><li><a href="global.html#normals">normals</a></li><li><a href="global.html#parityOfPermutation">parityOfPermutation</a></li><li><a href="global.html#pathSetsContain">pathSetsContain</a></li><li><a href="global.html#polyCircumradius">polyCircumradius</a></li><li><a href="global.html#position">position</a></li><li><a href="global.html#print">print</a></li><li><a href="global.html#printRingInfo">printRingInfo</a></li><li><a href="global.html#radFactor">radFactor</a></li><li><a href="global.html#relativeClockwise">relativeClockwise</a></li><li><a href="global.html#remove">remove</a></li><li><a href="global.html#removeAll">removeAll</a></li><li><a href="global.html#removeRing">removeRing</a></li><li><a href="global.html#removeRingConnection">removeRingConnection</a></li><li><a href="global.html#removeRingConnectionsBetween">removeRingConnectionsBetween</a></li><li><a href="global.html#removeUnique">removeUnique</a></li><li><a href="global.html#reset">reset</a></li><li><a href="global.html#resolvePrimaryOverlaps">resolvePrimaryOverlaps</a></li><li><a href="global.html#resolveSecondaryOverlaps">resolveSecondaryOverlaps</a></li><li><a href="global.html#restoreRingInformation">restoreRingInformation</a></li><li><a href="global.html#restoreRings">restoreRings</a></li><li><a href="global.html#rotate">rotate</a></li><li><a href="global.html#rotateAround">rotateAround</a></li><li><a href="global.html#rotateAwayFrom">rotateAwayFrom</a></li><li><a href="global.html#rotateDrawing">rotateDrawing</a></li><li><a href="global.html#rotateSubtree">rotateSubtree</a></li><li><a href="global.html#rotateTo">rotateTo</a></li><li><a href="global.html#rotateToXAxis">rotateToXAxis</a></li><li><a href="global.html#round">round</a></li><li><a href="global.html#sameSideAs">sameSideAs</a></li><li><a href="global.html#scalarProjection">scalarProjection</a></li><li><a href="global.html#scale">scale</a></li><li><a href="global.html#setBondType">setBondType</a></li><li><a href="global.html#setLeftVector">setLeftVector</a></li><li><a href="global.html#setParentVertexId">setParentVertexId</a></li><li><a href="global.html#setPosition">setPosition</a></li><li><a href="global.html#setPositionFromVector">setPositionFromVector</a></li><li><a href="global.html#setRightVector">setRightVector</a></li><li><a href="global.html#setRingCenter">setRingCenter</a></li><li><a href="global.html#setTheme">setTheme</a></li><li><a href="global.html#shorten">shorten</a></li><li><a href="global.html#shortenFrom">shortenFrom</a></li><li><a href="global.html#shortenLeft">shortenLeft</a></li><li><a href="global.html#shortenRight">shortenRight</a></li><li><a href="global.html#shortenTo">shortenTo</a></li><li><a href="global.html#sortByAtomicNumberDesc">sortByAtomicNumberDesc</a></li><li><a href="global.html#subtract">subtract</a></li><li><a href="global.html#threePointangle">threePointangle</a></li><li><a href="global.html#toDeg">toDeg</a></li><li><a href="global.html#toggle">toggle</a></li><li><a href="global.html#toRad">toRad</a></li><li><a href="global.html#toString">toString</a></li><li><a href="global.html#traverseBF">traverseBF</a></li><li><a href="global.html#traverseTree">traverseTree</a></li><li><a href="global.html#twoPI">twoPI</a></li><li><a href="global.html#unique">unique</a></li><li><a href="global.html#units">units</a></li><li><a href="global.html#updateOther">updateOther</a></li><li><a href="global.html#updateSize">updateSize</a></li><li><a href="global.html#visitStereochemistry">visitStereochemistry</a></li><li><a href="global.html#whichSide">whichSide</a></li></ul> </nav> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="atomicNumbers"><span class="type-signature"></span>atomicNumbers<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Atom.js.html">Atom.js</a>, <a href="Atom.js.html#line278">line 278</a> </li></ul></dd> </dl> <div class="description"> <p>A map mapping element symbols to the atomic number.</p> </div> <h4 class="name" id="bonds"><span class="type-signature"></span>bonds<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Edge.js.html">Edge.js</a>, <a href="Edge.js.html#line48">line 48</a> </li></ul></dd> </dl> <div class="description"> <p>An object mapping the bond type to the number of bonds.</p> </div> <h4 class="name" id="degFactor"><span class="type-signature"></span>degFactor<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MathHelper.js.html">MathHelper.js</a>, <a href="MathHelper.js.html#line149">line 149</a> </li></ul></dd> </dl> <div class="description"> <p>The factor to convert radians to degrees.</p> </div> <h4 class="name" id="mass"><span class="type-signature"></span>mass<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Atom.js.html">Atom.js</a>, <a href="Atom.js.html#line410">line 410</a> </li></ul></dd> </dl> <div class="description"> <p>A map mapping element symbols to the atomic mass.</p> </div> <h4 class="name" id="maxBonds"><span class="type-signature"></span>maxBonds<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Atom.js.html">Atom.js</a>, <a href="Atom.js.html#line260">line 260</a> </li></ul></dd> </dl> <div class="description"> <p>A map mapping element symbols to their maximum bonds.</p> </div> <h4 class="name" id="radFactor"><span class="type-signature"></span>radFactor<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MathHelper.js.html">MathHelper.js</a>, <a href="MathHelper.js.html#line144">line 144</a> </li></ul></dd> </dl> <div class="description"> <p>The factor to convert degrees to radians.</p> </div> <h4 class="name" id="twoPI"><span class="type-signature"></span>twoPI<span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MathHelper.js.html">MathHelper.js</a>, <a href="MathHelper.js.html#line154">line 154</a> </li></ul></dd> </dl> <div class="description"> <p>Two times PI.</p> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="_bridgeDfs"><span class="type-signature"></span>_bridgeDfs<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line823">line 823</a> </li></ul></dd> </dl> <div class="description"> <p>PRIVATE FUNCTION used by getBridges().</p> </div> <h4 class="name" id="_ccCountDfs"><span class="type-signature"></span>_ccCountDfs<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line904">line 904</a> </li></ul></dd> </dl> <div class="description"> <p>PRIVATE FUNCTION used by getConnectedComponentCount().</p> </div> <h4 class="name" id="_ccGetDfs"><span class="type-signature"></span>_ccGetDfs<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line920">line 920</a> </li></ul></dd> </dl> <div class="description"> <p>PRIVATE FUNCTION used by getConnectedComponents().</p> </div> <h4 class="name" id="_init"><span class="type-signature"></span>_init<span class="signature">(node, parentVertexId, isBranch)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line45">line 45</a> </li></ul></dd> </dl> <div class="description"> <p>PRIVATE FUNCTION. Initializing the graph from the parse tree.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="default"> </td> <td class="description last"><p>The current node in the parse tree.</p></td> </tr> <tr> <td class="name"><code>parentVertexId</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="default"> <code>null</code> </td> <td class="description last"><p>The id of the previous vertex.</p></td> </tr> <tr> <td class="name"><code>isBranch</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="default"> <code>false</code> </td> <td class="description last"><p>Whether or not the bond leading to this vertex is a branch bond. Branches are represented by parentheses in smiles (e.g. CC(O)C).</p></td> </tr> </tbody> </table> <h4 class="name" id="_initInfos"><span class="type-signature"></span>_initInfos<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line123">line 123</a> </li></ul></dd> </dl> <div class="description"> <p>PRIVATE FUNCTION. Initializes element counts etc.</p> </div> <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(vec)</span><span class="type-signature"> &rarr; {Vector2}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vector2.js.html">Vector2.js</a>, <a href="Vector2.js.html#line53">line 53</a> </li></ul></dd> </dl> <div class="description"> <p>Add the x and y coordinate values of a vector to the x and y coordinate values of this vector.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vec</code></td> <td class="type"> <span class="param-type">Vector2</span> </td> <td class="description last"><p>Another vector.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>Returns itself.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Vector2</span> </dd> </dl> <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(vecA, vecB)</span><span class="type-signature"> &rarr; {Vector2}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vector2.js.html">Vector2.js</a>, <a href="Vector2.js.html#line442">line 442</a> </li></ul></dd> </dl> <div class="description"> <p>Adds two vectors and returns the result as a new vector.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vecA</code></td> <td class="type"> <span class="param-type">Vector2</span> </td> <td class="description last"><p>A summand.</p></td> </tr> <tr> <td class="name"><code>vecB</code></td> <td class="type"> <span class="param-type">Vector2</span> </td> <td class="description last"><p>A summand.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the sum of two vectors.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Vector2</span> </dd> </dl> <h4 class="name" id="addAnchoredRing"><span class="type-signature"></span>addAnchoredRing<span class="signature">(ringId)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Atom.js.html">Atom.js</a>, <a href="Atom.js.html#line158">line 158</a> </li></ul></dd> </dl> <div class="description"> <p>Defines this atom as the anchor for a ring. When doing repositionings of the vertices and the vertex associated with this atom is moved, the center of this ring is moved as well.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>ringId</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>A ring id.</p></td> </tr> </tbody> </table> <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(vertexId)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vertex.js.html">Vertex.js</a>, <a href="Vertex.js.html#line80">line 80</a> </li></ul></dd> </dl> <div class="description"> <p>Add a child vertex id to this vertex.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vertexId</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The id of a vertex to be added as a child to this vertex.</p></td> </tr> </tbody> </table> <h4 class="name" id="addEdge"><span class="type-signature"></span>addEdge<span class="signature">(edge)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line163">line 163</a> </li></ul></dd> </dl> <div class="description"> <p>Add an edge to the graph.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>edge</code></td> <td class="type"> <span class="param-type">Edge</span> </td> <td class="description last"><p>A new edge.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The edge id of the new edge.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="addNeighbouringElement"><span class="type-signature"></span>addNeighbouringElement<span class="signature">(element)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Atom.js.html">Atom.js</a>, <a href="Atom.js.html#line82">line 82</a> </li></ul></dd> </dl> <div class="description"> <p>Adds a neighbouring element to this atom.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"><p>A string representing an element.</p></td> </tr> </tbody> </table> <h4 class="name" id="addRing"><span class="type-signature"></span>addRing<span class="signature">(ring)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Drawer.js.html">Drawer.js</a>, <a href="Drawer.js.html#line956">line 956</a> </li></ul></dd> </dl> <div class="description"> <p>Add a ring to this representation of a molecule.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>ring</code></td> <td class="type"> <span class="param-type">Ring</span> </td> <td class="description last"><p>A new ring.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The ring id of the new ring.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="addRingbondChild"><span class="type-signature"></span>addRingbondChild<span class="signature">(vertexId, ringbondIndex)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vertex.js.html">Vertex.js</a>, <a href="Vertex.js.html#line96">line 96</a> </li></ul></dd> </dl> <div class="description"> <p>Add a child vertex id to this vertex as the second child of the neighbours array, except this vertex is the first vertex of the SMILE string, then it is added as the first. This is used to get the correct ordering of neighbours for parity calculations. If a hydrogen is implicitly attached to the chiral center, insert as the third child.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vertexId</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The id of a vertex to be added as a child to this vertex.</p></td> </tr> <tr> <td class="name"><code>ringbondIndex</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The index of the ringbond.</p></td> </tr> </tbody> </table> <h4 class="name" id="addRingConnection"><span class="type-signature"></span>addRingConnection<span class="signature">(ringConnection)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Drawer.js.html">Drawer.js</a>, <a href="Drawer.js.html#line1007">line 1007</a> </li></ul></dd> </dl> <div class="description"> <p>Add a ring connection to this representation of a molecule.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>ringConnection</code></td> <td class="type"> <span class="param-type">RingConnection</span> </td> <td class="description last"><p>A new ringConnection.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The ring connection id of the new ring connection.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="addVertex"><span class="type-signature"></span>addVertex<span class="signature">(vertexId)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="RingConnection.js.html">RingConnection.js</a>, <a href="RingConnection.js.html#line44">line 44</a> </li></ul></dd> </dl> <div class="description"> <p>Adding a vertex to the ring connection.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vertexId</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>A vertex id.</p></td> </tr> </tbody> </table> <h4 class="name" id="addVertex"><span class="type-signature"></span>addVertex<span class="signature">(vertex)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Graph.js.html">Graph.js</a>, <a href="Graph.js.html#line150">line 150</a> </li></ul></dd> </dl> <div class="description"> <p>Add a vertex to the graph.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vertex</code></td> <td class="type"> <span class="param-type">Vertex</span> </td> <td class="description last"><p>A new vertex.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The vertex id of the new vertex.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="angle"><span class="type-signature"></span>angle<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vector2.js.html">Vector2.js</a>, <a href="Vector2.js.html#line129">line 129</a> </li></ul></dd> </dl> <div class="description"> <p>Returns the angle of this vector in relation to the coordinate system.</p> </div> <h5>Returns:</h5> <div class="param-desc"> <p>The angle in radians.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="angle"><span class="type-signature"></span>angle<span class="signature">(vecA, vecB)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Vector2.js.html">Vector2.js</a>, <a href="Vector2.js.html#line572">line 572</a> </li></ul></dd> </dl> <div class="description"> <p>Returns the angle between two vectors.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>vecA</code></td> <td class="type"> <span class="param-type">Vector2</span> </td> <td class="description last"><p>A vector.</p></td> </tr> <tr> <td class="name"><code>vecB</code></td> <td class="type"> <span class="param-type">Vector2</span> </td> <td class="description last"><p>A vector.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The angle between two vectors in radians.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="annotateStereochemistry"><span class="type-signature"></span>annotateStereochemistry<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Drawer.js.html">Drawer.js</a>, <a href="Drawer.js.html#line2602">line 2602</a> </li></ul></dd> </dl> <div class="description"> <p>Annotaed stereochemistry information for visualization.</p> </div> <h4 class="name" id="apothem"><span class="type-signature"></span>apothem<span class="signature">(r, n)</span><span class="type-signature"> &rarr; {Number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MathHelper.js.html">MathHelper.js</a>, <a href="MathHelper.js.html#line68">line 68</a> </li></ul></dd> </dl> <div class="description"> <p>Returns the apothem of a regular n-sided polygon based on its radius.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>r</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The radius.</p></td> </tr> <tr> <td class="name"><code>n</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The nu