Analytical dashboards
Build a Python web dashboard with interactive controls, charts, and callbacks.
Plotly · Class
Dash is the main application class for creating Python analytical web apps. Instantiate it, define a component layout, optionally register callbacks, and run the app to serve interactive Plotly-based interfaces.
Dash is the application object that connects a Python layout to a running web app. Instantiate it, assign components such as html.Div to layout, and call run to serve the result locally.
Dash(name=None, server=True, use_pages=None, **kwargs)A Dash application object.
dash package.app.callback decorator.from dash import Dash, html
app = Dash(__name__)
app.layout = html.Div("Hello, Dash!")
if __name__ == "__main__":
app.run(debug=True)Creates a Dash application, assigns a simple HTML layout, and starts the development server.
Build a Python web dashboard with interactive controls, charts, and callbacks.
Place Plotly figures in a browser-based application with selection and click interactions.
Compose pages from Dash HTML and core components without writing JavaScript.
Dash is the application object used to define and serve a Dash app. A typical app creates Dash(__name__), assigns a component tree to app.layout, and starts it with app.run().
Follow-up: How are Plotly figures embedded? Pass a figure to the figure property of dcc.Graph, which renders the Plotly visualization inside the app.
The class supports analytical applications built from Python components and integrates with Plotly figures. Its app layout can contain components such as html.Div and dcc.Graph.
Follow-up: What enables interactivity? Dash callbacks connect component properties so Python functions can update the user interface reactively.
Create the app with Dash(__name__), define app.layout, and run it from the application file. The official example uses app.run(debug=True) to start the development server.
Follow-up: Why use __name__? It gives the application the module name, which is the conventional initialization value for a Python web application.
dcc.Graphhtml.Divapp.layoutapp.callbackInputOutput