Reader small image

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

Product typeBook
Published inMay 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800568914
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Elias Dabbas
Elias Dabbas
author image
Elias Dabbas

Elias Dabbas is an online marketing and data science practitioner. He produces open-source software for building dashboards, data apps, as well as software for online marketing, with a focus on SEO, SEM, crawling, and text analysis.
Read more about Elias Dabbas

Right arrow

Incorporating the function into the app

Here is the plan for the functionality that we are going to introduce:

  1. Create a drop-down list using the countries and regions available in our dataset.
  2. Create a callback function that takes the selected country, filters the dataset, and finds the population of that country in the year 2010.
  3. Return a small report about the found data. Figure 2.7 shows the desired end result:
    Figure 2.7 – A drop-down list used to display the selected country's population

Figure 2.7 – A drop-down list used to display the selected country's population

Important note

Now that we are beginning to use our dataset, we will start opening files from the data folder. This assumes that the app you are running is in the same folder. The code for each chapter in the GitHub repository is placed in its own folder for easy access; however, the code only works if the data folder and app.py are both in the same folder.

Figure 2.8 shows what this folder structure might look like:

Figure 2.8 – The assumed folder structure for the app

Figure...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Interactive Dashboards and Data Apps with Plotly and Dash
Published in: May 2021Publisher: PacktISBN-13: 9781800568914

Author (1)

author image
Elias Dabbas

Elias Dabbas is an online marketing and data science practitioner. He produces open-source software for building dashboards, data apps, as well as software for online marketing, with a focus on SEO, SEM, crawling, and text analysis.
Read more about Elias Dabbas