Book Image

Interactive Dashboards and Data Apps with Plotly and Dash

By : Elias Dabbas
Book Image

Interactive Dashboards and Data Apps with Plotly and Dash

By: Elias Dabbas

Overview of this book

Plotly's Dash framework is a life-saver for Python developers who want to develop complete data apps and interactive dashboards without JavaScript, but you'll need to have the right guide to make sure you’re getting the most of it. With the help of this book, you'll be able to explore the functionalities of Dash for visualizing data in different ways. Interactive Dashboards and Data Apps with Plotly and Dash will first give you an overview of the Dash ecosystem, its main packages, and the third-party packages crucial for structuring and building different parts of your apps. You'll learn how to create a basic Dash app and add different features to it. Next, you’ll integrate controls such as dropdowns, checkboxes, sliders, date pickers, and more in the app and then link them to charts and other outputs. Depending on the data you are visualizing, you'll also add several types of charts, including scatter plots, line plots, bar charts, histograms, and maps, as well as explore the options available for customizing them. By the end of this book, you'll have developed the skills you need to create and deploy an interactive dashboard, handle complexities and code refactoring, and understand the process of improving your application.
Table of Contents (18 chapters)
1
Section 1: Building a Dash App
6
Section 2: Adding Functionality to Your App with Real Data
11
Section 3: Taking Your App to the Next Level

What this book covers

Chapter 1, Overview of the Dash Ecosystem, will help you attain a good understanding of the Dash ecosystem, the main packages used, as well as the available third-party packages. By the end of this chapter, you will be able to differentiate between the different elements of an app and what each is responsible for, and you will have built a minimal app.

Chapter 2, Exploring the Structure of a Dash App, demonstrates how to add some interactive functionality to the app we created earlier. We will go through the app callbacks and see how they allow your users to connect visual elements of your app, and how you can let users use some of those elements to control others by creating special callback functions.

Chapter 3, Working with Plotly's Figure Objects, provides an in-depth introduction to the Figure object, its components, how it can be manipulated, and how it can be converted to different formats. Later on, we will use this understanding to build specific types of charts as needed in our application.

Chapter 4, Data Manipulation and Preparation - Paving the Way to Plotly Express, introduces an overview of tidy data, as well as the high-level Plotly Express package, and shows how it uses the grammar of graphics to easily produce charts and map data to visual elements.

Chapter 5, Interactively Comparing Values with Bar Charts and Dropdown Menus, goes in some depth into the available options for graphs and explores further possibilities. Then, we will see how to allow users to select which values they want to compare using drop-down menus.

Chapter 6, Exploring Variables with Scatter Plots and Filtering Subsets with Sliders, moves on to one of the most frequently used chart types: scatter plots. Like we did with bar charts, we will see many different ways to customize them. Scatter plots provide even more options that we will explore, such as mapping the size of the points to a certain variable, dealing with overplotting, and handling a large number of points.

Chapter 7, Exploring Map Plots and Enriching Your Dashboards with Markdown, explores a new type of chart that we see in many situations. There are many ways to plot data on maps, and we will explore two of the most frequently used types: scatter maps and choropleth maps.

Chapter 8, Calculating the Frequency of Your Data with Histograms and Building Interactive Tables, explores the different ways of creating histograms and customizing them, as well as splitting the data in different ways and then counting the resulting values.

Chapter 9, Letting Your Data Speak for Itself with Machine Learning, shows us how clustering works, and also uses a test model to evaluate performance. We will also explore a technique to evaluate various clusters and finally, we will design an interactive app using KMeans clustering.

Chapter 10, Turbo-charge Your Apps with Advanced Callbacks, introduces the pattern-matching callback to achieve dynamic app modification based on user interaction and various other conditions.

Chapter 11, URLs and Multi-Page Apps, introduces a new architecture that allows us to incorporate multiple pages in one app. The other interesting feature we will explore is using URLs either as inputs or outputs, interacting with different elements in the app.

Chapter 12, Deploying Your App, shows you how to deploy your app on a server, where people can access it from anywhere so you can share it with the world. Different options are available, and we will go through two simple options that might be useful.

Chapter 13, Next Steps, showcases the different options in taking your app(s) to the next level. This chapter provides some pointers on things you might want to explore.