C visible, transparent atom labels#70
Conversation
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
- Coverage 76.14% 76.05% -0.09%
==========================================
Files 56 56
Lines 4963 4970 +7
==========================================
+ Hits 3779 3780 +1
- Misses 1184 1190 +6
Continue to review full report at Codecov.
|
|
Thank you very much. That looks great! |
|
MolecularGraph.jl/src/draw/svg.jl Line 345 in 12679ba The anchor seems to be OK. The centering should be,
|
|
From To text.x value is a half of g.width g.width is still environment dependent. (font-size / 2 * word count) would be a good guess. |
|
based on here, felt like this would work, but it doesn't. :( elem = """<g transform="translate($(pos.x), $(pos.y))">
<rect x="0" y="0" width="$(size)" height="$(size)" rx="$(size/2)" ry="$(size/2)" fill="$(bc)" opacity="$(opacity)" />
<text x="$(size/2)" y="$(size/2)" font-size="$(size)" fill="$(c)" text-anchor="middle" alignment-baseline="middle">$(text) </text>
</g>
""" |
|
The attribute name would be |

let me know if you have any requested changes, happy to make them.
one thing I couldn't figure out: the atom indices are not centered with the circles behind them. there is an offset. how can I fix this?
https://github.com/mojaie/MolecularGraph.jl/blob/master/src/draw/svg.jl#L334-L335 some change here?
here is my test for this: