altair-viz/jupyterlab_voyager

Cannot open Vega-Lite file with data url

kanitw opened this issue · 3 comments

Step to reproduce:

  1. Clone Vega-Lite repository
  2. Start jupyter lab in the Vega-Lite code folder
  3. Go to examples/specs folder
  4. Right click on any example with URL data (not inline data) -> Open with -> Voyager (json)

cc: @FelixCodes

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

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!

local data url working now