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

SVG export in Observable: error on opening the file #213

Closed
ericemc3 opened this issue Dec 24, 2020 · 2 comments · Fixed by vega/vega#3049
Closed

SVG export in Observable: error on opening the file #213

ericemc3 opened this issue Dec 24, 2020 · 2 comments · Fixed by vega/vega#3049

Comments

@ericemc3
Copy link

Don't know wether it is an Observable or Vega-Lite issue:

I go to https://observablehq.com/@vega/vega-lite-pyramid-pie?collection=@vega/vega-lite-api

I change the render option to svg:
.render({renderer:'svg'});

then try and export via the download SVG item in the Observable cell menu.
When i open the file (in a browser like Chrome or Edge) i get:

This page contains the following errors:
error on line 1 at column 226: Attribute xmlns redefined
Below is a rendering of the page up to the first error.

And indeed, this appears repeated in the svg root node:
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"

@ericemc3
Copy link
Author

It appears that this is probably an Observable issue, so i am noticing their team.

@ericemc3
Copy link
Author

Having spoken with the Observable team, it appears that:
it looks like Vega uses setAttribute() to set xmlns attributes, while Observable uses setAttributeNS() in its conversion code,
so in the end these attributes pile up.

I don't know which encoding process is the most academic,
it would just be great if both parties were to agree on the same, considering the great complementarity between both worlds!

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.

1 participant