
Dashboards are a quick and effective way to visualize and monitor your data. With Plotly and Dash, building dashboards in Python has never been more straightforward.
This article will discuss why dashboards are helpful and show how to generate a basic dashboard using Dash, Plotly, and Python. The layout can be further customized using CSS.
The data used for the Dashboard in this article is publicly available adjusted stock prices of several car companies gathered using the Alpha Vantage API.
Visualizing data is about extracting value from information. However, the story may be hidden, unclear, or difficult to comprehend with large amounts of data. Therefore, analysts take advantage of visualizations and dashboarding tools to pinpoint critical aspects of data and reveal value.
Interactive Data
Because visualizations are data snapshots, analysts and data scientists must be selective with the subset of the data they choose to show. This issue is prominent in static visualizations where the dimensions of the graphs and selected during the design phase and remain constant.
To counter this issue, visualization tools such as Plotly incorporate dynamic visualizations. For example, Plotly lets users pane around charts, zoom in/out, and add/remove traces by default. This flexibility increases the effectiveness of the visualization and increases the engagement of the person viewing the chart.
Dashboards
Each year companies and organizations are bombarded with increasing amounts of data. However, the information is relatively meaningless without an effective way to parse through and extract decisive insights.
The goal is to use data to drive action, and this is where dashboards come in.

Dashboards serve as a channel between the data gathered and decision-makers. A dashboard aims to quickly provide actionable insights from the data in an easy to understand manner.
Users should be able to pull up a dashboard, pose a question, and answer the question. This user engagement is crucial to transmitting the information and ensures that the user properly absorbs the information.
That is where Dash comes in.
Because Dash is built on top of Plotly, the interactive capabilities are already present. Moreover, it is compatible with Python, R, and Scala, making it usable for many different.
Dash Design
Dash is set up to be highly user friendly. If you already have experience with Plotly, you’ll build able to build dash apps with ease.
The essential components of any dash app are the layout, the plots, and dashboard interactions.
Dash apps are built from a few different components. However, most of the functionality comes from the dash core components (DCC), html components, and any bootstrap themes.
When developing filters for a dashboard, the first step is to generate a list of options for the user. Then, these are passed to a DropDown component.
The data for this dashboard is stock data from five of the largest car companies. This basic dashboard allows the user to select which stocks are visible in the main plot.
Components
The layout is based on HTML tags. If you’re familiar with HTML, the dash components should appear standard. Each Dash component is based on an HTML tag but with custom functionality explicitly designed for Dash.
What this means is that you can start simple and start with what you know. Then slowly build up your dashboards into something increasingly complex.
Next is the dash core components. These include a graph component that accepts Plotly figures and other Plotly objects. These core components also include widgets such as Dropdowns which are used for this dashboard.
These core components are perfect for rapidly producing high-quality dashboards. Some popular components are Sliders, Checklists, or DatePickers. You can review the available components here: https://dash.plotly.com/dash-core-components.
Callbacks
After designing the layout with your target charts, what is left is to add interaction. While the plots already have some base level of interaction, Dash allows the user to dynamically change the data in the dashboard, update the charts, and some navigation functions.
At the core of dynamic Dash apps, is the callback function.
Callback functions are defined using Python decorators before the function definition. The input, output, and function parameters follow a rigid format.
Inputs often come from dash core components such as the DropDown selector in this case. The first argument is the id of the element specifying the data source. The second argument is the attribute of the component.
Outputs follow the same format as the inputs, but the data is sent to the specified dash component.
Depending on the input and output specified, the function you create expects the same number of input parameters and an output data type that matches the expected output type.
For multiple inputs, the function parameters correspond to each element in a list of inputs.
Customization and CSS
After the basic functionality of the dashboard is set up, what if the left is to add some customization.
For this dashboard, I’ve kept the styling within the main app itself. So, add these details as a dictionary, then add to the style attribute of each Dash HTML component.
Alternatively, you can add an asset folder and CSS file to your app. This structure is defined the same as you would for any webpage with CSS. Match the classes and ids and directly alter your dashboard.
Deployment
Deployment of Dash apps can vary wildly depending on your requirements. For example, hosting a dashboard on a local server requires only that the dashboard is run with Python. However, accessing within a local network may require unique network specifications.
If local hosting is not your goal for your dashboard, consider a service such as Heroku. Free tiers for Heroku are available.

Wrap up
Dashboards are great tools to monitor your business goals, track progress, and analyze data.
Gone are the days of spending hours on ends to develop a fully interactive dashboard. Instead, you can rapidly generate dashboards through Dash and save yourself an enormous amount of time.
This article discussed several aspects of setting up and running a Dash app. With minimal effort, you can create your dashboards with ease.
If you’re interested in reading articles about novel Data Science tools and understanding machine learning algorithms, consider following me on medium. I always include code in my articles that you can apply to your work!
If you’re interested in my writing and want to support me directly, please subscribe through the following link. This link ensures that I will receive a portion of your membership fees.