Getting started with a simple Dash App - Part 1/2
Plotly Dash Enterprise is a great platform to design your custom applications to suite any kind of technical problems. Based on python, it also offers all the standard features of the python with simplicity and ease of use. Capabilities to use and integrate any other python libraries seamlessly takes it beyond any of the BI tools available in the market. This article will help you to understand how to start working with Dash apps from scratch. So, let's get started. (If you do not have Dash installed on your system, you may install it using command: pip install dash)
Let's understand the building blocks of a simple Dash app using below diagram.
To import required libraries
To Initialize the Dash app (This one is standard for all apps)
Here we define the layout using Dash provided html components, so you don't have to write the html code from scratch. Dash will generate backend html from the simple layout defined by you using Dash components.
It's time to run ! Not from here, but to run the code 😜. This one is also standard for all the Dash apps, though you can customize it as per need.
Enough of discussion ! Let's have a look at code for our first app.
Open a blank folder in your VS Code editor
# import dependanciesfrom dash import Dash, html
# initializationapp = Dash(__name__)
# define layoutapp.layout = html.Div('Hello World')
# runif __name__ == '__main__':app.run_server(debug=True)
You can see the output in your browser window by using url 'http://127.0.0.1:8050/' as indicated in the screenshot above.
Comments
Post a Comment