LePa-YU / Visualizer

A web based tool to represent the AIR model of LePa project
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

disable/enable relation buttons #29

Open ElmiraOn opened 1 year ago

ElmiraOn commented 1 year ago

disable the delete relation button when the relation does not exist and enable it when it does.

Disable the add-relation button when it exists and disable it when it does not.

ElmiraOn commented 1 year ago

Added the functionality. However double click is required as state session attributes cannot be used for buttons in streamlit for automatic update the state of buttons.

ElmiraOn commented 1 year ago

Looked into different methods to allow disabling and enabling buttons without the need for double click. The existing methods for such purpose (e.g. toggle) do not work for our project as the initial state of the buttons in such scenarios is not dependant on a flag (existence of relation in our case) for the initial state of the button.

One method suggested here that was not tried. in this method, instead of a list, we could use the df. however, implementing this method suggests changing the structure of how the data frame is being handled currently and is likely to not work.

ElmiraOn commented 1 year ago

Use the solution suggested in the previous comment to modify the dataset (csv file) using the st.session_state which would allow a smoother transition between add/ delete relation buttons.