You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I was going through the code for org.openscience.cdk.depict.DepictionGenerator for drawing a reaction as svg. I noticed that a molecule's title is generated as a <path> element in the resulting svg instead of a usual <text>. Reading through the code, I noticed that titles are interpreted as org.openscience.cdk.renderer.elements.Bounds instead of org.openscience.cdk.renderer.elements.TextElement.
I am not sure why is this the case. Maybe someone from the cdk developers could throw light on this. My problem is that my titles are HTML strings with <sub><sup> tags in there. These are not rendered correctly in the resulting svg.
The text was updated successfully, but these errors were encountered:
We renderer them as paths otherwise we don’t have correct sizing information and we want things to be consistent. We could make an option to not do this for the title though.
A work around is to use Unicode sub/super scripts instead of HTML.
What I prefer to do is just not embedded the title, check out the advanced options on cdkdepict (www.simolecule.com/cdkdepict) you can embedded the title or render it in HTML
Hello @johnmay I checked the cdkdepict, my problem is that I am rendering an entire reaction, so can't use the similar logic of showing the name at the bottom is each molecule (as is in the example) without embedding it. Do you know a way to associate metadata like custom class name to the <g> tag surrounding the title? Right now there is no way to associate title to the molecule in the svg.
There is no way to currently do it then, a new option "NonRenderedTitle" option which by passes the rendering would do the trick. Please feel free to submit a patch
Hello,
I was going through the code for org.openscience.cdk.depict.DepictionGenerator for drawing a reaction as svg. I noticed that a molecule's title is generated as a
<path>
element in the resulting svg instead of a usual<text>
. Reading through the code, I noticed that titles are interpreted as org.openscience.cdk.renderer.elements.Bounds instead of org.openscience.cdk.renderer.elements.TextElement.cdk/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java
Line 487 in 82b1a3c
I am not sure why is this the case. Maybe someone from the cdk developers could throw light on this. My problem is that my titles are HTML strings with
<sub>
<sup>
tags in there. These are not rendered correctly in the resulting svg.The text was updated successfully, but these errors were encountered: