Topics

  • What is Dash?
  • Elements of A Dash App
  • Coding a Dash App

What is Dash?

Dash is a Python framework for developing web applications. It’s written on top of Plotly, so any graphs you can create with Plotly are easy to implement in an interactive web app! The potential for dash apps is limitless, and there are plenty of complex and beautiful examples on the  Dash App Gallery (source code is available for these projects too).

Today I’ll be breaking down the basic elements of a Dash app, and teach you to code your own simple app. This app will show Wal-Mart store openings across the US over time.

Let’s get started!

Elements of a Dash App

  • Components

A Dash Application is made up of various components arranged in a specific layout. These components are visual elements that can take the form of sliders, dropdown menus, graphs, and  more. Components are made using HTML (and in some cases JavaScript and CSS too), but coding the components is easy in Python. Just import dash_core_components and/or dash_html_components!

  • Layout

The layout portion of the app arranges the components. Size, color, text, and other general attributes can be set in the layout section of code.

  • Callback

This section of the code adds interactivity to the application by connecting the components to the functions. Take inputs from your components and use the components’ outputs to make adjustments using functions.

  • Functions

The function(s) contain the logic of the interactivity in the app. What do you want to update or change once the user interacts with the components?

Now let’s write some code!

#analytics #python #dashboard #data-visualization #data

How to Create Interactive Dashboards in Python
61.00 GEEK