plotly / plotly/dash

Document assets_folder more widely

Open
#2,022 3 comments 0 reactions 1 assignee View on GitHub

@LiamConnors is already working on this.

Since Jul 24, 2024.

documentation feature P2 P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

I started building my app with JupyterDash. I put the assets in a folder called assets next to my notebook. CSS/JS in the assets folder show up in my dash app. If I move them and do app = JupyterDash(__name__, assets_url_path="/relative/path/") it doesn't work. Ditto for os.cwd()+"/relative/path/" and "/absolute/path/".

If i run the application with python dash_app.py, changing app = JupyterDash(...) to app = Dash(assets_url_path=...), None of the option above work. Only if I put an assets folder next to dash_app.py do I see my styles applied.

I think the documentation for assets_url_path could be improved a little -- it's only quickly mentioned here.

dash                              2.0.0
dash-bio                          0.7.1
dash-bootstrap-components         1.0.0
dash-core-components              2.0.0
dash-html-components              2.0.0
dash-renderer                     1.9.1
dash-table                        5.0.0
jupyter-dash                      0.4.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.