queryverse / VegaLite.jl

Julia bindings to Vega-Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I cannot reproduce this example plot from Vega-lite

kavir1698 opened this issue · comments

I am trying to set color values from a field, replicating this example. However, I get no plot. Here is my code:

using VegaLite
using DataFrames

df = DataFrame(Dict(
  :y => ["X", "Y", "Z"],
  :l => ["A", "B", "C"],
  :c => ["red", "green", "blue"]
))

df |> @vlplot(
  mark = :circle,
  y = "y:n",
  color = {
    field = "l:n",
    scale = {range = {field = :c}}
  }
)

I have tested it with VegaLite v2.3.0 on Windows and Linux. Is this a bug?

Seems the scale range expects a number, but you are passing text.

Text works in the original vega-lite example.

what if you use the literal "c" instead of :c?

Doesn't help.

It looks like this feature was added in vega-lite v4.14 and VegaLite.jl currently uses v4.13, so this will become supported whenever that update is made. https://github.com/vega/vega-lite/releases/tag/v4.14.0

Right! Thanks for the feedback.