Skip to content

Repository files navigation

DashAppCourse

Repository for Plotly-Dash course exercises.

Week 1:

Resources - Dash Fundamentals

WasmDash for building Dash apps on the browser: https://wasmdash.vercel.app/

Installation guide for local Dash app development: Tech stack

Datasets to be used throughout the course: agriculture, makeup

Dash in 20 tutorial

Dash Core Components: https://dash.plotly.com/dash-core-components

Dash html Button component: https://dash.plotly.com/dash-html-components/button

Tables with Dash Ag Grid Getting Started Recommended chapters for more advanced learning: Pagination, Column filters, Cell editing

Graphing Library

Plotly Express Graphs:
Graph attributes

Resources - Dash Interactivity

WasmDash for building Dash apps on the browser: https://wasmdash.vercel.app/

Installation guide for local Dash app development: Tech stack

Datasets to be used throughout the course: agriculture, makeup

The Callback

Supplement video tutorial on the callback

Plotly Histogram

Dash Input Component

Plotly Dash Forum

Week2:

Resources - Building Graphs

WasmDash for building Dash apps on the browser: https://wasmdash.vercel.app/

Datasets to be used throughout the course: agriculture, makeup

Plotly Python graphing docs

Plotly Express: intro to the high-level interface

Plotly Figure Reference

The Dash Core Graph Component

Resources - Advanced Applications

Dash Bootstrap: choosing and declaring the stylesheet/theme

List of all available themes

Rows and Columns to position your app components neatly on the page

dbc.Button()

Dash Bootstrap styling cheat sheet

Advanced Callbacks:

  • State argument:
    commonly used when there are certain components in the callback Input that should not trigger the callback. For example, a dropdown combined with a button; the dropdown would be assigned to the State and the button to the Input.
  • no_update:
    used at the end of the function when you don’t want certain Output components to update.
  • duplicate_outputs:
    needs to be added when you use the same component ID AND Property in the Output within two different callbacks.
  • prevent_initial_call
    used if you don’t want the callback to trigger when the app first loads or anytime the app (browser) is refreshed.

Expanding your component collection:

Week3:

Resources - App Deployment and Resources

Render.com

Deployed example on Render with data coming in through http link:

deploy-app-example-repo

Prepare your App on Pycharm:
  1. Open Pycharm and activate venv:
    .\venv\Scripts\activate
  2. Install all libraries and gunicorn in your virtual environment
  3. Create requirements file:
    pip freeze > requirements.txt
  4. Make sure your app code has
    server = app.server
  5. Run app to make sure it works:
    python app.py
  6. Push code to your github account; how-to see: https://youtu.be/vpRkAoCqX3o
Deploy App to the Web with Render

how-to see: https://youtu.be/H16dZMYmvqo?feature=shared

  1. Open your Render account
  2. Create new Web Service and choose: “Build and deploy from a Git repository”
  3. Add the url of your public git repository
  4. Give the app a unique name
  5. Update the gunicorn command to:
    gunicorn app_name:server
    (Note: uvicorn can be used as well, see app conditions you have implemented)

Note: Possible error:
Render won’t work with the latest version of certain python libraries. For example, you’ll get an error if your requirements.txt file has the most recent version of pandas. Render allows up to pandas==1.3.5

Deployed example on Render with data in local csv sheet:

deploy-app2-example-repo

  • When your app has a local csv sheet you’re pulling data from, the file structure should look like this: deploy-app2-example-repo
  • Notice how you would read the csv sheet into your app
  • Don’t forget to add to your app code:
    server = app.server
  • And install gunicorn or uvicorn in your virtual environment
  • When deploying the app on Render.com, ensure that the Root Directory is src

Resources for future Dash learning

Make use of community Dash knowledge on the forum: https://community.plotly.com/

About

Repository for Plotly-Dash course exercises

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages