lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
20 stars 8 forks source link

Selection of a directory in dash #29

Closed christian-oreilly closed 1 year ago

christian-oreilly commented 1 year ago

The current code used to select a folder has multiple issues (does not work on MacOS, open the window in background). It is unclear that it is a good idea to use TkInter in combination with Dash.

Issues with threads interfering with one another has been reported at multiple places, e.g., here: https://community.plotly.com/t/core-component-allow-select-folder/14955/11

Maybe the TkInter issues can be solved (https://stackoverflow.com/questions/67702316/combining-plotly-dash-with-a-tkinter-gui-dash-forces-to-execute-the-tk-mainloo) but I am unsure that it will provide a robust solution. Maybe a native Dash solution would be preferable.

A folder selection dash-core-component has been asked for in 2019 and upvoted multiple times, but without apparently having caught the attention of the developers: https://github.com/plotly/dash-core-components/issues/639

Other relevant links:

scott-huberty commented 1 year ago

open the window in background

I solved this part on my windows machine. The code to get the directory to open on top of other windows is on my local machine. But this is pointless given the broader issue you raise.

yes... I too spent much of my weekend trying to find a solution (to no avail) for my mac, regarding getting tkinter askdirectory to work in a dash callback.

Maybe we can use the dcc.upload button instead (although it's less ideal. While it's possible to allow for selection of multiple files and to filter by file types, you cannot select a directory).