Cannot open Vega-Lite file with data url
kanitw opened this issue · 3 comments
kanitw commented
Step to reproduce:
- Clone Vega-Lite repository
- Start jupyter lab in the Vega-Lite code folder
- Go to
examples/specs
folder - Right click on any example with URL data (not inline data) -> Open with -> Voyager (json)
cc: @FelixCodes
zzhangjii commented
Hi @kanitw , the standard vl.json form jupyterlab_voyager accepts are:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "A scatterplot showing horsepower and miles per gallons.",
"data": {"url": "https://vega.github.io/vega-datasets/data/cars.json"},
"mark": "point",
"encoding": {
"x": {"field": "Horsepower", "type": "quantitative"},
"y": {"field": "Miles_per_Gallon", "type": "quantitative"},
"color": {"field": "Origin", "type": "nominal"},
"shape": {"field": "Origin", "type": "nominal"}
}
}
the program will try to extract src_file.data.url, so make sure it has the 'data' field and 'url' inside 'data'.
Also, if the url is local url, then it probably won't work because the filepath may conflict with the jupyterlab filebrowser path
kanitw commented
Yes, but users wouldn't know that. I wonder if there is a way to fix this in the plugin.
Also if you need a config in Voyager to pass in path prefix for data url, let us know!
zzhangjii commented
local data url working now