Plotly Dash

Plotly Dash

Numerous supports Plotly Dash as an app engine; however, we have no affiliation with them. If you decide to use Plotly Dash, we encourage you to join their community to contribute to their development and learn more.

Home page: Dash Plotly (opens in a new tab)

Plotly Dash "Hello, World!" Example

Create a file and name it app.py. Copy and paste the following code into the file:

app.py
from dash import Dash, dcc, html, Input, Output, callback
 
app = Dash(__name__)
server = app.server
 
app.layout = html.Div(
    html.Div([
        html.Div(id='text'),
        dcc.Interval(
            id='interval-component',
            interval=500, # in milliseconds
            n_intervals=0
        )
    ])
)
 
 
@callback(Output('text', 'children'),
          Input('interval-component', 'n_intervals'))
def update_text(count):
 
    if (count % 2) == 0:
        return [
            html.Span('hello world')
        ]
    else:
        return [
            html.Span('')
        ]
 
if __name__ == '__main__':
    app.run()

Create a file and name it requirements.txt. Copy and paste the following code into the file:

requirements.txt
dash
gunicorn

Alternatively, you can clone the code on this page from here (opens in a new tab).