Skip to content

Commit

Permalink
Merge pull request #115 from Melclic/issue_105_fix
Browse files Browse the repository at this point in the history
fixed issue #105 by adding rings and improved svg handling
  • Loading branch information
daenuprobst authored Mar 25, 2022
2 parents c9bf491 + 100d0cf commit c2afe04
Show file tree
Hide file tree
Showing 41 changed files with 435 additions and 313 deletions.
63 changes: 48 additions & 15 deletions dist/smiles-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9344,16 +9344,8 @@ class SvgDrawer {


drawAromaticityRing(ring) {
let ctx = this.ctx;
let radius = MathHelper.apothemFromSideLength(this.opts.bondLength, ring.getSize());
ctx.save();
ctx.strokeStyle = this.getColor('C');
ctx.lineWidth = this.opts.bondThickness;
ctx.beginPath();
ctx.arc(ring.center.x + this.offsetX, ring.center.y + this.offsetY, radius - this.opts.bondSpacing, 0, Math.PI * 2, true);
ctx.closePath();
ctx.stroke();
ctx.restore();
let svgWrapper = this.svgWrapper;
svgWrapper.drawRing(ring.center.x, ring.center.y, ring.getSize());
}
/**
* Draw the actual edges as bonds.
Expand Down Expand Up @@ -9383,7 +9375,7 @@ class SvgDrawer {

if (!this.bridgedRing) {
for (var i = 0; i < rings.length; i++) {
let ring = rings[i];
let ring = rings[i]; //TODO: uses canvas ctx to draw... need to update this to SVG

if (preprocessor.isRingAromatic(ring)) {
this.drawAromaticityRing(ring);
Expand Down Expand Up @@ -9619,10 +9611,31 @@ const Line = require('./Line');

const Vector2 = require('./Vector2');

const MathHelper = require('./MathHelper');

function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;

for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}

return result;
}

class SvgWrapper {
constructor(themeManager, target, options) {
if (typeof target === 'string' || target instanceof String) {
this.svg = document.getElementById(target);
} else {
this.svg = target;
}

this.svg = document.getElementById(target);
this.opts = options;
this.uid = makeid(5);
this.gradientId = 0; // maintain a list of line elements and their corresponding gradients
// maintain a list of vertex elements

Expand Down Expand Up @@ -9662,7 +9675,7 @@ class SvgWrapper {
vertices = document.createElementNS('http://www.w3.org/2000/svg', 'g'),
pathChildNodes = this.paths; // give the mask an id

masks.setAttributeNS(null, 'id', 'text-mask'); // create the css styles
masks.setAttributeNS(null, 'id', this.uid + '-text-mask'); // create the css styles

style.appendChild(document.createTextNode(`
.element {
Expand Down Expand Up @@ -9690,7 +9703,7 @@ class SvgWrapper {
defs.appendChild(gradient);
}

paths.setAttributeNS(null, 'mask', 'url(#text-mask)');
paths.setAttributeNS(null, 'mask', 'url(#' + this.uid + '-text-mask)');

if (this.svg) {
this.svg.appendChild(defs);
Expand Down Expand Up @@ -9719,7 +9732,7 @@ class SvgWrapper {
createGradient(line) {
// create the gradient and add it
let gradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient'),
gradientUrl = `line-${this.gradientId++}`,
gradientUrl = this.uid + `-line-${this.gradientId++}`,
l = line.getLeftVector(),
r = line.getRightVector(),
fromX = l.x + this.offsetX,
Expand Down Expand Up @@ -9912,6 +9925,26 @@ class SvgWrapper {
textElem.appendChild(document.createTextNode(text));
this.vertices.push(textElem);
}
/**
* Draws a ring.
*
* @param {x} x The x coordinate of the ring.
* @param {y} r The y coordinate of the ring.
* @param {s} s The size of the ring.
*/


drawRing(x, y, s) {
let circleElem = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
let radius = MathHelper.apothemFromSideLength(this.opts.bondLength, s);
circleElem.setAttributeNS(null, 'cx', x + this.offsetX);
circleElem.setAttributeNS(null, 'cy', y + this.offsetY);
circleElem.setAttributeNS(null, 'r', radius - this.opts.bondSpacing);
circleElem.setAttributeNS(null, 'stroke', this.themeManager.getColor('C'));
circleElem.setAttributeNS(null, 'stroke-width', this.opts.bondThickness * 1.5);
circleElem.setAttributeNS(null, 'fill', 'none');
this.paths.push(circleElem);
}
/**
* Draws a line.
*
Expand Down Expand Up @@ -10179,7 +10212,7 @@ class SvgWrapper {

module.exports = SvgWrapper;

},{"./Line":8,"./UtilityFunctions":17,"./Vector2":18}],16:[function(require,module,exports){
},{"./Line":8,"./MathHelper":9,"./UtilityFunctions":17,"./Vector2":18}],16:[function(require,module,exports){
"use strict";

class ThemeManager {
Expand Down
8 changes: 4 additions & 4 deletions dist/smiles-drawer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/smiles-drawer.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/ArrayHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -3398,7 +3398,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/ArrayHelper.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ <h1 class="page-title">ArrayHelper.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:09 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Atom.html
Original file line number Diff line number Diff line change
Expand Up @@ -2906,7 +2906,7 @@ <h4 class="name" id="restoreRings"><span class="type-signature"></span>restoreRi
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Atom.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ <h1 class="page-title">Atom.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/CanvasWrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
5 changes: 3 additions & 2 deletions doc/CanvasWrapper.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,8 @@ <h1 class="page-title">CanvasWrapper.js</h1>

}

module.exports = CanvasWrapper;</code></pre>
module.exports = CanvasWrapper;
</code></pre>
</article>
</section>

Expand All @@ -947,7 +948,7 @@ <h1 class="page-title">CanvasWrapper.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Drawer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9583,7 +9583,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
5 changes: 3 additions & 2 deletions doc/Drawer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -3085,7 +3085,8 @@ <h1 class="page-title">Drawer.js</h1>
}
}

module.exports = Drawer;</code></pre>
module.exports = Drawer;
</code></pre>
</article>
</section>

Expand All @@ -3099,7 +3100,7 @@ <h1 class="page-title">Drawer.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Edge.html
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Edge.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h1 class="page-title">Edge.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -4275,7 +4275,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Graph.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ <h1 class="page-title">Graph.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Line.html
Original file line number Diff line number Diff line change
Expand Up @@ -3017,7 +3017,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Line.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ <h1 class="page-title">Line.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/MathHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/MathHelper.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h1 class="page-title">MathHelper.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Ring.html
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/Ring.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ <h1 class="page-title">Ring.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/RingConnection.html
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/RingConnection.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ <h1 class="page-title">RingConnection.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/SSSR.html
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion doc/SSSR.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ <h1 class="page-title">SSSR.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
20 changes: 6 additions & 14 deletions doc/SvgDrawer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,8 @@ <h1 class="page-title">SvgDrawer.js</h1>
* @param {Ring} ring A ring.
*/
drawAromaticityRing(ring) {
let ctx = this.ctx;
let radius = MathHelper.apothemFromSideLength(this.opts.bondLength, ring.getSize());

ctx.save();
ctx.strokeStyle = this.getColor('C');
ctx.lineWidth = this.opts.bondThickness;
ctx.beginPath();
ctx.arc(ring.center.x + this.offsetX, ring.center.y + this.offsetY,
radius - this.opts.bondSpacing, 0, Math.PI * 2, true);
ctx.closePath();
ctx.stroke();
ctx.restore();
let svgWrapper = this.svgWrapper;
svgWrapper.drawRing(ring.center.x, ring.center.y, ring.getSize());
}

/**
Expand Down Expand Up @@ -145,6 +135,7 @@ <h1 class="page-title">SvgDrawer.js</h1>
for (var i = 0; i &lt; rings.length; i++) {
let ring = rings[i];

//TODO: uses canvas ctx to draw... need to update this to SVG
if (preprocessor.isRingAromatic(ring)) {
this.drawAromaticityRing(ring);
}
Expand Down Expand Up @@ -380,7 +371,8 @@ <h1 class="page-title">SvgDrawer.js</h1>
}
}

module.exports = SvgDrawer;</code></pre>
module.exports = SvgDrawer;
</code></pre>
</article>
</section>

Expand All @@ -394,7 +386,7 @@ <h1 class="page-title">SvgDrawer.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Fri Feb 14 2020 15:34:37 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Dec 02 2020 01:12:10 GMT+0100 (Central European Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit c2afe04

Please sign in to comment.