dash icon indicating copy to clipboard operation
dash copied to clipboard

[DOC] Document assets_folder more widely

Open alexlenail opened this issue 3 years ago • 3 comments

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

alexlenail avatar Apr 21 '22 22:04 alexlenail

Yes, we could probably be clearer about that. I think you want assets_folder, which tells dash where the assets are on disk, instead of assets_url_path which just changes how the browser references them.

alexcjohnson avatar Apr 22 '22 17:04 alexcjohnson

@alexcjohnson this resolved my issue -- would recommend slightly more documentation about it.

alexlenail avatar Jun 08 '22 07:06 alexlenail

cc @LiamConnors

alexcjohnson avatar Jun 08 '22 12:06 alexcjohnson