UNPKG

smiles-drawer

Version:

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

2,283 lines (617 loc) 52.3 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>SSSR - 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><li><a href="SmilesDrawer.ArrayHelper.html">ArrayHelper</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.clone">clone</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.contains">contains</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.containsAll">containsAll</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.count">count</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.deepCopy">deepCopy</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.each">each</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.get">get</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.intersection">intersection</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.merge">merge</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.print">print</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.remove">remove</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.removeAll">removeAll</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.removeUnique">removeUnique</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.sortByAtomicNumberDesc">sortByAtomicNumberDesc</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.toggle">toggle</a></li><li data-type='method'><a href="SmilesDrawer.ArrayHelper.html#.unique">unique</a></li></ul></li><li><a href="SmilesDrawer.Atom.html">Atom</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Atom.html#.getDuplicateAtomicNumbers">getDuplicateAtomicNumbers</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#.hasDuplicateAtomicNumbers">hasDuplicateAtomicNumbers</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#.sortByAtomicNumber">sortByAtomicNumber</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#addAnchoredRing">addAnchoredRing</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#addNeighbouringElement">addNeighbouringElement</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#attachPseudoElement">attachPseudoElement</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#backupRings">backupRings</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#getAtomicNumber">getAtomicNumber</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#getAttachedPseudoElements">getAttachedPseudoElements</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#getAttachedPseudoElementsCount">getAttachedPseudoElementsCount</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#getOrder">getOrder</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#getRingbondCount">getRingbondCount</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#haveCommonRingbond">haveCommonRingbond</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#neighbouringElementsEqual">neighbouringElementsEqual</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#restoreRings">restoreRings</a></li><li data-type='method'><a href="SmilesDrawer.Atom.html#setOrder">setOrder</a></li></ul></li><li><a href="SmilesDrawer.CanvasWrapper.html">CanvasWrapper</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#clear">clear</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawAromaticityRing">drawAromaticityRing</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawBall">drawBall</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawCircle">drawCircle</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawDashedWedge">drawDashedWedge</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawDebugPoint">drawDebugPoint</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawDebugText">drawDebugText</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawLine">drawLine</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawPoint">drawPoint</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawText">drawText</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#drawWedge">drawWedge</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#getColor">getColor</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#reset">reset</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#scale">scale</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#setTheme">setTheme</a></li><li data-type='method'><a href="SmilesDrawer.CanvasWrapper.html#updateSize">updateSize</a></li></ul></li><li><a href="SmilesDrawer.Edge.html">Edge</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Edge.html#getBondCount">getBondCount</a></li></ul></li><li><a href="SmilesDrawer.Graph.html">Graph</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Graph.html#._ccCountDfs">_ccCountDfs</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#._ccGetDfs">_ccGetDfs</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#.getConnectedComponentCount">getConnectedComponentCount</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#.getConnectedComponents">getConnectedComponents</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#_bridgeDfs">_bridgeDfs</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#_init">_init</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#_initInfos">_initInfos</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#addEdge">addEdge</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#addVertex">addVertex</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#clear">clear</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getAdjacencyList">getAdjacencyList</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getAdjacencyMatrix">getAdjacencyMatrix</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getBridges">getBridges</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getComponentsAdjacencyMatrix">getComponentsAdjacencyMatrix</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getDistanceMatrix">getDistanceMatrix</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getEdge">getEdge</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getEdgeList">getEdgeList</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getEdges">getEdges</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getSubgraphAdjacencyList">getSubgraphAdjacencyList</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getSubgraphAdjacencyMatrix">getSubgraphAdjacencyMatrix</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getSubgraphDistanceMatrix">getSubgraphDistanceMatrix</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#getVertexList">getVertexList</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#hasEdge">hasEdge</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#kkLayout">kkLayout</a></li><li data-type='method'><a href="SmilesDrawer.Graph.html#traverseBF">traverseBF</a></li></ul></li><li><a href="SmilesDrawer.Line.html">Line</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Line.html#clone">clone</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getAngle">getAngle</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getLeftChiral">getLeftChiral</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getLeftElement">getLeftElement</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getLeftVector">getLeftVector</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getLength">getLength</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getNormals">getNormals</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getRightChiral">getRightChiral</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getRightElement">getRightElement</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#getRightVector">getRightVector</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#rotate">rotate</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#rotateToXAxis">rotateToXAxis</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#setLeftVector">setLeftVector</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#setRightVector">setRightVector</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#shorten">shorten</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#shortenFrom">shortenFrom</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#shortenLeft">shortenLeft</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#shortenRight">shortenRight</a></li><li data-type='method'><a href="SmilesDrawer.Line.html#shortenTo">shortenTo</a></li></ul></li><li><a href="SmilesDrawer.Ring.html">Ring</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Ring.html#clone">clone</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#contains">contains</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#eachMember">eachMember</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#getAngle">getAngle</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#getDoubleBondCount">getDoubleBondCount</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#getOrderedNeighbours">getOrderedNeighbours</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#getPolygon">getPolygon</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#getSize">getSize</a></li><li data-type='method'><a href="SmilesDrawer.Ring.html#isBenzeneLike">isBenzeneLike</a></li></ul></li><li><a href="SmilesDrawer.RingConnection.html">RingConnection</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.RingConnection.html#.getNeighbours">getNeighbours</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#.getVertices">getVertices</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#.isBridge">isBridge</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#addVertex">addVertex</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#containsRing">containsRing</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#isBridge">isBridge</a></li><li data-type='method'><a href="SmilesDrawer.RingConnection.html#updateOther">updateOther</a></li></ul></li><li><a href="SmilesDrawer.SSSR.html">SSSR</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.SSSR.html#.areSetsEqual">areSetsEqual</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.bondsToAtoms">bondsToAtoms</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getBondCount">getBondCount</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getEdgeCount">getEdgeCount</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getEdgeList">getEdgeList</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getPathIncludedDistanceMatrices">getPathIncludedDistanceMatrices</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getRingCandidates">getRingCandidates</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getRings">getRings</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.getSSSR">getSSSR</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.isSupersetOf">isSupersetOf</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.matrixToString">matrixToString</a></li><li data-type='method'><a href="SmilesDrawer.SSSR.html#.pathSetsContain">pathSetsContain</a></li></ul></li><li><a href="SmilesDrawer.Vector2.html">Vector2</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Vector2.html#add">add</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#angle">angle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#clockwise">clockwise</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#clone">clone</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#distance">distance</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#distanceSq">distanceSq</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#divide">divide</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#getRotateAwayFromAngle">getRotateAwayFromAngle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#getRotateToAngle">getRotateToAngle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#getRotateTowardsAngle">getRotateTowardsAngle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#invert">invert</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#isInPolygon">isInPolygon</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#length">length</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#lengthSq">lengthSq</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#multiply">multiply</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#multiplyScalar">multiplyScalar</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#normalize">normalize</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#normalized">normalized</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#rotate">rotate</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#rotateAround">rotateAround</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#rotateAwayFrom">rotateAwayFrom</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#rotateTo">rotateTo</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#sameSideAs">sameSideAs</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#subtract">subtract</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#toString">toString</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#whichSide">whichSide</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.add">add</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.angle">angle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.averageDirection">averageDirection</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.divide">divide</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.dot">dot</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.midpoint">midpoint</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.multiply">multiply</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.multiplyScalar">multiplyScalar</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.normals">normals</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.scalarProjection">scalarProjection</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.subtract">subtract</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.threePointangle">threePointangle</a></li><li data-type='method'><a href="SmilesDrawer.Vector2.html#.units">units</a></li></ul></li><li><a href="SmilesDrawer.Vertex.html">Vertex</a><ul class='methods'><li data-type='method'><a href="SmilesDrawer.Vertex.html#addChild">addChild</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#clone">clone</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#equals">equals</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getAngle">getAngle</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getDrawnNeighbours">getDrawnNeighbours</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getNeighbourCount">getNeighbourCount</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getNeighbours">getNeighbours</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getNextInRing">getNextInRing</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getSpanningTreeNeighbours">getSpanningTreeNeighbours</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#getTextDirection">getTextDirection</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#isTerminal">isTerminal</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#setParentVertexId">setParentVertexId</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#setPosition">setPosition</a></li><li data-type='method'><a href="SmilesDrawer.Vertex.html#setPositionFromVector">setPositionFromVector</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#addRing">addRing</a></li><li><a href="global.html#addRingConnection">addRingConnection</a></li><li><a href="global.html#apothem">apothem</a></li><li><a href="global.html#areVerticesInSameRing">areVerticesInSameRing</a></li><li><a href="global.html#backupRingInformation">backupRingInformation</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#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#draw">draw</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#drawVertices">drawVertices</a></li><li><a href="global.html#edgeRingCount">edgeRingCount</a></li><li><a href="global.html#extend">extend</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#getClosestVertex">getClosestVertex</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#getCurrentCenterOfMass">getCurrentCenterOfMass</a></li><li><a href="global.html#getCurrentCenterOfMassInNeigbourhood">getCurrentCenterOfMassInNeigbourhood</a></li><li><a href="global.html#getEdgeNormals">getEdgeNormals</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#getNonRingNeighbours">getNonRingNeighbours</a></li><li><a href="global.html#getOverlapScore">getOverlapScore</a></li><li><a href="global.html#getRing">getRing</a></li><li><a href="global.html#getRingbondType">getRingbondType</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#getSpiros">getSpiros</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#getTotalOverlapScore">getTotalOverlapScore</a></li><li><a href="global.html#getTreeDepth">getTreeDepth</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#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#isEdgeInRing">isEdgeInRing</a></li><li><a href="global.html#isEdgeRotatable">isEdgeRotatable</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#meanAngle">meanAngle</a></li><li><a href="global.html#parityOfPermutation">parityOfPermutation</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#printRingInfo">printRingInfo</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#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#rotateSubtree">rotateSubtree</a></li><li><a href="global.html#round">round</a></li><li><a href="global.html#setRingCenter">setRingCenter</a></li><li><a href="global.html#SmilesDrawer">SmilesDrawer</a></li><li><a href="global.html#toDeg">toDeg</a></li><li><a href="global.html#toRad">toRad</a></li><li><a href="global.html#traverseTree">traverseTree</a></li></ul> </nav> <div id="main"> <h1 class="page-title">SSSR</h1> <section> <header> <h2> <span class="ancestors"><a href="global.html#SmilesDrawer">SmilesDrawer</a>.</span> SSSR </h2> <div class="class-description"><p>A class encapsulating the functionality to find the smallest set of smallest rings in a graph.</p></div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="SSSR"><span class="type-signature"></span>new SSSR<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="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line2">line 2</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".areSetsEqual"><span class="type-signature">(static) </span>areSetsEqual<span class="signature">(setA, setB)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line510">line 510</a> </li></ul></dd> </dl> <div class="description"> <p>Checks whether or not two sets are equal (contain the same elements).</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>setA</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>A set.</p></td> </tr> <tr> <td class="name"><code>setB</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>A set.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>A boolean indicating whether or not the two sets are equal.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id=".bondsToAtoms"><span class="type-signature">(static) </span>bondsToAtoms<span class="signature">(bonds)</span><span class="type-signature"> &rarr; {Set.&lt;Number>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line401">line 401</a> </li></ul></dd> </dl> <div class="description"> <p>Return a set of vertex indices contained in an array of bonds.</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>bonds</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last"><p>An array of bonds. A bond is defined as [ sourceVertexId, targetVertexId ].</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>An array of vertices.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Set.&lt;Number></span> </dd> </dl> <h4 class="name" id=".getBondCount"><span class="type-signature">(static) </span>getBondCount<span class="signature">(atoms, adjacencyMatrix)</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="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line419">line 419</a> </li></ul></dd> </dl> <div class="description"> <p>Returns the number of bonds within a set of atoms.</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>atoms</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>An array of atom ids.</p></td> </tr> <tr> <td class="name"><code>adjacencyMatrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>An adjacency matrix.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The number of bonds in a set of atoms.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id=".getEdgeCount"><span class="type-signature">(static) </span>getEdgeCount<span class="signature">(adjacencyMatrix)</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="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line355">line 355</a> </li></ul></dd> </dl> <div class="description"> <p>Returns the number of edges in a graph defined by an adjacency matrix.</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>adjacencyMatrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>An adjacency matrix.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The number of edges in the graph defined by the adjacency matrix.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id=".getEdgeList"><span class="type-signature">(static) </span>getEdgeList<span class="signature">(adjacencyMatrix)</span><span class="type-signature"> &rarr; {Array.&lt;Array>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line378">line 378</a> </li></ul></dd> </dl> <div class="description"> <p>Returns an edge list constructed form an adjacency matrix.</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>adjacencyMatrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>An adjacency matrix.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>An edge list. E.g. [ [ 0, 1 ], ..., [ 16, 2 ] ]</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;Array></span> </dd> </dl> <h4 class="name" id=".getPathIncludedDistanceMatrices"><span class="type-signature">(static) </span>getPathIncludedDistanceMatrices<span class="signature">(adjacencyMatrix)</span><span class="type-signature"> &rarr; {Object}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line96">line 96</a> </li></ul></dd> </dl> <div class="description"> <p>Returnes the two path-included distance matrices used to find the sssr.</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>adjacencyMatrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>An adjacency matrix.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The path-included distance matrices. { p1, p2 }</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id=".getRingCandidates"><span class="type-signature">(static) </span>getRingCandidates<span class="signature">(d, pe, pe_prime)</span><span class="type-signature"> &rarr; {Array.&lt;Array>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line251">line 251</a> </li></ul></dd> </dl> <div class="description"> <p>Get the ring candidates from the path-included distance matrices.</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>d</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>The distance matrix.</p></td> </tr> <tr> <td class="name"><code>pe</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the shortest paths.</p></td> </tr> <tr> <td class="name"><code>pe_prime</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the shortest paths + one vertex.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The ring candidates.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;Array></span> </dd> </dl> <h4 class="name" id=".getRings"><span class="type-signature">(static) </span>getRings<span class="signature">(graph)</span><span class="type-signature"> &rarr; {Array.&lt;Array>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line9">line 9</a> </li></ul></dd> </dl> <div class="description"> <p>Returns an array containing arrays, each representing a ring from the smallest set of smallest rings in 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>graph</code></td> <td class="type"> <span class="param-type"><a href="SmilesDrawer.Graph.html">SmilesDrawer.Graph</a></span> </td> <td class="description last"><p>A SmilesDrawer.Graph object.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>An array containing arrays, each representing a ring from the smallest set of smallest rings in the group.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;Array></span> </dd> </dl> <h4 class="name" id=".getSSSR"><span class="type-signature">(static) </span>getSSSR<span class="signature">(c, d, adjacencyMatrix, pe, pe_prime, arrBondCount, arrRingCount, nsssr)</span><span class="type-signature"> &rarr; {Array.&lt;Set>}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line296">line 296</a> </li></ul></dd> </dl> <div class="description"> <p>Searches the candidates for the smallest set of smallest rings.</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>c</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>The candidates.</p></td> </tr> <tr> <td class="name"><code>d</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>The distance matrix.</p></td> </tr> <tr> <td class="name"><code>adjacencyMatrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>An adjacency matrix.</p></td> </tr> <tr> <td class="name"><code>pe</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the shortest paths.</p></td> </tr> <tr> <td class="name"><code>pe_prime</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the shortest paths + one vertex.</p></td> </tr> <tr> <td class="name"><code>arrBondCount</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the bond count of each vertex.</p></td> </tr> <tr> <td class="name"><code>arrRingCount</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A matrix containing the number of rings associated with each vertex.</p></td> </tr> <tr> <td class="name"><code>nsssr</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The theoretical number of rings in the graph.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>The smallest set of smallest rings.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;Set></span> </dd> </dl> <h4 class="name" id=".isSupersetOf"><span class="type-signature">(static) </span>isSupersetOf<span class="signature">(setA, setB)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line531">line 531</a> </li></ul></dd> </dl> <div class="description"> <p>Checks whether or not a set (setA) is a superset of another set (setB).</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>setA</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>A set.</p></td> </tr> <tr> <td class="name"><code>setB</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>A set.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>A boolean indicating whether or not setB is a superset of setA.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id=".matrixToString"><span class="type-signature">(static) </span>matrixToString<span class="signature">(matrix)</span><span class="type-signature"> &rarr; {String}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line76">line 76</a> </li></ul></dd> </dl> <div class="description"> <p>Creates a printable string from a matrix (2D array).</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>matrix</code></td> <td class="type"> <span class="param-type">Array.&lt;Array></span> </td> <td class="description last"><p>A 2D array.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>A string representing the matrix.</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id=".pathSetsContain"><span class="type-signature">(static) </span>pathSetsContain<span class="signature">(pathSets, pathSet, bonds, allBonds, arrBondCount, arrRingCount)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SSSR.js.html">SSSR.js</a>, <a href="SSSR.js.html#line444">line 444</a> </li></ul></dd> </dl> <div class="description"> <p>Checks whether or not a given path already exists in an array of paths.</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>pathSets</code></td> <td class="type"> <span class="param-type">Array.&lt;Set></span> </td> <td class="description last"><p>An array of sets each representing a path.</p></td> </tr> <tr> <td class="name"><code>pathSet</code></td> <td class="type"> <span class="param-type">Set.&lt;Number></span> </td> <td class="description last"><p>A set representing a path.</p></td> </tr> <tr> <td class="name"><code>bonds</code></td> <td class="type"> <span class="param-type">A