YettiMG
YettiMG14mo ago

Plot Vega-Lite in Jupyter Notebook running the Deno kernel

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?
2 Replies
rgbkrk
rgbkrk14mo ago
Which version of the notebook are you in? Only some front ends have built in support for Vega.
YettiMG
YettiMGOP14mo ago
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!

Did you find this page helpful?