Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

clash of vegalite versions using from_spec() #32

Open
espinielli opened this issue May 20, 2018 · 1 comment
Open

clash of vegalite versions using from_spec() #32

espinielli opened this issue May 20, 2018 · 1 comment

Comments

@espinielli
Copy link

When I try one of the simple vegalite examples like:

from_spec('{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
          "description": "A simple bar chart with embedded data.",
          "data": {
          "values": [
          {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
          {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
          {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
          ]
          },
          "mark": "bar",
          "encoding": {
          "x": {"field": "a", "type": "ordinal"},
          "y": {"field": "b", "type": "quantitative"}
          }
          }')

I correctly get the relevant plot.

With the following one, the cloropleth example with data files pointing to relevant URLs, nothing is displayed and no error is reported:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.1.json",
  "width": 500,
  "height": 300,
  "data": {
    "url": "https://raw.githubusercontent.com/vega/editor/master/data/us-10m.json",
    "format": {
      "type": "topojson",
      "feature": "counties"
    }
  },
  "transform": [
    {
      "lookup": "id",
      "from": {
        "data": {
          "url": "https://raw.githubusercontent.com/vega/editor/master/data/unemployment.tsv"
        },
        "key": "id",
        "fields": [
          "rate"
        ]
      }
    }
  ],
  "projection": {
    "type": "albersUsa"
  },
  "mark": "geoshape",
  "encoding": {
    "color": {
      "field": "rate",
      "type": "quantitative"
    }
  }
}

The above spec in Vega-lite Editor works flowlessly.

It looks like the issue is with vegalite version in the package with respect to the one defined in the spec, in the web console of the detached plot I get:

 The input spec uses vega-lite v2.1, but the current version of Vega-Lite is 2.0.1.
@jdittrich
Copy link

That would be great to be able to run this – vega was much extended and it is currently, as far as I am concerned, not possible to use these extended capabilities from R.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants