Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI double-prints CM bonds into SVG, with black fill #606

Open
hmedina opened this issue Sep 26, 2019 · 2 comments
Open

GUI double-prints CM bonds into SVG, with black fill #606

hmedina opened this issue Sep 26, 2019 · 2 comments

Comments

@hmedina
Copy link
Collaborator

hmedina commented Sep 26, 2019

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:

%agent: A(a,b)
A(a[./1]), A(b[./1]) @ 1

The exported CM looks like:
Annotation 2019-09-26 164707

Notice that the layer view displays two <Path> elements.

@pirbo
Copy link
Member

pirbo commented Sep 30, 2019

I cannot reproduce the filling part! Your example works well on my firefox... (I agree about the 2 paths, I'll see if I see something obvious)

@hmedina
Copy link
Collaborator Author

hmedina commented Oct 4, 2019

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.

For the black fill:

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..)

For the double printing:

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants