Bubble chart with drop down list, slider and checklist in plotly dash

Bubble chart with drop down list, slider and check list in plotly dash

Create Bubble chart with drop down list, slider and checklist in plotly dash by using plotly data visualizations library and dash library.

Inputs: Drop down list, slider and check list

I have created this Bubble chart with drop down list, slider and checklist in plotly dash. There are three input components in this simple dash app. Bubble chart depends on these three input components. By changing any value in these three input components, data on the bubble chart changes according to the input values. Checklist has six check boxes. By selecting and unselecting any box on the checklist, values change on the bubble chart. See below how this dashboard work?

Layout of input components

Create the layout of input components that are drop down list, slider and checklist. Import values for each core component in options parameter from data frame. These input components are independent and don’t depend any component on other component. In line

Bubble chart

First of all, create callback for this bubble chart. Use id of each input component in the callback function as input and figure as output. Then use id of each input component in the argument of define function as key. Create data frames in lines 6 and 7, see below in the code template. In line 7, put id of drop down list is equal to corresponding values of column, and use slider id greater than or equal to corresponding values of column and last insert isin() function to filter checklist values from the corresponding column of the data frame.

Size of markers (Bubble)

In line 15, put mode parameter is equal to markers and text because text will display the text values on each bubble using the specific column. In line 17, use size property of marker parameter to adjust the size of bubbles.

Download the full code and CSV data file and learn more about plotly dash on Udemy.


If you have any problem in learning above code, please comment in the comment box. I will help you as soon as possible.


Recommended For You

About the Author: Mubeen Ali

I am passionate about learning Dash. Dash is a python framework that creates beautiful web based data visualization dashboards.