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

clash of vegalite versions using from_spec()  #32

@espinielli

Description

@espinielli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions