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

Open in editor breaks if data is not available #55

Closed
domoritz opened this issue Jan 24, 2018 · 6 comments
Closed

Open in editor breaks if data is not available #55

domoritz opened this issue Jan 24, 2018 · 6 comments

Comments

@domoritz
Copy link
Member

Since URLs in Vega or Vega-Lite specs can be relative, the URLs may not be correct. We could either use the origin URL as the baseurl or send the data along when a spec is opened in the editor.

@timelyportfolio
Copy link

will take a look...

@timelyportfolio
Copy link

timelyportfolio commented Feb 7, 2018

Seems like we could test the spec for data:url. If exists, test for relative. If relative, change spec to new URL(data:url, window.location.href).href and send new spec through post. I checked new URL() and it seems to work with absolute and relative url.

image

@domoritz, does this approach fit your expectation?

@domoritz
Copy link
Member Author

domoritz commented Feb 7, 2018

We should avoid reading the spec. I suggest that we create our own vega loader that checks a relative URL and attaches the baseurl of the post sender if the relative URL returns a 404. This should be done in the editor (https://github.com/vega/editor).

Vega embed only needs to be changed to send the baseurl (I don't know whether post already does that, haven't checked).

@ydlamba
Copy link
Member

ydlamba commented Mar 9, 2018

I just checked that Vega embed is already sending the baseURL of sender in the post request. So, I think no change needed here.

@domoritz
Copy link
Member Author

domoritz commented Mar 9, 2018

Sweet. I guess it's coming in via the POST message, right?

@domoritz domoritz closed this as completed Mar 9, 2018
@domoritz
Copy link
Member Author

Done in editor.

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

No branches or pull requests

3 participants