Open dorra opened 2 years ago
Hey @dorra, thanks for reporting. It looks like RequireJS isn't included in JupyterLab, which is causing an error. Not sure when I'll be able to put together a fix, but it should work in Jupyter Notebook in the meantime.
Hi @ankane - thank you for the swift reply. Yes, it seems to work in every other client or environment than jupyter lab. That's a real shame, we are in the process of building a data analysis environment. A server oriented environment is useful ;) Thanks for your great open source contributions!
@ankane here is an interim solution:
require 'net/http'
require 'vega'
IRuby.html "<script>#{Net::HTTP.get(URI('https://requirejs.org/docs/release/2.3.6/minified/require.js'))}</script>"
Vega.lite
.data([{city: "A", sales: 28}, {city: "B", sales: 55}, {city: "C", sales: 43}])
.mark(type: "bar", tooltip: true)
.encoding(
x: {field: "city", type: "nominal"},
y: {field: "sales", type: "quantitative"}
)
Quick update: it looks like Jupyter Lab has built-in support for Vega/Vega-Lite, but haven't had any luck getting it working with Ruby.
iruby 0.7.4 ruby 3.0.4 vega-ruby 0.2.6 jupyter lab 3.3.2
Notebook command:
vega-ruby creates html code
html code is not rendered in jupyter lab
This might be an issue of jupyterlab? Daruview with googlecharts renders fine.