The Book of Dash

Book description

A swift and practical introduction to building interactive data visualization apps in Python, known as dashboards. Youâ??ve seen dashboards before; think election result visualizations you can update in real time, or population maps you can filter by demographic. With the Python Dash library youâ??ll create analytic dashboards that present data in effective, usable, elegant ways in just a few lines of code.

The book is fast-paced and caters to those entirely new to dashboards. It will talk you through the necessary software, then get straight into building the dashboards themselves. Youâ??ll learn the basic format of a Dash app by building a twitter analysis dashboard that maps the number of likes certain accounts gained over time. Youâ??ll build up skills through three more sophisticated projects. The first is a global analysis app that compares country data in three areas: the percentage of a population using the internet, percentage of parliament seats held by women, and CO2 emissions. Youâ??ll then build an investment portfolio dashboard, and an app that allows you to visualize and explore machine learning algorithms.

In this book you will:

â?¢Create and run your first Dash apps

â?¢Use the pandas library to manipulate and analyze social media data

â?¢Use Git to download and build on existing apps written by the pros

â?¢Visualize machine learning models in your apps

â?¢Create and manipulate statistical and scientific charts and maps using Plotly

Dash combines several technologies to get you building dashboards quickly and efficiently. This book will do the same.

Table of contents

  1. Title Page
  2. Copyright
  3. Dedication
  4. About the Authors
  5. Acknowledgments
  6. Introduction
    1. Why This Book
    2. Why Plotly Dash
    3. Who This Book Is For
    4. What’s in the Book
    5. Online Resources
  7. Part I: Crash Courses
    1. 1. Python Refresher
      1. Lists
        1. Adding Elements
        2. Removing Elements
        3. Reversing Lists
        4. Sorting Lists
        5. Indexing List Elements
      2. Slicing
      3. Dictionaries
      4. List Comprehension
      5. Object-Oriented Programming
        1. Classes and Objects
        2. Terminology
      6. Decorator Functions and Annotations
      7. Summary
    2. 2. Pycharm Tutorial
      1. Installing PyCharm
      2. Creating a Project
      3. Running a Dash App
      4. Installing Dash Through PyCharm
      5. Using Dash with GitHub
      6. Summary
    3. 3. A Crash Course in Pandas
      1. Visual Overview Cheat Sheet
      2. Installing pandas
      3. Creating Objects in pandas
        1. Series
        2. DataFrames
      4. Selecting Elements in DataFrames
        1. Select by Column
        2. Select by Index and Slice
        3. Select by Label
      5. Modifying an Existing DataFrame
      6. Summary
      7. Resources
  8. Part II: Building Applications
    1. 4. First Dash App
      1. Setting Up the Project
        1. Importing the Libraries
        2. Data Management
        3. Layout and Styling
        4. Styling: Embellishing Your App
      2. Dash Components
        1. HTML Components
        2. Core Components
      3. Dash Callbacks
        1. Callback Decorator
        2. Callback Function
        3. Callback Diagram
      4. Plotly Express Line Charts
      5. Summary
    2. 5. Global Data Analysis: Advanced Layouts and Graphs
      1. Setting Up the Project
        1. Importing the Libraries
        2. Data Management
        3. Dash Bootstrap Styling
      2. Dash Core Components
      3. Dash Callbacks
        1. Data Retrieval Callback
        2. Figure Creation Callback
        3. Callback Diagram
        4. Callback Ordering
      4. Plotly Express Choropleth Maps
      5. Summary
    3. 6. Investment Portfolio: Building Larger Apps
      1. Asset Allocation
      2. Download and Run the App
      3. App Structure
      4. Setting Up the Project
        1. Importing the Libraries
        2. Adding the Stylesheets
        3. Data Management
      5. Layout and Styling
      6. Components
        1. Tabs
        2. Card Containers and Sliders
        3. Input Containers
        4. Tool Tips
        5. Data Tables
        6. Content Tables
        7. Markdown Text
      7. Pie Chart Using Plotly Graph Objects
      8. Line Chart Using Plotly Graph Objects
      9. Dash Callbacks
        1. Interactive Figures
        2. Callbacks Using State
        3. Circular Callbacks and Synchronizing Components
        4. Callbacks with Multiple Inputs and Multiple Outputs
      10. Summary
    4. 7. Exploring Machine Learning
      1. Dashboard Apps to Make Machine Learning Models More Intuitive
        1. Classification: A Short Guide
        2. Support Vector Machines
      2. The SVM Explorer App
        1. Python Libraries
        2. Data Management
      3. Layout and Styling
        1. Layout
        2. Styling
      4. Reusable Components
        1. Defining a Card
        2. Defining a Formatted Slider
        3. Defining a Named Slider
        4. Defining a Named Dropdown
        5. Using a Dash Graph
        6. Creating a Plotly Contour Plot
        7. Using Dash Loading
      5. Dash Callbacks
      6. Summary
      7. Resources
    5. 8. Tips and Tricks
      1. Dash Enterprise App Gallery
      2. Enhancing Your Learning with the Plotly Forum
      3. App Theme Explorer
      4. Debugging a Dash App
      5. dash-labs
      6. Formatting Your Code with Black
      7. Follow-up Resources
  9. Appendix: Python Basics
  10. Index

Product information

  • Title: The Book of Dash
  • Author(s): Adam Schroeder, Christian Mayer, Ann Marie Ward
  • Release date: October 2022
  • Publisher(s): No Starch Press
  • ISBN: 9781718502222