queryverse / VegaLite.jl

Julia bindings to Vega-Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rule mark not rendering

seanlaff opened this issue · comments

@vlplot() +
@vlplot(
    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"}
    }
) + @vlplot(
	mark=:rule,
	y={datum=75},
	data={values=[{}]}
) #|> save("figure.vegalite") 

No rule is displayed. However if I save the output via uncommenting that last line, I get

{
  "layer": [
    {
      "encoding": {
        "x": {"field": "a", "type": "ordinal"},
        "y": {"field": "b", "type": "quantitative"}
      },
      "data": {
        "values": [
          {"b": 28, "a": "A"},
          {"b": 55, "a": "B"},
          {"b": 43, "a": "C"},
          {"b": 91, "a": "D"},
          {"b": 81, "a": "E"},
          {"b": 53, "a": "F"},
          {"b": 19, "a": "G"},
          {"b": 87, "a": "H"},
          {"b": 52, "a": "I"}
        ]
      },
      "mark": "bar"
    },
    {"encoding": {"y": {"datum": 75}}, "data": {"values": [{}]}, "mark": "rule"}
  ]
}

which when displayed in the vega editor, shows the rule.

I see this when plotting from the REPL
image

What version of VegaLite.jl are you using? which environment are you running it in?

I'm using 1.0.0 in Pluto v0.12.17 in Julia 1.5.3 on linux

Status `~/.julia/environments/v1.5/Project.toml`
  [112f6efa] VegaLite v1.0.0

That's a pretty old version of VegaLite - can you upgrade?

@mcmcgrath13 Ahh, sorry that did the trick :) I am new to Julia and had assumed in this cleanroom environment the most-recent version of VegaLite would have been fetched. Perhaps something peculiar with the way Pluto tried to initialize it since I used it first from within a notebook? Anyway, thanks!