1

I am new dash and was wondering if there is a way to run dash on .ipynb files in vs-code. I found out that using JupyterDash you're able to run dash on Jupyter IDE (The web version). I was wondering if there is a way to extend this to .ipynb files in vs-code (I heavily use vs-code Jupyter instead of the web version). I tried making a radio button using this code within a cell in a .ipynb file in vs-code and it didn't work (Of course the same code did work in Jupyter web version). If there is way to run it in vscode, please do let me know.

 from jupyter_plotly_dash import JupyterDash 
 import dash 
 import dash_core_components as dcc 
 import dash_html_components as HTML 
 from dash.dependencies import Input,Output 

 app = JupyterDash('SimpleExample')

 app.layout = html.Div([
    dcc.RadioItems(
        id = 'dropdown-color',
        options = [{'label' : c, 'value' : c.lower()} for c in ['Red','Green','Blue']],
        value = 'red'
    )
])
app

1 Answer 1

1

Follow the latest jupyter dash documents. Try this:

from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

app = JupyterDash('SimpleExample')

app.layout = html.Div([
    dcc.RadioItems(
        id = 'dropdown-color',
        options = [{'label' : c, 'value' : c.lower()} for c in ['Red','Green','Blue']],
        value = 'red'
    )
]) 
# Run app and display result inline in the notebook
app.run_server(mode='inline')

More about it here:
https://medium.com/plotly/introducing-jupyterdash-811f1f57c02e

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.