vega editor and external URL

239 views
Skip to first unread message

Andrea Borruso

unread,
Apr 15, 2020, 6:51:48 AM4/15/20
to vega-js

Marco Petris

unread,
Apr 15, 2020, 7:22:44 AM4/15/20
to vega-js
Hi,

if you look at the error message in the browser console it says that the CORS header "Access-Control-Allow-Origin" is missing: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin
So it is possible to use an external URL, but you need to be able to configure the CORS header in the response. The repsonse configuratio is probably not under your control on github.io. However if you put your JSON file somewhere where you can configure the response to contain the CORS header it will work.

Best,
Marco

Andrea Borruso

unread,
Apr 15, 2020, 7:54:43 AM4/15/20
to vega-js
Hi Marco,
and thank you.

If I'm not wrong I had tried with a github source and it worked, and I assumed gist had the same settings too.
And I have not looked to CORS :(

Best regards

Roy I

unread,
Apr 17, 2020, 9:37:04 AM4/17/20
to vega-js

andy

unread,
Apr 17, 2020, 10:40:26 AM4/17/20
to Roy I, vega-js
Hi Roy,

On Fri, 17 Apr 2020 at 15:37, Roy I <in...@glowingspirit.com> wrote:
Note: On the web page
click button "Raw" at upper right of the data file name


But this link has a redirect to the URL you have written. I did not notice that. 

Thank you very much


--
___________________

Andrea Borruso
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
___________________

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno, 
e farlo durare, e dargli spazio"

Italo Calvino
Reply all
Reply to author
Forward
0 new messages