Hosting and developing a Dash Application


In this tutorial, we demonstrate how to deploy a dashboard using Dash.jl, a dashboarding system powered by Plotly.

Getting Started

To start, install Dash.jl with the following command:

using Pkg

Developing with JuliaHub IDE

Here we will start with a simple example:

using Dash
using Sockets

port = 8000

app = dash(requests_pathname_prefix="/proxy/$port/")

app.layout = html_div() do
    html_h1("Hello Dash"),
    html_div("Dash.jl: Julia interface for Dash"),
        id = "example-graph",
        figure = (
            data = [
                (x = [1, 2, 3], y = [4, 1, 2], type = "bar", name = "SF"),
                (x = [1, 2, 3], y = [2, 4, 5], type = "bar", name = "Montréal"),
            layout = (title = "Dash Data Visualization",)

run_server(app, Sockets.localhost, port)

Once you run this script in the JuliaHub IDE, you should see the following dialog on the bottom right side of the screen:

Port Forward Dialog

Once you click on "Open in Browser" you should see the dashboard correctly rendered:

Dash App Preview


The default dash initialization call should be changed from:

app = dash()


port = 8888
app = dash(requests_pathname_prefix="/proxy/$port/")

By default, JuliaHub IDE proxies the requests, so we need to specify this path name to the Dash.jl so it may respond correctly.


The run_server call should be changed from:

run_server(app,, port, debug=true)


using Sockets
run_server(app, Sockets.localhost, port, debug=true)

This will allow the server to respond correctly.

Resources and Examples