Skip to main content

Dash

Links

Dash is an open-source Python framework developed by Plotly for building analytical web applications without requiring extensive web development experience. It enables the creation of interactive, data-driven applications with a minimal amount of code, leveraging the power of Plotly for visualization and React.js for the user interface. Dash is particularly well-suited for data scientists and analysts who need to create web-based dashboards and analytical apps.


Usage Example

Here’s a simple example of a Dash application that displays a scatter plot:

import dash
from dash import dcc, html
import plotly.express as px
import pandas as pd

# Sample data
df = pd.DataFrame({
    'Category': ['A', 'B', 'C', 'D'],
    'Values': [10, 23, 15, 12]
})

# Initialize the Dash app
app = dash.Dash(__name__)

# Define the layout
app.layout = html.Div(children=[
    html.H1(children='Simple Dash App'),
    dcc.Graph(
        id='example-graph',
        figure=px.bar(df, x='Category', y='Values', title='Category vs. Values')
    )
])

if __name__ == '__main__':
    app.run_server(debug=True)

In this example, a simple Dash application is created that displays a bar chart of categories versus their corresponding values.