Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

[Solved] DASH callback output and global variables

Hi guys,

I just found Dash recently and try develop an interactive dashboard with it. I am wondering if it is possible to have callback to output a pandas dataframe as global variables?

Details: I plan to have a Text Input which takes in a directory address like (“C:\…”). Then the Dash will search for all CSV files (around 15 per folder) and load CSV files into dash. Finally apply come data analysis and merging to create tables and plots automatically.

I notice we can do for each plot/table, under the current @callback, DASH will take the input and do things like read_csv in pandas, output to table. However, if one csv is used many times in different figure/table. It will cost many redundant computations. Is it possible to output the pandas data frame first, save it and used in following graphs? Or if there are other good practices, idea are welcome!

Thanks

####################
I found the solution lies in User Guide: Share between callbacks. Sry…This can be closed.

2 Likes