D
Deno

help

Plot Vega-Lite in Jupyter Notebook running the Deno kernel

YYettiMG11/16/2023
Hello, I am very new to Deno... I wanted to see if I can produce some interactive Vega visualizaiton in a Jupyter notebook, however I don't get any plot showing. Here is an example (taken from here):
import vl from "npm:vega-lite-api"
import vlData from 'npm:vega-datasets';

const data = await vlData['gapminder.json']();
let data2000 = data.filter(d => d.year === 2000)

let plot = vl.markPoint()
.data(data2000)
.encode(
vl.x().fieldQ('fertility')
)

await display(plot) // no output
import vl from "npm:vega-lite-api"
import vlData from 'npm:vega-datasets';

const data = await vlData['gapminder.json']();
let data2000 = data.filter(d => d.year === 2000)

let plot = vl.markPoint()
.data(data2000)
.encode(
vl.x().fieldQ('fertility')
)

await display(plot) // no output
Anyone has an idea, what am I missing?
Rrgbkrk11/16/2023
Which version of the notebook are you in? Only some front ends have built in support for Vega.
YYettiMG11/17/2023
Thanks @rgbkrk for your reply. I actually did have an old (3.5) version of Jupyterlab in my base environment. Updated and now I get the plots! This is fantastic!

Looking for more? Join the community!