Open hmedina opened 5 years ago
I cannot reproduce the filling part! Your example works well on my firefox... (I agree about the 2 path
s, I'll see if I see something obvious)
Using both Firefox and Chrome, I produce the same behavior: two times the bond. When viewed in Illustrator, it has black fill. When viewed by Chrome or Firefox, it does not. So there is an issue of viewer interpretation happening, which hinted to non-standard SVG.
From https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill the value of a Fill attribute must be a Paint type, which from https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint does not list "transparent"
as an option. If I switch to "none"
, the issue goes away, with Illustrator, Chrome, and Firefox displaying the line with no fill. I suspect l.249 of render-contactmap.js should be switched to none
rather than the current transparent
(but can't test at the moment..)
The lines are not identical if one inspects the SVG source. These paths of class "link"
have different values for their d=
attribute, which means they are technically different. On one file, the beginning of two looks like:
d="
M 255.16666666666663, -1.5624452079121645e-14
L 239.92754629629624, -1.449601942896286e-14 [...]
and
d="
M -255.16666666666663, 4.6873356237364935e-14
L -239.92754629629624, 4.426928089084467e-14 [...]
Notice the start position for the Move command has opposite X coordinate, and the Y coordinate has an exponent of -14. The second command, Line, also has an opposite X coordinate, and a Y coordinate of essentially zero. Is the double-printing arising out of printing the bond from A.a to A.b, and then another one from A.b back to A.a ?
When exporting a contact map as an SVG (Firefox 69.0.1): 1) Some bonds are output twice 2) Bonds have a fill value of black, instead of having no fill
For example, given the model:
The exported CM looks like:
Notice that the layer view displays two
<Path>
elements.