Dash is an open-source framework for building analytical web applications. No JavaScript required – just write in Python. This makes Dash ideal for building data visualizations and dashboards directly from your Python code. In this guide, we'll create a basic Dash app with a few interactive visualizations.
Dash uses Flask under the hood – which means you can also serve your Dash apps easily, just like you serve a Flask app.
Einblick allows you to deploy these visualizations directly from our canvas, meaning you no longer need to use third-party services or manage additional deployment resources in order to bring your model to production. Want to try it yourself? Simply clone this canvas and try it yourself.
NOTE: Even the Einblick free tier allows you to create Endpoints, but will expire after 30 minutes of inactivity.
Jump to Just the Python Code
1. Prepare the Data for Visualization
Let's use the well-known Iris dataset for creating a few different plots.
!pip install plotly
import plotly.express as px
# Load the Iris dataset
iris = px.data.iris()
2. Initialize the Dash Application
Here, we'll initialize the Dash app and start laying out the components. For each plot or figure you create with Plotly, you'll use a Graph component in Dash.
!pip install dash pandas
import dash
from dash import dcc, html
import plotly.express as px
import pandas as pd
app = dash.Dash(__name__)
# Define the layout of the app
# We'll finish this code in the next section
app.layout = html.Div([
html.H1("Iris Dataset Visualizations"),
3. Let’s make a few graphs, using Plotly
Plotly is a powerful and flexible graphing package, with many built-in types of charts that are interactive. Here, we just make a scatter plot and a histogram.
# Continue code where we left off above
dcc.Graph(
id='scatter-plot',
figure=px.scatter(iris, x="sepal_width", y="sepal_length",
color="species", title="Sepal Width vs Length")
),
dcc.Graph(
id='histogram',
figure=px.histogram(iris, x="petal_length", color="species",
title="Petal Length Distribution")
)
])
We recommend you try using Einblick Prompt to create charts – just tell us what you want to create and the AI helper will generate the right chart for you.

# Calculate the correlation matrix for the iris dataset
correlation_matrix = iris.corr()
heatmap = px.imshow(correlation_matrix)
Then you can easily add the resulting heatmap to the app by adding it with another dcc.Graph()
:
app.layout = html.Div([
html.H1("Iris Dataset Visualizations"),
dcc.Graph(id='scatter-plot',
figure=px.scatter(iris, x="sepal_width", y="sepal_length",
color="species", title="Sepal Width vs Length")),
dcc.Graph(id='histogram',
figure=px.histogram(iris, x="petal_length", color="species",
title="Petal Length Distribution")),
dcc.Graph(id='scatter-plot', figure=heatmap)
])
4. Run the Dash App
To run the Dash app, simply call app.run_server()
In Einblick, you should use