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

Misplacement of element #174

Closed
drexhage opened this issue Nov 17, 2023 · 4 comments · Fixed by #176
Closed

Misplacement of element #174

drexhage opened this issue Nov 17, 2023 · 4 comments · Fixed by #176

Comments

@drexhage
Copy link
Contributor

Describe the bug (+ To Reproduce)

I'm still wondering about this input SVG: https://vega.github.io/editor/#/examples/vega-lite/stacked_bar_h (Go on export -> svg) but I don't know what the bug is. I would be glad if someone has enough insights to point me into the right direction here.

This is how inkscape displays it:

image

This is what svg2tikz produces:

image

Setup:

  • Mode: shell tool
  • SVG2TikZ version: f142e3a
  • OS version: Linux

Expected behavior
"Variety" is supposed to be placed according to svg specs.

Additional context
I fixed the fact that this same svg wasn't compiling in #168 and I made the y-axis labels align correctly in #170 however I'm not deep enough into the program to understand why this is malfunctioning. There isn't really that much going on in the svg of this example in regards to the "variety" text, I think it has something to do with the transform transform="translate(-88.8076171875,100) rotate(-90) translate(0,-2)" (for example two translate operations) but I couldn't isolate the issue.

@ldevillez
Copy link
Collaborator

Hello @drexhage,
I will look into it 😉 Most of tested svg were from inkscape so it is good to have another source of svg. In inkscape, in general it's a transformation matrix and not multiple transformations on the same element.

@ldevillez
Copy link
Collaborator

Ok I found the problem but I need to find the right solution: the problem is the rotation from the transformation matrix. The origin from Inkscape and tikz is not the same by default (to avoid multiplying every tikz coordinate by -1. Normally you could have working figure with the option --noreversey but all the text is translated (the problem is propably linked).

@ldevillez
Copy link
Collaborator

I'm making some progress (you can check https://github.com/xyz2tex/svg2tikz/tree/174-misplacement-of-element with the option --noreversey) but I still have a small shift to correct

@ldevillez ldevillez mentioned this issue Nov 27, 2023
8 tasks
@ldevillez ldevillez linked a pull request Nov 27, 2023 that will close this issue
8 tasks
@ldevillez
Copy link
Collaborator

@drexhage can you test to see if everything is okay for you in #176 ? (the base document has wide margin so you maybe need to reduce them with the geometrypackage)

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

Successfully merging a pull request may close this issue.

2 participants