Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript output is disabled in JupyterLab

Although Google has a lot to say when searching for the title I could not find anything that helped me...

When running the following code in a Jupyter notebook

from vega import VegaLite

VegaLite(
{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "description": "A simple bar chart with embedded data.",
  "width": 360,
  "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"},
    "tooltip": {"field": "b", "type": "quantitative"}
  }
})

I get the error message

JavaScript output is disabled in JupyterLab
like image 995
lanes Avatar asked Jan 30 '19 14:01

lanes


2 Answers

You must change to Help Launch Classic Notebook

enter image description here

like image 141
Hermes Morales Avatar answered Oct 15 '22 01:10

Hermes Morales


I was having the same problem.

According to this github issue, creating widgets this way, "was only ever intended to be a quick way to experiment with widgets before creating a real widget package, so is a bit hacky."

It only worked in Jupyter Notebook has since been deprecated in Jupyter Lab.

They recommend starting off with the official cookie cutter template and creating a proper widget. Tutorial here: https://jupyterlab.readthedocs.io/en/3.2.x/extension/extension_tutorial.html#

like image 1
TheHeadlessSourceMan Avatar answered Oct 15 '22 00:10

TheHeadlessSourceMan