Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

🐌 Smaller version of async-plotlyjs.js? it's so BIG and loads so slow

I’ve been troubleshooting a very slow app that I originally thought was slow because of my try at clustering
27k data points on a leaflet map. There are problems with the leaflet component - as is being discussed here - but I’ve noticed that I big factor is seemingly unrelated - loading of async-plotlyjs.js

Loading this 3.4MB behemoth takes usually between 6 and 10 seconds.

I’ve tried loading this in two different ways:

  1. via app = dash.Dash(__name__, serve_locally=False) which serves it from unpackage here
  2. via app = dash.Dash(__name__, serve_locally=True) which is Dash’s default configuration which serves it locally from \Lib\site-packages\dash_core_components\

The remote method seems to shave about 1 to 2 seconds off the local serve method. Even so, the quickest it ever gets takes more than 6 seconds.


The browser is mostly idle through all of this

As a result, it takes the rest of the page about that long to complete rendering. Is there any way to get a trimmed down version of this script? Or perhaps a way to make it non blocking?

You can see what I am talking about live at https://dash.scious.io/ Thanks in advance! :slight_smile:

It is possible to use a smaller plotly.js bundle. This isn’t documented yet, but we’ve got an open issue for documenting this somewhere here: https://github.com/plotly/dash-docs/issues/723#issuecomment-656393396. That issue has instructions on how this works.


I think that helped quite a bit. Thanks @chriddyp