Max size of dataframes that can be plotted


Firstly, a BIG THANKS for making this wonderful tool. I have managed to deliver 3 prototypes within a month of learning how to use this!

On a recent prototype, I am plotting the following -

  1. A heatmap (using plotly.graph_objects.heamap)
  2. A line chart using px.line()
  3. A map using px.scatter_mapbox()

I found that the tool and the webpage crashes on Chrome when the size of the dataframe is around 4MB. I derived this size of the dataframe by using df.memory_usage(deep=True).sum()

The above dataframe is used for making the heatmap. Is there a limit that I should be aware of or are there other methods of plotting this?


Hey @a.iyer - welcome to Streamlit, and thanks for the report!

There isn’t any Streamlit-enforced limit on dataframe sizes, but the various plotting tools that Streamlit uses have their own (implicit) performance limits, and I imagine you’re hitting that in plotly.

Depending on your particular app, this may or may not be trivial, but Altair, matplotlib, and are other plotting libraries that are supported by Streamlit, and they may give better performance for your chart. (The playground, for example, has a geographic heatmap that pulls in ~3mb data and renders it quickly with no problem.)