queryverse / VegaLite.jl

Julia bindings to Vega-Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New update of VegaLite "broke" some functionality

davibarreira opened this issue · comments

I've the VegaLite.jl package, and a code that was working before is not working anymore. I went back to a fork that I had, and the fork is working, so indeed the problem is something related to the most recent commits to the package.

Here is an example of code that does not work anymore:

color_bar1= "black"
color_bar2 = "blue"
@vlplot(data=df,x=:x,y=:y,mark={type=:circle},color={field=:z,type="nominal",scale={range=[color_bar1,color_bar2]}}

This returns an error saying that the variable color_bar1 is not declared. If I actually write the string instead of using the variable, the code runs.

@davibarreira Just wanted to update this issue with a reproducible example which both documents the problem and demonstrates an interim solution:

using VegaLite
using DataFrames

color_bar1= "black"
color_bar2 = "blue"
df = DataFrame(Dict("x"=> [1,2,3], "y"=> [2,3,4], "z"=> [1,1,2]))

# Works
range_list = ["black", "blue"]
@vlplot(data=df,x=:x,y=:y,mark={type=:circle},color={field=:z,type="nominal",scale={range=range_list}})

# Also works
color_bar1= "orange"

@vlplot(data=df,x=:x,y=:y,mark={type=:circle},color={field=:z,type="nominal",scale={range=[color_bar1,"blue"]}})
Status `~/.julia/environments/v1.5/Project.toml`
  [a93c6f00] DataFrames v0.22.5
  [31a5f54b] Debugger v0.6.7
  [98e50ef6] JuliaFormatter v0.13.2
  [112f6efa] VegaLite v2.3.1

Any ideas on why this is happening?

@davibarreira I don't believe that this is an issue in the current version of the library, try updating?; will add a test for this sort of 'deep nesting' in a PR

Thanks. This is odd, cause I've updated and it's not working. And when I go back to the previous version it works.

@davibarreira Can you check and confirm the versions of Vega and vegalite you are using?

Right now I'm using a personal fork. I'll try updating back and see if everything works.

So I'm not entirely clear what the status of this is :) Do we think that this is resolved?

IMHO this is resolved as soon as #359 is merged