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

Dash inputs and outputs

The next step is to determine which component is going to become an input (to our pure Python function) and which component will get the return value of the function (as an output) to be displayed to the user.

Determining your inputs and outputs

The dash.dependencies module has several classes, two of which we will be using here: Output and Input.

These classes can be imported by adding the following line to the imports section of our app:

from dash.dependencies import Output, Input

Let's quickly recap what we did earlier before adding the final element that will make this functionality work:

  1. We instantiated an app in the Jupyter Notebook environment.
  2. We created a dropdown containing three colors.
  3. We created a regular function that returns a string, together with the value provided to it: 'Your selected' + <color>.
  4. The components were identified with descriptive names through their id parameters.
  5. Input...
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