Debugger and Vega Plotting questions in Julia 1.4.1

Hi folks,

I am moving away from Atom… and have installed VS code and the Julia extension. I am in Julia 1.4.1 The debugger extension is not doing anything. How do we Vega graph in the VS code? that is @vlplot in Queryverse is not doing anything. do we need to install Jupyter Notebook extension to see the Vega plots?

thanks
C.Cruz

How are you trying to use the debugger? This has some information.

VegaLite.jl should just work out-of-the-box, without a need to install anything else. How exactly are you trying to use it? From the REPL? In a script? Something else? What is the code you are using?

Hi David,

Thank you for time time. I will read more about the debugger.

My vega lite function definition is below. I call it from the .jl tab in VS studio and not from the REPL. The call is: plotLinearICP( r.X, r.ConfInt)

But the call does nothing. I would expect some error in the TERMINAL or the plot to pop up like when plotting in R Studio.

function plotLinearICP(

X::DataFrame,

ConfInt::Array{Float64,2}

)

dfGraph = DataFrame(ConfInt, names(X))

dfTranspose = DataFrames.stack(dfGraph, 1:ncol(dfGraph))  |> @rename(:value => :ConfidenceInterval) |> DataFrame



dfTranspose |>

    @vlplot(

        mark = {:boxplot, extent = "min-max"},

        x = {"variable:o", axis = {title = "Predictors"}},

        y = {:ConfidenceInterval, axis = {title = "Linear Invariant Causal Prediction"}},

        size = {value = 25},

        width  = 600,

        height = 500)

end # plotLinearICP

thank you

Your code is creating a plot instance, but unless that is the final value in the REPL, you need to call display on the plot instance to actually display it, that is the default behavior in Julia.

Hi David,

I included the display function call as follows. Yet, VS code is only displaying the string below in the TERMINAL. No graph is display by VS code. Am I calling display incorrectly? The documentation Vega-lite specifications · VegaLite.jl does not include an example in how to call the display function.

thanks

plot = dfTranspose |>
@vlplot(
mark = {:boxplot, extent = “min-max”},
x = {“variable:o”, axis = {title = “Predictors”}},
y = {:ConfidenceInterval, axis = {title = “Linear Invariant Causal Prediction”}},
size = {value = 25},
width = 600,
height = 500)

VegaLite.display(plot)

STRING PRINTED IN THE TERMINAL
@vlplot(
mark={
extent=“min-max”,
type=“boxplot”
},
width=600,
height=500,
encoding={
x={
axis={
title=“Predictors”
},
field=“variable”,
type=“ordinal”
},
y={
axis={
title=“Linear Invariant Causal Prediction”
},
field=“ConfidenceInterval”
},
size={
value=25
}
},
data={
values=…
}
)

Were you able to figure this out? I am trying @vlplot in Atom but am also seeing no plots.

I tried to use display() too. Apparently that is not doing anything too.

Hi

No, it didn’t work for me in VS code. I ended up using the RELP to display the graph.