Interactive Dashboards and Data Apps with Plotly and Dash: Harness the power of a fully fledged frontend web framework in Python – no JavaScript required

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Learn how to build web-based and mobile-friendly analytic apps and interactive dashboards with Python Key Features • Develop data apps and dashboards without any knowledge of JavaScript • Map different types of data such as integers, floats, and dates to bar charts, scatter plots, and more • Create controls and visual elements with multiple inputs and outputs and add functionality to the app as per your requirements Book Description With Plotly's Dash framework, it is now easier than ever for Python programmers to develop complete data apps and interactive dashboards. Dash apps can be used by a non-technical audience, and this will make data analysis accessible to a much wider group of people. This book will help you to explore the functionalities of Dash for visualizing data in different ways and getting the most out of it. The book starts with 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. What you will learn • Find out how to run a fully interactive and easy-to-use app • Convert your charts to various formats including images and HTML files • Use Plotly Express and the grammar of graphics for easily mapping data to various visual attributes • Create different chart types, such as bar charts, scatter plots, histograms, maps, and more • Expand your app by creating dynamic pages that generate content based on URLs • Implement new callbacks to manage charts based on URLs and vice versa 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 will help you to grasp the concepts covered in this book more effectively.

Author(s): Elias Dabbas
Edition: 1
Publisher: Packt Publishing
Year: 2021

Language: English
Commentary: Vector PDF
Pages: 362
City: Birmingham, UK
Tags: Machine Learning; Data Analysis; Python; Web Applications; Data Visualization; Deployment; scikit-learn; Callback Functions; Dashboards; plotly; Dash

Cover
Copyright
Contributors
Table of Contents
Preface
Section 1: Building a Dash App
Chapter 1: Overview of the Dash Ecosystem
Technical requirements
Setting up your environment
Exploring Dash and other supporting packages
The different packages that Dash contains
Understanding the general structure of a Dash app
Creating and running the simplest app
Adding HTML and other components to the app
Adding HTML components to a Dash app
Learning how to structure the layout and managing themes
Themes
Grid system and responsiveness
Prebuilt components
Encoded colors
Adding Dash Bootstrap components to our app
Summary
Chapter 2: Exploring the Structure of a Dash App
Technical requirements
Using Jupyter Notebooks to run Dash apps
Isolating functionality for better management and debugging
Creating a standalone pure Python function
The id parameter of Dash components
Dash inputs and outputs
Determining your inputs and outputs
Specifying your callback function
Implementing the callback
Incorporating the function into the app
Properties of Dash's callback functions
Summary
Chapter 3: Working with Plotly's Figure Object
Technical requirements
Understanding the Figure object
Getting to know the data attribute
Getting to know the layout attribute
Interactively exploring the Figure object
Configuration options for the Figure object
Exploring the different ways of converting figures
Converting figures into HTML
Converting figures into images
Plotting using a real dataset
Data manipulation as an essential part of the data visualization process
Making the chart interactive with a callback function
Adding the new functionality to our app
Theming your figures
Summary
Chapter 4: Data Manipulation and Preparation, Paving the Way to Plotly Express
Technical requirements
Understanding long format (tidy) data
Plotly Express example chart
Main attributes of long format (tidy) data
Understanding the role of data manipulation skills
Exploring the data files
Melting DataFrames
Pivoting DataFrames
Merging DataFrames
Learning Plotly Express
Plotly Express and Figure objects
Creating a Plotly Express chart using the dataset
Adding new data and columns to our dataset
Summary
Section 2: Adding Functionality to Your App with Real Data
Chapter 5: Interactively Comparing Values with Bar Charts and Drop-Down Menus
Technical requirements
Plotting bar charts vertically and horizontally
Creating vertical bar charts with many values
Linking bar charts and dropdowns
Exploring different ways of displaying multiple bar charts (stacked, grouped, overlaid, and relative)
Creating the income share DataFrame
Incorporating the functionality into our app
Using facets to split charts into multiple sub-charts – horizontally, vertically, or wrapped
Exploring additional features of dropdowns
Adding placeholder text to dropdowns
Modifying the app's theme
Resizing components
Summary
Chapter 6: Exploring Variables with Scatter Plots and Filtering Subsets with Sliders
Technical requirements
Learning about the different ways of using scatter plots: markers, lines, and text
Markers, lines, and text
Creating multiple scatter traces in a single plot
Mapping and setting colors with scatter plots
Discrete and continuous variables
Using color with continuous variables
Manually creating color scales
Using color with discrete variables
Handling over-plotting and outlier values by managing opacity, symbols, and scales
Controlling the opacity and size of markers
Using logarithmic scales
Introducing sliders and range sliders
Customizing the marks and values of sliders
Summary
Chapter 7: Exploring Map Plots and Enriching Your Dashboards with Markdown
Technical requirements
Exploring choropleth maps
Utilizing animation frames to add a new layer to your plots
Using callback functions with maps
Creating a Markdown component
Understanding map projections
Using scatter map plots
Exploring Mapbox maps
Exploring other map options and tools
Incorporating an interactive map into our app
Summary
Chapter 8: Calculating Data Frequency and Building Interactive Tables
Technical requirements
Creating a histogram
Customizing the histogram by modifying its bins and using multiple histograms
Using color to further split the data
Exploring other ways of displaying multiple bars in histograms
Adding interactivity to histograms
Creating a 2D histogram
Creating a DataTable
Controlling the look and feel of the table (cell width, height, text display, and more)
Adding histograms and tables to the app
Summary
What we have covered so far
Section 3: Taking Your App to the Next Level
Chapter 9: Letting Your Data Speak for Itself with Machine Learning
Technical requirements
Understanding clustering
Finding the optimal number of clusters
Clustering countries by population
Preparing data with scikit-learn
Handling missing values
Scaling data with scikit-learn
Creating an interactive KMeans clustering app
Summary
Chapter 10: Turbo-Charge Your Apps with Advanced Callbacks
Technical requirements
Understanding State
Understanding the difference between Input and State
Creating components that control other components
Allowing users to add dynamic components to the app
Introducing pattern-matching callbacks
Summary
Chapter 11: URLs and Multi-Page Apps
Technical requirements
Getting to know the Location and Link components
Getting to know the Link component
Parsing URLs and using their components to modify parts of the app
Restructuring your app to cater to multiple layouts
Displaying content based on the URL
Adding dynamically generated URLs to the app
Incorporating the new URL interactivity into the app
Summary
Chapter 12: Deploying Your App
Technical requirements
Establishing the general development,deployment, and update workflow
Creating a hosting account and virtual server
Connecting to your server with SSH
Running the app on the server
Setting up and running the app with a WSGI
Setting up and configuring the web server
Managing maintenance and updates
Fixing bugs and making changes
Updating Python packages
Maintaining your server
Summary
Chapter 13: Next Steps
Technical requirements
Expanding your data manipulation and preparation skills
Exploring more data visualization techniques
Exploring other Dash components
Creating your own Dash component
Operationalizing and visualizing machine learning models
Enhancing performance and using big data tools
Going large scale with Dash Enterprise
Summary
Why subscribe?
Other Books You May Enjoy
Index