Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Interactive Dashboards and Data Apps with Plotly and Dash

You're reading from  Interactive Dashboards and Data Apps with Plotly and Dash

Product type Book
Published in May 2021
Publisher Packt
ISBN-13 9781800568914
Pages 364 pages
Edition 1st Edition
Languages
Author (1):
Elias Dabbas Elias Dabbas
Profile icon Elias Dabbas

Table of Contents (18) Chapters

Preface Section 1: Building a Dash App
Chapter 1: Overview of the Dash Ecosystem Chapter 2: Exploring the Structure of a Dash App Chapter 3: Working with Plotly's Figure Objects Chapter 4: Data Manipulation and Preparation, Paving the Way to Plotly Express Section 2: Adding Functionality to Your App with Real Data
Chapter 5: Interactively Comparing Values with Bar Charts and Dropdown Menus Chapter 6: Exploring Variables with Scatter Plots and Filtering Subsets with Sliders Chapter 7: Exploring Map Plots and Enriching Your Dashboards with Markdown Chapter 8: Calculating the Frequency of Your Data with Histograms and Building Interactive Tables Section 3: Taking Your App to the Next Level
Chapter 9: Letting Your Data Speak for Itself with Machine Learning Chapter 10: Turbo-charge Your Apps with Advanced Callbacks Chapter 11: URLs and Multi-Page Apps Chapter 12: Deploying Your App Chapter 13: Next Steps Other Books You May Enjoy

Preface

Plotly's Dash framework allows Python programmers to develop complete analytic data apps and interactive dashboards. This book will help you explore the functionalities of Dash for visualizing data in different ways and getting the most out of your data.

You'll start with an overview of the Dash ecosystem, its main packages, and the available third-party packages crucial for structuring and building different parts of your apps. Next, you will learn how to create a basic Dash app and add different features to it. You'll then 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 will also add several types of charts, including scatter plots, line plots, bar charts, histograms, maps, and more, as well as exploring the options available for customizing them.

By the end of this book, you will have developed the skills you need to create and deploy an interactive dashboard, be able to handle complexity and code refactoring, and understand the process of improving your application.

Who this book is for

This Plotly Dash book is for data professionals and data analysts who want to gain a better understanding of their data with the help of different visualizations and dashboards. Basic to intermediate-level knowledge of the Python programming language is expected to grasp the concepts covered in this book more effectively.

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.

To get the most out of this book

You will need a system with a stable internet connection.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Interactive-Dashboards-and-Data-Apps-with-Plotly-and-Dash. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781800568914_ColorImages.pdf.

Code in Action

Code in Action videos for this book can be viewed at (https://bit.ly/3vaXYQJ).

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Our dataset will consist of the files in the data folder in the root of the repository."

A block of code is set as follows:

import plotly.express as px
gapminder = px.data.gapminder()
gapminder

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

import os
import pandas as pd
pd.options.display.max_columns = None
os.listdir(‚data')
['PovStatsSeries.csv',
 'PovStatsCountry.csv',
 'PovStatsCountry-Series.csv',
 'PovStatsData.csv',
 'PovStatsFootNote.csv']

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Another important column is the Limitations and exceptions column."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

lock icon The rest of the chapter is locked
Next Chapter arrow right
You have been reading a chapter from
Interactive Dashboards and Data Apps with Plotly and Dash
Published in: May 2021 Publisher: Packt ISBN-13: 9781800568914
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}