DataVoyager.jl icon indicating copy to clipboard operation
DataVoyager.jl copied to clipboard

Incomplete copy

Open tomyun opened this issue 4 years ago • 1 comments

using VegaDatasets, DataVoyager, VegaLite
v = dataset("cars") |> Voyager()

I clicked copy button to get a vegalite specification of the plot, then the content is incomplete as below. It's missing almost all information needed to reproduce the same plot.

{
  "data": {
    "name": "source"
  },
  "mark": "point",
  "encoding": {
    "x": {
      "field": "Miles_per_Gallon",
      "type": "quantitative",
      "scale": {}
    },
    "y": {
      "field": "Horsepower",
      "type": "quantitative",
      "scale": {}
    }
  },
  "config": {
    "overlay": {
      "line": true
    },
    "scale": {
      "useUnaggregatedDomain": true
    }
  }
}

By the way, if I directly save the file as below, it then has all necessary data intact so that can be loaded up in i.e. Vega Editor.

v[] |> save("figure1.vegalite")

I use DataVoyager v1.0.0 and VegaLite v2.0.1 on macOS.

julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, haswell)

tomyun avatar Apr 01 '20 18:04 tomyun

I guess it is just missing the actual data, right?

There is not much we can do on that front, the copy functionality is in the Voyager JavaScript code that we just repackage (the original is at https://github.com/vega/voyager).

davidanthoff avatar Apr 01 '20 20:04 davidanthoff