We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
xlink
svgstring
Using svglite v2.1.1, given the following code:
require(ggplot2) require(svglite) p <- ggplot(mtcars) + geom_point(aes(x = disp, y = mpg, color = gear)) svg <- svgstring(fix_text_size = FALSE, standalone = FALSE) plot(p) invisible(dev.off()) s <- svg() write(s, file="foo.svg")
When I open the SVG file "foo.svg" in the chrome browser, I get the error message:
error on line 108 at column 401: Namespace prefix xlink for href on image is not defined
Line 108 of the SVG contains:
<image width='17.28' height='86.40' x='672.30' y='239.58' preserveAspectRatio='none' xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAEsCAYAAAAC UNnVAAAAmElEQVQ4ja2UQRLDMAgDd3hk/tnX5agcknFaCoa0vnkMCEnGsL12GQhDYDpPwoDrpBFlRDWi/9Wu6AHC9FkLYLrzlhD3oJ3mDvRHRYy7IC8A7bCK8gpWKYDzeQVArDcDyD2YAnSofZvzaOA6Q7Oahp/ dmRuVTQ0xU5TGP2o8Waool1obVuv1q8qP9xPvg633XlGLDtfIhNUBcBeA5ss0BXMAAAAASUVORK5CYII='/>
The SVG renders correctly if we define xlink in the first line of the SVG file. That is, if we replace the current first line:
<svg class='svglite' width='720.00pt' height='576.00pt' viewBox='0 0 720.00 576.00'>
with
<svg class='svglite' width='720.00pt' height='576.00pt' viewBox='0 0 720.00 576.00' xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
The text was updated successfully, but these errors were encountered:
This is because you specifically sets standalone = FALSE which, as the documentation says, removes the namespaces from the file
standalone = FALSE
Sorry, something went wrong.
No branches or pull requests
Using svglite v2.1.1, given the following code:
When I open the SVG file "foo.svg" in the chrome browser, I get the error message:
Line 108 of the SVG contains:
The SVG renders correctly if we define
xlink
in the first line of the SVG file. That is, if we replace the current first line:with
The text was updated successfully, but these errors were encountered: