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

"data" outside top-level specification #15

Closed
Corvince opened this issue Feb 6, 2019 · 8 comments
Closed

"data" outside top-level specification #15

Corvince opened this issue Feb 6, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@Corvince
Copy link

Corvince commented Feb 6, 2019

If I load local data on the top-level of a spec it works fine, but if "data" appears somewhere else it doesn't work.
For example this works

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "data": {
    "url": "myfile.csv"
    },
    "Rest of specification"
}

While this doesn't

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "layer": [
    {
      "data": {
      "url": "myfile.csv"
      },
      "Rest of specification"
}
@Corvince
Copy link
Author

Corvince commented Feb 6, 2019

Somewhat related: I tried to start a local http server and included
"url": "http://127.0.0.1:8000/myfile.csv"
This also doesn't work, but it doesn't say "myfile.csv not found"

@RandomFractals
Copy link
Owner

Loading data from a web server currently works only via https due to Content-Security-Policy I have set for secure data transfers.

I'll add local data loading for layers in the next patch release update.

Thanks for pointing that out.

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 13, 2019

@Corvince this can now be worked out with http patch in v2.2.0 and instructions I added to #16 for simple hosting of your local data files: #16 (comment)

I'll still add relative local data files load for layers in the next patch, but it should not be a major showstopper for you to use this ext. now for authoring Vega json specs with layers data references.

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 20, 2019

@Corvince I am having hard time finding a vega or vega-lite example where layered data is used. I flipped through a hundred examples and pretty much all use top level data config.

Can you get the latest v3.0 of this ext. with built-in examples and point me to a working example with layered data url elements?

@Corvince
Copy link
Author

Built-in examples in V3 work great, but I can't point you to a working example, because they don't work ;)

Most geo_* examples use layerd data, e.g. geo_layer.vl.json ;)

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 20, 2019

Built-in examples in V3 work great, but I can't point you to a working example, because they don't work ;)

Most geo_* examples use layerd data, e.g. geo_layer.vl.json ;)

@Corvince Perfect! we'll make them work! I just could not find a good example using it.

Happy to hear you like built-in examples for quick starters and exploring community contributed vega jsons.

@RandomFractals
Copy link
Owner

@Corvince this should now work for all local/relative data references in vega spec. I am aware of.

Please review this patch update code here if you'd like: 8d49d4e#diff-5c245625569aa17bdc70402dfc2e4504

and let me know if there are any other edge cases I've missed for this feature request.

@Corvince
Copy link
Author

Hey there, after quite some delay I just wanted to say thank you! Both locally hosted data and "layered" data work like a charm!

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

No branches or pull requests

2 participants