Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.02 KB

README.md

File metadata and controls

23 lines (16 loc) · 1.02 KB

shared_components

The source for code every app in this repo shares. Today that's why_plotly.py: the View source link (to the app's folder on GitHub) and the Why Plotly button and drawer with the Dash Enterprise pitch. The pitch text sits at the top of the file.

Editing

Plotly Cloud deploys each app folder on its own, so every app carries its own copy as <app>/why_plotly.py. Edit only shared_components/why_plotly.py, then copy it out:

python shared_components/sync.py          # update every app's copy
python shared_components/sync.py --check  # list copies that are out of date (exit 1)

Using it in an app

from why_plotly import add_why_plotly
...
app.layout = ...
add_why_plotly(app, "<app-folder-name>")

To put the buttons in the app's own header instead of floating bottom-left, render *header_buttons("<app-folder-name>", className="<your header link class>") in the header and call add_why_plotly(app, "<app-folder-name>", floating=False). See self-driving for an example.